com.extjs.gxt.ui.client.widget.custom
Class Portal

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.BoxComponent
                  extended by com.extjs.gxt.ui.client.widget.Container<LayoutContainer>
                      extended by com.extjs.gxt.ui.client.widget.custom.Portal
All Implemented Interfaces:
Observable, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener

public class Portal
extends Container<LayoutContainer>

A Portal container of Portlets. It is required that setColumnWidth(int, double) be called for each column prior to rendering.

Events:
ValidateDrop : PortalEvent(portal, startColumn, startRow, column, row)
Fires before a dragged portlet can be inserted into a new location.
Drop : PortalEvent(portal, startColumn, startRow, column, row)
Fires after a portlet has been moved.
Inherited Events:
Container BeforeAdd
Container Add
Container BeforeRemove
Container Remove
BoxComponent Move
BoxComponent Resize
Component Enable
Component Disable
Component BeforeHide
Component Hide
Component BeforeShow
Component Show
Component Attach
Component Detach
Component BeforeRender
Component Render
Component BrowserEvent
Component BeforeStateRestore
Component StateRestore
Component BeforeStateSave
Component SaveState


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
Portal(int numColumns)
          Creates a new portal container.
 
Method Summary
 void add(Portlet portlet, int column)
          Adds a portlet to the portal.
 int getPortletColumn(Portlet portlet)
          Returns the column of the given porlet.
 int getPortletIndex(Portlet portlet)
          Returns the index of the column for the given portlet.
 int getSpacing()
          Returns the spacing between portlets.
 void insert(Portlet portlet, int index, int column)
          Inserts a portlet.
 void remove(Portlet portlet, int column)
          Removes a portlet from the portal.
 void setAjustForScroll(boolean adjust)
          True to adjust the layout for a vertical scroll bar (defaults to true).
 void setColumnWidth(int colIndex, double width)
          Sets the column's width.
 void setSpacing(int spacing)
          Sets the spacing between portlets (defaults to 10).
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Container
disable, enable, findItem, getItem, getItemByItemId, getItemCount, getItems, getLayoutTarget, getWidget, indexOf, iterator, removeAll, scrollIntoView
 
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
getBounds, getHeight, getHeight, getPosition, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, isAutoHeight, isAutoWidth, isDeferHeight, isShim, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addListener, addPlugin, addStyleName, addWidgetListener, clearState, disableEvents, disableTextSelection, el, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, getBaseStyle, getBorders, getContextMenu, getData, getElement, getHideMode, getId, getItemId, getListeners, getModel, getState, getStateId, getToolTip, hasListeners, hasListeners, hide, hideToolTip, isDisabledEvents, isEnabled, isRendered, isStateful, isVisible, mask, mask, mask, onBrowserEvent, onComponentEvent, recalculate, removeAllListeners, removeFromParent, removeListener, removeStyleName, removeSwallow, removeToolTip, removeWidgetListener, render, render, repaint, saveState, setBorders, setContextMenu, setData, setElement, setEnabled, setHideMode, setId, setIntStyleAttribute, setItemId, setStateful, setStateId, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, setZIndex, show, sinkEvents, swallowEvent, swallowEvent, toString, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
fireEvent, getParent, isAttached
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Portal

public Portal(int numColumns)
Creates a new portal container.

Parameters:
numColumns - the number of columns
Method Detail

add

public void add(Portlet portlet,
                int column)
Adds a portlet to the portal.

Parameters:
portlet - the portlet to add
column - the column to insert into

getPortletColumn

public int getPortletColumn(Portlet portlet)
Returns the column of the given porlet.

Parameters:
portlet - the portlet
Returns:
the column or -1 if not found

getPortletIndex

public int getPortletIndex(Portlet portlet)
Returns the index of the column for the given portlet.

Parameters:
portlet - the portlet
Returns:
the index or -1 if not found

getSpacing

public int getSpacing()
Returns the spacing between portlets.

Returns:
the spacing the spacing in pixels

insert

public void insert(Portlet portlet,
                   int index,
                   int column)
Inserts a portlet.

Parameters:
portlet - the portlet to add
index - the insert index
column - the column to insert into

remove

public void remove(Portlet portlet,
                   int column)
Removes a portlet from the portal.

Parameters:
portlet - the porlet to remove
column - the column

setAjustForScroll

public void setAjustForScroll(boolean adjust)
True to adjust the layout for a vertical scroll bar (defaults to true).

Parameters:
adjust - true to adjust

setColumnWidth

public void setColumnWidth(int colIndex,
                           double width)
Sets the column's width.

Parameters:
colIndex - the column index
width - the column width

setSpacing

public void setSpacing(int spacing)
Sets the spacing between portlets (defaults to 10).

Parameters:
spacing - the spacing in pixels