|
|||||||||
| 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) policies
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%".
LayoutPolicy,
VLayout,
HLayout,
VStack,
HStack,
LayoutSpacer| 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, nativeObject, scClassName |
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
Layout()
|
|
Layout(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(Widget widget)
Add a canvas to the layout, optionally at a specific position. |
void |
addMember(Widget widget,
int position)
|
protected void |
addMemberPostCreate(Object componentJS)
|
protected void |
addMemberPostCreate(Object componentJS,
int position)
|
protected void |
addMemberPreCreate(Object componentJS)
|
protected void |
addMemberPreCreate(Object componentJS,
int position)
|
void |
addMembers(Canvas... newMembers)
Add one or more canvases to the layout. |
void |
addMembers(Canvas[] newMembers,
int position)
Add one or more canvases to the layout at specific positions. |
protected JavaScriptObject |
create()
|
Boolean |
getAnimateMembers()
If true when members are added / removed, they should be animated as they are shown or hidden in position |
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. |
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. |
protected Canvas |
getDropComponent(Canvas dragTarget,
int dropPosition)
|
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. |
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 |
Integer |
getLayoutBottomMargin()
Space outside of all members, on the bottom side. |
Integer |
getLayoutLeftMargin()
Space outside of all members, on the left-hand side. |
Integer |
getLayoutMargin()
Space outside of all members. |
Integer |
getLayoutRightMargin()
Space outside of all members, on the right-hand side. |
Integer |
getLayoutTopMargin()
Space outside of all members, on the top side. |
Boolean |
getLeaveScrollbarGap()
Whether to leave a gap for a vertical scrollbar even when one is not actually present. |
LocatorStrategy |
getLocateMembersBy()
Strategy to use when locating members from within this Layout's members array. |
LocatorTypeStrategy |
getLocateMembersType()
LocatorTypeStrategy to use when finding members within this layout. |
com.smartgwt.logicalstructure.core.LogicalStructureObject |
getLogicalStructure()
|
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(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(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,
String alignment)
Override point for changing the offset on the breadth axis for members, that is, the offset relative to the left edge for a vertical layout, or the offset relative to the top edge for a horizontal 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. |
int |
getMinMemberSize()
Minimum size, in pixels, below which members should never be shrunk, even if this requires the Layout to overflow. |
static Layout |
getOrCreateRef(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 accommodate members. |
Boolean |
getPaddingAsLayoutMargin()
If this widget has padding specified (as this.padding or in the
CSS style applied to this layout), should it show up as space outside the members, similar to layoutMargin? |
String |
getResizeBarClass()
Class to use for creating resizeBars. |
int |
getResizeBarSize()
Thickness of the resizeBars in pixels |
Boolean |
getReverseOrder()
Reverse the order of stacking for this Layout, so that the last member is shown first. |
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. |
Boolean |
getShowDropLines()
Controls whether to show a drop-indicator during a drag and drop operation. |
String |
getStackZIndex()
For use in conjunction with memberOverlap, controls
the z-stacking order of members. |
Boolean |
getVertical()
Should this layout appear with members stacked vertically or horizontally. |
LayoutPolicy |
getVPolicy()
Sizing policy applied to members on vertical axis |
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. |
protected void |
onInit_Layout()
|
protected void |
onInit()
|
void |
reflow()
Layout members according to current settings. |
void |
reflow(String reason)
Layout members according to current settings. |
void |
reflowNow()
Layout members according to current settings, immediately. |
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(Boolean animateMembers)
If true when members are added / removed, they should be animated as they are shown or hidden in position |
void |
setAnimateMemberTime(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(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. |
static void |
setDefaultProperties(Layout layoutProperties)
Class level method to set the default properties of this class. |
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(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 |
setJavaScriptObject(JavaScriptObject jsObj)
|
void |
setLayoutBottomMargin(Integer layoutBottomMargin)
Space outside of all members, on the bottom side. |
void |
setLayoutLeftMargin(Integer layoutLeftMargin)
Space outside of all members, on the left-hand side. |
void |
setLayoutMargin(Integer layoutMargin)
Space outside of all members. |
void |
setLayoutRightMargin(Integer layoutRightMargin)
Space outside of all members, on the right-hand side. |
void |
setLayoutTopMargin(Integer layoutTopMargin)
Space outside of all members, on the top side. |
void |
setLeaveScrollbarGap(Boolean leaveScrollbarGap)
Whether to leave a gap for a vertical scrollbar even when one is not actually present. |
void |
setLocateMembersBy(LocatorStrategy locateMembersBy)
Strategy to use when locating members from within this Layout's members array. |
void |
setLocateMembersType(LocatorTypeStrategy locateMembersType)
LocatorTypeStrategy to use when finding members within this layout. |
com.smartgwt.logicalstructure.core.LogicalStructureObject |
setLogicalStructure(com.smartgwt.logicalstructure.widgets.layout.LayoutLogicalStructure s)
|
void |
setManagePercentBreadth(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 |
setMinMemberSize(int minMemberSize)
Minimum size, in pixels, below which members should never be shrunk, even if this requires the Layout to overflow. |
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(Boolean paddingAsLayoutMargin)
If this widget has padding specified (as this.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(String resizeBarClass)
Class to use for creating resizeBars. |
void |
setResizeBarSize(int resizeBarSize)
Thickness of the resizeBars in pixels |
void |
setReverseOrder(Boolean reverseOrder)
Reverse the order of stacking for this Layout, so that the last member is shown first. |
void |
setShowDragPlaceHolder(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 |
setShowDropLines(Boolean showDropLines)
Controls whether to show a drop-indicator during a drag and drop operation. |
void |
setStackZIndex(String stackZIndex)
For use in conjunction with memberOverlap, controls
the z-stacking order of members. |
void |
setVertical(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 |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, 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, resolvePotentialElement, 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 |
|---|
public Layout()
public Layout(JavaScriptObject jsObj)
| Method Detail |
|---|
public static Layout getOrCreateRef(JavaScriptObject jsObj)
public void setJavaScriptObject(JavaScriptObject jsObj)
setJavaScriptObject in class Canvasprotected JavaScriptObject create()
create in class Canvaspublic void setAnimateMembers(Boolean animateMembers)
animateMembers - animateMembers Default value is nullpublic Boolean getAnimateMembers()
public void setAnimateMemberTime(Integer animateMemberTime)
Note : This is an advanced setting
animateMemberTime - animateMemberTime Default value is nullpublic Integer getAnimateMemberTime()
public void setCanDropComponents(Boolean canDropComponents)
throws IllegalStateException
canAcceptDrop:true and canDropComponents:true
on a Layout, when a droppable Canvas (canDrop:true is dragged over
the layout, it 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 Layout.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 Smart GWT 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
IllegalStateException - this property cannot be changed after the component has been createdDragdrop overview and related methodspublic Boolean getCanDropComponents()
canAcceptDrop:true and canDropComponents:true
on a Layout, when a droppable Canvas (canDrop:true is dragged over
the layout, it 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 Layout.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 Smart GWT 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.
Dragdrop overview and related methodspublic void setDefaultResizeBars(LayoutResizeBarPolicy defaultResizeBars)
showResizeBar for members of this layout.
defaultResizeBars - defaultResizeBars Default value is "marked"Canvas.setShowResizeBar(java.lang.Boolean)public LayoutResizeBarPolicy getDefaultResizeBars()
showResizeBar for members of this layout.
Canvas.getShowResizeBar()
public void setDropLineThickness(int dropLineThickness)
throws 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
IllegalStateException - this property cannot be changed after the component has been createdLayout,
Dragdrop overview and related methods,
Drag move Examplepublic int getDropLineThickness()
canDropComponents is set to true. See the
discussion in Layout for more info.
Layout,
Dragdrop overview and related methods,
Drag move Examplepublic void setEnforcePolicy(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 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(Integer layoutBottomMargin)
layoutMargin. Requires a manual call to
setLayoutMargin() if changed on the fly.
layoutBottomMargin - layoutBottomMargin Default value is nullpublic Integer getLayoutBottomMargin()
layoutMargin. Requires a manual call to
setLayoutMargin() if changed on the fly.
public void setLayoutLeftMargin(Integer layoutLeftMargin)
layoutMargin. Requires a manual call to
setLayoutMargin() if changed on the fly.
layoutLeftMargin - layoutLeftMargin Default value is nullpublic Integer getLayoutLeftMargin()
layoutMargin. Requires a manual call to
setLayoutMargin() if changed on the fly.
public void setLayoutMargin(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.
layoutMargin - optional new setting for layout.layoutMargin. Regardless of whether a new layout margin is
passed, the layout reflows according to the current settings for layoutStartMargin et al. 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 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(Integer layoutRightMargin)
layoutMargin. Requires a manual call to
setLayoutMargin() if changed on the fly.
layoutRightMargin - layoutRightMargin Default value is nullpublic Integer getLayoutRightMargin()
layoutMargin. Requires a manual call to
setLayoutMargin() if changed on the fly.
public void setLayoutTopMargin(Integer layoutTopMargin)
layoutMargin. Requires a manual call to
setLayoutMargin() if changed on the fly.
layoutTopMargin - layoutTopMargin Default value is nullpublic Integer getLayoutTopMargin()
layoutMargin. Requires a manual call to
setLayoutMargin() if changed on the fly.
public void setLeaveScrollbarGap(Boolean leaveScrollbarGap)
throws 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
IllegalStateException - this property cannot be changed after the component has been createdpublic 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 setLocateMembersBy(LocatorStrategy locateMembersBy)
Note : This is an advanced setting
locateMembersBy - locateMembersBy Default value is nullpublic LocatorStrategy getLocateMembersBy()
public void setLocateMembersType(LocatorTypeStrategy locateMembersType)
LocatorTypeStrategy to use when finding members within this layout.
Note : This is an advanced setting
locateMembersType - locateMembersType Default value is nullpublic LocatorTypeStrategy getLocateMembersType()
LocatorTypeStrategy to use when finding members within this layout.
public void setManagePercentBreadth(Boolean managePercentBreadth)
throws IllegalStateException
layoutMargin. If false,
percentages work exactly as for a non-member, with layoutMargins, if any, ignored.
managePercentBreadth - managePercentBreadth Default value is true
IllegalStateException - this property cannot be changed after the component has been createdpublic Boolean getManagePercentBreadth()
layoutMargin. If false,
percentages work exactly as for a non-member, with layoutMargins, if any, ignored.
public void setMemberOverlap(int memberOverlap)
throws 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
IllegalStateException - this property cannot be changed after the component has been createdLayoutMember overview and related methodspublic 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.
LayoutMember overview and related methodspublic 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)
throws IllegalStateException
minMemberSize - minMemberSize Default value is 1
IllegalStateException - this property cannot be changed after the component has been createdpublic int getMinMemberSize()
public void setOverflow(Overflow overflow)
throws 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.
setOverflow in class Canvasoverflow - overflow Default value is "visible"
IllegalStateException - this property cannot be changed after the component has been createdSizing overview and related methodspublic 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.
getOverflow in class CanvasSizing overview and related methodspublic void setPaddingAsLayoutMargin(Boolean paddingAsLayoutMargin)
this.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
precedence over this value.
Note : This is an advanced setting
paddingAsLayoutMargin - paddingAsLayoutMargin Default value is truepublic Boolean getPaddingAsLayoutMargin()
this.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
precedence over this value.
public void setResizeBarClass(String resizeBarClass)
A resize bar will be created for any Layout member that specifies . 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 showResizeBar:trueresizeBarSize.
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 - . See String. Default value is "Splitbar"Splitbar,
ImgSplitbar,
setResizeBarSize(int)public String getResizeBarClass()
A resize bar will be created for any Layout member that specifies . 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 showResizeBar:trueresizeBarSize.
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.
StringSplitbar,
ImgSplitbar,
getResizeBarSize()public void setResizeBarSize(int resizeBarSize)
Note : This is an advanced setting
resizeBarSize - resizeBarSize Default value is 7public int getResizeBarSize()
public void setReverseOrder(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 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 setShowDragPlaceHolder(Boolean showDragPlaceHolder)
showDragPlaceHolder - showDragPlaceHolder Default value is nullDragdrop overview and related methods,
Drag move Examplepublic Boolean getShowDragPlaceHolder()
Dragdrop overview and related methods,
Drag move Examplepublic void setShowDropLines(Boolean showDropLines)
showDropLines - showDropLines Default value is nullDragdrop overview and related methodspublic Boolean getShowDropLines()
Dragdrop overview and related methods
public void setStackZIndex(String stackZIndex)
throws 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 - . See String. Default value is null
IllegalStateException - this property cannot be changed after the component has been createdpublic 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.
Stringpublic void setVertical(Boolean vertical)
false if
unspecified.
vertical - vertical Default value is nullpublic 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 int getDropPosition()
Use this method to obtain the drop position for e.g. a custom drop handler.
public void getMemberDefaultBreadth(Canvas member,
int defaultBreadth)
managePercentBreadth:true. Called only for
Layouts which have a layout policy 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 getMemberOffset(Canvas member,
int defaultOffset,
String alignment)
The method is passed the
default offset that would be used for the member if getMemberOffset() were not implemented. This default offset already
takes into account layoutMargin, as well as the alignment on the breadth axis, which is also passed to
getMemberOffset().
This method is an override point only; it does not exist by default and cannot be called.
member - Component to be positioneddefaultOffset - Value of the currently calculated member offset. If this value is returned unchanged the layout will have its
default behavioralignment - alignment of the enclosing layout, on the breadth axispublic Boolean hasMember(Canvas canvas)
canvas - the canvas to check for
public void hideDropLine()
canDropComponents set to true. This method is only
useful for custom implementations of Layout.drop as the default
implementation calls this method automatically.
public void membersChanged()
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(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 void removeMember(Canvas member)
member - the canvas to be removed from the layoutpublic void removeMembers(Canvas[] members)
members - array of members to be removed, or single member
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 to
public 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 static void setDefaultProperties(Layout layoutProperties)
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.
layoutProperties - properties that should be used as new defaults when instances of this class are createdprotected void onInit()
onInit in class Canvasprotected void onInit_Layout()
protected Canvas getDropComponent(Canvas dragTarget,
int dropPosition)
public void addMembers(Canvas... newMembers)
newMembers - canvases to be added
public void addMembers(Canvas[] newMembers,
int position)
newMembers - array of canvases to be addedposition - position to add newMembers
positionpublic void setMembers(Canvas... members)
defaultLayoutAlign for default implementation.) vPolicy.
members - members Default value is nullpublic void addMember(Widget widget)
widget - the canvas object to be added to the layoutpublic void addMember(Canvas component)
component - the canvas object to be added to the layout
public void addMember(Widget widget,
int position)
public void addMember(Canvas component,
int position)
component - 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(Object componentJS)
protected void addMemberPostCreate(Object componentJS)
protected void addMemberPreCreate(Object componentJS,
int position)
protected void addMemberPostCreate(Object componentJS,
int position)
public void setPlaceHolderProperties(Canvas placeHolderProperties)
throws 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
IllegalStateException - this property cannot be changed after the component has been created
public void setPlaceHolderDefaults(Canvas placeHolderDefaults)
throws 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 {...}
IllegalStateException - this property cannot be changed after the component has been created
public void setDefaultLayoutAlign(Alignment alignment)
throws IllegalStateException
layoutAlign.
alignment - defaultLayoutAlign Default value is null
IllegalStateException - this property cannot be changed after the component has been created
public void setDefaultLayoutAlign(VerticalAlignment alignment)
throws IllegalStateException
layoutAlign.
alignment - defaultLayoutAlign Default value is null
IllegalStateException - this property cannot be changed after the component has been created
public void setDropLineProperties(Canvas dropLineProperties)
throws IllegalStateException
IllegalStateExceptionpublic void setAlign(Alignment alignment)
setAlign in class Canvasalignment - alignment Default value is nullpublic void setAlign(VerticalAlignment alignment)
alignment - alignment Default value is nullpublic 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 show
public 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 hide
public 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.
index - index for the member
public Canvas getMember(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.
member - the member
public int getMemberNumber(String memberID)
If passed a number, just returns it.
memberID - identifier for the required member
public com.smartgwt.logicalstructure.core.LogicalStructureObject setLogicalStructure(com.smartgwt.logicalstructure.widgets.layout.LayoutLogicalStructure s)
public com.smartgwt.logicalstructure.core.LogicalStructureObject getLogicalStructure()
getLogicalStructure in interface LogicalStructuregetLogicalStructure in class Canvas
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||