com.sas.servlet.tbeans
Class BaseExpandCollapse

com.sas.servlet.tbeans.BaseExpandCollapse
All Implemented Interfaces:
HttpActionProviderInterface, com.sas.beans.PropertyChangeSource, com.sas.lang.ObjectDataInterface, com.sas.servlet.tbeans.AJAXControllerURLInterface, ComplexStyleInterface, CompositeComponentInterface, ExpandCollapseKeysInterface, RenderableInterface, TemplateInterface, com.sas.servlet.tbeans.TemplateKeyInterface, TransformationInterface, com.sas.util.WriteToPrintWriterInterface, java.io.Serializable
Direct Known Subclasses:
ExpandCollapse

public abstract class BaseExpandCollapse
implements ExpandCollapseKeysInterface

The BaseExpandCollapse is an abstract TransformationBean™ for creating an ExpandCollapse area. By default, this class contains a title area containing text and buttons used for expanding or collaping the content area. The content area is written inside of an HTML div tag, which can be expanded or collapsed.

Note that subclasses of this bean actually provide the markup rendering used in/with Servlet and JavaServer Pages technologies. If you need to add support for a markup language that is not explicitly provided with AppDev Studio, then you must extend this class.

For More Information:

JSP custom tags provide an alternative to using the TransformationBeans™. Visit the Custom Tag Library Reference for additional information on the sas:ExpandCollapse custom tag.

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:
Serialized Form

Field Summary
protected  java.lang.String content
           
protected  BaseTransformation contentBean
           
protected  java.lang.String imageLocation
           
static int SAVE_STATE_NONE
          Save state variable for ignoring (not saving) state.
static int SAVE_STATE_SESSION
          Save state variable for saving state via the session.
 
Fields inherited from interface com.sas.servlet.tbeans.ExpandCollapseKeysInterface
COL_BUTTON, CONTENT, DIV_ID, EXP_BUTTON, EXPCOL_BUTTON, REMOVE_BUTTON, TITLE_LABEL
 
Constructor Summary
BaseExpandCollapse()
          Default Constructor
 
Method Summary
 void cleanUpResources()
          This method releases all of the necessary resources that were needed by the transformation bean to render itself.
 java.lang.String getCollapseImageDefault()
          Gets the collapse default image String for the collapse button.
 java.lang.String getCollapseImageDisabled()
          Gets the collapse disable image String for the collapse button.
 java.lang.String getCollapseImageTooltip()
          S0863963
 java.lang.String getContent()
          Get the content to be placed inside the div tag of this component.
 BaseTransformation getContentBean()
          Get the content to be placed inside the div tag of this component.
 java.lang.String getExpandImageDefault()
          Gets the expand default image String for the expand button.
 java.lang.String getExpandImageDisabled()
          Gets the expand disable image String for the expand button.
 java.lang.String getExpandImageTooltip()
          S0863963
 java.lang.String getImageLocation()
          Returns the image location used for the button images.
 java.lang.String getRemoveImageDefault()
          Gets the remove default image String for the remove button.
 java.lang.String getRemoveImageTooltip()
          S0863963
 int getSaveState()
          Returns whether the component's state is to be saved.
 java.lang.String getTitle()
          Convenience method to get the text set on the title Label.
 boolean isExpanded()
          Returns whether the component is expanded.
 boolean isRemoveButtonVisible()
          Returns whether or not the remove button is visible.
 boolean isSingleButton()
          Returns whether or not the expand/collapse button is visible as a single button.
 void setCollapseImageDefault(java.lang.String image)
          Sets the collapse default image String for the collapse button.
 void setCollapseImageDisabled(java.lang.String image)
          Sets the collapse disable image String for the collapse button.
 void setCollapseImageTooltip(java.lang.String collapseImageTooltip)
          S0863963 Set the tooltip for the collapse image
 void setContent(BaseTransformation tbean)
          Set the content to be placed inside the div tag of this component.
 void setContent(java.lang.String content)
          Set the content to be placed inside the div tag of this component.
 void setContentBean(BaseTransformation contentBean)
          Get the content to be placed inside the div tag of this component.
 void setExpanded(boolean value)
          Sets whether the component is expanded.
 void setExpandImageDefault(java.lang.String image)
          Sets the expand default image String for the expand button.
 void setExpandImageDisabled(java.lang.String image)
          Sets the expand disable image String for the expand button.
 void setExpandImageTooltip(java.lang.String expandImageTooltip)
          S0863963 Set the tooltip for the expand image
 void setImageLocation(java.lang.String location)
          For example, setImageLocation("assets/").
 void setRemoveButtonVisible(boolean value)
          Determines whether or not the remove button will be visible.
 void setRemoveImageDefault(java.lang.String image)
          Sets the remove default image String for the remove button.
 void setRemoveImageTooltip(java.lang.String removeImageTooltip)
          S0863963 Set the tooltip for the remove image
 void setSaveState(int saveState)
          Sets whether the component is to save the expanded state to the session.
 void setSingleButton(boolean value)
          When this member is set to true, the expand/collapse button will be visible as a single button which changes or toggles the image on the click.
 void setTitle(java.lang.String title)
          Convenience method to set the text on the title Label.
 
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, write, 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, setLocaleDependentProperties, setName, setObjectData, setObjectDataProperty, setOutputTransform, setTagEpilog, setTagProlog, setVisible, toString, write, write, write
 
