com.arsdigita.toolbox.ui
Class PrivilegedComponentSelector

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.CompoundComponent
          extended bycom.arsdigita.toolbox.ui.PrivilegedComponentSelector
All Implemented Interfaces:
Component, Lockable

public class PrivilegedComponentSelector
extends CompoundComponent

This component wraps two other components and chooses one of them based on whether or not a given party (specified in a RequestLocal) has a given privilege on a given object (also specified in a RequestLocal).


Field Summary
 
Fields inherited from class com.arsdigita.bebop.Completable
versionId
 
Fields inherited from interface com.arsdigita.bebop.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE, versionId
 
Constructor Summary
PrivilegedComponentSelector(PrivilegeDescriptor requiredPrivilege, RequestLocal objectRL, Component priviledgedComponent, Component unprivilegedComponent)
          Construct a new PrivilegedComponentSelector.
 
Method Summary
 void generateXML(PageState ps, Element parent)
          Adds a DOM subtree representing this component under the given parent node.
 
Methods inherited from class com.arsdigita.bebop.CompoundComponent
add, add, children, contains, get, getClassAttr, getContainer, getIdAttr, getKey, getStyleAttr, indexOf, isEmpty, isLocked, isVisible, lock, register, register, respond, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible, size
 
Methods inherited from class com.arsdigita.bebop.Completable
addCompletionListener, fireCompletionEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrivilegedComponentSelector

public PrivilegedComponentSelector(PrivilegeDescriptor requiredPrivilege,
                                   RequestLocal objectRL,
                                   Component priviledgedComponent,
                                   Component unprivilegedComponent)

Construct a new PrivilegedComponentSelector.

Parameters:
requiredPrivilege - Privilege that will be checked
objectRL - RequestLocal in which the object on which permission will be checked is stored
unprivilegedComponent - Component to be displayed when the current user lacks the required privilege on the specified object
Method Detail

generateXML

public void generateXML(PageState ps,
                        Element parent)
Description copied from interface: Component

Adds a DOM subtree representing this component under the given parent node. Uses the request values stored in state.

Specified by:
generateXML in interface Component
Overrides:
generateXML in class CompoundComponent
See Also:
Component.generateXML( PageState, Element )


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC