Package io.guise.framework.component
Interface Component
- All Superinterfaces:
DepictedObject
,Displayable
,InfoModel
,LabelModel
,Model
,PresentationModel
,com.globalmentor.beans.PropertyBindable
,com.globalmentor.beans.PropertyConstrainable
- All Known Subinterfaces:
ActionControl
,ActionValueControl<V>
,ApplicationFrame
,ArrangeContainer
,Box
,ButtonControl
,CardContainer
,CardControl
,CompositeComponent
,Container
,ContainerControl
,ContentComponent
,Control
,DialogFrame<V>
,EditComponent
,FlyoverFrame
,Frame
,HeadingComponent
,ImageComponent
,InputFocusableComponent
,InputFocusGroupComponent
,LabelComponent
,LabelDisplayableComponent
,LayoutComponent
,LayoutControl
,LinkControl
,ListSelectControl<V>
,Menu
,ModalComponent<M>
,ModalFrame<R>
,ModalNavigationPanel<R>
,NavigationComponent
,OptionDialogFrame<O>
,Panel
,PendingImageComponent
,SectionComponent
,SelectActionControl
,SelectButtonControl
,SelectControl<V>
,SelectLinkControl
,ToolButtonControl
,ValueControl<V>
,ValuedComponent<V>
,Widget
- All Known Implementing Classes:
AboutPanel
,AbstractActionControl
,AbstractActionValueControl
,AbstractApplicationFrame
,AbstractArrayCompositeComponent
,AbstractBooleanSelectActionControl
,AbstractBox
,AbstractButtonControl
,AbstractCardPanel
,AbstractComponent
,AbstractCompositeComponent
,AbstractCompositeStateComponent
,AbstractCompositeStateControl
,AbstractContainer
,AbstractContainerControl
,AbstractContainerValueControl
,AbstractControl
,AbstractDialogFrame
,AbstractEditComponentTextControl
,AbstractEditValueControl
,AbstractEditValuePanel
,AbstractEnumCompositeComponent
,AbstractFlyoverFrame
,AbstractFrame
,AbstractImageComponent
,AbstractLabel
,AbstractLayoutComponent
,AbstractLayoutControl
,AbstractLayoutValueControl
,AbstractLinkControl
,AbstractListCompositeComponent
,AbstractListSelectContainerControl
,AbstractListSelectControl
,AbstractMenu
,AbstractModalFrame
,AbstractModalNavigationPanel
,AbstractMultipleCompositeComponent
,AbstractOptionDialogFrame
,AbstractPanel
,AbstractSelectActionControl
,AbstractSelectActionValueControl
,AbstractSequenceTaskPanel
,AbstractSingleCompositeComponent
,AbstractTextControl
,AbstractValueControl
,AbstractValuedPanel
,AccordionMenu
,ArrangePanel
,AutoNavigationPathBreadcrumbLinkPanel
,BooleanSelectButton
,BooleanSelectLink
,BooleanSelectToolButton
,BooleanValueControlSelectControl
,BusyPanel
,Button
,CalendarControl
,CalendarDialogFrame
,CardPanel
,CardTabControl
,CheckControl
,DateTimeControl
,DateTimeFieldsControl
,DefaultApplicationFrame
,DefaultDialogFrame
,DefaultFlyoverFrame
,DefaultFrame
,DefaultModalFrame
,DefaultModalNavigationPanel
,DropMenu
,EditComponentLabelControl
,EditComponentTextControl
,Flash
,GroupPanel
,Heading
,HeadingLink
,Image
,ImageActionControl
,ImageBooleanSelectActionControl
,Label
,LayoutPanel
,LikeButton
,Link
,ListControl
,Message
,MessageOptionDialogFrame
,NamePanel
,NavigationPathBreadcrumbLinkPanel
,NotificationOptionDialogFrame
,PasswordAuthenticationPanel
,PendingImage
,PendingImageActionControl
,Picture
,PlatformFileUploadPanel
,ResourceCollectControl
,ResourceImportControl
,ScrollControl
,SectionPanel
,SelectableLabel
,SelectButton
,SelectLink
,SequenceCardPanel
,SliderControl
,SpinnerControl
,TabbedPanel
,TabContainerControl
,TabControl
,Table
,Table.DefaultCellMessage
,TaskStateSelectLink
,TextBox
,TextControl
,Toolbar
,ToolButton
,TreeControl
,ValueSelectButton
,ValueSelectLink
Base interface for all Guise components. Each component must provide either a Guise session constructor; or a Guise session and string ID constructor. Any
component may contain other components, but only a
Container
allows for custom addition and removal of child components.
A component takes up space regardless of whether it is set to be visible using PresentationModel.setVisible(boolean)
. PresentationModel.setDisplayed(boolean)
determines whether the component is displayed at all. If a component is not displayed, it takes up no space. If a component is not displayed, it is not
visible regardless of whether it is set to be visible. If a developer must hide sensitive data, the developer should remove the component from its parent
container altogether.
For widest platform support the general PresentationModel.ROUNDED_CORNER_ARC_SIZE
constant should be used whenever possible when requesting rounded
corners.
- Author:
- Garret Wilson
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Component.FlyoverStrategy<S extends Component>
A strategy for showing and hiding flyovers in response to mouse events. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The bound property of whether the component has bookmarks enabled.static final String
The bound property of the layout constraints.static final String
The bound property of whether the component has dragging enabled.static final String
The bound property of whether the component has dropping enabled.static final String
The bound property of whether the component has flyovers enabled.static final String
The bound property of the strategy controlling flyovers.static final String
The input strategy bound property.static final String
The bound property of the component name.static final String
The bound property of the notification.static final String
The orientation bound property.static final String
The bound property of whether a theme has been applied to this object.static final String
The valid bound property.Fields inherited from interface io.guise.framework.model.Displayable
DISPLAYED_PROPERTY
Fields inherited from interface io.guise.framework.model.InfoModel
DESCRIPTION_CONTENT_TYPE_PROPERTY, DESCRIPTION_PROPERTY, INFO_CONTENT_TYPE_PROPERTY, INFO_PROPERTY
Fields inherited from interface io.guise.framework.model.LabelModel
GLYPH_URI_PROPERTY, LABEL_CONTENT_TYPE_PROPERTY, LABEL_PROPERTY
Fields inherited from interface io.guise.framework.model.ui.PresentationModel
BACKGROUND_COLOR_PROPERTY, BORDER_LINE_FAR_COLOR_PROPERTY, BORDER_LINE_FAR_EXTENT_PROPERTY, BORDER_LINE_FAR_STYLE_PROPERTY, BORDER_LINE_NEAR_COLOR_PROPERTY, BORDER_LINE_NEAR_EXTENT_PROPERTY, BORDER_LINE_NEAR_STYLE_PROPERTY, BORDER_PAGE_FAR_COLOR_PROPERTY, BORDER_PAGE_FAR_EXTENT_PROPERTY, BORDER_PAGE_FAR_STYLE_PROPERTY, BORDER_PAGE_NEAR_COLOR_PROPERTY, BORDER_PAGE_NEAR_EXTENT_PROPERTY, BORDER_PAGE_NEAR_STYLE_PROPERTY, CORNER_LINE_FAR_PAGE_FAR_ARC_SIZE_PROPERTY, CORNER_LINE_FAR_PAGE_NEAR_ARC_SIZE_PROPERTY, CORNER_LINE_NEAR_PAGE_FAR_ARC_SIZE_PROPERTY, CORNER_LINE_NEAR_PAGE_NEAR_ARC_SIZE_PROPERTY, CURSOR_PROPERTY, FONT_FAMILIES_PROPERTY, FONT_SIZE_PROPERTY, FONT_STYLE_PROPERTY, FONT_WEIGHT_BOLD, FONT_WEIGHT_NORMAL, FONT_WEIGHT_PROPERTY, LABEL_FONT_FAMILIES_PROPERTY, LABEL_FONT_SIZE_PROPERTY, LABEL_FONT_STYLE_PROPERTY, LABEL_FONT_WEIGHT_PROPERTY, LABEL_TEXT_COLOR_PROPERTY, LINE_EXTENT_PROPERTY, MARGIN_LINE_FAR_EXTENT_PROPERTY, MARGIN_LINE_NEAR_EXTENT_PROPERTY, MARGIN_PAGE_FAR_EXTENT_PROPERTY, MARGIN_PAGE_NEAR_EXTENT_PROPERTY, OPACITY_PROPERTY, PADDING_LINE_FAR_EXTENT_PROPERTY, PADDING_LINE_NEAR_EXTENT_PROPERTY, PADDING_PAGE_FAR_EXTENT_PROPERTY, PADDING_PAGE_NEAR_EXTENT_PROPERTY, PAGE_EXTENT_PROPERTY, ROUNDED_CORNER_ARC_SIZE, STYLE_ID_PROPERTY, TEXT_COLOR_PROPERTY, TOOLTIP_ENABLED_PROPERTY, VISIBLE_PROPERTY
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCommandListener
(CommandListener commandListener) Adds a command listener.void
addExportStrategy
(ExportStrategy<?> exportStrategy) Adds an export strategy to the component.void
addImportStrategy
(ImportStrategy<?> importStrategy) Adds an import strategy to the component.void
addKeyListener
(KeyboardListener keyListener) Adds a key listener.void
addMouseListener
(MouseListener mouseListener) Adds a mouse listener.void
addNotificationListener
(NotificationListener notificationListener) Adds a notification listener.void
addPreferenceProperty
(String propertyName) Adds a property to be saved and loaded as a preference.void
Applies the theme to this object.void
applyTheme
(Theme theme) Applies a theme and its parents to this object.void
dispatchInputEvent
(InputEvent inputEvent) Dispatches an input event to this component and all child components, if any.Transferable<?>
Exports data from the component.void
fireInputEvent
(InputEvent inputEvent) Fire the given even to all registered listeners, if any.<A extends CompositeComponent>
AgetAncestor
(Class<A> ancestorClass) Retrieves the first ancestor of the given type.Determines the internationalization orientation of the component's contents.getName()
Returns this component's requested orientation.Returns all properties stored as preferences.getTheme()
Returns the theme to apply to this component.boolean
boolean
boolean
boolean
importTransfer
(Transferable<?> transferable) Imports data to the component.void
Initializes the component after construction.boolean
boolean
boolean
boolean
isPreferenceProperty
(String propertyName) Determines whether the given property is saved and loaded as a preference.boolean
boolean
isValid()
void
loadPreferences
(boolean includeDescendants) Loads the preferences for this component and optionally any descendant components.void
notify
(Notification notification) Notifies the user of the given notification information.void
removeCommandListener
(CommandListener commandListener) Removes a command listener.void
removeExportStrategy
(ExportStrategy<?> exportStrategy) Removes an export strategy from the component.void
removeImportStrategy
(ImportStrategy<?> importStrategy) Removes an import strategy from the component.void
removeKeyListener
(KeyboardListener keyListener) Removes a key listener.void
removeMouseListener
(MouseListener mouseListener) Removes a mouse listener.void
removeNotificationListener
(NotificationListener notificationListener) Removes a notification listener.void
removePreferenceProperty
(String propertyName) Removes a property from being saved and loaded as preferences.void
Resets this object's theme.void
savePreferences
(boolean includeDescendants) Saves the preferences for this component and optionally any descendant components.void
setConstraints
(Constraints newConstraints) Sets the layout constraints of this component.void
setDragEnabled
(boolean newDragEnabled) Sets whether the component has dragging enabled.void
setDropEnabled
(boolean newDropEnabled) Sets whether the component has dropping enabled.void
setFlyoverEnabled
(boolean newFlyoverEnabled) Sets whether flyovers are enabled for this component.void
setFlyoverStrategy
(Component.FlyoverStrategy<?> newFlyoverStrategy) Sets the strategy for controlling flyovers.void
setInputStrategy
(InputStrategy newInputStrategy) Sets the strategy for processing input.void
Sets the name of the component.void
setNotification
(Notification newNotification) Sets the component notification.void
setOrientation
(Orientation newOrientation) Sets the orientation.void
setParent
(CompositeComponent newParent) Sets the parent of this component.void
setThemeApplied
(boolean newThemeApplied) Sets whether a theme has been applied to this component.void
Updates this object's theme.boolean
validate()
Validates the user input of this component and all child components.Methods inherited from interface io.guise.framework.platform.DepictedObject
depict, getDepictID, getSession, processEvent
Methods inherited from interface io.guise.framework.model.InfoModel
getDescription, getDescriptionContentType, getInfo, getInfoContentType, setDescription, setDescriptionContentType, setInfo, setInfoContentType
Methods inherited from interface io.guise.framework.model.LabelModel
getGlyphURI, getLabel, getLabelContentType, setGlyphURI, setLabel, setLabelContentType
Methods inherited from interface io.guise.framework.model.ui.PresentationModel
BorderLineFarColor, BorderLineFarExtent, BorderLineFarStyle, BorderLineNearColor, BorderLineNearExtent, BorderLineNearStyle, BorderPageFarColor, BorderPageFarExtent, BorderPageFarStyle, BorderPageNearColor, BorderPageNearExtent, BorderPageNearStyle, getBackgroundColor, getBorderColor, getBorderExtent, getBorderStyle, getCornerArcSize, getCornerLineFarPageFarArcSize, getCornerLineFarPageNearArcSize, getCornerLineNearPageFarArcSize, getCornerLineNearPageNearArcSize, getCursor, getExtent, getFontFamilies, getFontSize, getFontStyle, getFontWeight, getLabelFontFamilies, getLabelFontSize, getLabelFontStyle, getLabelFontWeight, getLabelTextColor, getLineExtent, getMarginExtent, getMarginLineFarExtent, getMarginLineNearExtent, getMarginPageFarExtent, getMarginPageNearExtent, getOpacity, getPaddingExtent, getPaddingLineFarExtent, getPaddingLineNearExtent, getPaddingPageFarExtent, getPaddingPageNearExtent, getPageExtent, getSession, getStyleID, getTextColor, isDisplayed, isTooltipEnabled, isVisible, setBackgroundColor, setBorderColor, setBorderColor, setBorderExtent, setBorderExtent, setBorderLineFarColor, setBorderLineFarExtent, setBorderLineFarStyle, setBorderLineNearColor, setBorderLineNearExtent, setBorderLineNearStyle, setBorderPageFarColor, setBorderPageFarExtent, setBorderPageFarStyle, setBorderPageNearColor, setBorderPageNearExtent, setBorderPageNearStyle, setBorderStyle, setBorderStyle, setCornerArcSize, setCornerArcSize, setCornerLineFarPageFarArcSize, setCornerLineFarPageNearArcSize, setCornerLineNearPageFarArcSize, setCornerLineNearPageNearArcSize, setCursor, setDisplayed, setExtent, setFontFamilies, setFontSize, setFontStyle, setFontWeight, setLabelFontFamilies, setLabelFontSize, setLabelFontStyle, setLabelFontWeight, setLabelTextColor, setLineExtent, setMarginExtent, setMarginExtent, setMarginLineFarExtent, setMarginLineNearExtent, setMarginPageFarExtent, setMarginPageNearExtent, setOpacity, setPaddingExtent, setPaddingExtent, setPaddingLineFarExtent, setPaddingLineNearExtent, setPaddingPageFarExtent, setPaddingPageNearExtent, setPageExtent, setStyleID, setTextColor, setTooltipEnabled, setVisible
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
-
Field Details
-
BOOKMARK_ENABLED_PROPERTY
The bound property of whether the component has bookmarks enabled. -
CONSTRAINTS_PROPERTY
The bound property of the layout constraints. -
DRAG_ENABLED_PROPERTY
The bound property of whether the component has dragging enabled. -
DROP_ENABLED_PROPERTY
The bound property of whether the component has dropping enabled. -
FLYOVER_ENABLED_PROPERTY
The bound property of whether the component has flyovers enabled. -
FLYOVER_STRATEGY_PROPERTY
The bound property of the strategy controlling flyovers. -
INPUT_STRATEGY_PROPERTY
The input strategy bound property. -
NAME_PROPERTY
The bound property of the component name. -
NOTIFICATION_PROPERTY
The bound property of the notification. -
ORIENTATION_PROPERTY
The orientation bound property. -
THEME_APPLIED_PROPERTY
The bound property of whether a theme has been applied to this object. -
VALID_PROPERTY
The valid bound property.
-
-
Method Details
-
getDepictor
- Specified by:
getDepictor
in interfaceDepictedObject
- Returns:
- The depictor for this component.
-
addPreferenceProperty
Adds a property to be saved and loaded as a preference.- Parameters:
propertyName
- The property to store as a preference.- See Also:
-
isPreferenceProperty
Determines whether the given property is saved and loaded as a preference.- Parameters:
propertyName
- The property to determine if it is stored as a preference.- Returns:
true
if the given property is saved and loaded as a preference.- See Also:
-
getPreferenceProperties
Returns all properties stored as preferences.- Returns:
- An iterable of all properties saved and loaded as preferences.
- See Also:
-
removePreferenceProperty
Removes a property from being saved and loaded as preferences.- Parameters:
propertyName
- The property that should no longer be stored as a preference.- See Also:
-
getName
String getName()- Returns:
- The name of the component, not guaranteed to be unique (but guaranteed not to be the empty string) and useful only for searching for components
within a component sub-hierarchy, or
null
if the component has no name.
-
setName
Sets the name of the component. This is a bound property.- Parameters:
newName
- The new name of the component, ornull
if the component should have no name.- Throws:
IllegalArgumentException
- if the given name is the empty string.- See Also:
-
getConstraints
Constraints getConstraints()- Returns:
- The layout constraints describing individual component layout information, or
null
if no constraints have been specified for this component.
-
setConstraints
Sets the layout constraints of this component. This is a bound property.- Parameters:
newConstraints
- The layout constraints describing individual component layout information, ornull
if no constraints have been specified for this component.- See Also:
-
getInputStrategy
InputStrategy getInputStrategy()- Returns:
- The strategy for processing input, or
null
if this component has no input strategy.
-
setInputStrategy
Sets the strategy for processing input. This is a bound property.- Parameters:
newInputStrategy
- The new strategy for processing input, ornull
if this component is to have no input strategy.- See Also:
-
getNotification
Notification getNotification()- Returns:
- The notification associated with the component, or
null
if no notification is associated with this component.
-
setNotification
Sets the component notification. This is a bound property. The notification is also fired as aNotificationEvent
on this component if a new notification is given. Parents are expected to refire the notification event up the hierarchy.- Parameters:
newNotification
- The notification for the component, ornull
if no notification is associated with this component.- See Also:
-
getOrientation
Orientation getOrientation()Returns this component's requested orientation. To resolve the orientation up the hierarchy,getComponentOrientation()
should be used.- Returns:
- The internationalization orientation of the component's contents, or
null
if the default orientation should be used. - See Also:
-
getComponentOrientation
Orientation getComponentOrientation()Determines the internationalization orientation of the component's contents. This method returns the local orientation value, if there is one. If there is no orientation specified for this component, the request is deferred to this component's parent. If there is no parent component, a default orientation is retrieved from the current session.- Returns:
- The internationalization orientation of the component's contents.
- See Also:
-
setOrientation
Sets the orientation. This is a bound property- Parameters:
newOrientation
- The new internationalization orientation of the component's contents, ornull
if default orientation should be determined based upon the session's locale.- See Also:
-
getParent
CompositeComponent getParent()- Returns:
- The parent of this component, or
null
if this component does not have a parent.
-
getAncestor
Retrieves the first ancestor of the given type.- Type Parameters:
A
- The type of ancestor component requested.- Parameters:
ancestorClass
- The class of ancestor component requested.- Returns:
- The first ancestor component of the given type, or
null
if this component has no such ancestor.
-
setParent
Sets the parent of this component. This method is managed by containers, and normally should not be called by applications. A component cannot be given a parent if it already has a parent. A component's parent cannot be removed if that parent is a container and this component is still a child of that container. A container's parent cannot be set to a container unless that container already recognizes this component as one of its children. If a component is given the same parent it already has, no action occurs.- Parameters:
newParent
- The new parent for this component, ornull
if this component is being removed from a parent.- Throws:
IllegalStateException
- if a parent is provided and this component already has a parent.IllegalStateException
- if no parent is provided and this component's old parent is a container that still recognizes this component as its child.IllegalArgumentException
- if a parent container is provided and the given parent container does not already recognize this component as its child.- See Also:
-
isDragEnabled
boolean isDragEnabled()- Returns:
- Whether the component has dragging enabled.
-
setDragEnabled
void setDragEnabled(boolean newDragEnabled) Sets whether the component has dragging enabled. This is a bound property of typeBoolean
.- Parameters:
newDragEnabled
-true
if the component should allow dragging, elsefalse
.- See Also:
-
isDropEnabled
boolean isDropEnabled()- Returns:
- Whether the component has dropping enabled.
-
setDropEnabled
void setDropEnabled(boolean newDropEnabled) Sets whether the component has dropping enabled. This is a bound property of typeBoolean
.- Parameters:
newDropEnabled
-true
if the component should allow dropping, elsefalse
.- See Also:
-
isFlyoverEnabled
boolean isFlyoverEnabled()- Returns:
- Whether flyovers are enabled for this component.
-
setFlyoverEnabled
void setFlyoverEnabled(boolean newFlyoverEnabled) Sets whether flyovers are enabled for this component. Flyovers contain information from the component model's "description" property. This is a bound property of typeBoolean
.- Parameters:
newFlyoverEnabled
-true
if the component should display flyovers, elsefalse
.- See Also:
-
getFlyoverStrategy
Component.FlyoverStrategy<?> getFlyoverStrategy()- Returns:
- The installed flyover strategy, or
null
if there is no flyover strategy installed.
-
setFlyoverStrategy
Sets the strategy for controlling flyovers. The flyover strategy will be registered as a mouse listener for this component. This is a bound property.- Parameters:
newFlyoverStrategy
- The new flyover strategy, ornull
if there is no flyover strategy installed.- See Also:
-
isThemeApplied
boolean isThemeApplied()- Returns:
- Whether a theme has been applied to this component.
-
setThemeApplied
void setThemeApplied(boolean newThemeApplied) Sets whether a theme has been applied to this component. This is a bound property of typeBoolean
.- Parameters:
newThemeApplied
-true
if a theme has been applied to this component, elsefalse
.- See Also:
-
addExportStrategy
Adds an export strategy to the component. The export strategy will take precedence over any compatible export strategy previously added.- Parameters:
exportStrategy
- The export strategy to add.
-
removeExportStrategy
Removes an export strategy from the component.- Parameters:
exportStrategy
- The export strategy to remove.
-
exportTransfer
Transferable<?> exportTransfer()Exports data from the component. Each export strategy, from last to first added, will be asked to export data, until one is successful.- Specified by:
exportTransfer
in interfaceDepictedObject
- Returns:
- The object to be transferred, or
null
if no data can be transferred.
-
addImportStrategy
Adds an import strategy to the component. The import strategy will take precedence over any compatible import strategy previously added.- Parameters:
importStrategy
- The import strategy to add.
-
removeImportStrategy
Removes an import strategy from the component.- Parameters:
importStrategy
- The import strategy to remove.
-
importTransfer
Imports data to the component. Each import strategy, from last to first added, will be asked to import data, until one is successful.- Parameters:
transferable
- The object to be transferred.- Returns:
true
if the given object was be imported.
-
initialize
void initialize()Initializes the component after construction. This method can only be called once during the life of a component. Subclasses should call this version.- Throws:
IllegalStateException
- if this method has already been called.
-
isValid
boolean isValid()- Returns:
- Whether the state of the component and all child components represents valid user input.
-
validate
boolean validate()Validates the user input of this component and all child components. The component will be updated with error information.- Returns:
- The current state of
isValid()
as a convenience.
-
getTheme
Returns the theme to apply to this component. If there is no theme to this component, the parent theme will be returned.- Returns:
- The theme to apply to this component.
- Throws:
IOException
- if there is an error loading the theme.
-
resetTheme
void resetTheme()Resets this object's theme. This method sets tofalse
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.- See Also:
-
updateTheme
Updates this object's theme. This method checks whether a theme has been applied to this object. If a theme has not been applied to this object this method callsapplyTheme()
. This method is called for any child components before applying the theme to the component itself, to assure that child theme updates have already occurred before theme updates occur for this component. There is normally no need to override this method or to call this method directly by applications.- Throws:
IOException
- if there was an error loading or applying a theme.- See Also:
-
applyTheme
Applies the theme to this object. Themes are only applied of the application is themed. This method may be overridden to effectively override theme settings by ensuring the state of important properties after the theme has been set. If the theme is successfully applied, this method updates the theme applied status.- Throws:
IOException
- if there was an error loading or applying a theme.- See Also:
-
applyTheme
Applies a theme and its parents to this object. The theme's rules will be applied to this object and any related objects. Theme application occurs unconditionally, regardless of whether themes have been applied to this component before. There is normally no need to call this method directly by applications.- Parameters:
theme
- The theme to apply to the object.
-
loadPreferences
Loads the preferences for this component and optionally any descendant components. Any preferences returned fromgetPreferenceProperties()
will be loaded automatically.- Parameters:
includeDescendants
-true
if preferences of any descendant components should also be loaded, elsefalse
.- Throws:
IOException
- if there is an error loading preferences.
-
savePreferences
Saves the preferences for this component and optionally any descendant components. Any preferences returned fromgetPreferenceProperties()
will be saved automatically.- Parameters:
includeDescendants
-true
if preferences of any descendant components should also be saved, elsefalse
.- Throws:
IOException
- if there is an error saving preferences.
-
dispatchInputEvent
Dispatches an input event to this component and all child components, if any. If this is aFocusedInputEvent
, the event will be directed towards the branch in which lies the focused component of anyInputFocusGroupComponent
ancestor of this component (or this component, if it is a focus group). If this is instead aTargetedEvent
, 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.- Parameters:
inputEvent
- The input event to dispatch.- Throws:
NullPointerException
- if the given event isnull
.- See Also:
-
fireInputEvent
Fire the given even to all registered listeners, if any. If the event is consumed further processing should cease.- Parameters:
inputEvent
- The input event to fire.- Throws:
NullPointerException
- if the given event isnull
.- See Also:
-
addCommandListener
Adds a command listener.- Parameters:
commandListener
- The command listener to add.
-
removeCommandListener
Removes a command listener.- Parameters:
commandListener
- The command listener to remove.
-
hasCommandListeners
boolean hasCommandListeners()- Returns:
true
if there is one or more command listeners registered.
-
addKeyListener
Adds a key listener.- Parameters:
keyListener
- The key listener to add.
-
removeKeyListener
Removes a key listener.- Parameters:
keyListener
- The key listener to remove.
-
hasKeyListeners
boolean hasKeyListeners()- Returns:
true
if there is one or more key listeners registered.
-
addMouseListener
Adds a mouse listener.- Parameters:
mouseListener
- The mouse listener to add.
-
removeMouseListener
Removes a mouse listener.- Parameters:
mouseListener
- The mouse listener to remove.
-
hasMouseListeners
boolean hasMouseListeners()- Returns:
true
if there is one or more mouse listeners registered.
-
addNotificationListener
Adds a notification listener.- Parameters:
notificationListener
- The notification listener to add.
-
removeNotificationListener
Removes a notification listener.- Parameters:
notificationListener
- The notification listener to remove.
-
notify
Notifies the user of the given notification information. The notification is stored in this component usingsetNotification(Notification)
, which fires appropriate notification events. This method callsGuiseSession.notify(Notification...)
.- Parameters:
notification
- The notification information to relay.
-