Methods inherited from interface com.sas.actionprovider.HttpActionProviderInterface
getRequest
 

Field Detail

content

protected java.lang.String content

imageLocation

protected java.lang.String imageLocation

contentBean

protected BaseTransformation contentBean

SAVE_STATE_NONE

public static final int SAVE_STATE_NONE
Save state variable for ignoring (not saving) state. This is the default.

See Also:
Constant Field Values

SAVE_STATE_SESSION

public static final int SAVE_STATE_SESSION
Save state variable for saving state via the session.

See Also:
Constant Field Values
Constructor Detail

BaseExpandCollapse

public BaseExpandCollapse()
Default Constructor

Method Detail

setRemoveImageDefault

public void setRemoveImageDefault(java.lang.String image)
Sets the remove default image String for the remove button.

Parameters:
image - The default image.

getRemoveImageDefault

public java.lang.String getRemoveImageDefault()
Gets the remove default image String for the remove button.

Returns:
The default image.

setExpandImageDefault

public void setExpandImageDefault(java.lang.String image)
Sets the expand default image String for the expand button.

Parameters:
image - The default image.

getExpandImageDefault

public java.lang.String getExpandImageDefault()
Gets the expand default image String for the expand button.

Returns:
The default image.

setExpandImageDisabled

public void setExpandImageDisabled(java.lang.String image)
Sets the expand disable image String for the expand button. This is only used in the case where isSingleButton is false and 2 buttons are used.

Parameters:
image - The disable image.

getExpandImageDisabled

public java.lang.String getExpandImageDisabled()
Gets the expand disable image String for the expand button.

Returns:
The disable image.

setCollapseImageDefault

public void setCollapseImageDefault(java.lang.String image)
Sets the collapse default image String for the collapse button.

Parameters:
image - The default image.

getCollapseImageDefault

public java.lang.String getCollapseImageDefault()
Gets the collapse default image String for the collapse button.

Returns:
The default image.

setCollapseImageDisabled

public void setCollapseImageDisabled(java.lang.String image)
Sets the collapse disable image String for the collapse button. This is only used in the case where isSingleButton is false and 2 buttons are used.

Parameters:
image - The disable image.

getCollapseImageDisabled

public java.lang.String getCollapseImageDisabled()
Gets the collapse disable image String for the collapse button.

Returns:
The disable image.

setExpanded

public void setExpanded(boolean value)
Sets whether the component is expanded. The default is true.

Parameters:
value - True if the component is expanded, false if collapsed

isExpanded

public boolean isExpanded()
Returns whether the component is expanded. Default is true.

Returns:
True if the component is expanded, false if collapsed

