Class 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 the SelectionBasket, 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
    • Constructor Detail

      • SelectionContext

        protected SelectionContext()
    • 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.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object