public class Layout extends Canvas implements HasDragMoveHandlers
policies
already set. LayoutPolicy,
VLayout,
HLayout,
VStack,
HStack,
LayoutSpacercom.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled| Modifier and Type | Field and Description |
|---|---|
protected Alignment |
alignment |
protected java.lang.Boolean |
enforcePolicy |
protected LayoutPolicy |
hPolicy |
protected java.util.List<Canvas> |
members |
protected int |
membersMargin |
protected int |
minMemberSize |
protected boolean |
momentumScroll |
protected Overflow |
overflow |
protected boolean |
paddingAsLayoutMargin |
protected java.lang.Boolean |
reverseOrder |
protected VerticalAlignment |
valign |
protected java.lang.Boolean |
vertical |
_CONTENT_CHANGED_EVENT_TYPE, _CSS, _HISTORY_ENABLED, _REQUEST_SCROLL_TO_EVENT_TYPE, id, touched| Constructor and Description |
|---|
Layout() |
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addDragMoveHandler(DragMoveHandler dragMoveHandler)
Executed every time the mouse moves while dragging this canvas.
|
void |
addMember(Canvas component)
Add a canvas to the layout.
|
void |
addMember(Canvas component,
int position)
Adds a component to the layout at the specified position.
|
void |
addMember(com.google.gwt.user.client.ui.Widget widget) |
void |
addMember(com.google.gwt.user.client.ui.Widget widget,
int position) |
void |
addMembers(Canvas... members)
Add one or more canvases to the layout
|
void |
addMembers(Canvas[] members,
int position)
Add one or more canvases to the layout at specific positions.
|
void |
addMembers(java.lang.Iterable<? extends Canvas> members,
int position) |
void |
clear() |
java.lang.Boolean |
getEnforcePolicy()
Whether the layout policy is continuously enforced as new members are added or removed and as members are resized.
|
LayoutPolicy |
getHPolicy()
Sizing policy applied to members on horizontal axis
|
java.lang.Integer |
getLayoutBottomMargin()
Space outside of all members, on the bottom side.
|
java.lang.Integer |
getLayoutLeftMargin()
Space outside of all members, on the left-hand side.
|
java.lang.Integer |
getLayoutMargin()
Space outside of all members.
|
java.lang.Integer |
getLayoutRightMargin()
Space outside of all members, on the right-hand side.
|
java.lang.Integer |
getLayoutTopMargin()
Space outside of all members, on the top side.
|
java.lang.Boolean |
getManagePercentBreadth()
If set, a Layout with breadthPolicy:"fill" will specially interpret a percentage breadth on a member as a percentage of
available space excluding the
layoutMargin. |
Canvas |
getMember(int index)
Given a numerical index or a member ID, return a pointer to the appropriate member.
|
Canvas |
getMember(java.lang.String memberID)
Given a numerical index or a member ID, return a pointer to the appropriate member.
|
int |
getMemberNumber(Canvas member)
Given a member Canvas or member ID, return the index of that member within this layout's members array
|
int |
getMemberNumber(java.lang.String memberID)
Given a member Canvas or member ID, return the index of that member within this layout's members array
|
Canvas[] |
getMembers()
Return the members in the Layout.
|
int |
getMembersMargin()
Space between each member of the layout.
|
int |
getMinMemberSize()
Minimum size, in pixels, below which members should never be shrunk, even if this requires the Layout to overflow.
|
boolean |
getMomentumScroll()
Return if momentum scroll is enabled.
|
Overflow |
getOverflow()
Normal
Overflow settings can be used on layouts, for example, an overflow:auto Layout
will scroll if members exceed its specified size, whereas an overflow:visible Layout will grow to accommodate members. |
java.lang.Boolean |
getPaddingAsLayoutMargin()
If this widget has padding specified or in the
CSS style applied to this layout), should it show up as space outside the members, similar to layoutMargin?
|
java.lang.Boolean |
getReverseOrder()
Reverse the order of stacking for this Layout, so that the last member is shown first.
|
java.lang.Boolean |
getVertical()
Should this layout appear with members stacked vertically or horizontally.
|
LayoutPolicy |
getVPolicy()
Sizing policy applied to members on vertical axis
|
java.lang.Boolean |
hasMember(Canvas canvas)
Returns true if the layout includes the specified canvas.
|
void |
hideMember(Canvas member)
Hide the specified member, firing the specified callback when the hide is complete.
|
void |
hideMember(Canvas member,
Function callback)
Hide the specified member, firing the specified callback when the hide is complete.
|
void |
reflow()
Layout members according to current settings.
|
void |
removeMember(Canvas member)
Removes the specified member from the layout.
|
void |
removeMember(com.google.gwt.user.client.ui.Widget widget) |
void |
removeMembers(Canvas... members) |
void |
removeMembers(java.lang.Iterable<? extends Canvas> iterable) |
void |
reorderMember(int memberNum,
int newPosition)
Shift a member of the layout to a new position
|
void |
reorderMembers(int start,
int end,
int newPosition)
Move a range of members to a new position
|
void |
setAlign(Alignment alignment)
Alignment of all members in this Layout on the length axis.
|
void |
setAlign(VerticalAlignment valign)
Alignment of all members in this Layout on the length axis.
|
void |
setDefaultLayoutAlign(Alignment alignment)
Specifies the default alignment for layout members on the breadth axis.
|
void |
setDefaultLayoutAlign(VerticalAlignment alignment)
Specifies the default alignment for layout members on the breadth axis.
|
void |
setEnforcePolicy(java.lang.Boolean enforcePolicy)
Whether the layout policy is continuously enforced as new members are added or removed and as members are resized.
|
void |
setHPolicy(LayoutPolicy hPolicy)
Sizing policy applied to members on horizontal axis
|
void |
setLayoutBottomMargin(java.lang.Integer layoutBottomMargin)
Space outside of all members, on the bottom side.
|
void |
setLayoutLeftMargin(java.lang.Integer layoutLeftMargin)
Space outside of all members, on the left-hand side.
|
void |
setLayoutMargin(java.lang.Integer layoutMargin)
Space outside of all members.
|
void |
setLayoutRightMargin(java.lang.Integer layoutRightMargin)
Space outside of all members, on the right-hand side.
|
void |
setLayoutTopMargin(java.lang.Integer layoutTopMargin)
Space outside of all members, on the top side.
|
void |
setManagePercentBreadth(java.lang.Boolean managePercentBreadth)
If set, a Layout with breadthPolicy:"fill" will specially interpret a percentage breadth on a member as a percentage of
available space excluding the
layoutMargin. |
void |
setMembers(Canvas... members)
An array of canvases that will be contained within this layout.
|
void |
setMembersMargin(int membersMargin)
Space between each member of the layout.
|
void |
setMinMemberSize(int minMemberSize)
Minimum size, in pixels, below which members should never be shrunk, even if this requires the Layout to overflow.
|
void |
setMomentumScroll(boolean onoff)
Enable/disable momentum scroll
|
void |
setOverflow(Overflow overflow)
Normal
Overflow settings can be used on layouts, for example, an overflow:auto Layout
will scroll if members exceed its specified size, whereas an overflow:visible Layout will grow to accommodate members. |
void |
setPaddingAsLayoutMargin(java.lang.Boolean paddingAsLayoutMargin)
If this widget has padding specified (or in the
CSS style applied to this layout), should it show up as space outside the members, similar to layoutMargin?
|
void |
setReverseOrder(java.lang.Boolean reverseOrder)
Reverse the order of stacking for this Layout, so that the last member is shown first.
|
void |
setVertical(java.lang.Boolean vertical)
Should this layout appear with members stacked vertically or horizontally.
|
void |
setVisibleMember(Canvas member)
Hide all other members and make the single parameter member visible.
|
void |
setVPolicy(LayoutPolicy vPolicy)
Sizing policy applied to members on vertical axis
|
void |
showMember(Canvas member)
Show the specified member, firing the specified callback when the hide is complete.
|
void |
showMember(Canvas member,
Function callback)
Show the specified member, firing the specified callback when show is complete.
|
_add, _booleanValue, _fireContentChangedEvent, _fireContentChangedEvent, _fireRequestScrollToEvent, _getAndroidWindowSoftInputMode, _getAttributeFromSplitLocator, _getChildFromLocatorSubstring, _getFixNavigationBarPositionDuringKeyboardFocus, _getHideTabBarDuringKeyboardFocus, _getInnerAttributeFromSplitLocator, _getInnerElement, _hideAddressBar, _hideAddressBarNow, _insert, _isDifferent, _isHDPIDisplay, _isIOS4OrOlder, _isIOS5, _isIOSMin6_0, _isStandaloneMode, _nativeParseFloat, _removeClassName, _setClassName, _setHandleDisabled, _sinkAnimationEndEvent, _sinkContentChangedEvent, _sinkFocusInEvent, _sinkFocusOutEvent, _sinkInputEvent, _sinkRequestScrollToEvent, _sinkTransitionEndEvent, _triggerDebugger, addChild, addChild, addChild, addClickHandler, addShowContextMenuHandler, destroy, disable, enable, getContextMenu, getID, getInnerHTML, getMargin, hasChild, hasChild, isAndroid, isDisabled, isEnabled, isIPad, isIPhone, isSafari, isStandAlone, isUIWebView, onBrowserEvent, parseDimension, removeChild, removeChild, setContents, setContextMenu, setDisabled, setElement, setID, setMargin, setStyleName, split, useIOSNativeScrollingadd, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, removeadd, add, adopt, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringprotected Alignment alignment
protected java.lang.Boolean enforcePolicy
protected LayoutPolicy hPolicy
protected java.util.List<Canvas> members
protected int membersMargin
protected int minMemberSize
protected boolean momentumScroll
protected Overflow overflow
protected boolean paddingAsLayoutMargin
protected java.lang.Boolean reverseOrder
protected VerticalAlignment valign
protected java.lang.Boolean vertical
public void setEnforcePolicy(java.lang.Boolean enforcePolicy)
This setting implies that any member that resizes larger, or any added member, will take space from other members in order to allow the overall layout to stay the same size.
Note : This is an advanced setting
enforcePolicy - enforcePolicy Default value is truepublic java.lang.Boolean getEnforcePolicy()
This setting implies that any member that resizes larger, or any added member, will take space from other members in order to allow the overall layout to stay the same size.
public void setHPolicy(LayoutPolicy hPolicy)
Note : This is an advanced setting
hPolicy - hPolicy Default value is "fill"public LayoutPolicy getHPolicy()
public void setLayoutBottomMargin(java.lang.Integer layoutBottomMargin)
layoutMargin. Requires a manual call to
setLayoutMargin() if changed on the fly.
layoutBottomMargin - layoutBottomMargin Default value is nullpublic java.lang.Integer getLayoutBottomMargin()
layoutMargin. Requires a manual call to
setLayoutMargin() if changed on the fly.
public void setLayoutLeftMargin(java.lang.Integer layoutLeftMargin)
layoutMargin. Requires a manual call to
setLayoutMargin() if changed on the fly.
layoutLeftMargin - layoutLeftMargin Default value is nullpublic java.lang.Integer getLayoutLeftMargin()
layoutMargin. Requires a manual call to
setLayoutMargin() if changed on the fly.
public void setLayoutMargin(java.lang.Integer layoutMargin)
layoutLeftMargin and related properties does not have a
true setter method.Layout.setLayoutMargin may be called with no arguments to
reflow the layout.
Method to force a reflow of the layout after directly assigning a value to any of the layout*Margin properties. Takes no arguments.layoutMargin - layoutMargin Default value is nullsetLayoutLeftMargin(java.lang.Integer),
setLayoutRightMargin(java.lang.Integer),
setLayoutBottomMargin(java.lang.Integer),
setLayoutTopMargin(java.lang.Integer),
setPaddingAsLayoutMargin(java.lang.Boolean),
User Sizing Examplepublic java.lang.Integer getLayoutMargin()
layoutLeftMargin and related properties does not have a
true setter method.Layout.setLayoutMargin may be called with no arguments to
reflow the layout.getLayoutLeftMargin(),
getLayoutRightMargin(),
getLayoutBottomMargin(),
getLayoutTopMargin(),
getPaddingAsLayoutMargin(),
User Sizing Examplepublic void setLayoutRightMargin(java.lang.Integer layoutRightMargin)
layoutMargin. Requires a manual call to
setLayoutMargin() if changed on the fly.
layoutRightMargin - layoutRightMargin Default value is nullpublic java.lang.Integer getLayoutRightMargin()
layoutMargin. Requires a manual call to
setLayoutMargin() if changed on the fly.
public void setLayoutTopMargin(java.lang.Integer layoutTopMargin)
layoutMargin. Requires a manual call to
setLayoutMargin() if changed on the fly.
layoutTopMargin - layoutTopMargin Default value is nullpublic java.lang.Integer getLayoutTopMargin()
layoutMargin. Requires a manual call to
setLayoutMargin() if changed on the fly.
public void setManagePercentBreadth(java.lang.Boolean managePercentBreadth)
throws java.lang.IllegalStateException
layoutMargin. If false,
percentages work exactly as for a non-member, with layoutMargins, if any, ignored.managePercentBreadth - managePercentBreadth Default value is truejava.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic java.lang.Boolean getManagePercentBreadth()
layoutMargin. If false,
percentages work exactly as for a non-member, with layoutMargins, if any, ignored.public void setMembersMargin(int membersMargin)
Requires a manual call to reflow() if changed on the fly.
membersMargin - membersMargin Default value is 0public int getMembersMargin()
Requires a manual call to reflow() if changed on the fly.
public void setMinMemberSize(int minMemberSize)
minMemberSize - minMemberSize Default value is 1public int getMinMemberSize()
public void setOverflow(Overflow overflow) throws java.lang.IllegalStateException
Overflow settings can be used on layouts, for example, an overflow:auto Layout
will scroll if members exceed its specified size, whereas an overflow:visible Layout will grow to accommodate members.overflow - overflow Default value is "visible"java.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic Overflow getOverflow()
Overflow settings can be used on layouts, for example, an overflow:auto Layout
will scroll if members exceed its specified size, whereas an overflow:visible Layout will grow to accommodate members.public void setPaddingAsLayoutMargin(java.lang.Boolean paddingAsLayoutMargin)
If this setting is false, padding will not affect member positioning (as CSS padding normally does not affect absolutely positioned children). Leaving this setting true allows a designer to more effectively control layout purely from CSS.
Note : This is an advanced setting
paddingAsLayoutMargin - paddingAsLayoutMargin Default value is truepublic java.lang.Boolean getPaddingAsLayoutMargin()
If this setting is false, padding will not affect member positioning (as CSS padding normally does not affect absolutely positioned children). Leaving this setting true allows a designer to more effectively control layout purely from CSS.
Note that layoutMargin if specified, takes
precedence over this value.
public void setReverseOrder(java.lang.Boolean reverseOrder)
Requires a manual call to
reflow() if changed on the fly.
In RTL mode, for horizontal Layouts the value of this flag will be flipped during initialization.
reverseOrder - reverseOrder Default value is falsepublic java.lang.Boolean getReverseOrder()
Requires a manual call to
reflow() if changed on the fly.
In RTL mode, for horizontal Layouts the value of this flag will be flipped during initialization.
public void setVertical(java.lang.Boolean vertical)
false if
unspecified.vertical - vertical Default value is nullpublic java.lang.Boolean getVertical()
false if
unspecified.public void setVPolicy(LayoutPolicy vPolicy)
Note : This is an advanced setting
vPolicy - vPolicy Default value is "fill"public LayoutPolicy getVPolicy()
public java.lang.Boolean hasMember(Canvas canvas)
canvas - the canvas to check forpublic void reflow()
Members will reflow automatically when the layout is resized, members
resize, the list of members changes or members change visibility. It is only necessary to manually call
reflow() after changing settings on the layout, for example, layout.reverseOrder.
public void removeMember(Canvas member)
member - the canvas to be removed from the layoutpublic void removeMember(com.google.gwt.user.client.ui.Widget widget)
public void removeMembers(Canvas... members)
public void removeMembers(java.lang.Iterable<? extends Canvas> iterable)
public void reorderMember(int memberNum,
int newPosition)
memberNum - current position of the member to move to a new positionnewPosition - new position to move the member topublic void reorderMembers(int start,
int end,
int newPosition)
start - beginning of range of members to moveend - end of range of members to move, non-inclusivenewPosition - new position to move the members topublic void setVisibleMember(Canvas member)
member - member to showpublic void setMembers(Canvas... members)
members - members Default value is nullpublic void addMembers(Canvas... members)
members - - canvases to be addedpublic void addMembers(Canvas[] members, int position)
members - - array of canvases to be addedposition - - position to add newMemberspublic void addMembers(java.lang.Iterable<? extends Canvas> members, int position)
public void addMember(Canvas component)
component - the canvas object to be added to the layoutpublic void addMember(com.google.gwt.user.client.ui.Widget widget)
public void addMember(Canvas component, int position)
component - the Canvas object to be added to the layoutposition - the position in the layout at which to place component (starts with 0)public void addMember(com.google.gwt.user.client.ui.Widget widget,
int position)
public void clear()
clear in interface com.google.gwt.user.client.ui.HasWidgetsclear in class com.google.gwt.user.client.ui.Panelpublic void setDefaultLayoutAlign(Alignment alignment) throws java.lang.IllegalStateException
alignment - defaultLayoutAlign Default value is nulljava.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic void setDefaultLayoutAlign(VerticalAlignment alignment) throws java.lang.IllegalStateException
alignment - defaultLayoutAlign Default value is nulljava.lang.IllegalStateException - this property cannot be changed after the component has been createdpublic void setAlign(Alignment alignment)
alignment - alignment Default value is nullpublic void setAlign(VerticalAlignment valign)
valign - alignment Default value is nullpublic Canvas[] getMembers()
public boolean getMomentumScroll()
public void setMomentumScroll(boolean onoff)
public final void showMember(Canvas member)
Members can always be
directly shown via member.show()
member - Member to showpublic final void showMember(Canvas member, Function callback)
Members can always be
directly shown via member.show()
member - Member to showcallback - action to fire when the member has been shownpublic final void hideMember(Canvas member)
Members can always be
directly hidden via member.hide()
member - Member to hidepublic final void hideMember(Canvas member, Function callback)
Members can always be
directly hidden via member.hide()
member - Member to hidecallback - callback to fire when the member is hidden.public Canvas getMember(int index)
If passed a member Canvas, just returns it.
index - index for the memberpublic Canvas getMember(java.lang.String memberID)
If passed a member Canvas, just returns it.
memberID - identifier for the required memberpublic int getMemberNumber(Canvas member)
If passed a number, just returns it.
member - the memberpublic int getMemberNumber(java.lang.String memberID)
If passed a number, just returns it.
memberID - identifier for the required memberpublic com.google.gwt.event.shared.HandlerRegistration addDragMoveHandler(DragMoveHandler dragMoveHandler)
HasDragMoveHandlersaddDragMoveHandler in interface HasDragMoveHandlersdragMoveHandler - the dragMove handlerHandlerRegistration used to remove this handler