setTitle

public void setTitle(java.lang.String title)
Convenience method to set the text on the title Label. This value is checked at the time of the write, so previously calling this method will override the value of the title Label's text. Another option is to call getTitleLabel().setText() to set the text.

Parameters:
title - The title String to be used as in the title Label when the write occurs.

getTitle

public java.lang.String getTitle()
Convenience method to get the text set on the title Label.

Returns:
The title String to be used in the title Label when the write occurs.

setSingleButton

public void setSingleButton(boolean value)
When this member is set to true, the expand/collapse button will be visible as a single button which changes or toggles the image on the click. The default is true. Set this value to false to show the expand and collapse buttons as two separate buttons.

Parameters:
value - true if single button is visible, false if two are visible

isSingleButton

public boolean isSingleButton()
Returns whether or not the expand/collapse button is visible as a single button.

Returns:
true if single button is visible, false if two are visible

setRemoveButtonVisible

public void setRemoveButtonVisible(boolean value)
Determines whether or not the remove button will be visible. The default is false.

Parameters:
value - true if button is visible, false otherwise

isRemoveButtonVisible

public boolean isRemoveButtonVisible()
Returns whether or not the remove button is visible.

Returns:
true if button is visible, false otherwise

setContent

public void setContent(java.lang.String content)
Set the content to be placed inside the div tag of this component. The content is the portion that can be expanded or collapsed.

Parameters:
content - The String content to be set on this component.

setContent

public void setContent(BaseTransformation tbean)
Set the content to be placed inside the div tag of this component. The content is the portion that can be expanded or collapsed. Convenience method for adding a Transformation Bean as the content of this component.

Parameters:
tbean - The Transformation bean used as the content.

getContent

public java.lang.String getContent()
Get the content to be placed inside the div tag of this component.

Returns:
The String representation of the content.

setContentBean

public void setContentBean(BaseTransformation contentBean)
Get the content to be placed inside the div tag of this component.


getContentBean

public BaseTransformation getContentBean()
Get the content to be placed inside the div tag of this component.

Returns:
The String representation of the content.

setImageLocation

public void setImageLocation(java.lang.String location)
For example, setImageLocation("assets/").

Parameters:
location - the location of the default images

getImageLocation

public java.lang.String getImageLocation()
Returns the image location used for the button images. Uses the ComponentPropertyManager if is hasn not been set on the component.


setSaveState

public void setSaveState(int saveState)
Sets whether the component is to save the expanded state to the session. The default is SAVE_STATE_NONE. To guarantee that saving of state (expanded or collapsed) works, call setName(String) with a unique value which will not change.

Parameters:
value - Set to SAVE_STATE_NONE or SAVE_STATE_SESSION.

getSaveState

public int getSaveState()
Returns whether the component's state is to be saved. Default is SAVE_STATE_NONE.

Returns:
SAVE_STATE_NONE or SAVE_STATE_SESSION.

cleanUpResources

public void cleanUpResources()
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

getCollapseImageTooltip

public java.lang.String getCollapseImageTooltip()
S0863963

Returns:
the tooltip for the collapse image

setCollapseImageTooltip

public void setCollapseImageTooltip(java.lang.String collapseImageTooltip)
S0863963 Set the tooltip for the collapse image

Parameters:
collapseImageTooltip -

getExpandImageTooltip

public java.lang.String getExpandImageTooltip()
S0863963

Returns:
the tooltip for the expand image

setExpandImageTooltip

public void setExpandImageTooltip(java.lang.String expandImageTooltip)
S0863963 Set the tooltip for the expand image

Parameters:
expandImageTooltip -

getRemoveImageTooltip

public java.lang.String getRemoveImageTooltip()
S0863963

Returns:
the tooltip for the remove image

setRemoveImageTooltip

public void setRemoveImageTooltip(java.lang.String removeImageTooltip)
S0863963 Set the tooltip for the remove image

Parameters:
removeImageTooltip -



Copyright © 2009 SAS Institute Inc. All Rights Reserved.