com.guiseframework.component
Class NotificationOptionDialogFrame

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<Notification.Option>
                                              extended by com.guiseframework.component.NotificationOptionDialogFrame
All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, Component, CompositeComponent, ContentComponent, Control, DialogFrame<Notification.Option>, Frame, InputFocusableComponent, InputFocusGroupComponent, ModalComponent<Frame.Mode>, OptionDialogFrame<Notification.Option>, ValueControl<Notification.Option>, ValuedComponent<Notification.Option>, Displayable, Enableable, InfoModel, LabelModel, Model, PresentationModel, Valued<Notification.Option>, ValueModel<Notification.Option>, DepictedObject
Direct Known Subclasses:
MessageOptionDialogFrame

public class NotificationOptionDialogFrame
extends AbstractOptionDialogFrame<Notification.Option>

Default implementation of a frame for communication of an option such as "OK" or "Cancel". 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 AbstractOptionDialogFrame.getOptionContent() and AbstractOptionDialogFrame.setOptionContent(Component).

This class binds the command ProcessCommand.CONTINUE to the button for the first non-fatal option.

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
NotificationOptionDialogFrame(Component component, Notification.Option... options)
          Component and options constructor.
NotificationOptionDialogFrame(Notification.Option... options)
          Options constructor.
NotificationOptionDialogFrame(Notification notification)
          Notification constructor.
NotificationOptionDialogFrame(java.lang.String text, com.globalmentor.net.ContentType textContentType, Notification.Option... options)
          Text and content type constructor Duplicate options are ignored.
NotificationOptionDialogFrame(java.lang.String text, Notification.Option... options)
          Text constructor with a default Model.PLAIN_TEXT_CONTENT_TYPE content type.
NotificationOptionDialogFrame(ValueModel<Notification.Option> valueModel, Component component, Notification.Option... options)
          Value model, component, and options constructor.
NotificationOptionDialogFrame(ValueModel<Notification.Option> valueModel, Notification.Option... options)
          Value model, and options constructor.
 
Method Summary
protected  Component createOptionComponent(Notification.Option option)
          Creates a component to represent the given option.
 void open(java.lang.Runnable afterNotify)
          Opens the frame as modal with a Runnable to be performed after modality ends successfully.
 
Methods inherited from class com.guiseframework.component.AbstractOptionDialogFrame
createOptionContainer, getContentContainer, getOptionComponent, getOptionContainer, getOptionContent, getOptions, initializeOptionContainer, setContent, setOptionContent
 
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

NotificationOptionDialogFrame

public NotificationOptionDialogFrame(Notification.Option... options)
Options constructor. Duplicate options are ignored.

Parameters:
options - The available options.
Throws:
java.lang.NullPointerException - if the given options is null.

NotificationOptionDialogFrame

public NotificationOptionDialogFrame(Notification notification)
Notification constructor. Duplicate options are ignored.

Parameters:
notification - The notification that specifies the message and options.
Throws:
java.lang.NullPointerException - if the given notification is null. #see TextBox

NotificationOptionDialogFrame

public NotificationOptionDialogFrame(java.lang.String text,
                                     Notification.Option... options)
Text constructor with a default Model.PLAIN_TEXT_CONTENT_TYPE content type. Duplicate options are ignored.

Parameters:
text - The text, which may include a resource reference, or null if there is no text.
options - The available options.
Throws:
java.lang.NullPointerException - if the given options is null. #see TextBox

NotificationOptionDialogFrame

public NotificationOptionDialogFrame(java.lang.String text,
                                     com.globalmentor.net.ContentType textContentType,
                                     Notification.Option... options)
Text and content type constructor Duplicate options are ignored.

Parameters:
text - The text, which may include a resource reference, or null if there is no text.
textContentType - The content type of the text.
options - The available options.
Throws:
java.lang.NullPointerException - if the given content type and/or options is null.
java.lang.IllegalArgumentException - if the given content type is not a text content type. #see TextBox

NotificationOptionDialogFrame

public NotificationOptionDialogFrame(Component component,
                                     Notification.Option... options)
Component and options constructor. Duplicate options are ignored.

Parameters:
component - The single child component, or null if this frame should have no child component.
options - The available options.
Throws:
java.lang.NullPointerException - if the given options is null.

NotificationOptionDialogFrame

public NotificationOptionDialogFrame(ValueModel<Notification.Option> valueModel,
                                     Notification.Option... options)
Value model, and options constructor. Duplicate options are ignored.

Parameters:
valueModel - The frame value model.
options - The available options.
Throws:
java.lang.NullPointerException - if the given value model and or options is null.

NotificationOptionDialogFrame

public NotificationOptionDialogFrame(ValueModel<Notification.Option> valueModel,
                                     Component component,
                                     Notification.Option... 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

open

public void open(java.lang.Runnable afterNotify)
Opens the frame as modal with a Runnable to be performed after modality ends successfully. When the frame closes, if a non-fatal option was chosen the given runnable is executed. This is a convenience method that delegates to Frame.open(com.globalmentor.beans.GenericPropertyChangeListener). If the selected option to any notification is fatal, the specified logic, if any, will not be performed. The absence of an option selection is considered fatal only if a fatal option was presented for a given notification.

Parameters:
afterNotify - The code that executes after notification has taken place, or null if no action should be taken after notification.
See Also:
Frame.open(com.globalmentor.beans.GenericPropertyChangeListener), Option#isFatal()

createOptionComponent

protected Component createOptionComponent(Notification.Option option)
Creates a component to represent the given option. This implementation creates a button for the given option.

Specified by:
createOptionComponent in class AbstractOptionDialogFrame<Notification.Option>
Parameters:
option - The option for which a component should be created.


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