DLESE Tools
v1.6.0

org.dlese.dpc.schemedit.display
Class CollapseBean

java.lang.Object
  extended by org.dlese.dpc.schemedit.display.CollapseBean
All Implemented Interfaces:
Serializable

public class CollapseBean
extends Object
implements Serializable

Maintains the state of collapsible nodes in the metadata Editor. States are OPENED and CLOSED, and the default is controlled by setDefaultState.

Author:
ostwald
See Also:
Serialized Form

Field Summary
static String CLOSED
          Description of the Field
static String DEFAULT_STATE
          Description of the Field
static String OPEN
          Description of the Field
 
Constructor Summary
CollapseBean()
          Constructor for the CollapseBean object
 
Method Summary
 void clear()
          Removes all state information from the CollapseBean.
 void closeElement()
          Set the state of the current element (the value returned by getId) to CLOSED.
 void closeElement(String key)
          Set the state of the specified element to CLOSED.
 void displayStateMap()
          Debugging utility
 void exposeElement(String xpath)
          Opens the element at the given xpath, as well as each ancestor element.
 String getDisplayState()
          Gets the displayState of the default element
 String getDisplayState(String key)
          Gets the displayState attribute of the specified element
 String getId()
          Gets the id of the default element.
 boolean getIsOpen()
          Gets the isOpen attribute of the default element
 Map getStateMap()
          Gets the stateMap attribute of the CollapseBean object
 void openElement()
          Opens the default element
 void openElement(String key)
          Opens the specified element
protected  void prtln(String s)
          Description of the Method
 void setDefaultState(String state)
          Sets the defaultState attribute of the CollapseBean object
 void setDisplayState(String state)
          Sets the displayState attribute of the default element of the CollapseBean object
 void setDisplayState(String key, String state)
          Sets the displayState for a document node corresponding to the given key.
 void setId(String id)
          Sets the id attribute which represets the *default element* to be operated upon when a "key" is not specified.
 void update(HttpServletRequest request)
          Find the request parameters that specify displayStates for the content boxes of the metadataEditor's instance document, and update the collapseBean so it reflects the displayStates specified by the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPEN

public static String OPEN
Description of the Field


CLOSED

public static String CLOSED
Description of the Field


DEFAULT_STATE

public static String DEFAULT_STATE
Description of the Field

Constructor Detail

CollapseBean

public CollapseBean()
Constructor for the CollapseBean object

Method Detail

clear

public void clear()
Removes all state information from the CollapseBean.


closeElement

public void closeElement()
Set the state of the current element (the value returned by getId) to CLOSED.


closeElement

public void closeElement(String key)
Set the state of the specified element to CLOSED.

Parameters:
key - String designating an element in the instance document

setId

public void setId(String id)
Sets the id attribute which represets the *default element* to be operated upon when a "key" is not specified. Used by jsp pages to designate a particular element that will be queried, and then subsequent calls to the CollapseBean need not pass a parameter to specify the element.

For example:

Parameters:
id - The new id value

getId

public String getId()
Gets the id of the default element.

Returns:
The id value

setDefaultState

public void setDefaultState(String state)
Sets the defaultState attribute of the CollapseBean object

Parameters:
state - The new defaultState value

exposeElement

public void exposeElement(String xpath)
Opens the element at the given xpath, as well as each ancestor element.

Parameters:
xpath - NOT YET DOCUMENTED

getStateMap

public Map getStateMap()
Gets the stateMap attribute of the CollapseBean object

Returns:
The stateMap value

setDisplayState

public void setDisplayState(String key,
                            String state)
Sets the displayState for a document node corresponding to the given key. A key is an xpath encoded to be acceptable as a javascript var (see org.dlese.dpc.schemedit.SchemEditUtils#pathToId(String))

Parameters:
key - An encoded xpath
state - The new displayState value

setDisplayState

public void setDisplayState(String state)
Sets the displayState attribute of the default element of the CollapseBean object

Parameters:
state - The new displayState value

getIsOpen

public boolean getIsOpen()
Gets the isOpen attribute of the default element

Returns:
The isOpen value

getDisplayState

public String getDisplayState()
Gets the displayState of the default element

Returns:
The displayState value

getDisplayState

public String getDisplayState(String key)
Gets the displayState attribute of the specified element

Parameters:
key - Description of the Parameter
Returns:
The displayState value

openElement

public void openElement()
Opens the default element


openElement

public void openElement(String key)
Opens the specified element

Parameters:
key - an identifier for the element to open

displayStateMap

public void displayStateMap()
Debugging utility


update

public void update(HttpServletRequest request)
Find the request parameters that specify displayStates for the content boxes of the metadataEditor's instance document, and update the collapseBean so it reflects the displayStates specified by the request.

Parameters:
request - Description of the Parameter

prtln

protected final void prtln(String s)
Description of the Method

Parameters:
s - Description of the Parameter

DLESE Tools
v1.6.0