com.guiseframework.component
Class AbstractOptionDialogFrame<O>

java.lang.Object
  extended by com.globalmentor.beans.BoundPropertyObject
      extended by com.guiseframework.event.GuiseBoundPropertyObject
          extended by com.guiseframework.model.ui.AbstractPresentationModel
              extended by com.guiseframework.component.AbstractComponent
                  extended by com.guiseframework.component.AbstractCompositeComponent
                      extended by com.guiseframework.component.AbstractMultipleCompositeComponent
                          extended by com.guiseframework.component.AbstractArrayCompositeComponent
                              extended by com.guiseframework.component.AbstractEnumCompositeComponent<AbstractFrame.FrameComponent>
                                  extended by com.guiseframework.component.AbstractFrame
                                      extended by com.guiseframework.component.AbstractDialogFrame<O>
                                          extended by com.guiseframework.component.AbstractOptionDialogFrame<O>
Type Parameters:
O - The type of options available.
All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, Component, CompositeComponent, ContentComponent, Control, DialogFrame<O>, Frame, InputFocusableComponent, InputFocusGroupComponent, ModalComponent<Frame.Mode>, OptionDialogFrame<O>, ValueControl<O>, ValuedComponent<O>, Displayable, Enableable, InfoModel, LabelModel, Model, PresentationModel, Valued<O>, ValueModel<O>, DepictedObject
Direct Known Subclasses:
NotificationOptionDialogFrame

public abstract class AbstractOptionDialogFrame<O>
extends AbstractDialogFrame<O>
implements OptionDialogFrame<O>

Abstract implementation of a frame for communication of an option. An option frame defaults to a single composite child panel with a row of options along the bottom. The contents of an option dialog frame should be accessed by getOptionContent() and setOptionContent(Component). This implementation does not allow its frame content to be changed.

Author:
Garret Wilson

Nested Class Summary
 
Nested classes/interfaces inherited from class com.guiseframework.component.AbstractFrame
AbstractFrame.DefaultPrototypeProvider, AbstractFrame.FrameComponent
 
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.Frame
Frame.Mode, Frame.State
 
Nested classes/interfaces inherited from interface com.guiseframework.component.Control
Control.Status
 
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.Frame
CLOSE_ACTION_CONTROL_PROPERTY, MENU_PROPERTY, MODAL_PROPERTY, MOVABLE_PROPERTY, OPEN_EFFECT_PROPERTY, RELATED_COMPONENT_PROPERTY, RESIZABLE_PROPERTY, STATE_PROPERTY, TITLE_BACKGROUND_COLOR_PROPERTY, TITLE_VISIBLE_PROPERTY, TOOLBAR_PROPERTY
 
Fields inherited from interface com.guiseframework.component.ContentComponent
CONTENT_PROPERTY
 
Fields inherited from interface com.guiseframework.component.ModalComponent
MODE_PROPERTY
 
Fields inherited from interface com.guiseframework.component.InputFocusGroupComponent
INPUT_FOCUS_STRATEGY_PROPERTY, INPUT_FOCUSED_COMPONENT_PROPERTY
 
Fields inherited from interface com.guiseframework.component.ValueControl
CONVERTER_PROPERTY
 
Fields inherited from interface com.guiseframework.component.Control
STATUS_PROPERTY
 
Fields inherited from interface com.guiseframework.model.Enableable
ENABLED_PROPERTY
 
Fields inherited from interface com.guiseframework.model.ValueModel
VALIDATOR_PROPERTY, VALUE_PROPERTY
 
Constructor Summary
AbstractOptionDialogFrame(ValueModel<O> valueModel, Component component, O... options)
          Value model, component, and options constructor.
 
Method Summary
protected abstract  Component createOptionComponent(O option)
          Creates a component to represent the given option.
protected  Container createOptionContainer()
          Creates a container for holding the options.
protected  Container getContentContainer()
           
 Component getOptionComponent(O option)
          Returns the component that represents the specified option.
 Container getOptionContainer()
           
 Component getOptionContent()
           
 java.util.List<O> getOptions()
           
