|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.globalmentor.beans.BoundPropertyObject
com.guiseframework.event.GuiseBoundPropertyObject
com.guiseframework.model.ui.AbstractPresentationModel
com.guiseframework.component.AbstractComponent
com.guiseframework.component.AbstractCompositeComponent
public abstract class AbstractCompositeComponent
An abstract implementation of a composite component.
Every child component must be added or removed using #addComponent(Component) and #removeComponent(Component), although other actions may take place.
This version listens for the Component.VALID_PROPERTY of each child component and updates the valid status of this component in response.
This version listens for child notifications and fires a copy of the NotificationEvent, retaining the original event target.
This version listens for child components being added or removed and fires a copy of the ComponentEvent, retaining the original event target.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.guiseframework.component.AbstractComponent |
|---|
AbstractComponent.AbstractFlyoverFrameStrategy<S extends Component>, AbstractComponent.AbstractFlyoverStrategy<S extends Component>, AbstractComponent.DefaultFlyoverStrategy<S extends Component> |
| Nested classes/interfaces inherited from interface com.guiseframework.component.Component |
|---|
Component.FlyoverStrategy<S extends Component> |
| Field Summary |
|---|
| Fields inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS |
| Fields inherited from interface com.guiseframework.component.Component |
|---|
BOOKMARK_ENABLED_PROPERTY, CONSTRAINTS_PROPERTY, DRAG_ENABLED_PROPERTY, DROP_ENABLED_PROPERTY, FLYOVER_ENABLED_PROPERTY, FLYOVER_STRATEGY_PROPERTY, INPUT_STRATEGY_PROPERTY, NAME_PROPERTY, NOTIFICATION_PROPERTY, ORIENTATION_PROPERTY, THEME_APPLIED_PROPERTY, VALID_PROPERTY |
| Fields inherited from interface com.guiseframework.model.Displayable |
|---|
DISPLAYED_PROPERTY |
| Fields inherited from interface com.guiseframework.model.InfoModel |
|---|
DESCRIPTION_CONTENT_TYPE_PROPERTY, DESCRIPTION_PROPERTY, INFO_CONTENT_TYPE_PROPERTY, INFO_PROPERTY |
| Fields inherited from interface com.guiseframework.model.LabelModel |
|---|
GLYPH_URI_PROPERTY, LABEL_CONTENT_TYPE_PROPERTY, LABEL_PROPERTY |
| Fields inherited from interface com.guiseframework.model.Model |
|---|
PLAIN_TEXT_CONTENT_TYPE, XHTML_CONTENT_TYPE, XHTML_FRAGMENT_CONTENT_TYPE |
| Constructor Summary | |
|---|---|
AbstractCompositeComponent(InfoModel infoModel)
Info model constructor. |
|
| Method Summary | |
|---|---|
void |
addCompositeComponentListener(CompositeComponentListener compositeComponentListener)
Adds a composite component listener. |
protected void |
childComponentValidPropertyChanged(Component childComponent,
boolean oldValid,
boolean newValid)
Called when the Component.VALID_PROPERTY of a child component changes. |
protected boolean |
determineChildrenValid()
Checks the state of child components for validity. |
protected boolean |
determineValid()
Checks the state of the component for validity. |
void |
dispatchInputEvent(InputEvent inputEvent)
Dispatches an input event to this component and all child components, if any. |
protected void |
dispatchInputEvent(InputEvent inputEvent,
Component target)
Dispatches an input event to the specified target child hierarchy. |
protected void |
fireChildComponentAdded(Component childComponent)
Fires a component added event to all registered composite component listeners. |
protected void |
fireChildComponentAdded(ComponentEvent childComponentEvent)
Fires a given component added event to all registered composite component listeners. |
protected void |
fireChildComponentRemoved(Component childComponent)
Fires a component removed event to all registered composite component listeners. |
protected void |
fireChildComponentRemoved(ComponentEvent childComponentEvent)
Fires a given component removed event to all registered composite component listeners. |
protected void |
initializeChildComponent(Component childComponent)
Initializes a component to be added as a child component of this composite component. |
void |
loadPreferences(boolean includeDescendants)
Loads the preferences for this component and optionally any descendant components. |
void |
removeCompositeComponentListener(CompositeComponentListener compositeComponentListener)
Removes a composite component listener. |
void |
resetTheme()
Resets this object's theme. |
void |
savePreferences(boolean includeDescendants)
Saves the preferences for this component and optionally any descendant components. |
protected void |
uninitializeChildComponent(Component childComponent)
Uninitializes a comopnent to be removed as a child comopnent of this composite component. |
void |
updateTheme()
Updates this object's theme. |
boolean |
validate()
Validates the user input of this component and all child components. |
protected boolean |
validateChildren()
Validates the user input of child components. |
| Methods inherited from class com.guiseframework.event.GuiseBoundPropertyObject |
|---|
getSession |
| Methods inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.guiseframework.component.CompositeComponent |
|---|
getChildComponents, hasChildComponents |
| Methods inherited from interface com.guiseframework.platform.DepictedObject |
|---|
depict, getDepictID, getSession, processEvent |
| Methods inherited from interface com.guiseframework.model.InfoModel |
|---|
getDescription, getDescriptionContentType, getInfo, getInfoContentType, setDescription, setDescriptionContentType, setInfo, setInfoContentType |
| Methods inherited from interface com.guiseframework.model.LabelModel |
|---|
getGlyphURI, getLabel, getLabelContentType, setGlyphURI, setLabel, setLabelContentType |
| Methods inherited from interface com.globalmentor.beans.PropertyBindable |
|---|
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener |
| Methods inherited from interface com.globalmentor.beans.PropertyConstrainable |
|---|
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, hasVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener |
| Constructor Detail |
|---|
public AbstractCompositeComponent(InfoModel infoModel)
infoModel - The component info model.
java.lang.NullPointerException - if the given info model is null.| Method Detail |
|---|
protected void initializeChildComponent(Component childComponent)
childComponent - The component to add to this component.Component#loadPreferences()protected void uninitializeChildComponent(Component childComponent)
childComponent - The component to remove from this component.Component#savePreferences()
protected void childComponentValidPropertyChanged(Component childComponent,
boolean oldValid,
boolean newValid)
Component.VALID_PROPERTY of a child component changes.
Every child version should call this version.
This version updates the composite component's valid state by calling AbstractComponent.updateValid().
childComponent - The child component the valid property of which changed.oldValid - The old valid property.newValid - The new valid property.protected boolean determineValid()
determineChildrenValid().
determineValid in class AbstractComponenttrue if the component and all relevant children passes all validity tests, else false.protected boolean determineChildrenValid()
Component.isValid(); child component are not asked to update their valid state.
Children that are not visible and/or not displayed are not taken into account.
true if the relevant children pass all validity tests.public boolean validate()
validateChildren() so that all children will be validated before checks are performed on this component.
validate in interface Componentvalidate in class AbstractComponentAbstractComponent.isValid() as a convenience.protected boolean validateChildren()
true if all child validations return true.public void resetTheme()
false the state of whether a theme has been applied to this object.
This method is called for any child components resetting its own theme.
No new theme is actually loaded.
There is normally no need to override this method or to call this method directly by applications.
This version recursively calls the resetTheme() method of all child components before resetting the theme of this component.
resetTheme in interface ComponentresetTheme in class AbstractComponentAbstractComponent.setThemeApplied(boolean)
public void updateTheme()
throws java.io.IOException
AbstractComponent.applyTheme().
This method is called for any child components before applying the theme to the component itself,
to assure that child theme updates have already occured before theme updates occur for this component.
There is normally no need to override this method or to call this method directly by applications.
This version recursively calls the updateTheme() method of all child components before updating the theme of this component.
updateTheme in interface ComponentupdateTheme in class AbstractComponentjava.io.IOException - if there was an error loading or applying a theme.AbstractComponent.isThemeApplied(),
AbstractComponent.applyTheme()
public void loadPreferences(boolean includeDescendants)
throws java.io.IOException
AbstractComponent.getPreferenceProperties() will be loaded automatically.
This version loads the preferences of child components if descendants should be included.
loadPreferences in interface ComponentloadPreferences in class AbstractComponentincludeDescendants - true if preferences of any descendant components should also be loaded, else false.
java.io.IOException - if there is an error loading preferences.
public void savePreferences(boolean includeDescendants)
throws java.io.IOException
AbstractComponent.getPreferenceProperties() will be saved automatically.
This version loads the preferences of child components if descendants should be included.
savePreferences in interface ComponentsavePreferences in class AbstractComponentincludeDescendants - true if preferences of any descendant components should also be saved, else false.
java.io.IOException - if there is an error saving preferences.public void dispatchInputEvent(InputEvent inputEvent)
FocusedInputEvent, the event will be directed towards the branch in which lies the focused component of any InputFocusGroupComponent ancestor of this component (or this component, if it is a focus group).
If this is instead a TargetedEvent, the event will be directed towards the branch in which lies the target component of the event.
Otherwise, the event will be dispatched to all child components.
Only after the event has been dispatched to any children will the event be fired to any event listeners and then passed to the installed input strategy, if any.
Once the event is consumed, no further processing takes place.
This version dispatches the event to child component(s) depending on whether the event is focused, targeted, or neither, and then performs default processing.
dispatchInputEvent in interface ComponentdispatchInputEvent in class AbstractComponentinputEvent - The input event to dispatch.
java.lang.NullPointerException - if the given event is null.TargetedEvent,
FocusedInputEvent,
dispatchInputEvent(InputEvent, Component),
InputEvent.isConsumed(),
AbstractComponent.fireInputEvent(InputEvent),
AbstractComponent.getInputStrategy(),
InputStrategy.input(Input)
protected void dispatchInputEvent(InputEvent inputEvent,
Component target)
inputEvent - The input event to dispatch.target - The target indicating the child hierarchy to which this event should be directed.
java.lang.NullPointerException - if the given event and/or target is null.AbstractComponent.fireInputEvent(InputEvent),
InputEvent.isConsumed(),
TargetedEvent,
MouseEventpublic void addCompositeComponentListener(CompositeComponentListener compositeComponentListener)
addCompositeComponentListener in interface CompositeComponentcompositeComponentListener - The composite component listener to add.public void removeCompositeComponentListener(CompositeComponentListener compositeComponentListener)
removeCompositeComponentListener in interface CompositeComponentcompositeComponentListener - The composite component listener to remove.protected void fireChildComponentAdded(Component childComponent)
fireChildComponentAdded(ComponentEvent).
childComponent - The child component added.CompositeComponentListener,
ComponentEventprotected void fireChildComponentAdded(ComponentEvent childComponentEvent)
childComponentEvent - The child component event to fire.protected void fireChildComponentRemoved(Component childComponent)
fireChildComponentRemoved(ComponentEvent).
childComponent - The child component removed.CompositeComponentListener,
ComponentEventprotected void fireChildComponentRemoved(ComponentEvent childComponentEvent)
childComponentEvent - The child component event to fire.CompositeComponentListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||