|
|||||||||
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.smartgwt.client.widgets.BaseWidget
com.smartgwt.client.widgets.Canvas
com.smartgwt.client.widgets.layout.Layout
public class Layout
A subclass of Canvas that automatically arranges other Canvases according to a layout policy.
A Layout manages a set of "member" Canvases initialized via the "members" property. Layouts
can have both "members", which are managed by the Layout, and normal Canvas children, which
are unmanaged.
Rather than using the Layout class directly, use the HLayout, VLayout, HStack and VStack
classes, which are subclasses of Layout preconfigured for horizontal or vertical stacking,
with the "fill" (VLayout) or "none" (VStack) LayoutPolicy
already set.
Layouts and Stacks may be nested to create arbitrarily complex layouts.
To show a resizer bar after (to the right or bottom of) a layout member, set showResizeBar to
true on that member component (not on the HLayout or VLayout). Resizer bars override
membersMargin spacing.
Like other Canvas subclasses, Layout and Stack components may have % width and height
values. To create a dynamically-resizing layout that occupies the entire page (or entire
parent component), set width and height to "100%".
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.smartgwt.client.widgets.BaseWidget |
---|
config, configOnly, id, isElementSet |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
Layout()
|
|
Layout(com.google.gwt.core.client.JavaScriptObject jsObj)
|
Method Summary | |
---|---|
void |
addMember(Canvas component)
Add a canvas to the layout, optionally at a specific position. |
void |
addMember(Canvas component,
int position)
Add a canvas to the layout, optionally at a specific position. |
void |
addMember(com.google.gwt.user.client.ui.Widget widget)
Add a canvas to the layout, optionally at a specific position. |
void |
addMember(com.google.gwt.user.client.ui.Widget widget,
int position)
|
protected void |
addMemberPostCreate(java.lang.Object componentJS)
|
protected void |
addMemberPostCreate(java.lang.Object componentJS,
int position)
|
protected void |
addMemberPreCreate(java.lang.Object componentJS)
|
protected void |
addMemberPreCreate(java.lang.Object componentJS,
int position)
|
protected com.google.gwt.core.client.JavaScriptObject |
create()
|
java.lang.Boolean |
getAnimateMembers()
If true when members are added / removed, they should be animated as they are shown or hidden in position |
java.lang.Integer |
getAnimateMemberTime()
If specified this is the duration of show/hide animations when members are being shown or hidden due to being added / removed from this layout. |
java.lang.Boolean |
getCanDropComponents()
Layouts provide a default implementation of a drag and drop interaction. |
LayoutResizeBarPolicy |
getDefaultResizeBars()
Policy for whether resize bars are shown on members by default. |
java.lang.Boolean |
getDropComponent(Canvas dragTarget,
int dropPosition)
When canDropComponents is true, this method will be called when a component is
dropped onto the layout to determine what component to add as a new layout member.
|
int |
getDropLineThickness()
Thickness, in pixels of the dropLine shown during drag and drop when canDropComponents is set to true . |
int |
getDropPosition()
Get the position a new member would be dropped. |
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 horizonal 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 |
getLeaveScrollbarGap()
Whether to leave a gap for a vertical scrollbar even when one is not actually present. |
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. |
void |
getMemberDefaultBreadth(Canvas member,
int defaultBreadth)
Return the breadth for a member of this layout which either didn't specify a breadth or specified a percent breadth with managePercentBreadth :true.
|
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 |
void |
getMemberOffset(Canvas member,
int defaultOffset,
java.lang.String alignment)
An optional method that, if it exists, allows the manipulation of the calculated offset for members of this layout. |
int |
getMemberOverlap()
Number of pixels by which each member should overlap the preceding member, used for creating an "stack of cards" appearance for the members of a Layout. |
Canvas[] |
getMembers()
Return the members in the Layout. |
int |
getMembersMargin()
Space between each member of the layout. |
static Layout |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
|
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 accomodate members. |
java.lang.Boolean |
getPaddingAsLayoutMargin()
If this widget has padding specified (as padding or in the
CSS style applied to this layout), should it show up as space outside the members,
similar to layoutMargin?
|
java.lang.String |
getResizeBarClass()
Class to use for creating resizeBars. |
int |
getResizeBarSize()
Thickness of the resizeBars in pixels |
java.lang.Boolean |
getReverseOrder()
Reverse the order of stacking for this Layout, so that the last member is shown first. |
java.lang.Boolean |
getShowDragPlaceHolder()
If set to true, when a member is dragged out of layout, a visible placeholder canvas will be displayed in place of the dragged widget for the duration of the drag and drop interaction. |
java.lang.String |
getStackZIndex()
For use in conjunction with memberOverlap , controls the z-stacking order of
members.
|
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 |
hideDropLine()
Calling this method hides the dropLine shown during a drag and drop interaction with a Layout that has canDropComponents set to true. |
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 |
membersChanged()
Fires once at initialization if the layout has any initial members, and then fires whenever members are added, removed or reordered. |
void |
reflow()
Layout members according to current settings. |
void |
reflow(java.lang.String reason)
Layout members according to current settings. |
void |
reflowNow()
Layout members according to current settings, immediately. Generally, when changes occur that require a layout to reflow (such as members being shown or hidden), the Layout will reflow only after a delay, so that multiple changes cause only one reflow. |
void |
removeMember(Canvas member)
Removes the specified member from the layout. |
void |
removeMembers(Canvas[] members)
Removes the specified members from the layout. |
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 alignment)
Alignment of all members in this Layout on the length axis. |
void |
setAnimateMembers(java.lang.Boolean animateMembers)
If true when members are added / removed, they should be animated as they are shown or hidden in position |
void |
setAnimateMemberTime(java.lang.Integer animateMemberTime)
If specified this is the duration of show/hide animations when members are being shown or hidden due to being added / removed from this layout. |
void |
setCanDropComponents(java.lang.Boolean canDropComponents)
Layouts provide a default implementation of a drag and drop interaction. |
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 |
setDefaultResizeBars(LayoutResizeBarPolicy defaultResizeBars)
Policy for whether resize bars are shown on members by default. |
void |
setDropLineProperties(Canvas dropLineProperties)
|
void |
setDropLineThickness(int dropLineThickness)
Thickness, in pixels of the dropLine shown during drag and drop when canDropComponents is set to true . |
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 horizonal 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 |
setLeaveScrollbarGap(java.lang.Boolean leaveScrollbarGap)
Whether to leave a gap for a vertical scrollbar even when one is not actually present. |
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 |
setMemberOverlap(int memberOverlap)
Number of pixels by which each member should overlap the preceding member, used for creating an "stack of cards" appearance for the members of a Layout. |
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 |
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 accomodate members. |
void |
setPaddingAsLayoutMargin(java.lang.Boolean paddingAsLayoutMargin)
If this widget has padding specified (as padding or in the
CSS style applied to this layout), should it show up as space outside the members,
similar to layoutMargin?
|
void |
setPlaceHolderDefaults(Canvas placeHolderDefaults)
If showDragPlaceHolder is true, this
defaults object determines the default appearance of the placeholder displayed when the user drags a widget out
of this layout.Default value for this property sets the placeholder styleName to "layoutPlaceHolder" To modify this object, use com.smartgwt.client..Class#changeDefaults |
void |
setPlaceHolderProperties(Canvas placeHolderProperties)
If showDragPlaceHolder is true, this
properties object can be used to customize the appearance of the placeholder displayed when the user drags a
widget out of this layout. |
void |
setResizeBarClass(java.lang.String resizeBarClass)
Class to use for creating resizeBars. |
void |
setResizeBarSize(int resizeBarSize)
Thickness of the resizeBars in pixels |
void |
setReverseOrder(java.lang.Boolean reverseOrder)
Reverse the order of stacking for this Layout, so that the last member is shown first. |
void |
setShowDragPlaceHolder(java.lang.Boolean showDragPlaceHolder)
If set to true, when a member is dragged out of layout, a visible placeholder canvas will be displayed in place of the dragged widget for the duration of the drag and drop interaction. |
void |
setStackZIndex(java.lang.String stackZIndex)
For use in conjunction with memberOverlap , controls the z-stacking order of
members.
|
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 the hide is complete. |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent |
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, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkEvents, 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 |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Constructor Detail |
---|
public Layout()
public Layout(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
public static Layout getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
protected com.google.gwt.core.client.JavaScriptObject create()
create
in class Canvas
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 accomodate members.
setOverflow
in class Canvas
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 accomodate members.
getOverflow
in class Canvas
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 void setHPolicy(LayoutPolicy hPolicy)
Note : This is an advanced setting
hPolicy
- hPolicy Default value is "fill"public LayoutPolicy getHPolicy()
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 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 setPaddingAsLayoutMargin(java.lang.Boolean paddingAsLayoutMargin)
padding
or in the
CSS style applied to this layout), should it show up as space outside the members,
similar to layoutMargin?
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 precidence over this value.
Note : This is an advanced setting
paddingAsLayoutMargin
- paddingAsLayoutMargin Default value is truepublic java.lang.Boolean getPaddingAsLayoutMargin()
padding
or in the
CSS style applied to this layout), should it show up as space outside the members,
similar to layoutMargin?
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 precidence over this value.
public void setLayoutMargin(java.lang.Integer layoutMargin)
layoutLeftMargin
and related properties does not have a true setter method.setLayoutMargin(java.lang.Integer)
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 nullpublic java.lang.Integer getLayoutMargin()
layoutLeftMargin
and related properties does not have a true setter method.setLayoutMargin(java.lang.Integer)
may be called with no arguments to reflow the layout.
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 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 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 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 setLeaveScrollbarGap(java.lang.Boolean leaveScrollbarGap) throws java.lang.IllegalStateException
This setting avoids the layout resizing all members when the vertical scrollbar is introduced or removed, which can avoid unnecessary screen shifting and improve performance.
leaveScrollbarGap
- leaveScrollbarGap Default value is false
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getLeaveScrollbarGap()
This setting avoids the layout resizing all members when the vertical scrollbar is introduced or removed, which can avoid unnecessary screen shifting and improve performance.
public void setMemberOverlap(int memberOverlap) throws java.lang.IllegalStateException
memberOverlap
can be used in conjunction with stackZIndex
to create
a particular visual stacking order.
Note that overlap of individual members can be accomplished with a negative setting for
extraSpace
.
memberOverlap
- memberOverlap Default value is 0
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic int getMemberOverlap()
memberOverlap
can be used in conjunction with stackZIndex
to create
a particular visual stacking order.
Note that overlap of individual members can be accomplished with a negative setting for
extraSpace
.
public void setDefaultResizeBars(LayoutResizeBarPolicy defaultResizeBars) throws java.lang.IllegalStateException
defaultResizeBars
- defaultResizeBars Default value is "marked"
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic LayoutResizeBarPolicy getDefaultResizeBars()
public void setResizeBarClass(java.lang.String resizeBarClass)
A resize bar will be created for any Layout member that specifies
showResizeBar
.
Resize bars will be instances of the class specified by this property, and will
automatically be sized to the member's breadth and to the thickness
given by resizeBarSize
.
Classes that are valid by default are Splitbar
and ImgSplitbar
.
To customize the appearance or behavior of resizeBars within some layout a custom
resize bar class can be created by subclassing Splitbar
or ImgSplitbar
and
setting this property on your layout to use your new class.
Resize bars will automatically be sized to the member's breadth and to the thickness
given by layout.resizeBarSize
. The built-in Splitbar class supports
drag resizing of its target member, and clicking on the bar to hide the target member.
Note : This is an advanced setting
resizeBarClass
- resizeBarClass Default value is "Splitbar"public java.lang.String getResizeBarClass()
A resize bar will be created for any Layout member that specifies
showResizeBar
.
Resize bars will be instances of the class specified by this property, and will
automatically be sized to the member's breadth and to the thickness
given by resizeBarSize
.
Classes that are valid by default are Splitbar
and ImgSplitbar
.
To customize the appearance or behavior of resizeBars within some layout a custom
resize bar class can be created by subclassing Splitbar
or ImgSplitbar
and
setting this property on your layout to use your new class.
Resize bars will automatically be sized to the member's breadth and to the thickness
given by layout.resizeBarSize
. The built-in Splitbar class supports
drag resizing of its target member, and clicking on the bar to hide the target member.
public void setResizeBarSize(int resizeBarSize)
Note : This is an advanced setting
resizeBarSize
- resizeBarSize Default value is 7public int getResizeBarSize()
public void setAnimateMembers(java.lang.Boolean animateMembers)
animateMembers
- animateMembers Default value is nullpublic java.lang.Boolean getAnimateMembers()
public void setAnimateMemberTime(java.lang.Integer animateMemberTime)
Note : This is an advanced setting
animateMemberTime
- animateMemberTime Default value is nullpublic java.lang.Integer getAnimateMemberTime()
public void setCanDropComponents(java.lang.Boolean canDropComponents) throws java.lang.IllegalStateException
canAcceptDrop
:true and canDropComponents:true
on a Layout, when a droppable Canvas (canDrop
is dragged over
the layout will show a dropLine (a simple insertion line) at the drop location.
When the drop occurs, the dragTarget (obtained using
EventHandler.getDragTarget()
) is added as a member of this layout at the location
shown by the dropLine (calculated by getDropPosition()
). This default
behavior allows either members or external components that have
canDragReposition
(or canDrag
) and canDrop
set
to true
to be added to or reordered within the Layout.
You can control the thickness of the dropLine via dropLineThickness
and
you can customize the style using css styling in the skin file (look for .layoutDropLine in
skin_styles.css for your skin).
If you want to dynamically create a component to be added to the Layout in response to a drop event you can do so as follows:
isc.VLayout.create({ ...various layout properties... canDropComponents: true, drop : function () { // create the new component var newMember = isc.Canvas.create(); // add to the layout at the current drop position // (the dropLine will be showing here) this.addMember(newMember, this.getDropPosition()); // hide the dropLine that was automatically shown // by builtin SmartGWT methods this.hideDropLine(); } });If you want to completely suppress the builtin drag and drop logic, but still receive drag and drop events for your own custom implementation, set
canAcceptDrop
to
true
and canDropComponents
to false
on your Layout.
Note : This is an advanced setting
canDropComponents
- canDropComponents Default value is true
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getCanDropComponents()
canAcceptDrop
:true and canDropComponents:true
on a Layout, when a droppable Canvas (canDrop
is dragged over
the layout will show a dropLine (a simple insertion line) at the drop location.
When the drop occurs, the dragTarget (obtained using
EventHandler.getDragTarget()
) is added as a member of this layout at the location
shown by the dropLine (calculated by getDropPosition()
). This default
behavior allows either members or external components that have
canDragReposition
(or canDrag
) and canDrop
set
to true
to be added to or reordered within the Layout.
You can control the thickness of the dropLine via dropLineThickness
and
you can customize the style using css styling in the skin file (look for .layoutDropLine in
skin_styles.css for your skin).
If you want to dynamically create a component to be added to the Layout in response to a drop event you can do so as follows:
isc.VLayout.create({ ...various layout properties... canDropComponents: true, drop : function () { // create the new component var newMember = isc.Canvas.create(); // add to the layout at the current drop position // (the dropLine will be showing here) this.addMember(newMember, this.getDropPosition()); // hide the dropLine that was automatically shown // by builtin SmartGWT methods this.hideDropLine(); } });If you want to completely suppress the builtin drag and drop logic, but still receive drag and drop events for your own custom implementation, set
canAcceptDrop
to
true
and canDropComponents
to false
on your Layout.
public void setDropLineThickness(int dropLineThickness) throws java.lang.IllegalStateException
canDropComponents
is set to true
. See the discussion in
Layout
for more info.
Note : This is an advanced setting
dropLineThickness
- dropLineThickness Default value is 2
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic int getDropLineThickness()
canDropComponents
is set to true
. See the discussion in
Layout
for more info.
public void setShowDragPlaceHolder(java.lang.Boolean showDragPlaceHolder)
showDragPlaceHolder
- showDragPlaceHolder Default value is nullpublic java.lang.Boolean getShowDragPlaceHolder()
public void setStackZIndex(java.lang.String stackZIndex) throws java.lang.IllegalStateException
memberOverlap
, controls the z-stacking order of
members.
If "lastOnTop", members stack from the first member at bottom to the last member at top. If "firstOnTop", members stack from the last member at bottom to the first member at top.
stackZIndex
- stackZIndex Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getStackZIndex()
memberOverlap
, controls the z-stacking order of
members.
If "lastOnTop", members stack from the first member at bottom to the last member at top. If "firstOnTop", members stack from the last member at bottom to the first member at top.
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 true
java.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 getMemberOffset(Canvas member, int defaultOffset, java.lang.String alignment)
member
- Component to be positioneddefaultOffset
- Value of the currently calculated member offset. This may be returned verbatim or manupulated in this method.alignment
- alignment of the enclosing layoutpublic void getMemberDefaultBreadth(Canvas member, int defaultBreadth)
managePercentBreadth
:true.
Called only for Layouts which have a LayoutPolicy
for the breadth
axis of "fill", since Layouts with a breadth policy of "none" leave all member breadths alone.
member
- Component to be sizeddefaultBreadth
- Value of the currently calculated member breadth. This may be returned verbatim or manipulated in this method.public 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 reflow(java.lang.String reason)
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
.
reason
- reason reflow() had to be called (appear in logs if enabled)public void reflowNow()
public java.lang.Boolean hasMember(Canvas canvas)
canvas
- the canvas to check for
public void removeMember(Canvas member)
member
- the canvas to be removed from the layoutpublic void setVisibleMember(Canvas member)
member
- member to showpublic 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 membersChanged()
public java.lang.Boolean getDropComponent(Canvas dragTarget, int dropPosition)
canDropComponents
is true, this method will be called when a component is
dropped onto the layout to determine what component to add as a new layout member.
By default, the actual component being dragged (isc.EventHandler.getDragTarget()) will be added to the layout. For a different behavior, such as wrapping dropped components in Windows, or creating components on the fly from dropped data, override this method.
You can also return false to cancel the drop.
dragTarget
- current drag targetdropPosition
- index of the drop in the list of current members
public int getDropPosition()
Use this method to obtain the drop position for e.g. a custom drop handler.
public void hideDropLine()
canDropComponents
set to true. This method is only useful for
custom implementations of com.smartgwt.client.widgets.layout.Layout#drop
as the default implementation calls this
method automatically.
public void setMembers(Canvas... members)
defaultLayoutAlign
for default implementation.) vPolicy
.
members
- members Default value is nullpublic void addMember(com.google.gwt.user.client.ui.Widget widget)
widget
- the canvas object to be added to the layoutpublic void addMember(Canvas component)
newMember
- the canvas object to be added to the layoutpublic void addMember(com.google.gwt.user.client.ui.Widget widget, int position)
public void addMember(Canvas component, int position)
newMember
- the canvas object to be added to the layoutposition
- the position in the layout to place newMember (starts with 0);
if omitted, it will be added at the last positionprotected void addMemberPreCreate(java.lang.Object componentJS)
protected void addMemberPostCreate(java.lang.Object componentJS)
protected void addMemberPreCreate(java.lang.Object componentJS, int position)
protected void addMemberPostCreate(java.lang.Object componentJS, int position)
public void setPlaceHolderProperties(Canvas placeHolderProperties) throws java.lang.IllegalStateException
showDragPlaceHolder
is true, this
properties object can be used to customize the appearance of the placeholder displayed when the user drags a
widget out of this layout.
placeHolderProperties
- placeHolderProperties Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic void setPlaceHolderDefaults(Canvas placeHolderDefaults) throws java.lang.IllegalStateException
showDragPlaceHolder
is true, this
defaults object determines the default appearance of the placeholder displayed when the user drags a widget out
of this layout.styleName
to "layoutPlaceHolder"
com.smartgwt.client..Class#changeDefaults
placeHolderDefaults
- placeHolderDefaults Default value is {...}
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic void setDefaultLayoutAlign(Alignment alignment) throws java.lang.IllegalStateException
layoutAlign
.
defaultLayoutAlign
- defaultLayoutAlign Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic void setDefaultLayoutAlign(VerticalAlignment alignment) throws java.lang.IllegalStateException
layoutAlign
.
defaultLayoutAlign
- defaultLayoutAlign Default value is null
java.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic void setDropLineProperties(Canvas dropLineProperties) throws java.lang.IllegalStateException
java.lang.IllegalStateException
public void setAlign(Alignment alignment)
setAlign
in class Canvas
align
- align Default value is nullpublic void setAlign(VerticalAlignment alignment)
align
- align Default value is nullpublic void removeMembers(Canvas[] members)
members
- array of members to be removed, or reference to single
member.public Canvas[] getMembers()
public void showMember(Canvas member)
Members can always be
directly shown via member.show()
, but if animateMembers
is enabled, animation will only occur if showMember() is called to show the member.
member
- Member to showpublic void showMember(Canvas member, Function callback)
Members can always be
directly shown via member.show()
, but if animateMembers
is enabled, animation will only occur if showMember() is called to show the member.
member
- Member to showcallback
- action to fire when the member has been shownpublic void hideMember(Canvas member)
Members can always be
directly hidden via member.hide()
, but if animateMembers
is enabled, animation will only occur if hideMember() is called to hide the member.
member
- Member to hidepublic void hideMember(Canvas member, Function callback)
Members can always be
directly hidden via member.hide()
, but if animateMembers
is enabled, animation will only occur if hideMember() is called to hide the member.
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.
memberID
- identifier for the required member
public Canvas getMember(java.lang.String memberID)
If passed a member Canvas, just returns it.
memberID
- identifier for the required member
public int getMemberNumber(Canvas member)
If passed a number, just returns it.
memberID
- identifier for the required member
public int getMemberNumber(java.lang.String memberID)
If passed a number, just returns it.
memberID
- identifier for the required member
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |