# com.bea.netuix.servlets.controls.window
WindowPresentationContext Class

public abstract class WindowPresentationContext
extends `PresentationContext`

This class represents a portal window component. All presentation-related attributes of a window component are available from instances of this class. Such instances are typically used during portal rendering via look and feel skeleton files (e.g. window.jsp).

Related Topics

``WindowPresentationContext.getWindowPresentationContext(HttpServletRequest)``

Hierarchy
  `Object`
  `ControlContext`
  `PresentationContext`
  `WindowPresentationContext`

All Implemented Interfaces
  `Serializable`

Direct Known Subclasses
  `PagePresentationContext`, `PortletPresentationContext`

## Field Summary

`protected static final `String`` | `CLASS_NAME` String

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

## Constructor Summary

## Method Summary

`public `Capability`` | `getCapability`(`Capability` capability) Gets the capability for the Window, may be a state or a mode.
`public `String`` | `getContentPresentationClass`() Returns this window's content presentationClass attribute.
`public `List`` | `getContentPresentationContextChildren`() Returns a list of `PresentationContext` children within this window's content area.
`public `String`` | `getContentPresentationStyle`() Returns this window's content presentationStyle attribute.
`public `String`` | `getDefinitionId`() The definition id for the window.
`public `String`` | `getDefinitionLabel`() The definition label for the window.
`public `String`` | `getInstanceId`() Returns the instance id for the window.
`public abstract `String`` | `getLabel`() Returns a general label for the window.
`public `String`` | `getOrientation`() Returns the orientation of the window's navigation/titlebar.
`public `PagePresentationContext`` | `getParentPagePresentationContext`() If this window is a child of a page, that page's `PagePresentationContext` is returned.
`public `WindowMode`` | `getPreviousWindowMode`() Returns the previous mode of the window, which may be from the standard set or an extended mode.
`public `ThemePresentationContext`` | `getThemePresentationContext`() Returns a ThemePresentation context for this portlet, page or book if one has been applied.
`public `String`` | `getTitle`() Returns the display title for the window, which may be localized if a proper localizable value can be resolved.
`public `TitlebarPresentationContext`` | `getTitlebarPresentationContext`() Returns a TitlebarPresentation context for this portlet, page or book if one exists.
`public `WindowMode`` | `getWindowMode`() Returns the current mode of the window, which may be from the standard set or an extended mode.
`public static `WindowPresentationContext`` | `getWindowPresentationContext`(`HttpServletRequest` request) This is a convenience method for returning a reference to the current `WindowPresentationContext`.
`public `WindowState`` | `getWindowState`() Returns the current state of the window, which may be from the following fixed set: normal, minimized, maximized.
`public boolean` | `isCapable`(`Capability` capability) Returns `true` if this control has the specified capability.
`public boolean` | `isPacked`() Returns whether or not the window should be rendered such that it occupies a minimal space as required by its contents (packed), or tries to expand to the maximum size of its containing layout cell.

Methods from `com.bea.netuix.servlets.controls.`PresentationContext``
``getChildren`, `getChildren`, `getFirstChild`, `getParsedProperties`, `getPresentationClass`, `getPresentationId`, `getPresentationStyle`, `getProperties`, `getProperty`, `getProperty`, `getPropertyAsBoolean`, `getPropertyAsInt`, `getResolvedLocale`, `getTagName`, `isVisible`, `setVisible``

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`

## Field Detail

### CLASS_NAME

    protected static final String CLASS_NAME

## Constructor Detail

## Method Detail

### getCapability(Capability) Method

    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.

#### Exceptions

``NullPointerException``

Related Topics

``WindowCapabilities``
com.bea.netuix.servlets.controls;.Capability
com.bea.netuix.servlets.controls.window.WindowMode;
com.bea.netuix.servlets.controls.window.WindowState;

### getContentPresentationClass() Method

    public String getContentPresentationClass()

Returns this window's content presentationClass attribute. Since window content areas do not have presentation contexts, their presentationClass attribute can be accessed from their parent window. This attribute should only affect the content area of the window.

#### Returns

The presentationClass for this window's content area

Related Topics

getPresentationClass

### getContentPresentationContextChildren() Method

    public List getContentPresentationContextChildren()

Returns a list of `PresentationContext` children within this window's content area.

#### Returns

The list of this window's content PresentationContext children

### getContentPresentationStyle() Method

    public String getContentPresentationStyle()

Returns this window's content presentationStyle attribute. Since window content areas do not have presentation contexts, their presentationStyle attribute can be accessed from their parent window. This attribute should only affect the content area of the window.

#### Returns

The presentationStyle for this window's content area

Related Topics

getPresentationStyle

### getDefinitionId() Method

    public String getDefinitionId()

The definition id for the window. This value is only valid in portal streaming mode.

#### Returns

The definition id of this window

### getDefinitionLabel() Method

    public String getDefinitionLabel()

The definition label for the window. This will be valid in both portal streaming and non-streaming modes, but may not necessarily be unique.

#### Returns

The definition label of this window

### getInstanceId() Method

    public String getInstanceId()

Returns the instance id for the window. This value is only valid in portal streaming mode.

#### Returns

A unique instance label for the portlet

### getLabel() Method

    public abstract String getLabel()

Returns a general label for the window. The precise semantic of the value depends on the subclass's implementation, but generally returns the most specific label (between definition label and instance label) available for the subtype.

#### Returns

A string label used to identify this window as specifically as possible

### getOrientation() Method

    public String getOrientation()

Returns the orientation of the window's navigation/titlebar. Values are top (the default), left, right, or bottom.

#### Returns

A string describing the window's nav/titlebar orientation

### getParentPagePresentationContext() Method

    public PagePresentationContext getParentPagePresentationContext()

If this window is a child of a page, that page's `PagePresentationContext` is returned.

#### Returns

The parent PagePresentationContext, or null if it does not exist

### getPreviousWindowMode() Method

    public WindowMode getPreviousWindowMode()

Returns the previous mode of the window, which may be from the standard set or an extended mode. Standard modes include (but are not limited to) view, edit, help, etc.

#### Returns

The WindowMode instance or null is there was no previous mode

Related Topics

``WindowMode``

### getThemePresentationContext() Method

    public ThemePresentationContext getThemePresentationContext()

Returns a ThemePresentation context for this portlet, page or book if one has been applied.

#### Returns

a ThemePresentationContext otherwise null if none was applied.

### getTitle() Method

    public String getTitle()

Returns the display title for the window, which may be localized if a proper localizable value can be resolved.

#### Returns

The title of the window, which may be localized

### getTitlebarPresentationContext() Method

    public TitlebarPresentationContext getTitlebarPresentationContext()

Returns a TitlebarPresentation context for this portlet, page or book if one exists.

#### Returns

a TitlebarPresentationContext otherwise null if none was applied.

### getWindowMode() Method

    public WindowMode getWindowMode()

Returns the current mode of the window, which may be from the standard set or an extended mode. Standard modes include (but are not limited to) view, edit, help, etc.

#### Returns

The WindowMode instance

Related Topics

``WindowMode``

### getWindowPresentationContext(HttpServletRequest) Method

    public static WindowPresentationContext getWindowPresentationContext(HttpServletRequest request)

This is a convenience method for returning a reference to the current `WindowPresentationContext`. Note this method will only work if called from within a portal (typically, from the window.jsp skeleton). This method may return null if called when no appropriate context exists, but such a context should safely exist when being fetched from the associated skeleton JSP during normal portal rendering.

#### Parameters

request
  The current HTTPServletRequest instance

#### Returns

A reference to the current WindowPresentationContext, if any

### getWindowState() Method

    public WindowState getWindowState()

Returns the current state of the window, which may be from the following fixed set: normal, minimized, maximized.

#### Returns

The WindowState instance

Related Topics

``WindowState``

### isCapable(Capability) Method

    public boolean isCapable(Capability capability)

Returns `true` if this control has the specified capability.

#### Parameters

capability
  A window mode or state

Related Topics

``WindowCapabilities``

### isPacked() Method

    public boolean isPacked()

Returns whether or not the window should be rendered such that it occupies a minimal space as required by its contents (packed), or tries to expand to the maximum size of its containing layout cell.

#### Returns

True, if the window should be packed into as small a space as possible