com.sas.servlet.tbeans.dataselectors.calculateditems.html
Class SimpleCalculatedItemSelectorPanel

com.sas.servlet.tbeans.dataselectors.calculateditems.html.SimpleCalculatedItemSelectorPanel
All Implemented Interfaces:
HttpActionProviderInterface, com.sas.beans.PropertyChangeSource, com.sas.collection.ContentsChangedListener, com.sas.lang.ObjectDataInterface, com.sas.servlet.tbeans.AJAXControllerURLInterface, ComplexStyleInterface, CompositeComponentInterface, BaseCalculatedItemSelectorPanelKeysInterface, BaseCalculatedItemSelectorPanelStyleKeysInterface, SimpleCalculatedItemSelectorKeysInterface, SimpleCalculatedItemSelectorStyleKeysInterface, FormViewInterface, RenderableInterface, TemplateInterface, com.sas.servlet.tbeans.TemplateKeyInterface, TransformationInterface, com.sas.util.WriteToPrintWriterInterface, java.io.Serializable, java.util.EventListener

public class SimpleCalculatedItemSelectorPanel
implements SimpleCalculatedItemSelectorKeysInterface, SimpleCalculatedItemSelectorStyleKeysInterface

The SimpleCalculatedItemSelectorPanel is a TransformationBean™ that generates the appropriate HTML 4.0 and JavaScript to provide a user interface for managing run-time calculated items.

This panel includes a list of available data items from which simple expressions can be built to create new calculated items. The SimpleCalculatedItemSelectorPanel supports the following operations: addition, subtraction, multiplication, and division. An embedded BaseExpressionEditor composite component is used to provide the user with the ability to edit an expression.

The panel also contains a list of calculated items previously created in the same session by the user. The items in the list can be updated or removed from the list and the underlying data model. An embedded ListEditor provides the list editing support.

The SimpleCalculatedItemSelectorPanel is contained by the SimpleCalculatedItemSelector, which is invoked from the menu bar on a relational or OLAP table view composite component.

The SimpleCalculatedItemSelectorPanel is one of several TransformationBeans™ that rely on a set of style classes that are used by default when generating the resulting markup language. For more information on style sheets and the default style classes that apply to this TransformationBean™, refer to the AppDev Studio Developer Site. You'll find a useful reference document entitled Cascading Style Sheets, Images, and TransformationBeans™ as well as the TransformationBeans™ Style Sheet Reference.

The SimpleCalculatedItemSelectorPanel is one of several TransformationBeans™ that rely on JavaScript to provide some of its functionality. These JavaScript files are including automatically by the tbean. See JavaScriptIncludeHandler for more information about how these files are included and how to customize this behavior. The SimpleCalculatedItemSelectorPanel uses the following JavaScript files:

sas_SimpleCalculatedItemSelectorPanel.js

Note that the toString() method on this class calls the write method, which may have undesirable side effects. See BaseTransformation.toString() for more information. Debuggers often use toString() to show the value of a variable, and this may cause unexpected behavior while debugging

For More Information:

Note: A snapshot of the AppDev Studio Developers Site is installed on your local Web server when you install AppDev Studio. To access the site from webAF, select Help -> Developer Site .

See Also:
BaseExpressionEditor, SimpleCalculatedItemSelector, ListEditor, Serialized Form

Field Summary
static java.lang.String DEFAULT_TEMPLATE_FILE_NAME
          The default file name for the template for this simple calculated item selector panel.
protected static java.lang.String FORMAT_ENTRY_CLASS
           
protected static java.lang.String FORMAT_ENTRY_SUFFIX
           
protected static java.lang.String FORMAT_NOTE_CLASS
           
protected static java.lang.String FORMAT_NOTE_SUFFIX
           
protected static java.lang.String FUNCTION_CHOICE_CLASS
          The style class key for the available list of this simple calculated item selector panel.
protected static java.lang.String FUNCTION_CHOICE_SUFFIX
          The suffix used to build the style class key for the available label of this calculated item selector panel.
protected static java.lang.String FUNCTION_LABEL_CLASS
          The style class key for the available label of this simple calculated item selector panel.
protected static java.lang.String FUNCTION_LABEL_SUFFIX
          The suffix used to build the style class key for the available label of this calculated item selector panel.
protected static java.lang.String JAVASCRIPT_PROCESS_CLEAR_FORMAT_BUTTON_SELECTION
          The name of the JavaScript function which handles the button events for the transfer button.
protected static java.lang.String JAVASCRIPT_PROCESS_FORMAT_ENTRY
          The name of the JavaScript function which handles the change events for the name entry field.
protected static java.lang.String JAVASCRIPT_PROCESS_FUNCTION_SELECTION
          The name of the JavaScript function which handles the processing on the choice box when an item in the choice list is selected.
protected static java.lang.String JAVASCRIPT_PROCESS_NODE_SELECTION
          The name of the JavaScript function which handles the user's selection of an item in the available list.
protected static java.lang.String JAVASCRIPT_PROCESS_SELECT_FORMAT_BUTTON_SELECTION
          The name of the JavaScript function which handles the button events for the transfer button.
protected static java.lang.String TREE_LABEL_CLASS
          The style class key for the available label of this simple calculated item selector panel.
protected static java.lang.String TREE_LABEL_SUFFIX
          The suffix used to build the style class key for the available label of this calculated item selector panel.
protected static java.lang.String TREEVIEW_CLASS
          The style class key for the available list of this simple calculated item selector panel.
protected static java.lang.String TREEVIEW_SUFFIX
          The suffix used to build the style class key for the available label of this calculated item selector panel.
 
Fields inherited from class com.sas.servlet.tbeans.dataselectors.calculateditems.html.BaseCalculatedItemSelectorPanel
BASE_EXPRESSION_EDITOR_RB_KEY, SELECTOR_CHOICE_CLASS, SELECTOR_LABEL_CLASS, SELECTOR_LIST_CLASS, SELECTOR_RADIO_CLASS, SELECTOR_TEXT_AREA_CLASS, SELECTOR_TEXT_CLASS, SELECTOR_TEXT_ENTRY_CLASS, SIMPLE_SELECTOR_RB_KEY
 
Fields inherited from class com.sas.servlet.tbeans.dataselectors.BaseSelectorPanel
SELECTOR_EXPAND, SELECTOR_EXTERNAL
 
Fields inherited from interface com.sas.servlet.tbeans.dataselectors.calculateditems.html.SimpleCalculatedItemSelectorKeysInterface
SIMPLECALCULATEDITEMSELECTOR_AVAILABLE_LABEL, SIMPLECALCULATEDITEMSELECTOR_AVAILABLE_LIST, SIMPLECALCULATEDITEMSELECTOR_DESCRIPTION_ENTRY, SIMPLECALCULATEDITEMSELECTOR_DESCRIPTION_LABEL, SIMPLECALCULATEDITEMSELECTOR_EXPRESSION_EDITOR, SIMPLECALCULATEDITEMSELECTOR_FORMAT_CLEAR_BUTTON, SIMPLECALCULATEDITEMSELECTOR_FORMAT_FIELD, SIMPLECALCULATEDITEMSELECTOR_FORMAT_LABEL, SIMPLECALCULATEDITEMSELECTOR_FORMAT_NOTE_LABEL, SIMPLECALCULATEDITEMSELECTOR_FORMAT_SELECT_BUTTON, SIMPLECALCULATEDITEMSELECTOR_FORMAT_SELECTOR_PANEL, SIMPLECALCULATEDITEMSELECTOR_FUNCTION_CHOICE, SIMPLECALCULATEDITEMSELECTOR_FUNCTION_LABEL, SIMPLECALCULATEDITEMSELECTOR_LIST_EDITOR, SIMPLECALCULATEDITEMSELECTOR_LIST_EDITOR_LABEL, SIMPLECALCULATEDITEMSELECTOR_NAME_ENTRY, SIMPLECALCULATEDITEMSELECTOR_NAME_LABEL, SIMPLECALCULATEDITEMSELECTOR_TRANSFER_BUTTON, SIMPLECALCULATEDITEMSELECTOR_TREE_LABEL, SIMPLECALCULATEDITEMSELECTOR_TREEVIEW
 
