com.arsdigita.formbuilder.ui
Class ControlEditor
java.lang.Object
com.arsdigita.bebop.Completable
com.arsdigita.bebop.SimpleComponent
com.arsdigita.bebop.TextStylable
com.arsdigita.bebop.BlockStylable
com.arsdigita.bebop.SimpleContainer
com.arsdigita.formbuilder.ui.ControlEditor
- All Implemented Interfaces:
- Cloneable, Component, Container, Lockable
- public class ControlEditor
- extends SimpleContainer
This class provides a basic UI component for editing the
controls on a persistent form. It is designed to be dropped
into any page without requiring any significant additional
infrasructure
Fields inherited from class com.arsdigita.bebop.BlockStylable |
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CENTER, FULL_WIDTH, INSERT, LEFT, MIDDLE, RIGHT, TEXTTOP, TOP |
Methods inherited from class com.arsdigita.bebop.SimpleContainer |
add, add, children, contains, generateChildrenXML, generateParent, generateXML, get, getNamespace, getTag, indexOf, isEmpty, setNamespace, setTag, size |
Methods inherited from class com.arsdigita.bebop.SimpleComponent |
clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, lock, register, setAttribute, setClassAttr, setIdAttr, setKey, setMetaDataAttribute, setStyleAttr, setVisible |
Methods inherited from interface com.arsdigita.bebop.Component |
getClassAttr, getIdAttr, getKey, getStyleAttr, isVisible, register, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible |
ControlEditor
public ControlEditor(String app,
SingleSelectionModel form)
- Constructor. Creates a new control editor widget,
for editing the form specified in the single
selection model. The key returned by the single
selection model should be an instance of the
BigDecimal
class.
- Parameters:
app
- the application typeform
- the form to edit
ControlEditor
public ControlEditor(String app,
SingleSelectionModel form,
boolean wantFormSection)
- Constructor. Creates a new control editor widget,
for editing the form specified in the single
selection model. The key returned by the single
selection model should be an instance of the
BigDecimal
class.
This constructor also allows the programmer
to turn on the use of form sections, although
they must also call the setFormSectionModelBuilder
method to populate the list box.
- Parameters:
app
- the application typeform
- the form to edit
addEditableComponent
protected void addEditableComponent(Container container,
Component child)
getFormSection
protected PersistentComponentFactory getFormSection(PageState state,
BigDecimal sectionID)
setFormSectionModelBuilder
public void setFormSectionModelBuilder(PrintListener l)
- Sets the form section model builder for populating
the drop down list of form sections. The model
builder is actually a PrintListener, which should
add new Options to the select box
- Parameters:
l
- the print listener for populating the list
respond
public void respond(PageState state)
throws javax.servlet.ServletException
- Description copied from interface:
Component
Responds to the request. This method is only called if the request
was made from a link or form that the component put on the page in the
PageState.stateAsURL()
previous request.
No output should be generated on the HTTP response. The component
can store intermediate results in the state
by calling
setAttribute
.
This method is called before any output is printed to the HTTP
response so that the component can forward to a different page and
thereby commit the response.
- Specified by:
respond
in interface Component
- Overrides:
respond
in class SimpleComponent
- Parameters:
state
- the current page state
- Throws:
javax.servlet.ServletException
getFormModel
protected SingleSelectionModel getFormModel()
register
public void register(Page page)
- Description copied from interface:
Component
- Registers state parameters for the page with its model.
A simple component with a state parameter
param
would do
the following in the body of this method:
p.addComponent(this);
p.addComponentStateParam(this, param);
You should override this method to set the default visibility
of your component:
public void register(Page p) {
super.register(p);
p.setVisibleDefault(childNotInitiallyShown,false);
p.setVisibleDefault(anotherChild, false);
}
Always call super.register
when you override
register
. Otherwise your component may
malfunction and produce errors like "Widget ... isn't
associated with any Form"
- Specified by:
register
in interface Component
- Overrides:
register
in class SimpleComponent
addItemEditObserver
protected boolean addItemEditObserver(PageState state)
- Allows subclasses to control when to add the edit/move/delete links
Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC