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

com.sas.servlet.tbeans.dataselectors.calculateditems.html.BaseExpressionEditor
All Implemented Interfaces:
HttpActionProviderInterface, com.sas.beans.PropertyChangeSource, com.sas.lang.ObjectDataInterface, com.sas.servlet.tbeans.AJAXControllerURLInterface, ComplexStyleInterface, CompositeComponentInterface, BaseExpressionEditorKeysInterface, BaseExpressionEditorStyleKeysInterface, RenderableInterface, TemplateInterface, com.sas.servlet.tbeans.TemplateKeyInterface, TransformationInterface, com.sas.util.WriteToPrintWriterInterface, java.io.Serializable

public class BaseExpressionEditor
implements BaseExpressionEditorKeysInterface, BaseExpressionEditorStyleKeysInterface

The BaseExpressionEditor is a TransformationBean™ that generates the appropriate HTML 4.0 and JavaScript that provides a basic UI for creating and editing expressions for use in calculated items. This version of the expression editor supports only a fixed list of operations: addition, subtraction, multiplication, division, and grouping [i.e. parentheses].

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

sas_BaseExpressionEditor.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:
SimpleCalculatedItemSelector, SimpleCalculatedItemSelectorPanel, Serialized Form

Field Summary
static java.lang.String DEFAULT_TEMPLATE_FILE_NAME
          The default file name for the template for this base expression editor panel.
protected static java.lang.String JAVASCRIPT_DISABLE_ENTER_KEY_FUNCTION
          The name of the JavaScript function which disables the enter key for the expression area.
protected static java.lang.String JAVASCRIPT_ENABLE_EDITOR_BUTTONS_FUNCTION
          The root portion of any JavaScript function names for this component.
 
Fields inherited from interface com.sas.servlet.tbeans.dataselectors.calculateditems.html.BaseExpressionEditorKeysInterface
BASEEXPRESSIONEDITOR_ADD_BUTTON, BASEEXPRESSIONEDITOR_CLEAR_BUTTON, BASEEXPRESSIONEDITOR_DIVIDE_BUTTON, BASEEXPRESSIONEDITOR_EXPRESSION_AREA, BASEEXPRESSIONEDITOR_EXPRESSION_LABEL, BASEEXPRESSIONEDITOR_HELP_TEXT, BASEEXPRESSIONEDITOR_MULTIPLY_BUTTON, BASEEXPRESSIONEDITOR_NETSCAPE_HELP_TEXT, BASEEXPRESSIONEDITOR_PARENTHESIZE_BUTTON, BASEEXPRESSIONEDITOR_SUBTRACT_BUTTON
 
Fields inherited from interface com.sas.servlet.tbeans.dataselectors.calculateditems.html.BaseExpressionEditorStyleKeysInterface
BASEEXPRESSIONEDITOR_CONTAINER_CLASS, BASEEXPRESSIONEDITOR_EXPRESSION_AREA_CLASS, BASEEXPRESSIONEDITOR_EXPRESSION_LABEL_CLASS, BASEEXPRESSIONEDITOR_HELP_TEXT_CLASS, BASEEXPRESSIONEDITOR_NETSCAPE_HELP_TEXT_CLASS, BASEEXPRESSIONEDITOR_OPERATOR_BUTTON_ROW_CLASS
 
Constructor Summary
BaseExpressionEditor(java.util.Map parentStyleMap, java.util.List operatorList)
          Construct a BaseExpressionEditor object and provide it with a style map and list of operators.
 
Method Summary
 java.lang.String getActionProviderPrefix()
          Returns the action provider prefix used by this component.
 java.lang.String getImageLocation()
          Returns the path location for the images for this expression editor.
 java.util.List getOperatorList()
          Gets the list of Operation objects associated with the operator buttons on this expression editor.
 void setActionProviderPrefix(java.lang.String prefix)
          Set the action provider prefix used by this component.
 void setImageLocation(java.lang.String location)
          Sets the path location for the images for this expression editor.
protected  void setLocaleDependentProperties(java.util.Locale locale)
          Sets the locale dependent properties.
 void setOperatorList(java.util.List operators)
          Sets the list of Operation objects associated with the operator buttons on this expression editor.
 void write(java.io.PrintWriter out)
          Writes the expression editor.
 
Methods inherited from class com.sas.servlet.tbeans.BaseCompositeTransformation
applyTemplate, applyTemplate, getActionProvider, getComponent, getComponents, getDefaultTemplate, getStyleInfo, getStyleMap, getTemplate, getTemplateDictionary, getTemplateFileName, getTemplateLocation, getVisibleComponents, isFlushEnabled, propertyChange, removeComponent, setActionProvider, 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 base expression editor panel.

See Also:
Constant Field Values

JAVASCRIPT_DISABLE_ENTER_KEY_FUNCTION

protected static final java.lang.String JAVASCRIPT_DISABLE_ENTER_KEY_FUNCTION
The name of the JavaScript function which disables the enter key for the expression area. This function will be registered as the onKeyPress handler for the expression area.

See Also:
Constant Field Values

JAVASCRIPT_ENABLE_EDITOR_BUTTONS_FUNCTION

protected static final java.lang.String JAVASCRIPT_ENABLE_EDITOR_BUTTONS_FUNCTION
The root portion of any JavaScript function names for this component.

See Also:
Constant Field Values
Constructor Detail

BaseExpressionEditor

public BaseExpressionEditor(java.util.Map parentStyleMap,
                            java.util.List operatorList)
Construct a BaseExpressionEditor object and provide it with a style map and list of operators.

Parameters:
parentStyleMap - is the style map of the object which created this expression editor.
operatorList - is a list of Operation objects from which the operator buttons will be constructed on this expression editor.
See Also:
CompositeComponentInterface, StyleInfo
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

write

public void write(java.io.PrintWriter out)
           throws java.io.IOException
Writes the expression editor.

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
Throws:
java.io.IOException - thrown if some type of I/O error occurs

getOperatorList

public java.util.List getOperatorList()
Gets the list of Operation objects associated with the operator buttons on this expression editor.

Returns:
the list of Operation objects

setOperatorList

public void setOperatorList(java.util.List operators)
Sets the list of Operation objects associated with the operator buttons on this expression editor.

Parameters:
operators - the list of Operation objects

getActionProviderPrefix

public java.lang.String getActionProviderPrefix()
Returns the action provider prefix used by this component.

Returns:
the action provider prefix used by this component.

setActionProviderPrefix

public void setActionProviderPrefix(java.lang.String prefix)
Set the action provider prefix used by this component.

Parameters:
prefix - is the action provider prefix.

getImageLocation

public java.lang.String getImageLocation()
Returns the path location for the images for this expression editor.

Returns:
the path location for the images for this expression editor.
See Also:
setImageLocation(java.lang.String)

setImageLocation

public void setImageLocation(java.lang.String location)
Sets the path location for the images for this expression editor.

Parameters:
location - is the path location for the images for this expression editor, relative to the root of the web app.
See Also:
getImageLocation()



Copyright © 2009 SAS Institute Inc. All Rights Reserved.