PresentationContext Class

com.bea.netuix.servlets.controls
PresentationContext Class

public abstract class PresentationContext

    extends ControlContext

The portal framework provides instances of subclasses of PresentationContext during portal rendering, actions, and in backing files. PresentationContext subclasses are used to represent portal framework components during the portal's rendering phase and are almost exclusively read only (the exception being the setVisible method to allow fine-grained rendering of components in skeleton files). PresentationContext subclasses are primarily targetted for use by skeleton JSPs in portal look and feel implementations.


Hierarchy
Object
  ControlContext
    PresentationContext
All Implemented Interfaces

Serializable
Direct Known Subclasses

AbstractButtonPresentationContext, BodyPresentationContext, DesktopPresentationContext, FooterPresentationContext, HeaderPresentationContext, HeadPresentationContext, LayoutPresentationContext, MenuPresentationContext, PlaceholderPresentationContext, ShellPresentationContext, ThemePresentationContext, TitlebarPresentationContext, WindowPresentationContext

Field Summary

   
Fields from  com.bea.netuix.servlets.controls.ControlContext
debug
 

Constructor Summary

 

Method Summary

public List
getChildren(String tagName)
Returns a list of PresentationContext children of this context, if any, narrowed by by the specified tag name.
public List
getChildren()
Returns a list of PresentationContext children of this context, if any.
public PresentationContext
getFirstChild(String tagName)
Given a tag name, return an instance of the component's PresentationContext subclass, if it exists as a child.
public Properties
getParsedProperties()
Get the extra properties of the component, if they exist.
public String
getPresentationClass()
Get the presentation class of the component, if it exists.
public String
getPresentationId()
Get the presentation id of the component, if it exists.
public String
getPresentationStyle()
Get the presentation style of the component, if it exists.
public String
getProperties()
Get the extra properties string of the component, if it exists.
public String
getProperty(String key)
Get a property of the underlying component.
public String
getProperty(String key, String defaultValue)
Get a property of the underlying component, using the specified default if none exists.
public boolean
getPropertyAsBoolean(String key, boolean defaultValue)
Get a property of the underlying component, using the specified default if none exists.
public int
getPropertyAsInt(String key, int defaultValue)
Get a property of the underlying component, using the specified default if none exists.
public Locale
getResolvedLocale()
Returns the Locale associated with the best matching portal component resource based on user request locale preferrences.
public String
getTagName()
Get the tag name of the component this context represents.
public boolean
isVisible()
Tests whether or not the component represented by this context is visible, and therefore whether or not it should be rendered.
public void
setVisible(boolean visible)
Set the visiblity state of the component.
 
Methods from  com.bea.netuix.servlets.controls.ControlContext
getContextFromRequest, getContextKey, getControl, getRequestKey, getUniqueId, removeContextFromRequest, setContextInRequest
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   

Constructor Detail


 

Method Detail

getChildren(String) Method

public List getChildren(String tagName)
Returns a list of PresentationContext children of this context, if any, narrowed by by the specified tag name. If no children exist for that tag name, an empty list is returned. Elements of the list are all descendents of the type PresentationContext. The returned list is for immediate children only -- there is no recursion into childrens' children. This list is unmodifiable.

Parameters

tagName
The namespace-qualified tag name namespace:tagname

Returns

The list of all immediate children with the given tag name

getChildren() Method

public List getChildren()
Returns a list of PresentationContext children of this context, if any. If no children exist, an empty list is returned. Elements of the list are all descendents of the type PresentationContext. The returned list is for immediate children only -- there is no recursion into childrens' children.

Note, this list is modifiable! Avoid mutating the list (or at least use caution if you do).

Returns

The list of all immediate children or an empty list if none exist

getFirstChild(String) Method

public PresentationContext getFirstChild(String tagName)
Given a tag name, return an instance of the component's PresentationContext subclass, if it exists as a child. The first child matching the specified tag name is returned.

Parameters

tagName
The namespace-qualified tag name namespace:tagname

Returns

The component's context if the control exists, otherwise null

getParsedProperties() Method

public Properties getParsedProperties()
Get the extra properties of the component, if they exist. This value will not be null. The Properties class returned by this method is the parsed view of those from PresentationContext.getProperties().

Returns

The control's extra properties, if set; an empty Properties instance if not

Related Topics

PresentationContext.getProperties()


getPresentationClass() Method

public String getPresentationClass()
Get the presentation class of the component, if it exists. This value may be null. The presentation id is typically mapped to an id attribute when rendering HTML-type output.

Returns

The control's presentation class, if set

getPresentationId() Method

public String getPresentationId()
Get the presentation id of the component, if it exists. This value may be null. The presentation id is typically mapped to an id attribute when rendering HTML-type output.

Returns

The control's presentation id, if set

getPresentationStyle() Method

public String getPresentationStyle()
Get the presentation style of the component, if it exists. This value may be null. The presentation id is typically mapped to an id attribute when rendering HTML-type output.

Returns

The control's presentation style, if set

getProperties() Method

public String getProperties()
Get the extra properties string of the component, if it exists. This value may be null. Properties are formatted as in the following example:

      my-first-key: my-first-value; my-second-key: my-second-value;
 
Any number of properties may be in a properties string.

Returns

The control's extra properties, if set

Related Topics

PresentationContext.getParsedProperties()


getProperty(String) Method

public String getProperty(String key)
Get a property of the underlying component. This is a convenience method. The key argument should not be null.

Parameters

key
The property key

Returns

The value associated with the specified key, if it exists

getProperty(String, String) Method

public String getProperty(String key, 
                          String defaultValue)
Get a property of the underlying component, using the specified default if none exists. This is a convenience method. The key argument should not be null.

Parameters

key
The property key
defaultValue
The value to use if no value is found for the specified key

Returns

The value associated with the specified key, if it exists, or the default

getPropertyAsBoolean(String, boolean) Method

public boolean getPropertyAsBoolean(String key, 
                                    boolean defaultValue)
Get a property of the underlying component, using the specified default if none exists. The key argument should not be null. This is a convenience method that attempts a conversion of the value from a String to a boolean. Failure during conversion causes a value of false to be returned. The default value is used if the key lookup in the properties instance returned null or if the key itself was null.

Parameters

key
The property key
defaultValue
The value to use if no value is found for the specified key

Returns

The value associated with the specified key, if it exists, or the default

getPropertyAsInt(String, int) Method

public int getPropertyAsInt(String key, 
                            int defaultValue)
Get a property of the underlying component, using the specified default if none exists. The key argument should not be null. This is a convenience method that attempts a conversion of the value from a String to an int. Failure during conversion or the key being null causes the default value to be returned.

Parameters

key
The property key
defaultValue
The value to use if no value is found for the specified key

Returns

The value associated with the specified key, if it exists, or the default

getResolvedLocale() Method

public Locale getResolvedLocale()
Returns the Locale associated with the best matching portal component resource based on user request locale preferrences. If no information is available about the matching Locale, the default locale as specified in netuix-config.xml is returned. This method is most useful for portlets and JSPs included by portlets.

Note that in streaming mode, the resolved locale for a portlet is always the default locale, since the portlet is disassembled from the default locale portal and inlined for requests.


getTagName() Method

public String getTagName()
Get the tag name of the component this context represents. The tag name is a short name used to identify the component of the form namespace:tagname, where the namespace corresponds to the parent package in which the context is defined (e.g. a book's full tag name would be page:book).

Returns

The tag name of the component this context represents; this should never be null

Related Topics

#getChildren


isVisible() Method

public boolean isVisible()
Tests whether or not the component represented by this context is visible, and therefore whether or not it should be rendered. Typically, this is only important to the renderer and not the skeletons using this context.

Returns

The true if visible

setVisible(boolean) Method

public void setVisible(boolean visible)
Set the visiblity state of the component. Setting the state to false will cause the beginRender and endRender methods to not be called during the render lifecycle stage.

Parameters

visible
The boolean value to set the visibility state