Fields inherited from interface com.sas.servlet.tbeans.dataselectors.calculateditems.html.SimpleCalculatedItemSelectorStyleKeysInterface
SIMPLECALCULATEDITEMSELECTOR_AVAILABLE_LABEL_CLASS, SIMPLECALCULATEDITEMSELECTOR_AVAILABLE_LIST_CLASS, SIMPLECALCULATEDITEMSELECTOR_CONTAINER_CLASS, SIMPLECALCULATEDITEMSELECTOR_DESCRIPTION_ENTRY_CLASS, SIMPLECALCULATEDITEMSELECTOR_DESCRIPTION_LABEL_CLASS, SIMPLECALCULATEDITEMSELECTOR_FORMAT_ENTRY_COMPONENT_CLASS, SIMPLECALCULATEDITEMSELECTOR_FORMAT_NOTE_COMPONENT_CLASS, SIMPLECALCULATEDITEMSELECTOR_FUNCTION_CHOICE_CLASS, SIMPLECALCULATEDITEMSELECTOR_FUNCTION_LABEL_CLASS, SIMPLECALCULATEDITEMSELECTOR_LIST_EDITOR_COMPONENT_CLASS, SIMPLECALCULATEDITEMSELECTOR_NAME_ENTRY_CLASS, SIMPLECALCULATEDITEMSELECTOR_NAME_LABEL_CLASS, SIMPLECALCULATEDITEMSELECTOR_TREE_LABEL_CLASS, SIMPLECALCULATEDITEMSELECTOR_TREEVIEW_CLASS
 
Fields inherited from interface com.sas.servlet.tbeans.dataselectors.calculateditems.html.BaseCalculatedItemSelectorPanelKeysInterface
BASECALCULATEDITEMSELECTORPANEL_DESCRIPTION_ENTRY, BASECALCULATEDITEMSELECTORPANEL_DESCRIPTION_LABEL, BASECALCULATEDITEMSELECTORPANEL_EXPRESSION_EDITOR, BASECALCULATEDITEMSELECTORPANEL_NAME_ENTRY, BASECALCULATEDITEMSELECTORPANEL_NAME_LABEL
 
Fields inherited from interface com.sas.servlet.tbeans.dataselectors.calculateditems.html.BaseCalculatedItemSelectorPanelStyleKeysInterface
BASECALCULATEDITEMSELECTORPANEL_DESCRIPTION_ENTRY_CLASS, BASECALCULATEDITEMSELECTORPANEL_DESCRIPTION_LABEL_CLASS, BASECALCULATEDITEMSELECTORPANEL_NAME_ENTRY_CLASS, BASECALCULATEDITEMSELECTORPANEL_NAME_LABEL_CLASS
 
Constructor Summary
SimpleCalculatedItemSelectorPanel()
          Construct a SimpleCalculatedItemSelectorPanel object with no associated model.
SimpleCalculatedItemSelectorPanel(java.lang.String name)
          Construct a SimpleCalculatedItemSelectorPanel object with the given name and with no associated model.
 
Method Summary
 void close()
          Base implementation that does nothing.
 void contentsChanged(com.sas.collection.ContentsChangedEvent event)
          Processes a ContentsChangedEvent received from the SimpleCalculatedItemSelectorCommand.
 void createClearFormatButton()
          Creates the transfer button for this simple calculated item selector panel.
 void createSelectFormatButton()
          Creates the transfer button for this simple calculated item selector panel.
protected  TextEntry getDescriptionEntryInstance()
           
protected  TextEntry getNameEntryInstance()
           
 javax.swing.tree.TreeModel getTreeModel()
           
protected  void initializeClearFormatButton()
          Sets default values for the transfer button component in preparation for each time this simple calculated item selector panel is rendered.
protected  void initializeFormatEntry()
           
protected  void initializeFunctionsList(java.util.Locale locale)
           
protected  void initializeSelectFormatButton()
          Sets default values for the transfer button component in preparation for each time this simple calculated item selector panel is rendered.
protected  ListBox newAvailableListBoxInstance()
          Creates the component containing the list of available data items, along with the associated label for the available list.
protected  TreeView newCumulativeTreeView()
           
protected  BaseChoiceBox newFunctionComboInstance()
           
protected  ListEditor newListEditorInstance()
          Creates the list editor for this simple calculated item selector panel.
protected  Button newTransferButtonInstance()
          Creates the transfer button for this simple calculated item selector panel.
protected  void populateTreeView()
           
protected  void setLocaleDependentProperties(java.util.Locale locale)
          Sets the locale dependent properties.
 void setSelector(AbstractSelectorContainer selector)
          Sets the selector which contains this SelectorPanel
 void write(java.io.PrintWriter out)
          Writes the selector panel.
 void writeInvalidItemMessage(java.io.PrintWriter out, java.util.List invalidItemList)
          Writes JavaScript back to the client to display a message listing all the invalid calculated items.
 void writeRemoteScriptCommands(java.io.PrintWriter out)
          Writes the remote javascript data to the output stream.
 
Methods inherited from class com.sas.servlet.tbeans.dataselectors.calculateditems.html.BaseCalculatedItemSelectorPanel
setSelectorModel
 
Methods inherited from class com.sas.servlet.tbeans.dataselectors.html.SelectorPanel
getAdditionalParameters, getDefaultFormObject, getFormObject, getIframeName, isFormEnabled, setAdditionalParameter, setAdditionalParameters, setFormEnabled, setFormObject, setIframeName, writeRemoteScriptFrame, writeSelectorPanelFooter, writeSelectorPanelHeader
 
Methods inherited from class com.sas.servlet.tbeans.dataselectors.BaseSelectorPanel
getActionProvider, getCommandId, getImageLocation, getSelector, getSelectorModel, setActionProvider, setCommandId, setImageLocation
 
Methods inherited from class com.sas.servlet.tbeans.BaseCompositeTransformation
applyTemplate, applyTemplate, getComponent, getComponents, getDefaultTemplate, getStyleInfo, getStyleMap, getTemplate, getTemplateDictionary, getTemplateFileName, getTemplateLocation, getVisibleComponents, isFlushEnabled, propertyChange, removeComponent, setCleanUpResourcesOn, setComponent, setFlushEnabled, setId, setLocale, setRequest, setResponse, setStyleInfo, setTemplate, setTemplate, setTemplateDictionary, setTemplateFileName, setTemplateLocation, writeTemplate
 
Methods inherited from class com.sas.servlet.tbeans.BaseTransformation
addPropertyChangeListener, addPropertyChangeListener, cleanUpResources, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCustomAttributes, getDescription, getId, getInputTransform, getLocale, getName, getObjectData, getObjectDataProperty, getOutputTransform, getRequest, getResponse, getTagEpilog, getTagProlog, hasListeners, isCleanUpResourcesOn, isVisible, removePropertyChangeListener, removePropertyChangeListener, setCustomAttributes, setInputTransform, setName, setObjectData, setObjectDataProperty, setOutputTransform, setTagEpilog, setTagProlog, setVisible, toString, write, write, write
 
Methods inherited from interface com.sas.actionprovider.HttpActionProviderInterface
getRequest
 

Field Detail

DEFAULT_TEMPLATE_FILE_NAME

public static final java.lang.String DEFAULT_TEMPLATE_FILE_NAME
The default file name for the template for this simple calculated item selector panel.

See Also:
Constant Field Values

JAVASCRIPT_PROCESS_SELECT_FORMAT_BUTTON_SELECTION

protected static final java.lang.String JAVASCRIPT_PROCESS_SELECT_FORMAT_BUTTON_SELECTION
The name of the JavaScript function which handles the button events for the transfer button.

See Also:
Constant Field Values

JAVASCRIPT_PROCESS_CLEAR_FORMAT_BUTTON_SELECTION

protected static final java.lang.String JAVASCRIPT_PROCESS_CLEAR_FORMAT_BUTTON_SELECTION
The name of the JavaScript function which handles the button events for the transfer button.

See Also:
Constant Field Values

JAVASCRIPT_PROCESS_FORMAT_ENTRY

protected static final java.lang.String JAVASCRIPT_PROCESS_FORMAT_ENTRY
The name of the JavaScript function which handles the change events for the name entry field.

See Also:
Constant Field Values

JAVASCRIPT_PROCESS_NODE_SELECTION

protected static final java.lang.String JAVASCRIPT_PROCESS_NODE_SELECTION
The name of the JavaScript function which handles the user's selection of an item in the available list.

See Also:
Constant Field Values

JAVASCRIPT_PROCESS_FUNCTION_SELECTION

protected static final java.lang.String JAVASCRIPT_PROCESS_FUNCTION_SELECTION
The name of the JavaScript function which handles the processing on the choice box when an item in the choice list is selected.

See Also:
Constant Field Values

FORMAT_NOTE_SUFFIX

protected static final java.lang.String FORMAT_NOTE_SUFFIX
See Also:
Constant Field Values

FORMAT_ENTRY_SUFFIX

protected static final java.lang.String FORMAT_ENTRY_SUFFIX
See Also:
Constant Field Values

FUNCTION_LABEL_SUFFIX

protected static final java.lang.String FUNCTION_LABEL_SUFFIX
The suffix used to build the style class key for the available label of this calculated item selector panel.

See Also:
Constant Field Values

FUNCTION_CHOICE_SUFFIX

protected static final java.lang.String FUNCTION_CHOICE_SUFFIX
The suffix used to build the style class key for the available label of this calculated item selector panel.

See Also:
Constant Field Values

TREE_LABEL_SUFFIX

protected static final java.lang.String TREE_LABEL_SUFFIX
The suffix used to build the style class key for the available label of this calculated item selector panel.

See Also:
Constant Field Values

TREEVIEW_SUFFIX

protected static final java.lang.String TREEVIEW_SUFFIX
The suffix used to build the style class key for the available label of this calculated item selector panel.

See Also:
Constant Field Values

FORMAT_NOTE_CLASS

protected static final java.lang.String FORMAT_NOTE_CLASS
See Also:
Constant Field Values

FORMAT_ENTRY_CLASS

protected static final java.lang.String FORMAT_ENTRY_CLASS
See Also:
Constant Field Values

FUNCTION_LABEL_CLASS

protected static final java.lang.String FUNCTION_LABEL_CLASS
The style class key for the available label of this simple calculated item selector panel.

See Also:
Constant Field Values

FUNCTION_CHOICE_CLASS

protected static final java.lang.String FUNCTION_CHOICE_CLASS
The style class key for the available list of this simple calculated item selector panel.

See Also:
Constant Field Values

TREE_LABEL_CLASS

protected static final java.lang.String TREE_LABEL_CLASS
The style class key for the available label of this simple calculated item selector panel.

See Also:
Constant Field Values

TREEVIEW_CLASS

protected static final java.lang.String TREEVIEW_CLASS
The style class key for the available list of this simple calculated item selector panel.

See Also:
Constant Field Values
Constructor Detail

SimpleCalculatedItemSelectorPanel

public SimpleCalculatedItemSelectorPanel()
Construct a SimpleCalculatedItemSelectorPanel object with no associated model. This constructor simply builds the visuals which comprise the selector panel. Users of this constructor will need to call setSelectorModel() to set the model for this selector panel.

See Also:
BaseCalculatedItemSelectorPanel.setSelectorModel(java.lang.Object)

SimpleCalculatedItemSelectorPanel

public SimpleCalculatedItemSelectorPanel(java.lang.String name)
Construct a SimpleCalculatedItemSelectorPanel object with the given name and with no associated model. This constructor simply builds the visuals which comprise the selector panel. Users of this constructor will need to call setSelectorModel() to set the model for this selector panel.

Parameters:
name - the name of the panel
See Also:
BaseCalculatedItemSelectorPanel.setSelectorModel(java.lang.Object)
Method Detail

setLocaleDependentProperties

protected void setLocaleDependentProperties(java.util.Locale locale)
Description copied from class: BaseTransformation
Sets the locale dependent properties. Not operational at this level.

Overrides:
setLocaleDependentProperties in class BaseCalculatedItemSelectorPanel

getNameEntryInstance

protected TextEntry getNameEntryInstance()

getDescriptionEntryInstance

protected TextEntry getDescriptionEntryInstance()

newAvailableListBoxInstance

protected ListBox newAvailableListBoxInstance()
Creates the component containing the list of available data items, along with the associated label for the available list.

See Also:
initializeAvailableList()

newTransferButtonInstance

protected Button newTransferButtonInstance()
Creates the transfer button for this simple calculated item selector panel.

See Also:
initializeTransferButton()

newFunctionComboInstance

protected BaseChoiceBox newFunctionComboInstance()

newCumulativeTreeView

protected TreeView newCumulativeTreeView()

newListEditorInstance

protected ListEditor newListEditorInstance()
Creates the list editor for this simple calculated item selector panel.

See Also:
initializeListEditor()

createSelectFormatButton

public void createSelectFormatButton()
Creates the transfer button for this simple calculated item selector panel.

See Also:
initializeTransferButton()

initializeSelectFormatButton

protected void initializeSelectFormatButton()
Sets default values for the transfer button component in preparation for each time this simple calculated item selector panel is rendered.

See Also:
#createTransferButton

createClearFormatButton

public void createClearFormatButton()
Creates the transfer button for this simple calculated item selector panel.

See Also:
initializeTransferButton()

initializeClearFormatButton

protected void initializeClearFormatButton()
Sets default values for the transfer button component in preparation for each time this simple calculated item selector panel is rendered.

See Also:
#createTransferButton

initializeFunctionsList

protected void initializeFunctionsList(java.util.Locale locale)

initializeFormatEntry

protected void initializeFormatEntry()

populateTreeView

protected void populateTreeView()

getTreeModel

public javax.swing.tree.TreeModel getTreeModel()

write

public void write(java.io.PrintWriter out)
           throws java.io.IOException
Writes the selector panel.

Specified by:
write in interface TransformationInterface
Specified by:
write in interface com.sas.util.WriteToPrintWriterInterface
Overrides:
write in class BaseCalculatedItemSelectorPanel
Parameters:
out - the output stream
Throws:
java.io.IOException - thrown if some type of I/O error occurs

writeInvalidItemMessage

public void writeInvalidItemMessage(java.io.PrintWriter out,
                                    java.util.List invalidItemList)
                             throws java.io.IOException
Writes JavaScript back to the client to display a message listing all the invalid calculated items. The message is displayed after the user tries to submit the list.

Parameters:
out - the output stream
invalidItemList - a list of String objects with the label of each invalid calculated item to be displayed to the user.
Throws:
java.io.IOException - thrown if some type of I/O error occurs

contentsChanged

public void contentsChanged(com.sas.collection.ContentsChangedEvent event)
Processes a ContentsChangedEvent received from the SimpleCalculatedItemSelectorCommand. If the event information map contains a list of invalid items received from the client, then writeInvalidItemMessage(java.io.PrintWriter, java.util.List) is invoked to return an error message to the client.

Specified by:
contentsChanged in interface com.sas.collection.ContentsChangedListener
Overrides:
contentsChanged in class BaseSelectorPanel
Parameters:
event - the ContentsChanged event generated by the Action Provider for the SimpleCalculatedItemSelectorCommand
See Also:
writeInvalidItemMessage(java.io.PrintWriter, java.util.List)

writeRemoteScriptCommands

public void writeRemoteScriptCommands(java.io.PrintWriter out)
                               throws java.io.IOException
Writes the remote javascript data to the output stream.

Overrides:
writeRemoteScriptCommands in class SelectorPanel
Parameters:
out - The PrintWriter used to write data back on the response
Throws:
java.io.IOException - thrown if some type of I/O error occurs

setSelector

public void setSelector(AbstractSelectorContainer selector)
Description copied from class: BaseSelectorPanel
Sets the selector which contains this SelectorPanel

Overrides:
setSelector in class BaseSelectorPanel
Parameters:
selector - The selector which contains this SelectorPanel

close

public void close()
Description copied from class: SelectorPanel
Base implementation that does nothing.

Subclasses may override this when they want to know a commit or cancel has occured on the selector.

Overrides:
close in class SelectorPanel



Copyright © 2009 SAS Institute Inc. All Rights Reserved.