com.smartgwt.client.widgets.layout
Class PortalLayout

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.smartgwt.client.widgets.BaseWidget
              extended by com.smartgwt.client.widgets.Canvas
                  extended by com.smartgwt.client.widgets.layout.Layout
                      extended by com.smartgwt.client.widgets.layout.PortalLayout
All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, IsWidget, HasClickHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers

public class PortalLayout
extends Layout

A PortalLayout is a special subclass of Layout designed to display Portlet windows. A PortalLayout displays Portlets in columns and supports drag-drop interaction for moving Portlets around within the PortalLayout. Portlets may be drag-reordered within columns, dragged into other columns, or dragged next to other Portlets to sit next to them horizontally within a column.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.smartgwt.client.widgets.BaseWidget
config, configOnly, id, isElementSet, scClassName
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
PortalLayout()
           
PortalLayout(int numColumns)
           
PortalLayout(JavaScriptObject jsObj)
           
 
Method Summary
 void addColumn(int index)
          Adds a new portal column to this layout at the specified position
 void addPortlet(Portlet portlet)
          Adds a Portlet instance to this portalLayout in the specified position.
 void addPortlet(Portlet portlet, int colNum, int rowNum)
          Adds a Portlet instance to this portalLayout in the specified position.
 void addPortlet(Portlet portlet, int colNum, int rowNum, int rowOffset)
          Adds a Portlet instance to this portalLayout in the specified position.
protected  JavaScriptObject create()
           
 Boolean getCanResizeColumns()
          Are columns in this PortalLayout drag-resizeable?
 Boolean getCanResizePortlets()
          Should the height and width of Portlets be drag-resizable?
 Boolean getCanShrinkColumnWidths()
          Controls whether the PortalLayout will shrink column widths to avoid overflowing the PortalLayout horizontally.
 Boolean getCanStretchColumnWidths()
          Controls whether the PortalLayout will stretch column widths, if needed to accommodate the width of Portlets.
 String getColumnBorder()
          Border to show around columns in this PortalLayout
 Overflow getColumnOverflow()
          Controls the overflow setting for each column.
 int getColumnWidth(int colNumber)
          Gets the width of a column in the PortalLayout.
 Canvas getDropPortlet(Canvas dragTarget, Integer colNum, Integer rowNum, Integer dropPosition)
          This method is called when the user drops components into the rows or columns of this PortalLayout.
 int getNumColumns()
          Initial number of columns to show in this PortalLayout.
static PortalLayout getOrCreateRef(JavaScriptObject jsObj)
           
 Overflow getOverflow()
          Controls how the PortalLayout reacts when column widths or Portlet widths overflow the width of the PortalLayout.
 Portlet[][][] getPortletArray()
          Returns a multi-level array of the Portlets in this PortalLayout, where the first level corresponds to columns, the second to rows, and the third to Portlets within rows.
 Portlet[] getPortlets()
          Returns a flat array of all the Portlets in this PortalLayout.
 Boolean getPreventColumnUnderflow()
          Controls whether the last Portlet in a column will be stretched to fill the column's height, or left at its specified height.
 Boolean getPreventRowUnderflow()
          Controls whether the last Portlet in a row will be stretched to fill the row's width, or left at its specified width.
 Boolean getPreventUnderflow()
          Controls whether the last column will be stretched to fill the PortalLayout's width, or left at its specified width.
 Boolean getShowColumnMenus()
          Should a menu be shown within each column with options to add / remove columns?
 Boolean getStretchColumnWidthsProportionally()
          When stretching column widths, should we stretch all column widths proportionally, or just stretch the columns that need extra width?
protected  void onInit_PortalLayout()
           
 void onInit()
           
 void removeColumn(int index)
          Removes the specified column from this layout.
 void removePortlet(Portlet portlet)
          Removes a Portlet which is currently rendered in this PortalLayout.
 void setCanResizeColumns(Boolean canResizeColumns)
          Are columns in this PortalLayout drag-resizeable?
 void setCanResizePortlets(Boolean canResizePortlets)
          Should the height and width of Portlets be drag-resizable?
 void setCanShrinkColumnWidths(Boolean canShrinkColumnWidths)
          Controls whether the PortalLayout will shrink column widths to avoid overflowing the PortalLayout horizontally.
 void setCanStretchColumnWidths(Boolean canStretchColumnWidths)
          Controls whether the PortalLayout will stretch column widths, if needed to accommodate the width of Portlets.
 void setColumnBorder(String columnBorder)
          Border to show around columns in this PortalLayout

If this method is called after the component has been drawn/initialized: Sets the columnBorder for to the specified value and updates any drawn columns to reflect this.
 void setColumnOverflow(Overflow columnOverflow)
          Controls the overflow setting for each column.
 void setColumnPreventUnderflow(boolean preventColumnUnderflow)
          Sets preventColumnUnderflow and reflows the layout to implement it.
 void setColumnWidth(int colNumber, int width)
          Sets the width of a column in the PortalLayout.
 void setColumnWidth(int colNumber, String width)
          Sets the width of a column in the PortalLayout.
static void setDefaultProperties(PortalLayout portalLayoutProperties)
          Class level method to set the default properties of this class.
 void setNumColumns(int numColumns)
          Initial number of columns to show in this PortalLayout.
 void setOverflow(Overflow overflow)
          Controls how the PortalLayout reacts when column widths or Portlet widths overflow the width of the PortalLayout.
 void setPortlets(Portlet... portlets)
          A convenience attribute which you can use to populate a PortalLayout with Portlets on initialization.
 void setPreventColumnUnderflow(Boolean preventColumnUnderflow)
          Controls whether the last Portlet in a column will be stretched to fill the column's height, or left at its specified height.
 void setPreventRowUnderflow(Boolean preventRowUnderflow)
          Controls whether the last Portlet in a row will be stretched to fill the row's width, or left at its specified width.
 void setPreventUnderflow(Boolean preventUnderflow)
          Controls whether the last column will be stretched to fill the PortalLayout's width, or left at its specified width.
 void setShowColumnMenus(Boolean showColumnMenus)
          Should a menu be shown within each column with options to add / remove columns?

If this method is called after the component has been drawn/initialized: Sets showColumnMenus and updates existing columns to reflect the new setting.
 void setStretchColumnWidthsProportionally(Boolean stretchColumnWidthsProportionally)
          When stretching column widths, should we stretch all column widths proportionally, or just stretch the columns that need extra width?
 
Methods inherited from class com.smartgwt.client.widgets.layout.Layout
addMember, addMember, addMember, addMember, addMemberPostCreate, addMemberPostCreate, addMemberPreCreate, addMemberPreCreate, getAnimateMembers, getAnimateMemberTime, getCanDropComponents, getDefaultResizeBars, getDropComponent, getDropLineThickness, getDropPosition, getEnforcePolicy, getHPolicy, getLayoutBottomMargin, getLayoutLeftMargin, getLayoutMargin, getLayoutRightMargin, getLayoutTopMargin, getLeaveScrollbarGap, getLocateMembersBy, getLocateMembersType, getManagePercentBreadth, getMember, getMember, getMemberDefaultBreadth, getMemberNumber, getMemberNumber, getMemberOffset, getMemberOverlap, getMembers, getMembersMargin, getMinMemberSize, getPaddingAsLayoutMargin, getResizeBarClass, getResizeBarSize, getReverseOrder, getShowDragPlaceHolder, getStackZIndex, getVertical, getVPolicy, hasMember, hideDropLine, hideMember, hideMember, membersChanged, onInit_Layout, reflow, reflow, reflowNow, removeMember, removeMembers, reorderMember, reorderMembers, setAlign, setAlign, setAnimateMembers, setAnimateMemberTime, setCanDropComponents, setDefaultLayoutAlign, setDefaultLayoutAlign, setDefaultProperties, setDefaultResizeBars, setDropLineProperties, setDropLineThickness, setEnforcePolicy, setHPolicy, setLayoutBottomMargin, setLayoutLeftMargin, setLayoutMargin, setLayoutRightMargin, setLayoutTopMargin, setLeaveScrollbarGap, setLocateMembersBy, setLocateMembersType, setManagePercentBreadth, setMemberOverlap, setMembers, setMembersMargin, setMinMemberSize, setPaddingAsLayoutMargin, setPlaceHolderDefaults, setPlaceHolderProperties, setResizeBarClass, setResizeBarSize, setReverseOrder, setShowDragPlaceHolder, setStackZIndex, setVertical, setVisibleMember, setVPolicy, showMember, showMember
 
Methods inherited from class com.smartgwt.client.widgets.Canvas
addChild, addChild, addChild, addClickHandler, addDoubleClickHandler, addDragMoveHandler, addDragRepositionMoveHandler, addDragRepositionStartHandler, addDragRepositionStopHandler, addDragResizeMoveHandler, addDragResizeStartHandler, addDragResizeStopHandler, addDragStartHandler, addDragStopHandler, addDropHandler, addDropMoveHandler, addDropOutHandler, addDropOverHandler, addFocusChangedHandler, addHoverHandler, addHoverHiddenHandler, addKeyDownHandler, addKeyPressHandler, addMouseDownHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseStillDownHandler, addMouseUpHandler, addMouseWheelHandler, addMovedHandler, addParentMovedHandler, addPeer, addPeer, addResizedHandler, addRightMouseDownHandler, addScrolledHandler, addShowContextMenuHandler, addStyleName, addVisibilityChangedHandler, adjustForContent, animateFade, animateFade, animateFade, animateHide, animateHide, animateHide, animateMove, animateMove, animateMove, animateMove, animateRect, animateRect, animateRect, animateResize, animateResize, animateResize, animateScroll, animateScroll, animateScroll, animateShow, animateShow, animateShow, blur, bringToFront, clear, clickMaskUp, clickMaskUp, contains, contains, containsEvent, containsFocus, containsPoint, containsPoint, convertToCanvasArray, disable, enable, focus, getAbsoluteLeft, getAbsoluteTop, getAccessKey, getAnimateAcceleration, getAnimateFadeTime, getAnimateHideAcceleration, getAnimateHideTime, getAnimateMoveAcceleration, getAnimateMoveTime, getAnimateRectAcceleration, getAnimateRectTime, getAnimateResizeAcceleration, getAnimateResizeTime, getAnimateScrollAcceleration, getAnimateScrollTime, getAnimateShowAcceleration, getAnimateShowEffect, getAnimateShowTime, getAnimateTime, getAppImgDir, getAriaRole, getAutoDraw, getAutoShowParent, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorder, getBottom, getById, getCanAcceptDrop, getCanDrag, getCanDragReposition, getCanDragResize, getCanDragScroll, getCanDrop, getCanDropBefore, getCanFocus, getCanHover, getCanSelectText, getCanvasItem, getChildren, getChildrenSnapResizeToGrid, getChildrenSnapToGrid, getContents, getContextMenu, getCursor, getDataPath, getDefaultHeight, getDefaultWidth, getDestroyed, getDestroying, getDisabled, getDisabledCursor, getDoubleClickDelay, getDragAppearance, getDragIntersectStyle, getDragOpacity, getDragRepositionAppearance, getDragRepositionCursor, getDragResizeAppearance, getDragScrollDelay, getDragStartDistance, getDragTarget, getDragType, getDynamicContents, getEdgeBackgroundColor, getEdgeCenterBackgroundColor, getEdgeImage, getEdgeMarginSize, getEdgeOffset, getEdgeOpacity, getEdgeShowCenter, getEdgeSize, getExtraSpace, getFacetId, getFullDataPath, getGroupTitle, getHeight, getHeightAsString, getHoverAlign, getHoverAutoDestroy, getHoverComponent, getHoverDelay, getHoverHeight, getHoverHTML, getHoverMoveWithMouse, getHoverOpacity, getHoverStyle, getHoverVAlign, getHoverWidth, getHoverWrap, getHSnapOrigin, getHSnapOrigin, getHSnapPosition, getHSnapPosition, getHtmlPosition, getImgURL, getImgURL, getInnerContentHeight, getInnerContentWidth, getInnerHeight, getInnerWidth, getIsGroup, getLeft, getLeftAsString, getLocateChildrenBy, getLocateChildrenType, getLocatePeersBy, getLocatePeersType, getMargin, getMatchElement, getMaxHeight, getMaxWidth, getMenuConstructor, getMinHeight, getMinWidth, getMouseStillDownDelay, getMouseStillDownInitialDelay, getNextZIndex, getNoDoubleClicks, getOffsetHeight, getOffsetWidth, getOffsetX, getOffsetY, getOpacity, getPadding, getPageBottom, getPageLeft, getPageRect, getPageRight, getPageTop, getParentElement, getPercentBox, getPosition, getPrefix, getPrintHTML, getPrintHTML, getPrompt, getRect, getRedrawOnResize, getResizeBarTarget, getRight, getScrollbarSize, getScrollBottom, getScrollHeight, getScrollLeft, getScrollRight, getScrollTop, getScrollWidth, getShadowDepth, getShadowImage, getShadowOffset, getShadowSoftness, getShouldPrint, getShowCustomScrollbars, getShowDragShadow, getShowEdges, getShowHover, getShowHoverComponents, getShowResizeBar, getShowShadow, getSkinImgDir, getSnapAxis, getSnapEdge, getSnapHDirection, getSnapHGap, getSnapOffsetLeft, getSnapOffsetTop, getSnapOnDrop, getSnapResizeToGrid, getSnapTo, getSnapToGrid, getSnapVDirection, getSnapVGap, getStyleName, getTabIndex, getTitle, getTooltip, getTop, getTopAsString, getUseOpacityFilter, getValuesManager, getViewportHeight, getViewportWidth, getVisibility, getVisibleHeight, getVisibleWidth, getVSnapOrigin, getVSnapOrigin, getVSnapPosition, getVSnapPosition, getWidth, getWidthAsString, getZIndex, handleHover, hide, hideClickMask, hideClickMask, hideContextMenu, imgHTML, imgHTML, imgHTML, intersects, isDirty, isDisabled, isDrawn, isVisible, keyUp, layoutChildren, linkHTML, linkHTML, markForDestroy, markForRedraw, markForRedraw, moveAbove, moveBelow, moveBy, moveTo, parentResized, printComponents, redraw, redraw, removeChild, removeChild, resizeBy, resizeTo, resizeTo, scrollBy, scrollByPercent, scrollTo, scrollTo, scrollToBottom, scrollToLeft, scrollToPercent, scrollToRight, scrollToTop, sendToBack, setAccessKey, setAllowExternalFilters, setAnimateAcceleration, setAnimateFadeTime, setAnimateHideAcceleration, setAnimateHideTime, setAnimateMoveAcceleration, setAnimateMoveTime, setAnimateRectAcceleration, setAnimateRectTime, setAnimateResizeAcceleration, setAnimateResizeTime, setAnimateScrollAcceleration, setAnimateScrollTime, setAnimateShowAcceleration, setAnimateShowEffect, setAnimateShowTime, setAnimateTime, setAppImgDir, setAriaRole, setAutoDraw, setAutoHeight, setAutoShowParent, setAutoWidth, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBottom, setCanAcceptDrop, setCanDrag, setCanDragReposition, setCanDragResize, setCanDragScroll, setCanDrop, setCanDropBefore, setCanFocus, setCanHover, setCanSelectText, setCanvasItem, setChildren, setChildrenSnapResizeToGrid, setChildrenSnapToGrid, setContents, setContextMenu, setCursor, setDataPath, setDefaultHeight, setDefaultProperties, setDefaultWidth, setDisabled, setDisabledCursor, setDoubleClickDelay, setDragAppearance, setDragIntersectStyle, setDragOpacity, setDragRepositionAppearance, setDragRepositionCursor, setDragResizeAppearance, setDragScrollDelay, setDragStartDistance, setDragTarget, setDragType, setDropTypes, setDynamicContents, setEdgeBackgroundColor, setEdgeCenterBackgroundColor, setEdgeImage, setEdgeMarginSize, setEdgeOffset, setEdgeOpacity, setEdgeShowCenter, setEdgeSize, setExtraSpace, setFacetId, setGroupTitle, setHeight, setHeight, setHeight100, setHoverAlign, setHoverAutoDestroy, setHoverDelay, setHoverHeight, setHoverMoveWithMouse, setHoverOpacity, setHoverStyle, setHoverVAlign, setHoverWidth, setHoverWrap, setHtmlPosition, setImage, setImage, setIsGroup, setKeepInParentRect, setKeepInParentRect, setLayoutAlign, setLayoutAlign, setLeft, setLeft, setLocateChildrenBy, setLocateChildrenType, setLocatePeersBy, setLocatePeersType, setMargin, setMatchElement, setMaxHeight, setMaxWidth, setMenuConstructor, setMinHeight, setMinWidth, setMouseStillDownDelay, setMouseStillDownInitialDelay, setNeverUseFilters, setNoDoubleClicks, setOpacity, setPadding, setPageLeft, setPageTop, setParentElement, setPercentBox, setPosition, setPrefix, setPrompt, setRect, setRect, setRedrawOnResize, setResizeBarTarget, setResizeFrom, setRight, setScrollbarSize, setShadowDepth, setShadowImage, setShadowOffset, setShadowSoftness, setShouldPrint, setShowCustomScrollbars, setShowDragShadow, setShowEdges, setShowHover, setShowHoverComponents, setShowResizeBar, setShowShadow, setSkinImgDir, setSmoothFade, setSnapAxis, setSnapEdge, setSnapHDirection, setSnapHGap, setSnapOffsetLeft, setSnapOffsetTop, setSnapOnDrop, setSnapResizeToGrid, setSnapTo, setSnapToGrid, setSnapVDirection, setSnapVGap, setStyleName, setTabIndex, setTitle, setTooltip, setTop, setTop, setUseOpacityFilter, setValuesManager, setVisibility, setVisible, setWidth, setWidth, setWidth100, setZIndex, shouldDragScroll, show, showClickMask, showNextTo, showNextTo, showPrintPreview, showPrintPreview, showPrintPreview, showPrintPreview, showRecursively, updateHover, updateHover, updateShadow, visibleAtPoint, willAcceptDrop
 
