Package org.intermine.web.logic.results
Class WebState
- java.lang.Object
-
- org.intermine.web.logic.results.WebState
-
public class WebState extends java.lang.Object
This class saves things related to the state of web GUI. It is meant as box for future staff that must be hold in session and is related to web application GUI.- Author:
- Jakub Kulaviak
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.lang.String>
subtabs
-
Constructor Summary
Constructors Constructor Description WebState()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSubtab(java.lang.String tab, java.lang.String subtab)
Set the subtab for a particular tabint
getHintCount(java.lang.String hint)
Get the number of times a particular hint has been shown.java.lang.Object
getState(java.lang.String name)
java.util.Map<java.lang.String,java.lang.Object>
getStates()
java.lang.String
getSubtab(java.lang.String tab)
java.util.Map<java.lang.String,java.lang.String>
getSubtabs()
map of tab --> subtabjava.util.Map<java.lang.String,java.lang.Boolean>
getToggledElements()
Gets map of ids of elements that were in the past (during session) toggled - if they are opened or closed.void
incrementHintCount(java.lang.String hint)
Increment the number of times a hint has been displayed.void
setState(java.lang.String name, java.lang.Object value)
Set attribute.void
setToggledElements(java.util.Map<java.lang.String,java.lang.Boolean> toggledElements)
Sets map of ids and its state.
-
-
-
Method Detail
-
getToggledElements
public java.util.Map<java.lang.String,java.lang.Boolean> getToggledElements()
Gets map of ids of elements that were in the past (during session) toggled - if they are opened or closed.- Returns:
- map of element ids
-
setToggledElements
public void setToggledElements(java.util.Map<java.lang.String,java.lang.Boolean> toggledElements)
Sets map of ids and its state. @see getToggleElements()- Parameters:
toggledElements
- a map of Strings to Booleans
-
setState
public void setState(java.lang.String name, java.lang.Object value)
Set attribute.- Parameters:
name
- name of attributevalue
- value of attribute
-
getState
public java.lang.Object getState(java.lang.String name)
- Parameters:
name
- name of state- Returns:
- value of state or null if state wasn't set
-
getStates
public java.util.Map<java.lang.String,java.lang.Object> getStates()
- Returns:
- map of states
-
addSubtab
public void addSubtab(java.lang.String tab, java.lang.String subtab)
Set the subtab for a particular tab- Parameters:
tab
- the tab/pageName namesubtab
- the subtab value
-
getSubtab
public java.lang.String getSubtab(java.lang.String tab)
- Parameters:
tab
- the tab/pageName name- Returns:
- the subtab for the specified page, if any
-
getSubtabs
public java.util.Map<java.lang.String,java.lang.String> getSubtabs()
map of tab --> subtab- Returns:
- the subtabs
-
incrementHintCount
public void incrementHintCount(java.lang.String hint)
Increment the number of times a hint has been displayed.- Parameters:
hint
- the hint that has been displayed
-
getHintCount
public int getHintCount(java.lang.String hint)
Get the number of times a particular hint has been shown.- Parameters:
hint
- the hint to fetch count for- Returns:
- number of times the hint has been displayed
-
-