Package org.silverpeas.core.selection
Class SelectionContext
- java.lang.Object
-
- org.silverpeas.core.selection.SelectionContext
-
- All Implemented Interfaces:
Serializable
public class SelectionContext extends Object implements Serializable
The context of a selection by a user of a resource in Silverpeas. It explains in what aim a resource has been put into theSelectionBasket
, in other words for what operation the selection has been done. As such it can contain additional information required by the operation to be performed against the selected resource. By specifying a context to a selection, the consumer of the selected resources in the basket can then either filter the resources on which it has to operate or apply a different behaviour according to their selection context.- Author:
- mmoquillon
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SelectionContext.Reason
Reason about the selection of a resource by a user.
-
Constructor Summary
Constructors Modifier Constructor Description protected
SelectionContext()
SelectionContext(SelectionContext.Reason reason)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getAttribute(String attrName)
Gets the value of the specified attribute.SelectionContext.Reason
getReason()
Gets the reason of a why a resource has been put into the selection basket.int
hashCode()
void
putAttribute(String attrName, String attrValue)
Defines a context attribute.
-
-
-
Constructor Detail
-
SelectionContext
protected SelectionContext()
-
SelectionContext
public SelectionContext(SelectionContext.Reason reason)
-
-
Method Detail
-
putAttribute
public void putAttribute(String attrName, String attrValue)
Defines a context attribute. Such attributes qualifies the context of a selection.- Parameters:
attrName
- the name of the attribute.attrValue
- the value of the attribute.
-
getAttribute
public String getAttribute(String attrName)
Gets the value of the specified attribute. If no such attribute is defined for this context, then null is returned.- Parameters:
attrName
- the name of the attribute.- Returns:
- the value of the attribute or null if no such attribute exists.
-
getReason
public SelectionContext.Reason getReason()
Gets the reason of a why a resource has been put into the selection basket.- Returns:
- the reason.
-
-