com.sas.servlet.tbeans.dataselectors.calculations.percent.html
Class PercentCalculationsSelectorPanel

com.sas.servlet.tbeans.dataselectors.calculations.percent.html.PercentCalculationsSelectorPanel
All Implemented Interfaces:
HttpActionProviderInterface, com.sas.beans.PropertyChangeSource, com.sas.collection.ContentsChangedListener, CancelInterface, com.sas.lang.ObjectDataInterface, com.sas.servlet.tbeans.AJAXControllerURLInterface, ComplexStyleInterface, CompositeComponentInterface, PercentCalculationsSelectorKeysInterface, PercentCalculationsSelectorStyleKeysInterface, FormViewInterface, RenderableInterface, TemplateInterface, com.sas.servlet.tbeans.TemplateKeyInterface, TransformationInterface, com.sas.util.WriteToPrintWriterInterface, java.io.Serializable, java.util.EventListener

public class PercentCalculationsSelectorPanel
implements CancelInterface, PercentCalculationsSelectorKeysInterface, PercentCalculationsSelectorStyleKeysInterface

The PercentCalculationsSelectorPanel is a TransformationBean™ that generates the appropriate HTML 4.0 and JavaScript to provide a user interface for adding and removing FractionOfTotal dataitems.

The PercentCalculationsSelectorPanel 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 PercentCalculationsSelectorPanel 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 PercentCalculationsSelectorPanel uses the following JavaScript files:

sas_percentCalculationsSelector.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 .

Since:
3.1.4
See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_TEMPLATE_FILE_NAME
          The default file name for the template for this panel.
protected static java.lang.String JAVASCRIPT_ACTIVATE_ADD_FUNCTION
          The name of the JavaScript function which removes items from the summary box.
protected static java.lang.String JAVASCRIPT_ADD_FUNCTION
          The name of the JavaScript function which adds items to the summary box.
protected static java.lang.String JAVASCRIPT_IGNORE_ENTER_FUNCTION
          The name of the JavaScript function which traps and throws away the enter key event.
protected static java.lang.String JAVASCRIPT_PANEL_CLASS
          The root portion of any JavaScript function names for this selector panel.
protected static java.lang.String JAVASCRIPT_REMOVE_FUNCTION
          The name of the JavaScript function which removes items from the summary box.
static java.lang.String RB_KEY
           
 
Fields inherited from class com.sas.servlet.tbeans.dataselectors.BaseSelectorPanel
imageLocation, SELECTOR_EXPAND, SELECTOR_EXTERNAL
 
Fields inherited from interface com.sas.servlet.tbeans.dataselectors.calculations.percent.html.PercentCalculationsSelectorKeysInterface
PCS_ADD_BUTTON, PCS_BUTTON_ROW_ID, PCS_LABEL, PCS_LABEL_LABEL, PCS_MEASURE_CHOICE, PCS_MEASURE_LABEL, PCS_PERCENT_CHOICE, PCS_PERCENT_CHOICE_CONDITIONAL, PCS_PERCENT_CHOICE_LABEL, PCS_PERCENT_LABEL, PCS_REMOVE_BUTTON, PCS_SUMMARY_BOX
 
Fields inherited from interface com.sas.servlet.tbeans.dataselectors.calculations.percent.html.PercentCalculationsSelectorStyleKeysInterface
PCS_BUTTON_STYLE, PCS_CHOICE_LABEL_STYLE, PCS_CHOICE_STYLE, PCS_LABEL_ENTRY_STYLE, PCS_LABEL_STYLE, PCS_SUMMARY_STYLE
 
Constructor Summary
PercentCalculationsSelectorPanel()
          Default constructor.
PercentCalculationsSelectorPanel(java.lang.String name)
          Constructor using the given name.
 
Method Summary
protected  void addComponents()
          Creates the components and adds them to the selector's template dictionary.
 void cancel()
          Cancels the command.
 void cleanUpResources()
          This method releases all of the necessary resources that were needed by the transformation bean to render itself.
protected  BaseButton newAddButtonInstance()
          Returns a new Button for Add field.
protected  BaseLabel newLabelLabelInstance()
          Returns a new default label for the Label field.
protected  TextEntry newLabelTextEntryInstance()
          Returns a new default TextEntry for the Label specification field.
protected  BaseChoiceBox newMeasureComboInstance()
          Returns a new default ChoiceBox for the Measure specification field.
protected  BaseLabel newMeasureLabelInstance()
          Returns a new default label for the For Measure field.
protected  BaseLabel newPercentChoiceLabelInstance()
          Returns a new default choice label for the Percent specification field.
protected  BaseChoiceBox newPercentComboInstance()
          Returns a new default ChoiceBox for the the Percent specification field.
protected  BaseLabel newPercentLabelInstance()
          Returns a new default label for the For Percent field.
protected  BaseButton newRemoveButtonInstance()
          Returns a new Button for Remove field.
protected  PercentCalculationsSelectorListBoxView newSummaryBoxInstance()
          Returns a new PercentCalculationsSelectorListBoxView for the summary field.
protected  void populateMeasureChoiceBox()
          Sets write-time properties for the measure choicebox, including the combobox model for the choicebox and the selectedIndex.
protected  void populatePercentChoiceBox()
          Sets write-time properties for the Percent choicebox, including the combobox model for the choicebox and the selectedIndex.
protected  void populateSummaryListBox()
          Sets write-time properties for the summary listbox including its model
protected  javax.swing.DefaultListModel populateSummaryListBoxModel(PercentCalculationsSelectorListBoxView listBox, javax.swing.DefaultListModel listModel, PercentCalculationsSelectorInterface adapter)
          Populates the summary listbox model.
protected  void setComponentValues()
          Populates the Measure ChoiceBox, the Percent ChoiceBox and the Summary ListBox.
protected  void setLocaleDependentProperties(java.util.Locale locale)
          Sets the locale dependent properties.
 void setSelectorModel(java.lang.Object selectormodel)
          Sets the selector's data model
protected  void setupTemplateDictionary()
           Updates the values associated with the following keys in the template dictionary: PCS_BUTTON_ROW_ID PCS_PERCENT_CHOICE_CONDITIONAL
 void write(java.io.PrintWriter out)
          Writes the custom attributes of the object.
protected  void writeActionProviderFields(java.io.PrintWriter out)
          Writes the fields needed to identify the ActionProvider, the CMDID and the selector's MODE.
 
Methods inherited from class com.sas.servlet.tbeans.dataselectors.html.SelectorPanel
close, getAdditionalParameters, getDefaultFormObject, getFormObject, getIframeName, isFormEnabled, setAdditionalParameter, setAdditionalParameters, setFormEnabled, setFormObject, setIframeName, writeRemoteScriptCommands, writeRemoteScriptFrame, writeSelectorPanelFooter, writeSelectorPanelHeader
 
Methods inherited from class com.sas.servlet.tbeans.dataselectors.BaseSelectorPanel
contentsChanged, getActionProvider, getCommandId, getImageLocation, getSelector, getSelectorModel, setActionProvider, setCommandId, setImageLocation, setSelector
 
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, 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

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values

DEFAULT_TEMPLATE_FILE_NAME

public static final java.lang.String DEFAULT_TEMPLATE_FILE_NAME
The default file name for the template for this panel. "PercentCalculationsSelectorPanel.html"

See Also:
Constant Field Values

JAVASCRIPT_PANEL_CLASS

protected static final java.lang.String JAVASCRIPT_PANEL_CLASS
The root portion of any JavaScript function names for this selector panel.

See Also:
Constant Field Values

JAVASCRIPT_ADD_FUNCTION

protected static final java.lang.String JAVASCRIPT_ADD_FUNCTION
The name of the JavaScript function which adds items to the summary box.

See Also:
Constant Field Values

JAVASCRIPT_REMOVE_FUNCTION

protected static final java.lang.String JAVASCRIPT_REMOVE_FUNCTION
The name of the JavaScript function which removes items from the summary box.

See Also:
Constant Field Values

JAVASCRIPT_ACTIVATE_ADD_FUNCTION

protected static final java.lang.String JAVASCRIPT_ACTIVATE_ADD_FUNCTION
The name of the JavaScript function which removes items from the summary box.

See Also:
Constant Field Values

JAVASCRIPT_IGNORE_ENTER_FUNCTION

protected static final java.lang.String JAVASCRIPT_IGNORE_ENTER_FUNCTION
The name of the JavaScript function which traps and throws away the enter key event.

See Also:
Constant Field Values
Constructor Detail

PercentCalculationsSelectorPanel

public PercentCalculationsSelectorPanel()
Default constructor.


PercentCalculationsSelectorPanel

public PercentCalculationsSelectorPanel(java.lang.String name)
Constructor using the given name.

Parameters:
name - String to set the name
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 BaseTransformation

setSelectorModel

public void setSelectorModel(java.lang.Object selectormodel)
Sets the selector's data model

Overrides:
setSelectorModel in class BaseSelectorPanel
Parameters:
selectormodel - The selector's data model

write

public void write(java.io.PrintWriter out)
Description copied from class: BaseCompositeTransformation
Writes the custom attributes of the object. All transformation beans should override this method and call SUPER.

Specified by:
write in interface TransformationInterface
Specified by:
write in interface com.sas.util.WriteToPrintWriterInterface
Overrides:
write in class BaseCompositeTransformation
Parameters:
out - The output stream

writeActionProviderFields

protected void writeActionProviderFields(java.io.PrintWriter out)
Writes the fields needed to identify the ActionProvider, the CMDID and the selector's MODE.

Parameters:
out - The PrintWriter to which the fields should be written.

setupTemplateDictionary

protected void setupTemplateDictionary()

Updates the values associated with the following keys in the template dictionary:


addComponents

protected void addComponents()
Creates the components and adds them to the selector's template dictionary.


newMeasureLabelInstance

protected BaseLabel newMeasureLabelInstance()
Returns a new default label for the For Measure field.

Returns:
a new default label for the For Measure field.

newPercentLabelInstance

protected BaseLabel newPercentLabelInstance()
Returns a new default label for the For Percent field.

Returns:
a new default label for the For Percent field.

newLabelLabelInstance

protected BaseLabel newLabelLabelInstance()
Returns a new default label for the Label field.

Returns:
a new default label for the Label field.

newPercentChoiceLabelInstance

protected BaseLabel newPercentChoiceLabelInstance()
Returns a new default choice label for the Percent specification field.

This component is written only when the selector is attached to the relational version of the adaper

Returns:
a new default choice label for the Percent specification field.

newMeasureComboInstance

protected BaseChoiceBox newMeasureComboInstance()
Returns a new default ChoiceBox for the Measure specification field.

Returns:
a new default ChoiceBox for the Measure specification field.

newPercentComboInstance

protected BaseChoiceBox newPercentComboInstance()
Returns a new default ChoiceBox for the the Percent specification field.

This component is written only when the selector is attached to the olap version of the adaper.

Returns:
a new default ChoiceBox for the the Percent specification field.

newLabelTextEntryInstance

protected TextEntry newLabelTextEntryInstance()
Returns a new default TextEntry for the Label specification field.

Returns:
a new default TextEntry for the Label specification field.

newAddButtonInstance

protected BaseButton newAddButtonInstance()
Returns a new Button for Add field.

Returns:
a new Button for Add field.

newRemoveButtonInstance

protected BaseButton newRemoveButtonInstance()
Returns a new Button for Remove field.

Returns:
a new Button for Remove field.

newSummaryBoxInstance

protected PercentCalculationsSelectorListBoxView newSummaryBoxInstance()
Returns a new PercentCalculationsSelectorListBoxView for the summary field.

Returns:
a new PercentCalculationsSelectorListBoxView for the summary field.

setComponentValues

protected void setComponentValues()
Populates the Measure ChoiceBox, the Percent ChoiceBox and the Summary ListBox.


cancel

public void cancel()
Description copied from interface: CancelInterface
Cancels the command.

Common things done in this method:

Specified by:
cancel in interface CancelInterface

populateSummaryListBox

protected void populateSummaryListBox()
Sets write-time properties for the summary listbox including its model

Throws:
java.io.IOException - thrown if some type of I/O error occurs

populateSummaryListBoxModel

protected javax.swing.DefaultListModel populateSummaryListBoxModel(PercentCalculationsSelectorListBoxView listBox,
                                                                   javax.swing.DefaultListModel listModel,
                                                                   PercentCalculationsSelectorInterface adapter)
Populates the summary listbox model.

Parameters:
listBox - the PercentCalculationsSelectorListBoxView to which the model will be attached.
listModel - the model to populate.
adapter - this panel's selectorModel.
Throws:
java.io.IOException - thrown if some type of I/O error occurs

populateMeasureChoiceBox

protected void populateMeasureChoiceBox()
Sets write-time properties for the measure choicebox, including the combobox model for the choicebox and the selectedIndex.

Throws:
java.io.IOException - thrown if some type of I/O error occurs

populatePercentChoiceBox

protected void populatePercentChoiceBox()
Sets write-time properties for the Percent choicebox, including the combobox model for the choicebox and the selectedIndex.

Throws:
java.io.IOException - thrown if some type of I/O error occurs

cleanUpResources

public void cleanUpResources()
Description copied from class: BaseTransformation
This method releases all of the necessary resources that were needed by the transformation bean to render itself. These resources include fields such as request and response. This method calls the setRequest and setResponse methods with a null value.

Overrides:
cleanUpResources in class BaseTransformation



Copyright © 2009 SAS Institute Inc. All Rights Reserved.