|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.palo.api.impl.subsets.AbstractSubsetState
org.palo.api.ext.subsets.states.FlatState
public class FlatState
The FlatState
interprets the visible elements as flat, i.e.
no hierarchy is defined. All elements are "root" elements.
Field Summary | |
---|---|
static java.lang.String |
ID
|
Constructor Summary | |
---|---|
FlatState()
|
Method Summary | |
---|---|
void |
addPath(Element element,
java.lang.String path)
Adds the specified path for the given visible element |
void |
addVisibleElement(Element element,
int position)
Adds the given element to the list of all visible elements. |
void |
addVisibleElment(Element element)
Adds the given element to the list of all visible elements |
boolean |
containsPath(Element element,
java.lang.String path)
Checks if this SubsetState contains the specified path for
the given
|
java.lang.String |
getExpression()
Returns an optional expression to determine the visible elements |
java.lang.String |
getId()
Returns the unique state id. |
java.lang.String |
getName()
Returns an optional name for the state. |
java.lang.String[] |
getPaths(Element element)
Returns all paths for the given Element or null , if
no paths were defined. |
int[] |
getPositions(Element element)
Returns the positions of the given visible element. |
Attribute |
getSearchAttribute()
Returns an attribute field that is used for searching with the regular expression. |
Element[] |
getVisibleElements()
Returns all visible elements. |
boolean |
isVisible(Element element)
Checks if the given is visible within this
SubsetState . |
void |
removeAllVisibleElements()
Convenience method to remove all visible elements |
void |
removePath(Element element,
java.lang.String path)
Removes the specified path for the given visible element. |
void |
removeVisibleElement(Element element)
Removes the given element from the list of all visible elements |
void |
setExpression(java.lang.String expression)
Sets an expression to determine the visible elements |
void |
setName(java.lang.String name)
Sets an optional name, label or description |
void |
setSearchAttribute(Attribute searchAttribute)
Sets the attribute field that is used instead of the element name when filtering with a regular expression |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ID
Constructor Detail |
---|
public FlatState()
Method Detail |
---|
public final void setExpression(java.lang.String expression)
SubsetState
setExpression
in interface SubsetState
expression
- a state expression to describe the visible elementspublic final void addVisibleElment(Element element)
SubsetState
addVisibleElment
in interface SubsetState
element
- the element to showpublic final void addVisibleElement(Element element, int position)
SubsetState
addVisibleElement
in interface SubsetState
element
- the element to showposition
- an element positionpublic final void removeVisibleElement(Element element)
SubsetState
removeVisibleElement
in interface SubsetState
element
- the element to removepublic final void removeAllVisibleElements()
SubsetState
removeAllVisibleElements
in interface SubsetState
public final java.lang.String getExpression()
SubsetState
getExpression
in interface SubsetState
public final java.lang.String getId()
SubsetState
getId
in interface SubsetState
public final void setName(java.lang.String name)
SubsetState
setName
in interface SubsetState
name
- a human readable labelpublic final java.lang.String getName()
SubsetState
getName
in interface SubsetState
public final Element[] getVisibleElements()
SubsetState
Note: the array could be empty but that does not necessarily mean that no element is visible because an expression can determine the elements too.
getVisibleElements
in interface SubsetState
public final Attribute getSearchAttribute()
SubsetState
getSearchAttribute
in interface SubsetState
public final void setSearchAttribute(Attribute searchAttribute)
SubsetState
setSearchAttribute
in interface SubsetState
searchAttribute
- field used for filteringpublic final java.lang.String[] getPaths(Element element)
SubsetState
Element
or null
, if
no paths were defined. An element path consists of a comma separated list
of element ids. Since an element can be referenced several times,
multiple paths are possible.
getPaths
in interface SubsetState
element
- a visible element
null
public final void addPath(Element element, java.lang.String path)
SubsetState
addPath
in interface SubsetState
element
- a visible elementpath
- a path to the visible elementpublic final void removePath(Element element, java.lang.String path)
SubsetState
removePath
in interface SubsetState
element
- a visible elementpath
- the path to removepublic final boolean containsPath(Element element, java.lang.String path)
SubsetState
SubsetState
contains the specified path for
the given Element
containsPath
in interface SubsetState
element
- a visible elementpath
- a valid path to the visible element
true
if the path is known for the given element,
false
otherwisepublic final int[] getPositions(Element element)
SubsetState
getPositions
in interface SubsetState
element
- a visible element
public final boolean isVisible(Element element)
SubsetState
Element
is visible within this
SubsetState
.
isVisible
in interface SubsetState
element
- the Element
to check
true
if it is visible, false
otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |