public abstract class ComponentManagerWrapper extends Object implements ComponentManager
A base class for wrapper implementations of the ComponentManager
interface.
An instance of this class is initialized with a reference to a
ComponentManager
object. All methods simply delegate to this object.
This class is especially useful if a custom implementation of
ComponentManager
is to be created based on an existing
implementation. Then only the methods to be customized have to be
implemented. All other methods can still delegate to the existing
implementation.
Modifier | Constructor and Description |
---|---|
protected |
ComponentManagerWrapper(ComponentManager wrapped)
Creates a new instance of
ComponentManagerWrapper and initializes
it with the wrapped ComponentManager . |
Modifier and Type | Method and Description |
---|---|
void |
addContainerComponent(Object container,
Object component,
Object constraints)
Adds a component to a container using the specified constraints.
|
Object |
createBorderLayout(BorderLayoutTag tag)
Creates a border layout object whose parameters are obtained form the
specified tag.
|
ComponentHandler<Boolean> |
createButton(ButtonTag tag,
boolean create)
Creates a button component.
|
Object |
createButtonLayout(ButtonLayoutTag tag)
Creates a button layout object whose parameters are obtained from the
specified tag.
|
ComponentHandler<Boolean> |
createCheckbox(CheckboxTag tag,
boolean create)
Creates a component handler that wraps a checkbox.
|
ComponentHandler<Object> |
createComboBox(ComboBoxTag tag,
boolean create)
Creates a component handler that wraps a combo box.
|
Object |
createDesktopPanel(DesktopPanelTag tag,
boolean create)
Creates a desktop panel whose parameters are obtained from the specified
tag.
|
PlatformEventManager |
createEventManager()
Returns a concrete implementation of the
PlatformEventManager interface for dealing with event
notifications. |
Object |
createFont(FontTag tag)
Creates a font object from the data specified by the given
FontTag . |
Object |
createIcon(Locator locator)
Creates an icon object with the data obtained from the specified
Locator |
Object |
createLabel(LabelTag tag,
boolean create)
Creates a label object.
|
ComponentHandler<Object> |
createListBox(ListBoxTag tag,
boolean create)
Creates a component handler that wraps a list box.
|
Object |
createPanel(PanelTag tag,
boolean create)
Creates a panel whose parameters are obtained from the specified tag.
|
ComponentHandler<String> |
createPasswordField(PasswordFieldTag tag,
boolean create)
Creates a
ComponentHandler that wraps a password text field. |
Object |
createPercentLayout(PercentLayoutTag tag)
Creates a percent layout object whose parameters are obtained from the
specified tag.
|
ComponentHandler<Integer> |
createProgressBar(ProgressBarTag tag,
boolean create)
Creates a component handler that wraps a progress bar element.
|
ComponentHandler<Boolean> |
createRadioButton(RadioButtonTag tag,
boolean create)
Creates a component handler that wraps a radio button.
|
Object |
createRadioGroup(Map<String,Object> radioButtons)
Creates a radio group which contains the radio buttons stored in the
passed in map.
|
ComponentHandler<Integer> |
createSlider(SliderTag tag,
boolean create)
Creates a component handler that wraps a slider component.
|
Object |
createSplitter(SplitterTag tag,
boolean create)
Creates a splitter whose parameters are obtained from the specified tag.
|
ComponentHandler<StaticTextData> |
createStaticText(StaticTextTag tag,
boolean create)
Creates a component handler that wraps a static text element.
|
ComponentHandler<Integer> |
createTabbedPane(TabbedPaneTag tag,
boolean create)
Creates a component handler that wraps a tabbed pane.
|
ComponentHandler<Object> |
createTable(TableTag tag,
boolean create)
Creates a table based on the information stored in the passed in table
tag.
|
ComponentHandler<String> |
createTextArea(TextAreaTag tag,
boolean create)
Creates a component handler that wraps a text area.
|
ComponentHandler<String> |
createTextField(TextFieldTag tag,
boolean create)
Creates a component handler that wraps a text field.
|
ComponentHandler<Boolean> |
createToggleButton(ToggleButtonTag tag,
boolean create)
Creates a toggle button component.
|
ComponentHandler<Object> |
createTree(TreeTag tag,
boolean create)
Creates a tree component based on the information stored in the passed in
tree tag.
|
WidgetHandler |
getWidgetHandlerFor(Object component)
Returns a
WidgetHandler for the specified component. |
ComponentManager |
getWrappedComponentManager()
Returns a reference to the wrapped
ComponentManager object. |
void |
linkLabel(Object label,
Object component,
String text)
Associates a link with another component.
|
void |
setContainerLayout(Object container,
Object layout)
Defines the layout manager for a container.
|
protected ComponentManagerWrapper(ComponentManager wrapped)
ComponentManagerWrapper
and initializes
it with the wrapped ComponentManager
. Note: This method does not
check whether the passed in ComponentManager
object is
null because we do not want to enforce this restriction on all
subclasses. The passed in wrapped component manager is stored in an
internal field and can be accessed using the
getWrappedComponentManager()
method. If a subclass needs another
mechanism to access the wrapped manager, it has to override the
getWrappedComponentManager()
method.wrapped
- the wrapped ComponentManager
public ComponentManager getWrappedComponentManager()
ComponentManager
object.ComponentManager
objectpublic void addContainerComponent(Object container, Object component, Object constraints)
ComponentManager
object.addContainerComponent
in interface ComponentManager
container
- the containercomponent
- the component which is to be added to the containerconstraints
- a generic constraints object; this object must be
compatible with the layout manager set for the container; it may be
nullpublic void setContainerLayout(Object container, Object layout)
ComponentManager
object.setContainerLayout
in interface ComponentManager
container
- the containerlayout
- the new layout managerpublic PlatformEventManager createEventManager()
PlatformEventManager
interface for dealing with event
notifications. This method is called once when the event handling
features are used for the first time. Just delegates to the wrapped ComponentManager
object.createEventManager
in interface ComponentManager
public WidgetHandler getWidgetHandlerFor(Object component)
WidgetHandler
for the specified component. This
method is called by ComponentBuilderData
when the user asks for a
handler to a certain component. The passed in object is one of the
components that was created during the last builder operation. An
implementation may throw a runtime exception if a widget handler for the
passed in component cannot be obtained. Just delegates to the wrapped ComponentManager
object.getWidgetHandlerFor
in interface ComponentManager
component
- the componentWidgetHandler
wrapping the specified componentpublic Object createLabel(LabelTag tag, boolean create) throws FormBuilderException
ComponentManager
object.createLabel
in interface ComponentManager
tag
- the label tagcreate
- the create flagFormBuilderException
- if an error occurspublic void linkLabel(Object label, Object component, String text) throws FormBuilderException
componentref
attribute of a LabelTag
was used to define a link between a lable and another component. An
implementation will have to use library specific methods to establish
such a connection. Eventually the label's text has to be set to the given
text (this is the case if the label is undefined; its text is then
obtained from the component's display name). Just delegates to the wrapped ComponentManager
object.linkLabel
in interface ComponentManager
label
- the label (as returned by the createLabel()
methodcomponent
- the component to be linked to the labeltext
- an optional text to be set for the label; can be null,
then no text has to be setFormBuilderException
- if an error occurspublic Object createIcon(Locator locator) throws FormBuilderException
Locator
Just delegates to the wrapped ComponentManager
object.createIcon
in interface ComponentManager
locator
- the Locator
pointing to the dataFormBuilderException
- if an error occurspublic Object createFont(FontTag tag) throws FormBuilderException
FontTag
. Just delegates to the wrapped ComponentManager
object.createFont
in interface ComponentManager
tag
- the FontTag
FormBuilderException
- if an error occurspublic Object createPercentLayout(PercentLayoutTag tag) throws FormBuilderException
ComponentManager
object.createPercentLayout
in interface ComponentManager
tag
- the percent layout tagFormBuilderException
- if an error occurspublic Object createButtonLayout(ButtonLayoutTag tag) throws FormBuilderException
ComponentManager
object.createButtonLayout
in interface ComponentManager
tag
- the button layout tagFormBuilderException
- if an error occurspublic Object createBorderLayout(BorderLayoutTag tag) throws FormBuilderException
ComponentManager
object.createBorderLayout
in interface ComponentManager
tag
- the border layout tagFormBuilderException
- if an error occurspublic Object createPanel(PanelTag tag, boolean create) throws FormBuilderException
ComponentManager
object.createPanel
in interface ComponentManager
tag
- the panel tagcreate
- the create flagFormBuilderException
- if an error occurspublic Object createDesktopPanel(DesktopPanelTag tag, boolean create) throws FormBuilderException
ComponentManager
object.createDesktopPanel
in interface ComponentManager
tag
- the desktop panel tagcreate
- the create flagFormBuilderException
- if an error occurspublic Object createSplitter(SplitterTag tag, boolean create) throws FormBuilderException
ComponentManager
object.createSplitter
in interface ComponentManager
tag
- the splitter tagcreate
- the create flagFormBuilderException
- if an error occurspublic Object createRadioGroup(Map<String,Object> radioButtons) throws FormBuilderException
ComponentManager
object.createRadioGroup
in interface ComponentManager
radioButtons
- a map with the radio button components that belong to
the groupFormBuilderException
- if an error occurspublic ComponentHandler<Boolean> createButton(ButtonTag tag, boolean create) throws FormBuilderException
ComponentHandler
instances, so for a button to generate
events there must be an associated component handler. Note that the
returned component handler is usually not added to the generated
Form
object. If the button really should be used as input
component, its data is a boolean value indicating whether the button is
selected (which makes sense if the button is used as a toggle button). Just delegates to the wrapped ComponentManager
object.createButton
in interface ComponentManager
tag
- the button tagcreate
- the create flagFormBuilderException
- if an error occurspublic ComponentHandler<Boolean> createToggleButton(ToggleButtonTag tag, boolean create) throws FormBuilderException
ComponentManager
object.createToggleButton
in interface ComponentManager
tag
- the tag defining the toggle buttoncreate
- the create flagFormBuilderException
- if an error occurspublic ComponentHandler<String> createTextField(TextFieldTag tag, boolean create) throws FormBuilderException
ComponentManager
object.createTextField
in interface ComponentManager
tag
- the tag defining the text fieldcreate
- the create flagFormBuilderException
- if an error occurspublic ComponentHandler<String> createTextArea(TextAreaTag tag, boolean create) throws FormBuilderException
ComponentManager
object.createTextArea
in interface ComponentManager
tag
- the tag defining the text areacreate
- the create flagFormBuilderException
- if an error occurspublic ComponentHandler<String> createPasswordField(PasswordFieldTag tag, boolean create) throws FormBuilderException
ComponentHandler
that wraps a password text field. This
handler acts like a regular handler for text input fields. Only the
visual representation is different because the characters typed by the
user in the text field are not readable. Just delegates to the wrapped ComponentManager
object.createPasswordField
in interface ComponentManager
tag
- the tag defining the password text fieldcreate
- the create flagComponentHandler
for the password text fieldFormBuilderException
- if an error occurspublic ComponentHandler<Boolean> createCheckbox(CheckboxTag tag, boolean create) throws FormBuilderException
ComponentManager
object.createCheckbox
in interface ComponentManager
tag
- the tag defining the checkboxcreate
- the create flagFormBuilderException
- if an error occurspublic ComponentHandler<Boolean> createRadioButton(RadioButtonTag tag, boolean create) throws FormBuilderException
ComponentManager
object.createRadioButton
in interface ComponentManager
tag
- the tag defining the radio buttoncreate
- the create flagFormBuilderException
- if an error occurspublic ComponentHandler<Object> createComboBox(ComboBoxTag tag, boolean create) throws FormBuilderException
ComponentManager
object.createComboBox
in interface ComponentManager
tag
- the tag defining the combo boxcreate
- the create flagFormBuilderException
- if an error occurspublic ComponentHandler<Object> createListBox(ListBoxTag tag, boolean create) throws FormBuilderException
ComponentManager
object.createListBox
in interface ComponentManager
tag
- the tag defining the list boxcreate
- the create flagFormBuilderException
- if an error occurspublic ComponentHandler<Integer> createTabbedPane(TabbedPaneTag tag, boolean create) throws FormBuilderException
Integer
object, which represents the
(0-based) index of the selected tab. It can be read and set. Just delegates to the wrapped ComponentManager
object.createTabbedPane
in interface ComponentManager
tag
- the tag defining the tabbed panecreate
- the create flagFormBuilderException
- if an error occurspublic ComponentHandler<StaticTextData> createStaticText(StaticTextTag tag, boolean create) throws FormBuilderException
StaticTextData
object, which can be used to read and write the static text's properties.
The returned handler can be casted into a
StaticTextHandler
object; the additional methods defined by this interface can be used to
directly set the key properties of the static text component. Just delegates to the wrapped ComponentManager
object.createStaticText
in interface ComponentManager
tag
- the tag defining the static textcreate
- the create flagFormBuilderException
- if an error occurspublic ComponentHandler<Integer> createProgressBar(ProgressBarTag tag, boolean create) throws FormBuilderException
ProgressBarHandler
object; the additional methods defined by this interface can be used to
manipulate further properties of the progress bar. Just delegates to the wrapped ComponentManager
object.createProgressBar
in interface ComponentManager
tag
- the tag defining the progress barcreate
- the create flagFormBuilderException
- if an error occurspublic ComponentHandler<Integer> createSlider(SliderTag tag, boolean create) throws FormBuilderException
ComponentManager
object.createSlider
in interface ComponentManager
tag
- the tag defining the slidercreate
- the create flagFormBuilderException
- if an error occurspublic ComponentHandler<Object> createTable(TableTag tag, boolean create) throws FormBuilderException
ComponentHandler
object wraps the table component. It can
be casted into a
TableHandler
object. Its data depends on the selection type of the table: in single
selection mode it is the index of the selected row; in multi selection
mode it is an int[] with the indices of the selected rows. By registering
a change listener at the returned ComponentHandler
interested components can be notified when the table's selection changes. Just delegates to the wrapped ComponentManager
object.createTable
in interface ComponentManager
tag
- the table tagcreate
- the create flagFormBuilderException
- if an error occurspublic ComponentHandler<Object> createTree(TreeTag tag, boolean create) throws FormBuilderException
ComponentHandler
returned
by this method can be casted into a
TreeHandler
object. Refer to the documentation of this class for more information
about the data supported by this handler. Just delegates to the wrapped ComponentManager
object.createTree
in interface ComponentManager
tag
- the tree tagcreate
- the create flagFormBuilderException
- if an error occursCopyright © 2016 The JGUIraffe Team. All rights reserved.