Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.netuix.servlets.controls.layout
Class GridLayoutPresentationContext

    java.lang.Object
      com.bea.netuix.servlets.controls.ControlContext
          com.bea.netuix.servlets.controls.PresentationContext
              com.bea.netuix.servlets.controls.layout.LayoutPresentationContext
                  com.bea.netuix.servlets.controls.layout.GridLayoutPresentationContext

All Implemented Interfaces
  Serializable

    public class GridLayoutPresentationContext

extends LayoutPresentationContext

Used to provide access to presentation-related attributes specific to the `GridLayout` in use. Typically used during portal rendering via look and feel skeleton files (e.g. gridlayout.jsp).

See Also
  `getGridLayoutPresentationContext(javax.servlet.http.HttpServletRequest)`, Serialized Form

Field Summary
`protected static String` | `CLASS_NAME`
`static int` | `DEFAULT_GRID_COLUMNS`

Method Summary
`int` | `getColumns()` Returns the value of the columns attribute that corresponds to this `GridLayout` portal component.
`static GridLayoutPresentationContext` | `getGridLayoutPresentationContext(javax.servlet.http.HttpServletRequest request)` This is a convenience method for returning a reference to the one and only GridLayoutPresentationContext.
`PlaceholderPresentationContext[][]` | `getPlaceholderGrid()` This method arranges the placeholder context children of this layout into an n-by-m grid, ready for rendering.
`String` | `getProperty(String key)` Get a property of the underlying component.
`int` | `getRows()` Returns the value of the rows attribute that corresponds to this `GridLayout` portal component.
`boolean` | `isRowMajor()` Row-major orientation is defined by specifying the number of columns to use when horizontally wrapping layout placeholders.

Methods inherited from class com.bea.netuix.servlets.controls.layout.LayoutPresentationContext
`getLayoutPresentationContext, getPlaceholders, getType`

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

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_GRID_COLUMNS

    public static final int DEFAULT_GRID_COLUMNS

See Also
  Constants Summary

### CLASS_NAME

    protected static final String CLASS_NAME

Method Detail

### getColumns

    public int getColumns()

  Returns the value of the columns attribute that corresponds to this `GridLayout` portal component. The columns is used to specify how many columns a `GridLayout` will contain.

  Returns
    the value of the columns attribute specified in the .layout file. If unspecified, defaults to 0.

### getRows

    public int getRows()

  Returns the value of the rows attribute that corresponds to this `GridLayout` portal component. The rows value is used to specify how many rows a `GridLayout` will contain.

  Returns
    the value of the rows attribute specified in the .layout file. If unspecified, defaults to 0.

### isRowMajor

    public boolean isRowMajor()

  Row-major orientation is defined by specifying the number of columns to use when horizontally wrapping layout placeholders. Therefore, this method will return true when `getColumns` is greater than zero.

  Returns
    true if `getColumns` is greater than zero (thus defining a row major layout).

### getPlaceholderGrid

    public PlaceholderPresentationContext[][] getPlaceholderGrid()

  This method arranges the placeholder context children of this layout into an n-by-m grid, ready for rendering.

  The grid layout logic is as follows:

  - First, the "columns" property is checked. If it exists and is greater than zero in value, then a row-major approach is used for rendering placeholders. That is, placement of placeholder content proceeds left to right, starting a new row every time the "columns" value is reached.
  - If the "columns" property is found to either not exist or be less than or equal to zero, then the "rows" property is checked. If it's value exists and is greater than zero, then a column-major approach is used for rendering placeholders. That is, placement of placeholder content proceeds top to bottom, starting a new column every time the "rows" value is reached.
  - If neither rows nor columns has a value specified, then the grid layout uses a hardcoded default fill strategy. This strategy is a row-major approach using the default "columns" value of "3".
  - Lastly, if the last column or row to be assigned placeholders cannot be completely filled due to insufficient remaining placeholders, the column or row is filled to the end with empty cells.

### getGridLayoutPresentationContext

    public static GridLayoutPresentationContext getGridLayoutPresentationContext(javax.servlet.http.HttpServletRequest request)

  This is a convenience method for returning a reference to the one and only GridLayoutPresentationContext. Note this method will only work if called from within a portal (typically, from the gridlayout.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 GridLayoutPresentationContext, if any

### getProperty

    public String getProperty(String key)

  Description copied from class: `PresentationContext`
  Get a property of the underlying component. This is a convenience method. The `key` argument should not be null.

  Overrides:
    `getProperty` in class `PresentationContext`
  Parameters
    `key` - The property key
  Returns
    The value associated with the specified key, if it exists

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.