|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.sencha.gxt.widget.core.client.Component
com.sencha.gxt.widget.core.client.container.Container
com.sencha.gxt.widget.core.client.container.ResizeContainer
com.sencha.gxt.widget.core.client.container.InsertResizeContainer
com.sencha.gxt.widget.core.client.container.CssFloatLayoutContainer
com.sencha.gxt.widget.core.client.container.PortalLayoutContainer
public class PortalLayoutContainer
A layout container that lays out its children in in multiple columns, each
containing zero or more Portlets. Supports drag and drop of child
Portlets between columns as well as modifying the order within
columns.
VerticalLayoutContainer for each column. The add, insert, remove
methods work against these internal containers, getWidget(int)
returns the internal containers. The portlets are children of the internal
containers, not the portlet container itself.
Code Snippet:
public void onModuleLoad() {
PortalLayoutContainer c = new PortalLayoutContainer(3);
c.add(createPortlet("Portlet 1", "Content 1"), 0);
c.add(createPortlet("Portlet 2", "Content 2"), 1);
c.add(createPortlet("Portlet 3", "Content 3"), 2);
Viewport v = new Viewport();
v.add(c);
RootPanel.get().add(v);
}
private Portlet createPortlet(String h, String l) {
Portlet p = new Portlet();
p.setHeadingText(h);
p.setWidget(new Label(l));
p.setPixelSize(200, 200);
return p;
}
| Nested Class Summary | |
|---|---|
static interface |
PortalLayoutContainer.PortalLayoutAppearance
|
| Nested classes/interfaces inherited from class com.sencha.gxt.widget.core.client.container.CssFloatLayoutContainer |
|---|
CssFloatLayoutContainer.CssFloatData, CssFloatLayoutContainer.CssFloatLayoutAppearance |
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
| Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.InsertPanel |
|---|
InsertPanel.ForIsWidget |
| Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets |
|---|
HasWidgets.ForIsWidget |
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
PortalLayoutContainer(int numColumns)
Creates a portal layout container with the default appearance and the specified number of columns. |
|
PortalLayoutContainer(PortalLayoutContainer.PortalLayoutAppearance appearance,
int numColumns)
Creates a portal layout container with the specified appearance and number of columns. |
|
| Method Summary | |
|---|---|
void |
add(IsWidget child)
Adds a widget to this panel. |
void |
add(IsWidget w,
int column)
Adds a portlet to the portal. |
void |
add(Portlet portlet,
int column)
Adds a portlet to the portal. |
void |
add(Widget child)
Adds the specified widget to the container. |
HandlerRegistration |
addDropHandler(PortalDropEvent.PortalDropHandler handler)
Adds a PortalDropEvent.PortalDropHandler handler for PortalDropEvent events. |
HandlerRegistration |
addValidateDropHandler(PortalValidateDropEvent.PortalValidateDropHandler handler)
Adds a PortalValidateDropEvent.PortalValidateDropHandler handler for PortalValidateDropEvent events. |
AutoScrollSupport |
getAutoScrollSupport()
Returns the scroll support instance. |
int |
getColumnCount()
Returns the number of columns. |
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. |
VerticalLayoutContainer |
getWidget(int index)
|
void |
insert(IsWidget w,
int beforeIndex)
|
void |
insert(IsWidget w,
int beforeIndex,
CssFloatLayoutContainer.CssFloatData layoutData)
Inserts the widget at the specified index in the CSS float layout container. |
void |
insert(IsWidget w,
int index,
int column)
Inserts a portlet. |
void |
insert(Portlet portlet,
int index,
int column)
Inserts a portlet. |
boolean |
isAutoScroll()
Returns true if auto scroll is enabled (defaults to true). |
boolean |
remove(int index)
|
boolean |
remove(IsWidget child)
|
void |
remove(IsWidget w,
int column)
Removes a portlet from the portal. |
void |
remove(Portlet portlet,
int column)
Removes a portlet from the portal. |
void |
setAutoScroll(boolean autoScroll)
True to automatically scroll the portal container when the user hovers over the top and bottom of the container (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.sencha.gxt.widget.core.client.container.CssFloatLayoutContainer |
|---|
add, addScrollHandler, getScrollMode, getScrollSupport, getStyleFloat, isAdjustForScroll, setAdjustForScroll, setScrollMode, setScrollSupport, setStyleFloat |
| Methods inherited from class com.sencha.gxt.widget.core.client.container.InsertResizeContainer |
|---|
insert |
| Methods inherited from class com.sencha.gxt.widget.core.client.container.ResizeContainer |
|---|
forceLayout, isLayoutRunning, isOrWasLayoutRunning, onResize |
| Methods inherited from class com.sencha.gxt.widget.core.client.container.Container |
|---|
addAddHandler, addBeforeAddHandler, addBeforeRemoveHandler, addContainerHandler, addRemoveHandler, clear, disable, enable, findWidget, getItemByItemId, getWidgetCount, getWidgetIndex, getWidgetIndex, iterator, remove |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget |
|---|
getWidgetIndex |
| Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel |
|---|
getWidgetCount, getWidgetIndex |
| Constructor Detail |
|---|
@UiConstructor public PortalLayoutContainer(int numColumns)
numColumns - the number of columns managed by this portal
public PortalLayoutContainer(PortalLayoutContainer.PortalLayoutAppearance appearance,
int numColumns)
appearance - the portal layout appearancenumColumns - the number of columns managed by this portal| Method Detail |
|---|
public void add(IsWidget child)
Container
add in interface HasWidgets.ForIsWidgetadd in interface InsertPanel.ForIsWidgetadd in class Containerchild - the child widget to be added
public void add(IsWidget w,
int column)
w - the portletcolumn - the column to add to
@UiChild(tagname="portlet")
public void add(Portlet portlet,
int column)
portlet - the portlet to addcolumn - the column to add topublic void add(Widget child)
ContainerPanel.add(Widget) for a
number of things you must take into consideration.
add in interface HasWidgetsadd in interface InsertPaneladd in class Containerchild - the child widget to be added.public HandlerRegistration addDropHandler(PortalDropEvent.PortalDropHandler handler)
PortalDropEvent.HasPortalDropHandlersPortalDropEvent.PortalDropHandler handler for PortalDropEvent events.
addDropHandler in interface PortalDropEvent.HasPortalDropHandlershandler - the handler
public HandlerRegistration addValidateDropHandler(PortalValidateDropEvent.PortalValidateDropHandler handler)
PortalValidateDropEvent.HasPortalValidateDropHandlersPortalValidateDropEvent.PortalValidateDropHandler handler for PortalValidateDropEvent events.
addValidateDropHandler in interface PortalValidateDropEvent.HasPortalValidateDropHandlershandler - the handler
public AutoScrollSupport getAutoScrollSupport()
public int getColumnCount()
public int getPortletColumn(Portlet portlet)
portlet - the portlet
public int getPortletIndex(Portlet portlet)
portlet - the portlet
public int getSpacing()
public VerticalLayoutContainer getWidget(int index)
getWidget in interface IndexedPanelgetWidget in class Container
public void insert(IsWidget w,
int beforeIndex)
insert in interface InsertPanel.ForIsWidgetinsert in class InsertResizeContainer
public void insert(IsWidget w,
int beforeIndex,
CssFloatLayoutContainer.CssFloatData layoutData)
CssFloatLayoutContainer
insert in class CssFloatLayoutContainerw - the widget to insert in the layout containerbeforeIndex - the insert indexlayoutData - the parameters that describe how to lay out the widget
public void insert(IsWidget w,
int index,
int column)
w - the portlet to addedindex - the insert indexcolumn - the column to insert into
public void insert(Portlet portlet,
int index,
int column)
portlet - the portlet to addindex - the insert indexcolumn - the column to insert intopublic boolean isAutoScroll()
public boolean remove(int index)
remove in interface IndexedPanelremove in class Containerpublic boolean remove(IsWidget child)
remove in interface HasWidgets.ForIsWidgetremove in class Container
public void remove(IsWidget w,
int column)
w - the widthcolumn - the column
public void remove(Portlet portlet,
int column)
portlet - the portlet to removecolumn - the columnpublic void setAutoScroll(boolean autoScroll)
autoScroll - true to enable auto scrollAutoScrollSupport
public void setColumnWidth(int colIndex,
double width)
colIndex - the column indexwidth - the column widthpublic void setSpacing(int spacing)
spacing - the spacing in pixels
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||