Methods inherited from class com.smartgwt.client.widgets.BaseWidget
addDrawHandler, destroy, doAddHandler, doInit, doOnRender, draw, equals, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsFloatArray, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getConfig, getDOM, getElement, getElement, getHandlerCount, getID, getInnerHTML, getJsObj, getOrCreateJsObj, getRef, getScClassName, hashCode, isConfigOnly, isCreated, onDestroy, onDraw, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setDragTracker, setElement, setHtmlElement, setID, setNullProperty, setPosition, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setScClassName, toString
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

PortalLayout

public PortalLayout()

PortalLayout

public PortalLayout(JavaScriptObject jsObj)

PortalLayout

public PortalLayout(int numColumns)
Method Detail

getOrCreateRef

public static PortalLayout getOrCreateRef(JavaScriptObject jsObj)

create

protected JavaScriptObject create()
Overrides:
create in class Layout

setCanResizeColumns

public void setCanResizeColumns(Boolean canResizeColumns)
Are columns in this PortalLayout drag-resizeable?

Note that the displayed width of a column will automatically shrink and stretch to accomodate the width of Portlet -- see canStretchColumnWidths and canShrinkColumnWidths for an explanation. This setting affects the intrinsic width of a column -- that is, the width it will try to return to when not necessary to stretch or shrink to accomodate Portlet widths.

If this method is called after the component has been drawn/initialized: Set whether columns in this portalLayout are drag-resizable, and update any drawn columns to reflect this.

Parameters:
canResizeColumns - Whether columns are drag-resizable. Default value is false
See Also:
setCanStretchColumnWidths(java.lang.Boolean), setCanShrinkColumnWidths(java.lang.Boolean), Sizing overview and related methods

getCanResizeColumns

public Boolean getCanResizeColumns()
Are columns in this PortalLayout drag-resizeable?

Note that the displayed width of a column will automatically shrink and stretch to accomodate the width of Portlet -- see canStretchColumnWidths and canShrinkColumnWidths for an explanation. This setting affects the intrinsic width of a column -- that is, the width it will try to return to when not necessary to stretch or shrink to accomodate Portlet widths.

Returns:
Boolean
See Also:
getCanStretchColumnWidths(), getCanShrinkColumnWidths(), Sizing overview and related methods

setCanResizePortlets

public void setCanResizePortlets(Boolean canResizePortlets)
Should the height and width of Portlets be drag-resizable?

Note that changing the height of a Portlet will change the height of all the Portlets in the same row to match.

If the height of Portlets causes a column to overflow, that column will scroll vertically (independent of other columns), depending on the columnOverflow setting.

Changing the width of a Portlet will potentially cause columns to stretch and shrink their displayed widths in order to accomodate the Portlets, depending on the value of canStretchColumnWidths and canShrinkColumnWidths.

However, the instrinsic width of the columns will remain the same, so that the columns will resume their former widths when no longer necessary to stretch or shrink to accomodate the widths of Portlets. To allow drag-resizing of the intrinsic width of columns, see canResizeColumns.

The net effect is that (by default) PortalLayouts behave like layouts when Portlet sizes do not cause overflow, but behave more like stacks when overflow occurs.

If this method is called after the component has been drawn/initialized: Set whether the height and width of Portlets should be drag-resizable, and update any drawn Portlets to reflect this.

Parameters:
canResizePortlets - Whether drag-resizing the height and width of portlets is allowed. Default value is false
See Also:
setCanResizeColumns(java.lang.Boolean), setCanStretchColumnWidths(java.lang.Boolean), setCanShrinkColumnWidths(java.lang.Boolean), setColumnOverflow(com.smartgwt.client.types.Overflow), Sizing overview and related methods

getCanResizePortlets

public Boolean getCanResizePortlets()
Should the height and width of Portlets be drag-resizable?

Note that changing the height of a Portlet will change the height of all the Portlets in the same row to match.

If the height of Portlets causes a column to overflow, that column will scroll vertically (independent of other columns), depending on the columnOverflow setting.

Changing the width of a Portlet will potentially cause columns to stretch and shrink their displayed widths in order to accomodate the Portlets, depending on the value of canStretchColumnWidths and canShrinkColumnWidths.

However, the instrinsic width of the columns will remain the same, so that the columns will resume their former widths when no longer necessary to stretch or shrink to accomodate the widths of Portlets. To allow drag-resizing of the intrinsic width of columns, see canResizeColumns.

The net effect is that (by default) PortalLayouts behave like layouts when Portlet sizes do not cause overflow, but behave more like stacks when overflow occurs.

Returns:
Boolean
See Also:
getCanResizeColumns(), getCanStretchColumnWidths(), getCanShrinkColumnWidths(), getColumnOverflow(), Sizing overview and related methods

setCanShrinkColumnWidths

public void setCanShrinkColumnWidths(Boolean canShrinkColumnWidths)
Controls whether the PortalLayout will shrink column widths to avoid overflowing the PortalLayout horizontally. If the PortalLayout would otherwise overflow its width, it will check each column to see whether it is wider than necessary to accommodate its Portlets. If so, the column may shrink to avoid having to scroll the PortalLayout.

If this method is called after the component has been drawn/initialized: Sets canShrinkColumnWidths and reflows to reflect the new setting.

Parameters:
canShrinkColumnWidths - Whether columns can shrink to avoid overflowing the PortalLayout's width.. Default value is true
See Also:
setCanStretchColumnWidths(java.lang.Boolean), Sizing overview and related methods

getCanShrinkColumnWidths

public Boolean getCanShrinkColumnWidths()
Controls whether the PortalLayout will shrink column widths to avoid overflowing the PortalLayout horizontally. If the PortalLayout would otherwise overflow its width, it will check each column to see whether it is wider than necessary to accommodate its Portlets. If so, the column may shrink to avoid having to scroll the PortalLayout.

Returns:
Boolean
See Also:
getCanStretchColumnWidths(), Sizing overview and related methods

setCanStretchColumnWidths

public void setCanStretchColumnWidths(Boolean canStretchColumnWidths)
Controls whether the PortalLayout will stretch column widths, if needed to accommodate the width of Portlets. If set, columns will overflow their widths in order to accomodate the widths of their Portlets.

With the default setting of Overflow: auto, the PortalLayout as a whole will scroll horizontally if needed. Depending on the setting of canShrinkColumnWidths, other columns may shrink to avoid overflow on the PortalLayout as a whole.

If canStretchColumnWidths is turned off, then individual rows will scroll horizontally in order to accommodate Portlets that are wider than their column width allows.

If this method is called after the component has been drawn/initialized: Sets canStretchColumnWidths and reflows to reflect the new setting.

Parameters:
canStretchColumnWidths - Whether columns can stretch to accommodate Portlet widths.. Default value is true
See Also:
setCanShrinkColumnWidths(java.lang.Boolean), setCanResizePortlets(java.lang.Boolean), Overflow, Sizing overview and related methods

getCanStretchColumnWidths

public Boolean getCanStretchColumnWidths()
Controls whether the PortalLayout will stretch column widths, if needed to accommodate the width of Portlets. If set, columns will overflow their widths in order to accomodate the widths of their Portlets.

With the default setting of Overflow: auto, the PortalLayout as a whole will scroll horizontally if needed. Depending on the setting of canShrinkColumnWidths, other columns may shrink to avoid overflow on the PortalLayout as a whole.

If canStretchColumnWidths is turned off, then individual rows will scroll horizontally in order to accommodate Portlets that are wider than their column width allows.

Returns:
Boolean
See Also:
getCanShrinkColumnWidths(), getCanResizePortlets(), Overflow, Sizing overview and related methods

setColumnBorder

public void setColumnBorder(String columnBorder)
Border to show around columns in this PortalLayout

If this method is called after the component has been drawn/initialized: Sets the columnBorder for to the specified value and updates any drawn columns to reflect this.

Parameters:
columnBorder - New border to show around columns. Default value is "1px solid gray"

getColumnBorder

public String getColumnBorder()
Border to show around columns in this PortalLayout

Returns:
String

setColumnOverflow

public void setColumnOverflow(Overflow columnOverflow)
Controls the overflow setting for each column. If set to "auto" (the default) then each column will scroll individually (if its Portlets overflow the column height). You can also use "hidden" to clip overflowing heights, or "visible" to show the overflow. The effect of "visible" will depend on the setting for overflow -- by default, the PortalLayout as a whole will scroll when necessary.

If this method is called after the component has been drawn/initialized: Sets columnOverflow and updates existing columns to reflect the new setting.

Note : This is an advanced setting

Parameters:
columnOverflow - Overflow setting for columns. Default value is "auto"
See Also:
Overflow, Canvas.setOverflow(com.smartgwt.client.types.Overflow), Sizing overview and related methods

getColumnOverflow

public Overflow getColumnOverflow()
Controls the overflow setting for each column. If set to "auto" (the default) then each column will scroll individually (if its Portlets overflow the column height). You can also use "hidden" to clip overflowing heights, or "visible" to show the overflow. The effect of "visible" will depend on the setting for overflow -- by default, the PortalLayout as a whole will scroll when necessary.

Returns:
Overflow
See Also:
Overflow, Canvas.getOverflow(), Sizing overview and related methods

setNumColumns

public void setNumColumns(int numColumns)
                   throws IllegalStateException
Initial number of columns to show in this PortalLayout. Note that after initialization columns should be added / removed via PortalLayout.addColumn and PortalLayout.removeColumn. numColumns is ignored if you initialize the portlets attribute, since the portlets attribute will imply how many columns to create.

Parameters:
numColumns - numColumns Default value is 2
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
setPortlets(com.smartgwt.client.widgets.layout.Portlet...)

getNumColumns

public int getNumColumns()
Initial number of columns to show in this PortalLayout. Note that after initialization columns should be added / removed via PortalLayout.addColumn and PortalLayout.removeColumn. numColumns is ignored if you initialize the portlets attribute, since the portlets attribute will imply how many columns to create.

Returns:
Returns the current number of columns displayed in this PortalLayout.
See Also:
getPortlets()

setOverflow

public void setOverflow(Overflow overflow)
Controls how the PortalLayout reacts when column widths or Portlet widths overflow the width of the PortalLayout. By default, the PortalLayout scrolls when necessary. You can also use overflow: visible or overflow: hidden, with the usual results -- see canResizePortlets for a further explanation of column widths.

Note that overflowing height is also affected by columnOverflow. By default, each column will scroll individually -- you can change columnOverflow to "auto" to scroll the whole PortalLayout instead.

Overrides:
setOverflow in class Layout
Parameters:
overflow - overflow Default value is "auto"
See Also:
setCanResizePortlets(java.lang.Boolean), setColumnOverflow(com.smartgwt.client.types.Overflow), Canvas.setOverflow(com.smartgwt.client.types.Overflow), Sizing overview and related methods

getOverflow

public Overflow getOverflow()
Controls how the PortalLayout reacts when column widths or Portlet widths overflow the width of the PortalLayout. By default, the PortalLayout scrolls when necessary. You can also use overflow: visible or overflow: hidden, with the usual results -- see canResizePortlets for a further explanation of column widths.

Note that overflowing height is also affected by columnOverflow. By default, each column will scroll individually -- you can change columnOverflow to "auto" to scroll the whole PortalLayout instead.

Overrides:
getOverflow in class Layout
Returns:
Overflow
See Also:
getCanResizePortlets(), getColumnOverflow(), Canvas.getOverflow(), Sizing overview and related methods

setPreventColumnUnderflow

public void setPreventColumnUnderflow(Boolean preventColumnUnderflow)
Controls whether the last Portlet in a column will be stretched to fill the column's height, or left at its specified height.

Parameters:
preventColumnUnderflow - preventColumnUnderflow Default value is true
See Also:
Sizing overview and related methods

getPreventColumnUnderflow

public Boolean getPreventColumnUnderflow()
Controls whether the last Portlet in a column will be stretched to fill the column's height, or left at its specified height.

Returns:
Boolean
See Also:
Sizing overview and related methods

setPreventRowUnderflow

public void setPreventRowUnderflow(Boolean preventRowUnderflow)
Controls whether the last Portlet in a row will be stretched to fill the row's width, or left at its specified width.

If this method is called after the component has been drawn/initialized: Sets preventRowUnderflow and reflows the layout to implement it.

Parameters:
preventRowUnderflow - Whether to stretch the last Portlet in a row to to fill the row's width.. Default value is true
See Also:
Sizing overview and related methods

getPreventRowUnderflow

public Boolean getPreventRowUnderflow()
Controls whether the last Portlet in a row will be stretched to fill the row's width, or left at its specified width.

Returns:
Boolean
See Also:
Sizing overview and related methods

setPreventUnderflow

public void setPreventUnderflow(Boolean preventUnderflow)
Controls whether the last column will be stretched to fill the PortalLayout's width, or left at its specified width.

If this method is called after the component has been drawn/initialized: Sets preventUnderflow and reflows the layout to implement it.

Parameters:
preventUnderflow - Whether to stretch the last column to fill the PortalLayout's width.. Default value is true
See Also:
Sizing overview and related methods

getPreventUnderflow

public Boolean getPreventUnderflow()
Controls whether the last column will be stretched to fill the PortalLayout's width, or left at its specified width.

Returns:
Boolean
See Also:
Sizing overview and related methods

setShowColumnMenus

public void setShowColumnMenus(Boolean showColumnMenus)
Should a menu be shown within each column with options to add / remove columns?

If this method is called after the component has been drawn/initialized: Sets showColumnMenus and updates existing columns to reflect the new setting.

Parameters:
showColumnMenus - Whether to show column menus. Default value is true

getShowColumnMenus

public Boolean getShowColumnMenus()
Should a menu be shown within each column with options to add / remove columns?

Returns:
Boolean

setStretchColumnWidthsProportionally

public void setStretchColumnWidthsProportionally(Boolean stretchColumnWidthsProportionally)
When stretching column widths, should we stretch all column widths proportionally, or just stretch the columns that need extra width?

Note that this implies turning off canShrinkColumnWidths.

If this method is called after the component has been drawn/initialized: Sets stretchColumnWidthsProportionally and reflows to reflect the new setting.

Note : This is an advanced setting

Parameters:
stretchColumnWidthsProportionally - Whether to stretch column widths proportionally. Default value is false
See Also:
setCanStretchColumnWidths(java.lang.Boolean), setCanShrinkColumnWidths(java.lang.Boolean), Sizing overview and related methods

getStretchColumnWidthsProportionally

public Boolean getStretchColumnWidthsProportionally()
When stretching column widths, should we stretch all column widths proportionally, or just stretch the columns that need extra width?

Note that this implies turning off canShrinkColumnWidths.

Returns:
Boolean
See Also:
getCanStretchColumnWidths(), getCanShrinkColumnWidths(), Sizing overview and related methods

addColumn

public void addColumn(int index)
Adds a new portal column to this layout at the specified position

Parameters:
index - target position for the new column

getColumnWidth

public int getColumnWidth(int colNumber)
Gets the width of a column in the PortalLayout.

Parameters:
colNumber - Which column's width to get
Returns:
width
See Also:
Canvas.getWidth()

removeColumn

public void removeColumn(int index)
Removes the specified column from this layout. All portlets displayed within this column will be destroyed when the column is removed.

Parameters:
index - column number to remove

removePortlet

public void removePortlet(Portlet portlet)
Removes a Portlet which is currently rendered in this PortalLayout. Portlet will not be destroyed by default - if this is desired the calling code should do this explicitly.

Parameters:
portlet - portlet to remove

setColumnPreventUnderflow

public void setColumnPreventUnderflow(boolean preventColumnUnderflow)
Sets preventColumnUnderflow and reflows the layout to implement it.

Parameters:
preventColumnUnderflow - Whether to stretch the last Porlet in a column to fill the column's height.

setDefaultProperties

public static void setDefaultProperties(PortalLayout portalLayoutProperties)
Class level method to set the default properties of this class. If set, then all subsequent instances of this class will automatically have the default properties that were set when this method was called. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

Note: This method is intended for setting default attributes only and will effect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead.

Parameters:
portalLayoutProperties - properties that should be used as new defaults when instances of this class are created

onInit

public void onInit()
Overrides:
onInit in class Layout

onInit_PortalLayout

protected void onInit_PortalLayout()

getDropPortlet

public Canvas getDropPortlet(Canvas dragTarget,
                             Integer colNum,
                             Integer rowNum,
                             Integer dropPosition)
This method is called when the user drops components into the rows or columns of this PortalLayout.

Overriding this method allows you to modify drop behaviour when creating or reordering portlets via drag & drop. You can return the dragTarget for the standard behavior, or null to cancel the drop.

Otherwise, return the component you want to be dropped (as for Layout.getDropComponent).

Note: this is an override point.

Parameters:
dragTarget - the component being dragged
colNum - indicates which column the portlet is being dropped on.
rowNum - indicates the row number being dropped on.
dropPosition - Drop position within an existing row. If the dropPosition is null, then that means that a new row will be created.
Returns:
drop-component or custom Portlet to embed in the portalLayout. Returning null will cancel the drop.

setPortlets

public void setPortlets(Portlet... portlets)
                 throws IllegalStateException
A convenience attribute which you can use to populate a PortalLayout with Portlets on initialization. After initialization, use addPortlet() or drag-and-drop to add Portlets, and getPortlets() or getPortletArray() to get Portlets.

To create one column, you can provide an array of Portlets.

To create multiple columns, provide an array of arrays (where the first level represents columns, and the second represents Portlets).

To put multiple portlets in the same row, provide a third level to the array.

Note that numColumns is ignored if you provide the portlets attribute, since the array will indicate how many columns to create. You can provide an empty second-level array to create a blank column, if needed.

Parameters:
portlets - portlets Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
getPortlets(), getPortletArray(), addPortlet(com.smartgwt.client.widgets.layout.Portlet), setNumColumns(int)

getPortlets

public Portlet[] getPortlets()
Returns a flat array of all the Portlets in this PortalLayout.

Returns:
portlets

getPortletArray

public Portlet[][][] getPortletArray()
Returns a multi-level array of the Portlets in this PortalLayout, where the first level corresponds to columns, the second to rows, and the third to Portlets within rows.

Returns:
portlets

addPortlet

public void addPortlet(Portlet portlet)
Adds a Portlet instance to this portalLayout in the specified position.

Parameters:
portlet - Portlet to add to this layout.

addPortlet

public void addPortlet(Portlet portlet,
                       int colNum,
                       int rowNum)
Adds a Portlet instance to this portalLayout in the specified position.

Parameters:
portlet - Portlet to add to this layout.
colNum - Column in which the Portlet should be added. If unspecified, defaults to zero.
rowNum - Position within the column for the Portlet.

addPortlet

public void addPortlet(Portlet portlet,
                       int colNum,
                       int rowNum,
                       int rowOffset)
Adds a Portlet instance to this portalLayout in the specified position.

Parameters:
portlet - Portlet to add to this layout.
colNum - Column in which the Portlet should be added. If unspecified, defaults to zero.
rowNum - Position within the column for the Portlet
rowOffset - Position for the portlet within an existing row. If the row specified by rowNum already exists, the portlet will be added to that row at this position. If rowNum does not already exist, this parameter is ignored

setColumnWidth

public void setColumnWidth(int colNumber,
                           int width)
Sets the width of a column in the PortalLayout.

Parameters:
colNumber - Which column's width to set.
width - How wide to make the column

setColumnWidth

public void setColumnWidth(int colNumber,
                           String width)
Sets the width of a column in the PortalLayout.

Parameters:
colNumber - Which column's width to set.
width - How wide to make the column