Package org.dlese.dpc.schemedit.display
Class CollapseBean
java.lang.Object
org.dlese.dpc.schemedit.display.CollapseBean
- All Implemented Interfaces:
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:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all state information from the CollapseBean.voidSet the state of the current element (the value returned by getId) to CLOSED.voidcloseElement(String key) Set the state of the specified element to CLOSED.voidDebugging utilityvoidexposeElement(String xpath) Opens the element at the given xpath, as well as each ancestor element.Gets the displayState of the default elementgetDisplayState(String key) Gets the displayState attribute of the specified elementgetId()Gets the id of the default element.booleanGets the isOpen attribute of the default elementGets the stateMap attribute of the CollapseBean objectvoidOpens the default elementvoidopenElement(String key) Opens the specified elementprotected final voidDescription of the MethodvoidsetDefaultState(String state) Sets the defaultState attribute of the CollapseBean objectvoidsetDisplayState(String state) Sets the displayState attribute of the default element of the CollapseBean objectvoidsetDisplayState(String key, String state) Sets the displayState for a document node corresponding to the given key.voidSets the id attribute which represets the *default element* to be operated upon when a "key" is not specified.voidupdate(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.
-
Field Details
-
OPEN
Description of the Field -
CLOSED
Description of the Field -
DEFAULT_STATE
Description of the Field
-
-
Constructor Details
-
CollapseBean
public CollapseBean()Constructor for the CollapseBean object
-
-
Method Details
-
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
Set the state of the specified element to CLOSED.- Parameters:
key- String designating an element in the instance document
-
setId
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:
- <jsp:setProperty name="collapseBean" property="id" value="${id}"/>
- <c:when test="${sef.collapseBean.isOpen}">
- Parameters:
id- The new id value
-
getId
Gets the id of the default element.- Returns:
- The id value
-
setDefaultState
Sets the defaultState attribute of the CollapseBean object- Parameters:
state- The new defaultState value
-
exposeElement
Opens the element at the given xpath, as well as each ancestor element.- Parameters:
xpath- NOT YET DOCUMENTED
-
getStateMap
Gets the stateMap attribute of the CollapseBean object- Returns:
- The stateMap value
-
setDisplayState
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)invalid reference
org.dlese.dpc.schemedit.SchemEditUtils#pathToId(String)- Parameters:
key- An encoded xpathstate- The new displayState value
-
setDisplayState
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
Gets the displayState of the default element- Returns:
- The displayState value
-
getDisplayState
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
Opens the specified element- Parameters:
key- an identifier for the element to open
-
displayStateMap
public void displayStateMap()Debugging utility -
update
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
Description of the Method- Parameters:
s- Description of the Parameter
-