© 2004 BEA Systems, Inc.

com.bea.netuix.servlets.controls.window.backing
Class WindowBackingContext

java.lang.Object
  extended bycom.bea.netuix.servlets.controls.ControlContext
      extended bycom.bea.netuix.servlets.controls.BackingContext
          extended bycom.bea.netuix.servlets.controls.window.backing.WindowBackingContext
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
PageBackingContext, PortletBackingContext

public abstract class WindowBackingContext
extends BackingContext

This is the backing context class for a Window. Use this class when in a backing file to get information about the owning window. If you want to access this context from a JSP, look at WindowPresentationContext instead.

You can obtain the backing context for the active window by calling BackingContext.getContextFromRequest

See Also:
BackingContext, Serialized Form

Field Summary
static String CLASS_NAME
           
 
Fields inherited from class com.bea.netuix.servlets.controls.ControlContext
debug
 
Method Summary
 Capability getCapability(Capability capability)
          Gets the capability for the Window, may be a state or a mode.
 boolean getCapabilityVisible(String name)
          Gets the visible property for a capability.
 String getDefinitionId()
          Return the definition id of this portlet, page or book.
 String getDefinitionLabel()
          Get the definition label for the portlet/page or book.
 String getDescription()
          Returns the description for the current window.
 String getInstanceId()
          Return the instance id of this portlet.
abstract  String getLabel()
          Return the label for the control.
 String getOrientation()
          Get the orientation of the navigation bar or titlebar of the current window.
 BackingContext getParentWindowBackingContext()
          Get the BackingContext of the parent of the current window.
 String getPlacementId()
          Get the PlacementId for this window.
 WindowMode getPreviousWindowMode()
          Get the previous WindowMode.
 WindowState getPreviousWindowState()
          Get the previous WindowState.
 List getRenderedChildrenWindowBackingContexts()
          This method returns a deep List containing all the Window, Page, and Book backing contexts of these type of controls that are rendered.
 String getTitle()
          Get the title of the window.
 WindowMode getWindowMode()
          Return the current window mode.
 WindowState getWindowState()
          Return the current window state.
 boolean isCapable(Capability capability)
          Determine if this control has the given capability.
 boolean isPacked()
          Get true if the current window is packed.
 void setCapabilityVisible(String name, boolean isVisible)
          Sets the visible property for a capability.
 void setDescription(String description)
          Set window description.
 void setTitle(String title)
          Set the window's title.
 void setupModeChangeEvent(String modeValue)
          Tell the window to change its mode.
 void setupModeChangeEvent(WindowMode modeValue)
          Tell the window to change its mode.
 void setupPageChangeEvent(String pageLabel)
          Tell the window to change the page.
 void setupStateChangeEvent(String stateValue)
          Tell the window to change its state.
 
Methods inherited from class com.bea.netuix.servlets.controls.BackingContext
getChildrenBackingContexts, getParentBackingContext, getTopParentBackingContext, isBackingPhase, isVisible, setBackingPhase, setVisible
 
Methods inherited from class com.bea.netuix.servlets.controls.ControlContext
getContextKey, getControl, getRequestKey, getUniqueId, removeContextFromRequest, setContextInRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME

public static final String CLASS_NAME
Method Detail

getCapability

public Capability getCapability(Capability capability)
                         throws NullPointerException

Gets the capability for the Window, may be a state or a mode. This method can be used to check if a Window (Book, Page or Portlet) supports a given Mode or State. If you are intersted in the current or active Window Mode or Window State you should use getWindowMode() and getWindowState repectively.

Note: this method should be called after the init() lifcycle, because the buttons have net yet registered with the parent window.

Parameters:
capability - the Capability to check for.
Returns:
The Capability if this Window has it and the user is entitled to use it, otherwise null. Note. this Capability may be cast to a WindowMode or WindowState to get additional information such as mode content uri.
Throws:
NullPointerException
See Also:
WindowCapabilities, com.bea.netuix.servlets.controls;.Capability, com.bea.netuix.servlets.controls.window.WindowMode;, com.bea.netuix.servlets.controls.window.WindowState;

getCapabilityVisible

public boolean getCapabilityVisible(String name)
                             throws NullPointerException
Gets the visible property for a capability. name should be the Capability name.

Parameters:
name - the Capability name
Returns:
is it visible
Throws:
NullPointerException

getDefinitionId

public String getDefinitionId()
Return the definition id of this portlet, page or book. Note: the definition id is only populated in streaming mode (database, not single file). This can be useful with the persistence API.

Returns:
A string representation of the windows defintion id (this is always a number)

getDefinitionLabel

public String getDefinitionLabel()
Get the definition label for the portlet/page or book.

Returns:
a String containing the window's definition label.

getDescription

public String getDescription()
Returns the description for the current window.

Returns:
description

getInstanceId

public String getInstanceId()
Return the instance id of this portlet. Note: the instance id is only populated when in streaming mode, not single file.

Returns:
A string representation of the portlet's instance id (this is always a number)

getLabel

public abstract String getLabel()
Return the label for the control. This will be the instance label for portlets and the definition label for pages and books.

Returns:
the label from the book, page or portlet.

getOrientation

public String getOrientation()
Get the orientation of the navigation bar or titlebar of the current window. Value can be top(default), left, right.

Returns:
titlebar or navigation bar orientation

getParentWindowBackingContext

public BackingContext getParentWindowBackingContext()
Get the BackingContext of the parent of the current window.

Returns:
parent window BackingContext

getPlacementId

public String getPlacementId()
Get the PlacementId for this window.

Returns:
PlacementId
See Also:
PlacementId

getPreviousWindowMode

public WindowMode getPreviousWindowMode()
Get the previous WindowMode.

Returns:
WindowMode

getPreviousWindowState

public WindowState getPreviousWindowState()
Get the previous WindowState.

Returns:
WindowState

getRenderedChildrenWindowBackingContexts

public List getRenderedChildrenWindowBackingContexts()
This method returns a deep List containing all the Window, Page, and Book backing contexts of these type of controls that are rendered.

Returns:
List of BookBackingContext, WindowBackingContext, and PageBackingContext

getTitle

public String getTitle()
Get the title of the window.


getWindowMode

public WindowMode getWindowMode()
Return the current window mode.

Returns:
mode

getWindowState

public WindowState getWindowState()
Return the current window state.

Returns:
window state

isCapable

public boolean isCapable(Capability capability)
Determine if this control has the given capability.

Parameters:
capability - - window mode or state
See Also:
WindowCapabilities

isPacked

public boolean isPacked()
Get true if the current window is packed.

Returns:
true if packed

setCapabilityVisible

public void setCapabilityVisible(String name,
                                 boolean isVisible)
                          throws NullPointerException
Sets the visible property for a capability. name should be the Capability name. This must be called in the pre-render method or earlier, and is reset upon every new request.

Parameters:
name - the Capability name
isVisible - is it visible
Throws:
NullPointerException

setDescription

public void setDescription(String description)
Set window description. Note this method only sets the description for the current request. If you want to set the description permanently (and you are in streaming mode - not single file) then use the PortalCustomizationManager EJB.

Parameters:
description -
See Also:
IPortletInstanceManager.updatePortletInstance(com.bea.netuix.application.manager.CustomizationContext, com.bea.netuix.application.identifier.DesktopDefinitionId, com.bea.netuix.application.instance.PortletInstance)

setTitle

public void setTitle(String title)

Set the window's title. Note: this method only sets the title for the current request. If you want to set the title permanently (and you are in streaming mode - not single file) then use the PortalCustomizationManager EJB.

Parameters:
title -
See Also:
IPortletInstanceManager.updatePortletInstance(com.bea.netuix.application.manager.CustomizationContext, com.bea.netuix.application.identifier.DesktopDefinitionId, com.bea.netuix.application.instance.PortletInstance)

setupModeChangeEvent

public void setupModeChangeEvent(String modeValue)
Tell the window to change its mode. Should only be called during handlePostback.

Parameters:
modeValue - the mode to change to

setupModeChangeEvent

public void setupModeChangeEvent(WindowMode modeValue)
Tell the window to change its mode. Should only be called during handlePostback.

Parameters:
modeValue - the mode to change to

setupPageChangeEvent

public void setupPageChangeEvent(String pageLabel)
Tell the window to change the page. Should only be called during handlePostback.

Parameters:
pageLabel - the label of the page to change to

setupStateChangeEvent

public void setupStateChangeEvent(String stateValue)
Tell the window to change its state. Should only be called during handlePostback.

Parameters:
stateValue - the state to change to

© 2004 BEA Systems, Inc.

Copyright © 2004 BEA Systems, Inc. All Rights Reserved