com.sas.swing.visuals.dataselectors
Class BaseSwingSelectorPanel

com.sas.swing.visuals.dataselectors.BaseSwingSelectorPanel
All Implemented Interfaces:
DataSelectorInterface, PanelInterface, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
DataItemSelector, FilterAndRankSelector, OLAPSortSelector, PercentCalculationsSelector, RankingSelector, ShowDetailSelector, SimpleCalculatedItemEditPanel, SimpleCalculatedItemSelector, SortSelector, TotalsSelector

public abstract class BaseSwingSelectorPanel
implements PanelInterface, DataSelectorInterface

This is an abstract class that all swing selectors should extend from.

See Also:
Serialized Form

Field Summary
protected  DynamicAttributeCommandInterface command
           
protected  boolean contentsValid
           
protected  java.lang.Object selectorModel
           
protected  boolean wasCancelled
           
 
Fields inherited from interface com.sas.swing.visuals.PanelInterface
CONTENTS_VALID_PROPERTY
 
Constructor Summary
BaseSwingSelectorPanel()
          Default constructor.
 
Method Summary
 DynamicAttributeCommandInterface getCommand()
          Returns the command associated with the selector.
 java.lang.String getDialogTitle()
          Returns a title for this panel that should be displayed on a dialog's title bar.
 java.lang.String getHelpID()
          Returns the help id for this panel.
 javax.swing.JComponent getPanel()
          Returns the panel to be displayed.
 java.lang.Object getSelectorModel()
          Returns the model used for the selector, or null if there isn't a model yet.
 java.lang.String getTabTitle()
          Returns a title for this panel that should be displayed as a title on a tab.
 boolean isContentsValid()
          Indicates if the panel's contents are in a valid state.
 boolean isYesNo()
          Indicates if the panel asks a yes-no or ok type question.
 void onApply()
          Apply any changes that may have been made in the panel.
 void onCancel()
          Cancel any changes that may have been made in the panel.
 void onClose()
          Indicates that the panel is being closed.
 void setCommand(DynamicAttributeCommandInterface newCommand)
          Sets the command associated with the selector, the command is used to updated or cancel the selector when needed.
 void setContentsValid(boolean newValue)
          Sets the valid state of the panel's contents.
 void setSelectorModel(java.lang.Object model)
          Sets the model used for the selector on the panel.
 
Methods inherited from interface com.sas.dataselectors.DataSelectorInterface
isVisible, setVisible
 

Field Detail

contentsValid

protected boolean contentsValid

selectorModel

protected java.lang.Object selectorModel

command

protected DynamicAttributeCommandInterface command

wasCancelled

protected boolean wasCancelled
Constructor Detail

BaseSwingSelectorPanel

public BaseSwingSelectorPanel()
Default constructor.

Method Detail

setCommand

public void setCommand(DynamicAttributeCommandInterface newCommand)
Sets the command associated with the selector, the command is used to updated or cancel the selector when needed.

Parameters:
newCommand - the command associated with the selector
See Also:
getCommand()

getCommand

public DynamicAttributeCommandInterface getCommand()
Returns the command associated with the selector.

Returns:
the command associated with teh selector, used to update or cancel the selector.
See Also:
setCommand(DynamicAttributeCommandInterface)

onApply

public void onApply()
Apply any changes that may have been made in the panel. For example, a dialog may call this in response to its "apply" or "ok" button being pressed. If the command is an instanceof BaseSelectorCommand, the command is put into PROCESS_MODE and is executed.

Specified by:
onApply in interface PanelInterface

onCancel

public void onCancel()
Cancel any changes that may have been made in the panel. For example, a dialog may call this in response to its "cancel" button being pressed. If the command is an instanceof BaseSelectorCommand, the command is put into CANCEL_MODE and is executed.

Specified by:
onCancel in interface PanelInterface

onClose

public void onClose()
Indicates that the panel is being closed. Any necessary cleanup that is needed can be performed in this method. This should be called after onApply() or onClose() is called. If the command is an instanceof BaseSelectorCommand, the command is put into COMMIT_MODE and is executed.

Specified by:
onClose in interface PanelInterface

getDialogTitle

public java.lang.String getDialogTitle()
Returns a title for this panel that should be displayed on a dialog's title bar.

Specified by:
getDialogTitle in interface PanelInterface
Returns:
the title to display if used in a dialog

getTabTitle

public java.lang.String getTabTitle()
Returns a title for this panel that should be displayed as a title on a tab.

Specified by:
getTabTitle in interface PanelInterface
Returns:
the title to display if used in a tabbed pane

getPanel

public javax.swing.JComponent getPanel()
Returns the panel to be displayed. Most panels will implement this interface and therefore return this.

Specified by:
getPanel in interface PanelInterface

getHelpID

public java.lang.String getHelpID()
Returns the help id for this panel. If null is returned, a help button is not added for this panel. By default this returns null.

Specified by:
getHelpID in interface PanelInterface
Returns:
the help id for this panel or null

isYesNo

public boolean isYesNo()
Indicates if the panel asks a yes-no or ok type question. This information can be used, for instance, by a dialog to determine if it should display an "OK" button or "Yes" and "No" buttons. By default, this returns false.

Specified by:
isYesNo in interface PanelInterface
Returns:
true if the panel asks a yes-no type question, false if the panel asks an ok type question

isContentsValid

public boolean isContentsValid()
Indicates if the panel's contents are in a valid state. This should always be true except for when the panel is behaving as an editor and incomplete information has been entered. This state can be used by a dialog, for example, to enable/disable the its "apply" buttons ("OK", "Yes", etc).

Specified by:
isContentsValid in interface PanelInterface
Returns:
true if the panel's contents are valid, otherwise false
See Also:
setContentsValid(boolean)

setContentsValid

public void setContentsValid(boolean newValue)
Sets the valid state of the panel's contents. This should be implemented as a bound property so that containers can receive notification to update properly. PanelInterface provides the property name identifier CONTENTS_VALID_PROPERTY as a convenience for implementing this as a bound property.

Specified by:
setContentsValid in interface PanelInterface
Parameters:
newValue - the new valid state for the panel's contents
See Also:
isContentsValid()

setSelectorModel

public void setSelectorModel(java.lang.Object model)
Sets the model used for the selector on the panel.

Specified by:
setSelectorModel in interface DataSelectorInterface
Parameters:
model - the new selector model to set on the panel
See Also:
getSelectorModel()

getSelectorModel

public java.lang.Object getSelectorModel()
Returns the model used for the selector, or null if there isn't a model yet.

Specified by:
getSelectorModel in interface DataSelectorInterface
Returns:
the selector model on the panel
See Also:
setSelectorModel(Object)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.