protected  void initializeOptionContainer(Container optionContainer, java.util.List<O> options)
          Initializes the option container with the available options.
 void setContent(Component newContent)
          Sets the single child component.
 void setOptionContent(Component newOptionContent)
          Sets the component representing option contents.
 
Methods inherited from class com.guiseframework.component.AbstractDialogFrame
clearValue, determineStatus, determineValid, firePropertyChange, getDefaultValue, getStatus, getValidator, getValue, getValueClass, getValueModel, isEnabled, isValidValue, reset, resetValue, setEnabled, setNotification, setStatus, setValidator, setValue, updateStatus, updateValid, validate, validateValue
 
Methods inherited from class com.guiseframework.component.AbstractFrame
canClose, close, closeImpl, getCloseActionControl, getCloseActionPrototype, getContent, getInputFocusedComponent, getInputFocusStrategy, getMenu, getMode, getOpenEffect, getPrototypeProvisionStrategy, getRelatedComponent, getState, getTitleBackgroundColor, getToolbar, isModal, isMovable, isResizable, isTitleVisible, open, open, open, provideDefaultPrototypes, setCloseActionControl, setInputFocusedComponent, setInputFocusStrategy, setMenu, setModal, setMode, setMovable, setOpenEffect, setRelatedComponent, setResizable, setState, setTitleBackgroundColor, setTitleVisible, setToolbar, updateDefaultPrototypeProvisions
 
Methods inherited from class com.guiseframework.component.AbstractEnumCompositeComponent
getComponent, setComponent
 
Methods inherited from class com.guiseframework.component.AbstractArrayCompositeComponent
getChildComponents, getChildList, getComponent, hasChildComponents, setComponent
 
Methods inherited from class com.guiseframework.component.AbstractMultipleCompositeComponent
addComponent, removeComponent
 
Methods inherited from class com.guiseframework.component.AbstractCompositeComponent
addCompositeComponentListener, childComponentValidPropertyChanged, determineChildrenValid, dispatchInputEvent, dispatchInputEvent, fireChildComponentAdded, fireChildComponentAdded, fireChildComponentRemoved, fireChildComponentRemoved, initializeChildComponent, loadPreferences, removeCompositeComponentListener, resetTheme, savePreferences, uninitializeChildComponent, updateTheme, validateChildren
 
Methods inherited from class com.guiseframework.component.AbstractComponent
addCommandListener, addExportStrategy, addImportStrategy, addKeyListener, addMouseListener, addNotificationListener, addPreferenceProperty, applyTheme, applyTheme, depict, equals, exportTransfer, fireInputEvent, fireNotified, fireNotified, getAncestor, getCommandListeners, getComponentByID, getComponentByName, getComponentOrientation, getConstraints, getDepictID, getDepictor, getDescription, getDescriptionContentType, getDirtyComponents, getDirtyComponents, getEventListenerManager, getFlyoverStrategy, getGlyphURI, getInfo, getInfoContentType, getInfoModel, getInputStrategy, getKeyListeners, getLabel, getLabelContentType, getMouseListeners, getName, getNotification, getNotifications, getNotifications, getOrientation, getParent, getPreferenceProperties, getRootComponent, getTheme, hasAncestor, hasCommandListeners, hashCode, hasKeyListeners, hasMouseListeners, importTransfer, initialize, isDragEnabled, isDropEnabled, isFlyoverEnabled, isPreferenceProperty, isThemeApplied, isValid, notify, processEvent, removeCommandListener, removeExportStrategy, removeImportStrategy, removeKeyListener, removeMouseListener, removeNotificationListener, removePreferenceProperty, setConstraints, setDepicted, setDescription, setDescriptionContentType, setDragEnabled, setDropEnabled, setFlyoverEnabled, setFlyoverStrategy, setGlyphURI, setInfo, setInfoContentType, setInputStrategy, setLabel, setLabelContentType, setName, setOrientation, setParent, setThemeApplied, setValid, toString, update
 
Methods inherited from class com.guiseframework.model.ui.AbstractPresentationModel
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, 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 class com.guiseframework.event.GuiseBoundPropertyObject
getSession
 
Methods inherited from class com.globalmentor.beans.BoundPropertyObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, 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.Frame
canClose, close, getCloseActionControl, getCloseActionPrototype, getMenu, getOpenEffect, getRelatedComponent, getState, getTitleBackgroundColor, getToolbar, isModal, isMovable, isResizable, isTitleVisible, open, open, open, setCloseActionControl, setMenu, setModal, setMovable, setOpenEffect, setRelatedComponent, setResizable, setTitleBackgroundColor, setTitleVisible, setToolbar
 
Methods inherited from interface com.guiseframework.component.ContentComponent
getContent
 
Methods inherited from interface com.guiseframework.component.CompositeComponent
addCompositeComponentListener, getChildComponents, hasChildComponents, removeCompositeComponentListener
 
Methods inherited from interface com.guiseframework.component.ModalComponent
getMode, setMode
 
Methods inherited from interface com.guiseframework.component.InputFocusGroupComponent
getInputFocusedComponent, getInputFocusStrategy, setInputFocusedComponent, setInputFocusStrategy
 
Methods inherited from interface com.guiseframework.component.Control
getStatus, reset
 
Methods inherited from interface com.guiseframework.model.Enableable
isEnabled, setEnabled
 
Methods inherited from interface com.guiseframework.model.ValueModel
clearValue, getDefaultValue, getValidator, getValue, getValueClass, isValidValue, resetValue, setValidator, setValue, validateValue
 
Methods inherited from interface com.guiseframework.component.ValuedComponent
getValue, getValueClass, setValue
 

Constructor Detail

AbstractOptionDialogFrame

public AbstractOptionDialogFrame(ValueModel<O> valueModel,
                                 Component component,
                                 O... options)
Value model, component, and options constructor. Duplicate options are ignored.

Parameters:
valueModel - The frame value model.
component - The component representing the content of the option dialog frame, or null if there is no content component.
options - The available options.
Throws:
java.lang.NullPointerException - if the given value model and/or options is null.
Method Detail

setContent

public void setContent(Component newContent)
Sets the single child component. This implementation throws an exception because the frame content is not allowed to be changed.

Specified by:
setContent in interface ContentComponent
Overrides:
setContent in class AbstractFrame
Parameters:
newContent - The single child component, or null if this frame does not have a child component.
Throws:
java.lang.IllegalArgumentException - if any different content is provided.
See Also:
AbstractFrame.FrameComponent.CONTENT_COMPONENT, ContentComponent.CONTENT_PROPERTY

getContentContainer

protected Container getContentContainer()
Returns:
The container component used to hold content, including the option child component.

getOptionContent

public Component getOptionContent()
Specified by:
getOptionContent in interface OptionDialogFrame<O>
Returns:
The component representing option contents, or null if this frame does not have an option contents component.

setOptionContent

public void setOptionContent(Component newOptionContent)
Sets the component representing option contents. This implementation adds the option content component to the center region of the child container.

Specified by:
setOptionContent in interface OptionDialogFrame<O>
Parameters:
newOptionContent - The single option contents component, or null if this frame does not have an option contents component.

getOptionContainer

public Container getOptionContainer()
Specified by:
getOptionContainer in interface OptionDialogFrame<O>
Returns:
The container containing the options.

getOptions

public java.util.List<O> getOptions()
Specified by:
getOptions in interface OptionDialogFrame<O>
Returns:
The read-only list of available options in order.

getOptionComponent

public Component getOptionComponent(O option)
Returns the component that represents the specified option.

Specified by:
getOptionComponent in interface OptionDialogFrame<O>
Parameters:
option - The option for which a component should be returned.
Returns:
The component, such as a button, that represents the given option, or null if there is no component that represents the given option.

createOptionContainer

protected Container createOptionContainer()
Creates a container for holding the options. This implementation creates a horizontal arrange panel.

Returns:
a container for holding the options.
See Also:
ArrangePanel

initializeOptionContainer

protected void initializeOptionContainer(Container optionContainer,
                                         java.util.List<O> options)
Initializes the option container with the available options. Each component is added to the option container and to the map of option components.

Parameters:
optionContainer - The container to the options.
options - The available options.

createOptionComponent

protected abstract Component createOptionComponent(O option)
Creates a component to represent the given option.

Parameters:
option - The option for which a component should be created.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.