Class Canvas
- All Implemented Interfaces:
HasAttachHandlers
,HasHandlers
,EventListener
,HasVisibility
,IsWidget
,LogicalStructure
,HasClearHandlers
,HasClickHandlers
,HasDoubleClickHandlers
,HasDragMoveHandlers
,HasDragRepositionMoveHandlers
,HasDragRepositionStartHandlers
,HasDragRepositionStopHandlers
,HasDragResizeMoveHandlers
,HasDragResizeStartHandlers
,HasDragResizeStopHandlers
,HasDragStartHandlers
,HasDragStopHandlers
,HasDropHandlers
,HasDropMoveHandlers
,HasDropOutHandlers
,HasDropOverHandlers
,HasFocusChangedHandlers
,HasHoverHandlers
,HasHoverHiddenHandlers
,HasKeyDownHandlers
,HasKeyPressHandlers
,HasMouseDownHandlers
,HasMouseMoveHandlers
,HasMouseOutHandlers
,HasMouseOverHandlers
,HasMouseStillDownHandlers
,HasMouseUpHandlers
,HasMouseWheelHandlers
,HasMovedHandlers
,HasParentMovedHandlers
,HasResizedHandlers
,HasRightMouseDownHandlers
,HasRuleContextChangedHandlers
,HasScrolledHandlers
,HasShowContextMenuHandlers
,HasVisibilityChangedHandlers
- Direct Known Subclasses:
AceEditor
,BrowserPlugin
,Calendar
,DetailViewer
,DrawKnob
,DrawPane
,DynamicForm
,EdgedCanvas
,EditPane
,GridRenderer
,HTMLFlow
,Layout
,LayoutSpacer
,PrintCanvas
,RangeSlider
,RowRangeDisplay
,Slider
,StatefulCanvas
,TabSet
,TileLayout
,WidgetCanvas
FormItems
). Canvas provides:
- basic visual lifecycle support - creation and destruction of HTML via
draw()
andclear()
, visibility viashow()
andhide()
, z-layering viabringToFront()
andsendToBack()
. - consistent cross-browser
positioning
,sizing
andsize detection
, with automatic compensation forbrowser CSS behavior differences
. - clipping, scrolling and overflow management of content via
overflow
- consistent cross-browser
key
andmouse
events, includingmapping touch events
to mouse events - built-in drag and drop
capabilities including
moving
,resizing
,drag scrolling
andsnap-to-grid
behavior. - the ability to either contain
HTML content
orcontain other Canvases
, includingan edge-based positioning
andpercent sizing system
for children. For more advanced layout capabilities, seeLayout
. - various other details like
cursors
,modal masking
,animation
,accessibility properties
, andsettings
forautomated testing
.
-
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, factoryCreated, factoryProperties, id, nativeObject, scClassName
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds newChild as a child of this widget, set up a named object reference (i.e., this[name]) to the new widget if name argument is provided, and draw the child if this widget has been drawn already.Adds newChild as a child of this widget, set up a named object reference (i.e., this[name]) to the new widget if name argument is provided, and draw the child if this widget has been drawn already.Adds newChild as a child of this widget, set up a named object reference (i.e., this[name]) to the new widget if name argument is provided, and draw the child if this widget has been drawn already.Adds newChild as a child of this widget, set up a named object reference (i.e., this[name]) to the new widget if name argument is provided, and draw the child if this widget has been drawn already.addClearHandler
(ClearHandler handler) Add a clear handler.addClickHandler
(ClickHandler handler) Add a click handler.addDoubleClickHandler
(DoubleClickHandler handler) Add a doubleClick handler.addDragMoveHandler
(DragMoveHandler handler) Add a dragMove handler.Add a dragRepositionMove handler.Add a dragRepositionStart handler.Add a dragRepositionStop handler.Add a dragResizeMove handler.Add a dragResizeStart handler.Add a dragResizeStop handler.addDragStartHandler
(DragStartHandler handler) Add a dragStart handler.addDragStopHandler
(DragStopHandler handler) Add a dragStop handler.addDropHandler
(DropHandler handler) Add a drop handler.addDropMoveHandler
(DropMoveHandler handler) Add a dropMove handler.addDropOutHandler
(DropOutHandler handler) Add a dropOut handler.addDropOverHandler
(DropOverHandler handler) Add a dropOver handler.Add a focusChanged handler.addHoverHandler
(HoverHandler handler) Add a hover handler.addHoverHiddenHandler
(HoverHiddenHandler handler) Add a hoverHidden handler.addKeyDownHandler
(KeyDownHandler handler) Add a keyDown handler.addKeyPressHandler
(KeyPressHandler handler) Add a keyPress handler.addMouseDownHandler
(MouseDownHandler handler) Add a mouseDown handler.addMouseMoveHandler
(MouseMoveHandler handler) Add a mouseMove handler.addMouseOutHandler
(MouseOutHandler handler) Add a mouseOut handler.addMouseOverHandler
(MouseOverHandler handler) Add a mouseOver handler.Add a mouseStillDown handler.addMouseUpHandler
(MouseUpHandler handler) Add a mouseUp handler.addMouseWheelHandler
(MouseWheelHandler handler) Add a mouseWheel handler.addMovedHandler
(MovedHandler handler) Add a moved handler.addParentMovedHandler
(ParentMovedHandler handler) Add a parentMoved handler.Adds newPeer as a peer of this widget (also making it a child of this widget's parent, if any), set up a named object reference (i.e., this[name]) to the new widget if name is provided, and draw the peer if this widget has been drawn already.Adds newPeer as a peer of this widget (also making it a child of this widget's parent, if any), set up a named object reference (i.e., this[name]) to the new widget if name is provided, and draw the peer if this widget has been drawn already.addResizedHandler
(ResizedHandler handler) Add a resized handler.Add a rightMouseDown handler.Add a ruleContextChanged handler.addScrolledHandler
(ScrolledHandler handler) Add a scrolled handler.Add a showContextMenu handler.void
addSnapAlignCandidate
(Canvas newCandidate) Add a candidate tosnapAlignCandidates
.void
addStyleName
(String style) Multiple styles are currently not supported.Add a visibilityChanged handler.void
adjustForContent
(boolean immediate) This method tells a component to adjust for changes in the size of its content that happen outside of Smart GWT APIs.void
animateFade
(int opacity) Animate a change in opacity from the widget's current opacity to the specified opacity.void
animateFade
(int opacity, AnimationCallback callback) Animate a change in opacity from the widget's current opacity to the specified opacity.void
animateFade
(int opacity, AnimationCallback callback, int duration) Animate a change in opacity from the widget's current opacity to the specified opacity.void
animateFade
(int opacity, AnimationCallback callback, int duration, AnimationAcceleration acceleration) Animate a change in opacity from the widget's current opacity to the specified opacity.void
animateFade
(Integer opacity) Animate a change in opacity from the widget's current opacity to the specified opacity.void
animateFade
(Integer opacity, AnimationCallback callback) void
animateFade
(Integer opacity, AnimationCallback callback, Integer duration) void
animateFade
(Integer opacity, AnimationCallback callback, Integer duration, AnimationAcceleration acceleration) Animate a change in opacity from the widget's current opacity to the specified opacity.void
Hide a canvas by shrinking it with default effect specified byanimateHideEffect
.void
animateHide
(AnimationEffect effect) Hide a canvas by shrinking it vertically to zero height over a period of time.void
animateHide
(AnimationEffect effect, AnimationCallback callback) Hide a canvas by shrinking it vertically to zero height over a period of time.void
animateHide
(AnimationEffect effect, AnimationCallback callback, int duration) Hide a canvas by shrinking it vertically to zero height over a period of time.void
animateHide
(AnimateShowEffect effect) Hide a canvas by shrinking it vertically to zero height over a period of time.void
animateHide
(AnimateShowEffect effect, AnimationCallback callback) Hide a canvas by shrinking it vertically to zero height over a period of time.void
animateHide
(AnimateShowEffect effect, AnimationCallback callback, int duration) Hide a canvas by shrinking it vertically to zero height over a period of time.void
animateMove
(Integer left, Integer top) Animate a reposition of this canvas from its current position to the specified positionvoid
animateMove
(Integer left, Integer top, AnimationCallback callback) void
animateMove
(Integer left, Integer top, AnimationCallback callback, Integer duration) void
animateMove
(Integer left, Integer top, AnimationCallback callback, Integer duration, AnimationAcceleration acceleration) Animate a reposition of this canvas from its current position to the specified positionvoid
animateRect
(Integer left, Integer top, Integer width, Integer height) Animate a reposition / resize of this canvas from its current size and position.void
animateRect
(Integer left, Integer top, Integer width, Integer height, AnimationCallback callback) void
animateRect
(Integer left, Integer top, Integer width, Integer height, AnimationCallback callback, Integer duration) void
animateRect
(Integer left, Integer top, Integer width, Integer height, AnimationCallback callback, Integer duration, AnimationAcceleration acceleration) Animate a reposition / resize of this canvas from its current size and position.void
animateResize
(Integer width, Integer height) Animate a resize of this canvas from its current size to the specified sizevoid
animateResize
(Integer width, Integer height, AnimationCallback callback) void
animateResize
(Integer width, Integer height, AnimationCallback callback, Integer duration) void
animateResize
(Integer width, Integer height, AnimationCallback callback, Integer duration, AnimationAcceleration acceleration) Animate a resize of this canvas from its current size to the specified sizevoid
animateScroll
(int scrollLeft, int scrollTop, AnimationCallback callback) Animate a scroll from the current scroll position to the specified position.void
animateScroll
(int scrollLeft, int scrollTop, AnimationCallback callback, int duration) Animate a scroll from the current scroll position to the specified position.void
animateScroll
(Integer scrollLeft, Integer scrollTop) Animate a scroll from the current scroll position to the specified position.void
animateScroll
(Integer scrollLeft, Integer scrollTop, AnimationCallback callback) void
animateScroll
(Integer scrollLeft, Integer scrollTop, AnimationCallback callback, Integer duration) void
animateScroll
(Integer scrollLeft, Integer scrollTop, AnimationCallback callback, Integer duration, AnimationAcceleration acceleration) Animate a scroll from the current scroll position to the specified position.void
Show a canvas by growing it with default effect specified byanimateShowEffect
.void
animateShow
(AnimationEffect effect) Show a canvas by growing it vertically to its fully drawn height over a period of time.void
animateShow
(AnimationEffect effect, AnimationCallback callback) Show a canvas by growing it vertically to its fully drawn height over a period of time.void
animateShow
(AnimationEffect effect, AnimationCallback callback, int duration) Show a canvas by growing it vertically to its fully drawn height over a period of time.void
animateShow
(AnimateShowEffect effect) Show a canvas by growing it vertically to its fully drawn height over a period of time.void
animateShow
(AnimateShowEffect effect, AnimationCallback callback) Show a canvas by growing it vertically to its fully drawn height over a period of time.void
animateShow
(AnimateShowEffect effect, AnimationCallback callback, int duration) Show a canvas by growing it vertically to its fully drawn height over a period of time.static <T extends Canvas>
TasSGWTComponent
(JavaScriptObject jsObj) Returns the existing SGWT widget, or creates and returns one if none exist, associated with the suppliedJavaScriptObject
.void
blur()
If this canvas has keyboard focus, blur it.void
Puts this widget at the top of the stacking order, so it appears in front of all other widgets in the same parent.static void
changeAutoChildDefaults
(String autoChildName, Canvas defaults) Changes the defaults for Canvas AutoChildren namedautoChildName
.static void
changeAutoChildDefaults
(String autoChildName, FormItem defaults) Changes the defaults for FormItem AutoChildren namedautoChildName
.void
clear()
Remove all visual representation of a Canvas, including all child or member Canvases, or managed top-level components such as the ListGrid drop location indicator.void
If an explicittabIndex
was assigned to this widget, clear it.Determines whether a clickmask is showingclickMaskUp
(String ID) Determines whether a clickmask is showingReturns true if element is a descendant of this widget (i.e., exists below this widget in the containment hierarchy); and false otherwise.Returns true if element is a descendant of this widget (i.e., exists below this widget in the containment hierarchy); and false otherwise.Return true if the last event's mouse coordinates are within the bounds of this component.Returns true if the currentmouse event target
is this component or a descendent of this component.Returns true if the keyboard focus is in this Canvas or any child of this Canvas.containsPoint
(int x, int y) Return whether or not this object contains the specified global (x,y) coordinates.containsPoint
(int x, int y, Boolean withinViewport) Return whether or not this object contains the specified global (x,y) coordinates.protected JavaScriptObject
create()
void
Notification method fired whenDataContext
is bound.void
deparent()
Remove this canvas from its parent if it has one.void
depeer()
Make this Canvas no longer a peer of its mastervoid
disable()
Disables this widget and any children and peers of this widget.void
enable()
Enables this widget and any children / peers of this widget.Returns true if the rectangle of this widget encloses the rectangle of the specified widget.void
focus()
If this canvas can accept focus, give it keyboard focus.void
Shifts focus to the next focusable element after this one, skipping any elements nested inside the tabbing group for this canvas, such as focusable children.void
focusAtEnd
(boolean start) Shifts focus to the start or end of this canvas and its descendants.void
Shifts focus to the next focusable element after this one.void
Shifts focus to the previous focusable element before this one.int
This method is similar togetPageLeft()
.int
This method is similar togetPageTop()
.If specified this governs the HTML accessKey for the widget.If multiple widgets in the same Layout haveadaptive width
,adaptiveWidthPriority
can be set to indicate which of the components should be given priority access to space.Should focus navigation for this canvas and its descendents be handled explicitly by intercepting "Tab" key events and calling theTabIndexManager.shiftFocus()
API?Should this browser always show custom scrollbars ifshowCustomScrollbars
is true?Default acceleration effect to apply to all animations on this Canvas.Default time for performing an animated fade.Default acceleration function for performing an animated hide.Default animation effect to use ifanimateHide()
is called without an explicit effect parameter.Default time for performing an animated hide.Default acceleration effect for performing an animated move.Default time for performing an animated move.Default acceleration function for performing an animated move and resize.Default time for performing an animated setRect.Default acceleration function for performing an animated resize.When to update thechild layout
for asize animation
.Default time for performing an animated resize.Default acceleration function for performing an animated scroll.Default time for performing an animated scroll.Default acceleration function for performing an animated show.Default animation effect to use ifanimateShow()
is called without an explicit effect parameter.Default time for performing an animated show.int
Default total duration of animations.Default directory for app-specific images, relative to the Page-wideappImgDir
.Returns the DOM ID for the main element for this canvas which will have ARIArole
andattributes
applied to it.ARIA role of this component.Retrieves dynamically calculated default ARIA state properties for this canvas.Deprecated.This initialization property allows developers to create a canvas using the Class.addAutoChild() method, and have it added as a child to some other component.If adataContext
is provided, should subcomponents automatically bind to the data?If set to true, the widget's parent (if any) will automatically be shown whenever the widget is shown.The background color for this widget.URL for a background image for this widget (corresponding to the CSS "background-image" attribute).Specifies how the background image should be positioned on the widget.Specifies how the background image should be tiled if this widget is larger than the image.Set the CSS border of this component, as a CSS string including border-width, border-style, and/or color (eg "2px solid blue").The CSS border-radius for this widget.int
Return the bottom coordinate of this object as rendered, relative to its enclosing context, in pixels.static Canvas
Retrieve a Canvas by its globalID
.static Canvas
getByJSObject
(JavaScriptObject jsObj) Retrieve a Canvas from itsJavaScriptObject
.getByLocalId
(String ID) Retrieve a child of this Canvas by it's local ID.Indicates that this object can receive dropped widgets (i.e.SeecanAdaptWidth
.Indicates that this component is able to render itself at multiple possible sizes, in order to fit into less space when very little space is available, or to display more information or provide more immediate access to functionality when more space is available.Indicates whether this widget can initiate custom drag-and-drop operations (other than reposition or resize).Indicates whether this widget can be moved by a user of your application by simply dragging with the mouse.Indicates whether this widget can be resized by dragging on the edges and/or corners of the widget with the mouse.boolean
If this Canvas is canAcceptDrop:true, when the user drags a droppable widget over an edge of the widget, should we scroll to show the rest of the widget's content? Returned from canvas.shouldDragScroll() if there are scrollbars.Indicates that this object can be dropped on top of other widgets.When explicitly set to false, disallows drop before this member in the Layout.Can this widget be allowed to become the target of keyboard events?Will this Canvas fire hover events when the user hovers over it, or one of its children?Whether native drag selection of contained text is allowed within this Canvas.final Canvas
getCanvasAutoChild
(String autoChildName) Returns theCanvas
AutoChild namedautoChildName
if already created.If this canvas is being displayed in aCanvasItem
, this property will be set to point at the item.Canvas[]
Array of all Canvii that are immediate children of this Canvas.Flag to disable snapping to alignment when children of this Canvas are resizedIf enabled whilechildrenSnapToGrid
is enabled, children dragged within this Canvas will also snap to positions where their edges or center lines would be aligned with the edges or centers of other components, and lines will be shown to point out the possible alignment (with appearance controlled bysnapAlignCenterLineStyle
andsnapAlignEdgeLineStyle
respectively.SeechildrenSnapAlign
.SeechildrenSnapAlign
.If true, causes this canvas's children to snap to its grid when resizing.If true, causes this canvas's children to snap to its grid when dragging.getChildTabPosition
(Canvas child) For a given child widget whereupdateTabPositionOnReparent
is true, return the expected tab position within this parent.Returns the JavaScript class name.Automatically generated mask canvas displayed whenshowComponentMask()
is called.Defaults for thecomponentMask
autoChild.Returns the DOM element for this Canvas which contains thecontents
, or forparent components
, the DOM elements for any drawn children.The contents of a canvas or label widget.Context menu to show for this object, an instance of the Menu widget.Whether the Framework should correct for erroneous scrollHeight and scrollWidth values reported by the browser when zoomed (via browser or OS-level zoom) by allowingmaxZoomOverflowError
of overflow before enabling scrolling and displaying custom scrollbars.Specifies the css cursor image to display when the mouse pointer is over this component.A mapping fromDataSource
IDs to specificRecords
from those DataSources, thatDataBoundComponents
contained within this Canvas should automatically bind to if a DataSource is provided but data is not provided (directly or indirectly, for example, indirectly via settingListGrid.autoFetchData
.A dataPath may be specified on any canvas.int
For custom components, establishes a default height for the component.int
For custom components, establishes a default width for the component.This attribute denotes the name of a property to use as agetDefiningPropertyName()
for this property when generating and resolvingAutoTest locators with search segments
.String[]
If no explicitdefiningProperty
was specified for this component, this array denotes a list of options to use as adefining property
when generating and resolvingAutoTest locators with search segments
.If this property is set totrue
, thedestroy()
method has been called on this canvas.This property is set to true when thedestroy()
method is called on a widget.boolean
If set to true, the widget will be disabled.Specifies the cursor image to display when the mouse pointer is over this widget if this widget is disabled.DisablesuseTouchScrolling
whenever a built-in drag operation has been enabled which is known to be non-functional if touch scrolling is enabled.int
Amount of time (in milliseconds) between which two clicks are considered a single clickVisual appearance to show when the object is being dragged.This indicates how the system will test for droppable targets: either by intersection with the mouse or intersection with the rectangle of the dragMoveTarget.This property controls what kind of mask is used in caseuseDragMask
is enabled.int
Sets maximum height that this Canvas can be resized to by a user.int
Maximum width that this Canvas can be resized to by a user.int
Minimum height that this Canvas can be resized to by a user.int
Minimum width that this Canvas can be resized to by a user.If this widget has dragAppearance"target"
, this value specifies the opacity to render the target while it is being dragged.IfcanDragReposition
is true, this attribute specifies the visual appearance to show during drag reposition.Cursor to switch to if the mouse is over a widget that is drag repositionable.IfcanDragResize
is true, this attribute specifies the visual appearance to show during drag resize.int
If this widget supports drag-scrolling, This property specifies how many ms the user must hover over the drag-scroll threshold before scrolling begins.int
Number of pixels the cursor needs to move before the EventHandler starts a drag operation.A different widget that should be actually dragged when dragging initiates on this widget.A different widget that should be actually dragged when dragging initiates on this widget.Sets adragType
for this widget used, to be compared todropTypes
on possible drop target widgets.Delegates a different widget that should actually be dropped on if the cursor is over this widget when the drop completes.Delegates a different widget that should actually be dropped on if the cursor is over this widget when the drop completes.String[]
When a drag and drop interaction occurs, if adragType
is configured on the source widget, it is compared to thedropTypes
configured on the target widget, and a drop is only allowed if thedragType
is listed in the target widget'sdropTypes
array.When a drag and drop interaction occurs, if adragType
is configured on the source widget, it is compared to thedropTypes
configured on the target widget, and a drop is only allowed if thedragType
is listed in the target widget'sdropTypes
array.Dynamic contents allows the contents string to be treated as a simple but powerful template.Background color for the EdgedCanvas created to decorate this component.Background color for the center section only.Base name of images for edges.int
How far into the edge of an object do we consider the "edge" for drag resize purposes?Amount the contained Canvas should be offset.Opacity of the edges.Whether to show media in the center section, that is, behind the decorated Canvas.int
Size in pixels for corners and edgesAnEditProxy
controls the behaviors of a component when it is placed intoediting mode
.Default class used to construct theEditProxy
for this component when the component isfirst placed into edit mode
.Normal usage of SmartGWT is to call draw() on SmartGWT widgets, not to use use RootPanel.add().getElement
(boolean allowPreRender) Criteria to be evaluated to determine whether this Canvas should be enabled.Whether this canvas should end the line it's in when used as a tile in aFlowLayout
.static EdgeName
Check if an event is within an "edge" of this canvas.static EdgeName
getEventEdge
(EdgeName... edgeMask) Check if an event is within an "edge" of this canvas.int
When this Canvas is included as a member in a Layout, extra blank space that should be left after this member in a Layout.boolean
IfshowCustomScrollbars
is true, should the scrollbars be drawn floating over the component handle, or should the handle shrink to accommodate them?final FormItem
getFormItemAutoChild
(String autoChildName) Returns theFormItem
AutoChild namedautoChildName
if already created.If true, events sent to the SVG inside an object tag are forwarded to the object itself by Framework handlers.Returns a fully qualifiedDataPath
for this canvas.Sets the style for the grouping frame around the canvas.If set, the background color of the grouping label.Sets the style for the grouping label.Padding to apply inside the border when this canvas is showing a groupborder and label
.The title/label for the grouping.Thecanvas.width
attribute specifies the size for a component's horizontal dimension;canvas.height
specifies the size for the vertical dimension.boolean
When this widget is hidden (seevisibility
andhide()
), should display:none be applied to theouter element
?Ifthis.showHover
is true, this property can be used to customize the alignment of content in the hover canvas.Ifthis.showHover
is true andgetHoverComponent()
is implemented, should the hoverCanvas returned from it be automatically destroyed when it is hidden?int
Maximum auto-fit width for a hover ifhoverAutoFitWidth
is enabled.Maximum auto-fit width for a hover ifhoverAutoFitWidth
is enabled.ifshowHover
is true, this property will cause the specifiedhoverWidth
to be treated as a minimum width for the hover.WhenshowHoverComponents
is true, this method is called to get the component to show as a hover for this Canvas.int
Ifthis.canHover
is true, how long should the mouse be kept over this widget before the hover event is firedFor canvasesshowing a hover
, this attribute gives users a way to pin the hover in place so they can interact with it (scroll it, click embedded links, etc).Ifthis.showHover
is true, this property can be used to customize the height of the hover canvas shown.Ifthis.showHover
is true, when the user holds the mouse over this Canvas for long enough to trigger a hover event, a hover canvas is shown by default.Ifthis.showHover
is true, should this widget's hover canvas be moved with the mouse while visible?Ifthis.showHover
is true, should the hover canvas be shown with opacity other than 100?Allows interaction with hovers when the cursor is positioned over them.Screen to create (viacreateScreen()
) in lieu of callinggetHoverComponent()
.Ifthis.showHover
is true, this property can be used to specify the css style to apply to the hover canvas.Ifthis.showHover
is true, this property can be used to customize the vertical alignment of content in the hover canvas.int
Ifthis.showHover
is true, this property can be used to customize the width of the hover canvas shown.Ifthis.showHover
is true, this property can be used to customize the whether content in the hover canvas is displayed in a single line, or wraps.int
getHSnapPosition
(int coordinate) Override this method to provide a custom snap-to grid.int
getHSnapPosition
(int coordinate, String direction) Override this method to provide a custom snap-to grid.If specified as a pointer to an HTML element present in the DOM, this canvas will be rendered inside that element ondraw()
.If specified as a pointer to an HTML element present in the DOM, this canvas will be rendered inside that element ondraw()
.IfhtmlElement
is specified, this attribute specifies the position where the canvas should be inserted relative to thehtmlElement
in the DOM.Retrieve a native image, SVG object element or the container for an SVG symbol or font-icon, by name.static String
Return the full URL for an image to be drawn in this canvas.static String
Return the full URL for an image to be drawn in this canvas.int
Returns the amount of space available for interior content (or relatively positioned child widget(s)) without introducing clipping, scrolling or overflow.
This is the space within the viewport of the widget (not including padding, and excluding margins, borders or scrollbars) rendered at its specified size.int
Returns the amount of space available for interior content (or relatively positioned child widget(s)) without introducing clipping, scrolling or overflow.
This is the space within the viewport of the widget (not including padding, and excluding margins, borders or scrollbars) rendered at its specified size.int
Returns the amount of space available for (an) absolutely positioned child widget(s) or absolutely positioned HTML content, without introducing clipping, scrolling or overflow.int
Returns the amount of space available for absolutely positioned child widget(s) or absolutely positioned HTML content, without introducing clipping, scrolling or overflow.boolean
Should a grouping frame be shown around this canvas if a non-empty string has been specified forgroupTitle
.This boolean flag will be set to true by framework logic while generating print HTML for this widget as a result to a call toshowPrintPreview()
(or justgetPrintHTML()
).Marks this Canvas as theruleScope
that will be discovered by any containedDataBoundComponent
s which do not specify an explicitruleScope
.Flag to disable snapping to alignment against this Canvas when other Canvases dragged into the same parent whenchildrenSnapAlign
is enabled on this Canvas' parent.Constrains drag-resizing and drag-repositioning of this canvas to either the rect of its parent (if set to true) or an arbitrary rect based on its parent (if set to a [Left,Top,Width,Height] rect array).When this Canvas is included as a member in a Layout, layoutAlign controls alignment on the breadth axis of the layout.When showing this widget in agroup
, should any content be shifted down so that the group-label doesn't sit in front of it?If set, overrides the globaldefaultPageSpace
.int
getLeft()
Number of pixels the left side of the widget is offset to the right from its default drawing context (either its parent's topleft corner, or the document flow, depending on the value of theposition
property).Number of pixels the left side of the widget is offset to the right from its default drawing context (either its parent's topleft corner, or the document flow, depending on the value of theposition
property).Retrieve the local ID of this canvas.boolean
Iftrue
, when retrieving alocator
for this component always return a reference directly to this component bywidget ID
, using the compact format"///canvasID"
, ignoring any parent elements and ignoring any configuredtestRoot
.Strategy to use when locating children in this canvas from an autoTest locator string.LocatorTypeStrategy
to use when finding children within this canvas.Strategy to use when locating peers of this canvas from an autoTest locator string.LocatorTypeStrategy
to use when finding peers of this canvas.Local name for referencing this canvas from an autoTest locator string.Getter implementing theLogicalStructure
interface, which supports Eclipse's logical structure debugging facility.Set the CSS Margin, in pixels, for this component.Returns this canvas's "master" (the canvas to which it was added as a peer), if any.Deprecated.In favor orgetMasterCanvas()
as of Smart GWT release 9.1IfhtmlElement
is specified, should this canvas be drawn at the same dimensions as the htmlElement?
See alsomatchElementWidth
andmatchElementHeight
For canvases with a specifiedhtmlElement
wherepersistentMatchElement
is set to true, how should the canvas match the element's height?For canvases with a specifiedhtmlElement
wherepersistentMatchElement
is set to true, how should the canvas match the element's width?int
Maximum height available to this Canvas.int
Maximum width available to this Canvas.int
WhencorrectZoomOverflow
is true and browser or OS-level zoom is active, determines how much overflow must occur before the Framework enables scrolling for this canvas.Default class used to construct menus created by this component, including context menus.int
Minimum height available to this Canvas.int
If the widget has drag resize configured on one or more of it's edges, and the edgeMarginSize is large enough that the remaining space is less thanminNonEdgeSize
, the edgeMarginSize will be reduced such that the non-edge part of the widget is at least 1/3 of the total space (with two draggable edges) or half of it (with one draggable edge).int
Minimum width available to this Canvas.double
The minimum speed in pixels per second that must be reached for momentum scrolling to kick in.int
Amount of time (in milliseconds) between repeated 'mouseStillDown' events for this canvas.int
Amount of time (in milliseconds) before mouseStillDown events start to be fired repeatedly for this canvas.getName()
Optional name for the canvas, which can later be used to reference it.In some platform/browser configurations, scrollable regions do not show visible scrollbars until the user attempts to interact with the region.int
get the next zIndex for the next item to be drawn.If true, this canvas will receive all mouse-clicks as singleclick
events rather than asdoubleClick
events.Specifies the cursor image to display when the user drags a droppable canvas over this if it is not a valid drop target for the event andshowNoDropIndicator
is true.int
int
int
Return the X-coordinate of the last event relative to the left edge of the content of this Canvas.
NOTE: To get a coordinate relative to the viewport of this Canvas, subtract this.getScrollLeft()int
Return the Y-coordinate of the last event, relative to the top edge of the content of this Canvas.
NOTE: To get a coordinate relative to the viewport of this Canvas, subtract this.getScrollTop()Renders the widget to be partly transparent.static Canvas
getOrCreateRef
(JavaScriptObject jsObj) Returns the outer DOM element of this Canvas.Controls what happens when the drawn size of the content of a Canvas is either greater or smaller than the specified size of the Canvas.Set the CSS padding of this component, in pixels.int
Return the page-relative bottom coordinate of this object, in pixels.int
Returns the page-relative left coordinate of the widget on the page, in pixels.int
Return the page-relative right coordinate of this object, in pixels.int
Returns the page-relative top coordinate of the widget on the page, in pixelsThis method returns a Map of config properties suitable for use as the "defaults" attribute of aPaletteNode
.Returns this Canvas's "panel container".This Canvas's immediate parent, if any.Deprecated.As of Smartclient version 9.1, deprecated in favor ofparentCanvas
andgetParentCanvas()
Canvas[]
getPeers()
Array of all Canvii that are peers of this Canvas.CSS class used to apply additional styles to this canvas whenshowPendingMarker()
is called, or whenpendingMarkerVisible
has been set.This attribute indicates whether thepending marker class
should be appended to the list of CSS classes applied to this canvas.Governs the model to be used when sizing canvases with percentage width or height, or positioning widgets with a specifiedsnapTo
.If this canvas has its size specified as a percentage, this property allows the user to explicitly designate another canvas upon which sizing will be based.If this canvas has a specifiedhtmlElement
andmatchElement
is set to true, should the canvas perform a one time resize to fit the target element on draw, or should it continue to match the target element as its size changes due to page reflows?Detail settings of thepointer
such as where it should be located along the outside of the canvas.This property in conjunction with thepointerSettings.snapTo
places the canvas in relation to the target canvas.This property in conjunction with thepointerSettings.snapTo
places the canvas in relation to the target canvas.Absolute or relative, corresponding to the "absolute" (with respect to parent) or "relative" (with respect to document flow) values for the CSS position attribute.Should this canvas print its children absolutely positioned when generatingprintable HTML
.getPrintHTML
(PrintProperties printProperties, PrintHTMLCallback callback) Retrieves printable HTML for this component and all printable subcomponents.static void
getPrintHTML
(Object[] components, PrintProperties printProperties, PrintHTMLCallback callback) Returns print-formatted HTML for the specified list of components.The CSS class to apply when printing this widget.Prompt displayed in hover canvas ifshowHover
is true.String[]
IfproportionalResizing
is set toProportionalResizeMode.MODIFIER
orProportionalResizeMode.MODIFIER_OFF
then proportional resizing of the DrawItem is activated or deactivated, respectively, whenever at least one key in this set of modifier keys is pressed.IfcanDragResize
is true, this property specifies the conditions for when proportional resizing is used.boolean
Whether this canvas should receiveevents
from its scrollbars, which arepeers
.getRect()
Get all four coordinates, relative to the enclosing context, at one.Should this element be redrawn in response to a resize?When this Canvas is included as a member in a Layout, andshowResizeBar
is set totrue
so that a resizeBar is created,resizeBarTarget:"next"
can be set to indicate that the resizeBar should resize the next member of the layout rather than this one.EdgeName[]
When drag resizing is enabled viacanDragResize
, restricts resizes to only certain edges or corners.int
getRight()
Return the right coordinate of this object as rendered, relative to its enclosing context, in pixels.Get the current value of the rule context collected by theruleScope
of this component (which may be this component itself or whatever component is managing theruleScope
for this component).getRuleContext
(boolean databoundOnly) Get the current value of the rule context collected by theruleScope
of this component (which may be this component itself or whatever component is managing theruleScope
for this component).ID
of the component that gathers the context for evaluation of criteria-based rules specified by properties such asFormItem.visibleWhen
, Dynamic Properties, andDynamicCriteria
such asListGrid.initialCriteria
.int
How thick should we make the scrollbars for this canvas.int
Returns the scrollTop required to scroll vertically to the end of this widget's content.int
Returns the scrollable height of the widget's contents, including children, ignoring clipping.int
Get the number of pixels this Canvas is scrolled from its left edge.int
Returns the scrollLeft required to scroll horizontally to the end of this widget's content.int
Get the number of pixels this Canvas is scrolled from its top edge.int
Returns the scrollable width of the widget's contents, including children, ignoring clipping.Color for the css-based drop shadow shown ifuseCSSShadow
is true andshowShadow
is true.int
Depth of the shadow, or the virtual height above the page of the widget throwing the shadow.Horizontal offset for theshadow
.IfuseCSSShadow
is false, (or for browsers that do not support css3), this property supplies the base name of the series of images for the sides, corners, and center of the shadow.Offset of the shadow.Softness, or degree of blurring, of the shadow.Explicit spread for the css-based drop shadow shown ifuseCSSShadow
is true andshowShadow
is true.Vertical offset for theshadow
.Whether this canvas should be included in a printable view.boolean
Whether to use the browser's native scrollbars or Smart GWT-based scrollbars.When this widget is dragged, if its dragAppearance is"target"
, should we show a shadow behind the canvas during the drag.Whether anEdgedCanvas
should be used to show image-based edges around this component.Ifthis.canHover
is true, should we show the global hover canvas by default when the user hovers over this canvas?When set to true, shows a widget hovering at the mouse point instead of the builtin hover label.Should a pointer be shown? A pointer can be placed on the border to identify the target of the canvas contents.When this Canvas is included as a member in aLayout
, whether a resizeBar should be shown after this member in the layout, to allow it to be resized.Whether to show a drop shadow for this Canvas.Whether to show a snap grid for this Canvas.boolean
This is an advanced setting.Is it possible that a call toredraw()
on this widget will change its size?Default directory for skin images (those defined by the class), relative to the Page-wideskinDir
.Canvas[]
WhenchildrenSnapAlign
is enabled, list of candidates to check for alignment.CSS border declaration used for the line shown to indicate snapping to a center line whenchildrenSnapAlign
is set.CSS border declaration used for the line shown to indicate snapping to a edge line whenchildrenSnapAlign
is set.Describes which axes to apply snap-to-grid to.IfsnapTo
is defined to this widget, this property can be used to define which edge of this widget should be snapped to an edge of the master or parent element.Specifies line styling to use when drawing the grid of lines forSnapGridStyle
: "lines".Specifies indication style to use for snap points, either a grid of lines or an array of crosses.The horizontal snap direction.int
The horizontal grid size to use, in pixels, when snap-to-grid is enabled.IfsnapTo
is defined for this widget, this property can be used to specify an offset in px or percentage for the left coordinate of this widget.IfsnapTo
is defined for this widget, this property can be used to specify an offset in px or percentage for the top coordinate of this widget.When this canvas is dropped onto an object supporting snap-to-grid, should it snap to the grid (true, the default) or just drop wherever the mouse is (false).static Point
getSnapPosition
(Canvas target, String snapTo, Canvas snapper) Return the position forsnapper
to be placed in order to "snap to" an edge or corner oftarget
, in the same sense assnapTo
.static Point
getSnapPosition
(Canvas target, String snapTo, Canvas snapper, String snapEdge) Return the position forsnapper
to be placed in order to "snap to" an edge or corner oftarget
, in the same sense assnapTo
.Flag to disable snapping to alignment when this Canvas is resized.Causes this canvas to snap to its parent's grid when resizing.Position this widget such that it is aligned with ("snapped to") an edge of itsmaster
(if specified), or itsparent canvas
.Flag to disable snapping to alignment when this Canvas is dragged whenchildrenSnapAlign
is enabled on this Canvas' parent.Flag to disable snapping to center alignment when this Canvas is dragged whenchildrenSnapAlign
is enabled on this Canvas' parent.Flag to disable snapping to edge alignment when this Canvas is dragged whenchildrenSnapAlign
is enabled on this Canvas' parent.Causes this canvas to snap to its parent's grid when dragging.The vertical snap direction.int
The vertical grid size to use, in pixels, when snap-to-grid is enabled.Whether this canvas should always start a new line when used as a tile in aFlowLayout
.The CSS class applied to this widget as a whole.If specified this governs the tabIndex of the widget in the page's tab order.ADataContext
to be used if nodataContext
is provided (directly or indirectly via a parent).protected Canvas
getTitle()
Synonym forgetPrompt()
Synonym forgetPrompt()
int
getTop()
Number of pixels the top of the widget is offset down from its default drawing context (either its parent's top-left corner, or the document flow, depending on the value of theposition
property).Number of pixels the top of the widget is offset down from its default drawing context (either its parent's top-left corner, or the document flow, depending on the value of theposition
property).The top-most Canvas (i.e., not a child of any other Canvas), if any, in this widget's containment hierarchy.getUISummary
(String[] heirarchyExcluded, String[] thisCanvasExcluded) Returns a summary of this canvas and its child canvii and/or fields that is useful to an AI in understanding the hierarchy.boolean
Should canvases with noparent canvas
be moved to the end of the TabIndexManager tree on draw()?boolean
Should canvases with aparent canvas
be added to the TabIndexManager under the parent as described inupdateChildTabPositions()
andupdateChildTabPosition()
?In earlier versions of Internet Explorer (pre IE9), a native limitation exists whereby if HTML elements are overlapping on the page, certain elements can appear to "burn through" elements in the same position with a higher z-index.boolean
IfshowShadow
is true, should we use the cssbox-shadow
property (where supported) to achieve the shadow?boolean
This flag controls whether we register the component as a maskable item with the EventHandler.boolean
If set, forces the main SVG image or icon in the canvas to be rendered in an image tag rather than an object tag, the default.If set, native HTML5 drag and drop will be used for all drags initiated on this widget (on browsers where this is supported), and native HTML5 drop events occurring over this widget will be processed.Configures where the Opacity filter is used for IE6-8.Ontouch devices
, if thisCanvas
can be scrolled, should touch-dragging the content area result in scrolling? Set tofalse
if touch-dragging should not cause scrolling.ValuesManager
for managing values displayed in this component.ValuesManager
for managing values displayed in this component.int
Returns the height of the viewport onto the scrollable content.int
Returns the width of the viewport onto the scrollable content.Controls widget visibility when the widget is initialized.int
Return the visible height of the Canvas.Criteria to be evaluated to determine whether this Canvas should be visible.int
Return the visible width of the Canvas.int
getVSnapPosition
(int coordinate) Override this method to provide a custom snap-to grid.int
getVSnapPosition
(int coordinate, String direction) Override this method to provide a custom snap-to grid.getWidth()
Thecanvas.width
attribute specifies the size for a component's horizontal dimension;canvas.height
specifies the size for the vertical dimension.Process[]
List of screen-globalworkflows
that can be shared by event handler workflows using aStartProcessTask
.int
Get the z-Index of this canvas.int
getZIndex
(boolean resolveToNumber) Get the z-Index of this canvas.void
Handler fired on a delay when the user hovers the mouse over this hover-target.void
hide()
Sets the widget's CSS visibility attribute to "hidden".void
Hides the click mask associated with this canvas.void
hideClickMask
(String ID) Hides the click mask associated with this canvas.void
Hide thecomponent level clickMask
for this widgetvoid
hideComponentMask
(boolean suppressFocusReset) Hide thecomponent level clickMask
for this widgetvoid
The default implementation of this method hides the contextMenu currently being shown for this component (which occurs when the mouse button that toggles the context menu is released).static String
Generates the HTML for an image unique to this Canvas.static String
static String
Generates the HTML for an image unique to this Canvas.void
Notification method fired afterinitWidget()
, when canvas initialization is complete.intersects
(Canvas other) Returns true if the rectangles of this widget and the specified widget overlap.isDirty()
Returns whether a canvas is waiting to be redrawn.Is this canvas disabled? Note that the disabled state is inherited - this method will return true if this widget, or any of its ancestors are marked disabled.Returns true if this Canvas has the keyboard focus.boolean
Returns true if the widget is visible, taking all parents into account, so that a widget which is not hidden might still report itself as not visible if it is within a hidden parent.keyUp()
Executed when a key is released on a focusable widget (canFocus
: true).void
layoutChildren
(String reason) layoutChildren()
is where a Canvas should implement a sizing policy for it's Canvas children.Generates the HTML for a standard link (anchor) element.Generates the HTML for a standard link (anchor) element.void
destroy()
this canvas on a timeout.void
Marks the widget as "dirty" so that it will be added to a queue for redraw.void
markForRedraw
(String reason) Marks the widget as "dirty" so that it will be added to a queue for redraw.void
Puts this widget just above the specified widget in the stacking order, so it appears in front of the specified widget if both widgets have the same parent.void
Puts this widget just below the specified widget in the stacking order, so it appears behind the specified widget if both widgets have the same parent.moveBy
(int deltaX, int deltaY) Moves the widget deltaX pixels to the right and deltaY pixels down.boolean
moveTo
(int left, int top) Moves the widget so that its top-left corner is at the specified coordinates.protected void
onAttach()
protected void
onDetach()
protected void
onInit()
void
This method is the programmatic equivalent of the user pressing the "Page Down" key while this widget has the focus.void
This method is the programmatic equivalent of the user pressing the "Page Up" key while this widget has the focus.protected void
Fires when the interior size of the parent changes, including parent resize and scrollbar introduction or removal.void
Move this canvas to the specified point, or as close to the specified point as possible without this widget extending beyond the edge of the browser viewport on any side.void
placeNear
(int left) void
placeNear
(int left, int top) Move this canvas to the specified point, or as close to the specified point as possible without this widget extending beyond the edge of the browser viewport on any side.void
print()
Generate and show aPrintWindow
containing aPrintCanvas
showing a printable view of this component.void
print
(PrintProperties printProperties) void
print
(PrintProperties printProperties, PrintWindow printWindowProperties) void
print
(PrintProperties printProperties, PrintWindow printWindowProperties, String callback) Generate and show aPrintWindow
containing aPrintCanvas
showing a printable view of this component.static void
printComponents
(Object[] components) Generate printable HTML for the designated components and trigger the native print dialog, without ever showing the printable HTML to the user.void
provideRuleContext
(String dataPath, Object data) Provide data to thecom.smartgwt.client.widgets.Canvas#ruleScope
component, to be made available in the rule context at the specifiedpath
.void
provideRuleContext
(String dataPath, Object data, DataBoundComponent dbc) Provide data to thecom.smartgwt.client.widgets.Canvas#ruleScope
component, to be made available in the rule context at the specifiedpath
.void
redraw()
Redraws the widget immediately with its current property values.void
Redraws the widget immediately with its current property values.static void
registerFontScaledPaddingStyles
(String[] scaledStyles, String[] baselineStyles, int targetSizeChange) Registers one or more CSS classes to have their padding adjusted (independently on all edges) according to thepadding size change
applied to the page.void
removeChild
(Canvas child) Remove a child from this parent.void
removeChild
(Canvas child, String name) Remove a child from this parent.void
removePeer
(Canvas peer) Remove a peer from this Canvasvoid
removePeer
(Canvas peer, String name) Remove a peer from this Canvasvoid
removeRuleContext
(String path) Remove data in the rule context at the specifiedpath
along with any user-provided schema.void
removeSnapAlignCandidate
(Canvas candidate) Remove a candidate fromsnapAlignCandidates
.static void
resizeAutoChildAttributes
(String policy, int delta) Change the value of attributes registered viaregisterAutoChildSizingAttributes()
by some number of pixels.resizeBy
(int deltaX, int deltaY) Resizes the widget, adding deltaX to its width and deltaY to its height (moves the right and/or bottom sides of the widget).static void
resizeControls
(int delta) Change the basic size of UI components in the current skin by "delta" pixels.static void
resizeControlsTo
(int targetDelta) Resizes controls as if callingresizeControls()
, but takes a final target size instead of a delta representing the change from a current size.static void
resizeFonts
(int sizeChange) Modify the size of fonts for some or all stylesheets defined in the page.static void
resizeFonts
(int sizeChange, String styleSheets) static void
resizeFonts
(int sizeChange, String styleSheets, Boolean resizeRelatedControls) Modify the size of fonts for some or all stylesheets defined in the page.static void
resizeFontsTo
(int targetDelta) Resizes fonts as if callingresizeFonts()
, but takes a final target size instead of a delta representing the change from a current size.static void
resizeIcons
(String policy, int delta) Change the basic size of icons in the current skin by "delta" pixels.static void
resizePadding
(int fontSizeChange) Modify the amount of padding for some CSS styles defined for the page.static void
resizePadding
(int fontSizeChange, String styleSheets) Modify the amount of padding for some CSS styles defined for the page.resizeTo
(int width, int height) Resizes the widget to the specified width and height (moves the right and/ or bottom sides of the widget).Resizes the widget to the specified width and height (moves the right and/ or bottom sides of the widget).void
revealChild
(Canvas child) Reveals the child Canvas passed in by showing it if it is currently hidden (note, this is stub functionality, certain Canvas subclasses such asTabSet
have more useful implementations) NOTE: This is an override point.void
revealChild
(String childID) Reveals the child Canvas passed in by showing it if it is currently hidden (note, this is stub functionality, certain Canvas subclasses such asTabSet
have more useful implementations) NOTE: This is an override point.void
scrollBy
(int dX, int dY) Scroll this widget by some pixel increment in either (or both) direction(s).void
scrollByPercent
(int dX, int dY) Scroll this widget by some percentage of scroll size in either (or both) direction(s).void
scrollTo()
Scrolls the content of the widget so that the origin (top-left corner) of the content is left pixels to the left and top pixels above the widget's top-left corner (but still clipped by the widget's dimensions).void
void
Scrolls the content of the widget so that the origin (top-left corner) of the content is left pixels to the left and top pixels above the widget's top-left corner (but still clipped by the widget's dimensions).void
Vertically scrolls the content of the widget to the end of its contentvoid
Horizontally scrolls the content of the widget to 0void
scrollToPercent
(int left, int top) Scroll this widget to some position specified as a percentage of scroll size in either (or both) direction(s).void
Horizontally scrolls the content of the widget to the end of its contentvoid
Vertically scrolls the content of the widget to 0void
Puts this widget at the bottom of the stacking order, so it appears behind all other widgets in the same parent.setAccessKey
(String accessKey) If specified this governs the HTML accessKey for the widget.setAdaptHeightByCustomizer
(AdaptHeightByCustomizer customizer) Set customizer that definesadaptHeightBy
.setAdaptiveHeightPriority
(Integer adaptiveHeightPriority) setAdaptiveWidthPriority
(Integer adaptiveWidthPriority) If multiple widgets in the same Layout haveadaptive width
,adaptiveWidthPriority
can be set to indicate which of the components should be given priority access to space.setAdaptWidthByCustomizer
(AdaptWidthByCustomizer customizer) Set customizer that definesadaptWidthBy
.static void
setAllowExternalFilters
(boolean allExternalFilters) Changes the system-wideallowExternalFilters
setting.setAlwaysManageFocusNavigation
(Boolean alwaysManageFocusNavigation) Should focus navigation for this canvas and its descendents be handled explicitly by intercepting "Tab" key events and calling theTabIndexManager.shiftFocus()
API?setAlwaysShowScrollbars
(Boolean alwaysShowScrollbars) Should this browser always show custom scrollbars ifshowCustomScrollbars
is true?setAnimateAcceleration
(AnimationAcceleration animateAcceleration) Default acceleration effect to apply to all animations on this Canvas.setAnimateFadeTime
(Integer animateFadeTime) Default time for performing an animated fade.setAnimateHideAcceleration
(AnimationAcceleration animateHideAcceleration) Default acceleration function for performing an animated hide.setAnimateHideEffect
(AnimationEffect animateHideEffect) Default animation effect to use ifanimateHide()
is called without an explicit effect parameter.setAnimateHideTime
(Integer animateHideTime) Default time for performing an animated hide.setAnimateMoveAcceleration
(AnimationAcceleration animateMoveAcceleration) Default acceleration effect for performing an animated move.setAnimateMoveTime
(Integer animateMoveTime) Default time for performing an animated move.setAnimateRectAcceleration
(AnimationAcceleration animateRectAcceleration) Default acceleration function for performing an animated move and resize.setAnimateRectTime
(Integer animateRectTime) Default time for performing an animated setRect.setAnimateResizeAcceleration
(AnimationAcceleration animateResizeAcceleration) Default acceleration function for performing an animated resize.setAnimateResizeLayoutMode
(AnimationLayoutMode animateResizeLayoutMode) When to update thechild layout
for asize animation
.setAnimateResizeTime
(Integer animateResizeTime) Default time for performing an animated resize.setAnimateScrollAcceleration
(AnimationAcceleration animateScrollAcceleration) Default acceleration function for performing an animated scroll.setAnimateScrollTime
(Integer animateScrollTime) Default time for performing an animated scroll.setAnimateShowAcceleration
(AnimationAcceleration animateShowAcceleration) Default acceleration function for performing an animated show.setAnimateShowEffect
(AnimationEffect animateShowEffect) Default animation effect to use ifanimateShow()
is called without an explicit effect parameter.setAnimateShowTime
(Integer animateShowTime) Default time for performing an animated show.setAnimateTime
(int animateTime) Default total duration of animations.setAppImgDir
(String appImgDir) Default directory for app-specific images, relative to the Page-wideappImgDir
.setAriaRole
(String ariaRole) ARIA role of this component.setAriaState
(String stateName, Object stateValue) Set a specific ARIA state mapping for this component.setAutoChildConstructor
(String autoChildName, String className) Sets the SmartClient constructor for the AutoChild namedautoChildName
.setAutoChildProperties
(String autoChildName, EditContext properties) Sets the properties for creating an AutoChild namedautoChildName
.setAutoChildProperties
(String autoChildName, EditProxy properties) Sets the properties for creating an AutoChild namedautoChildName
.setAutoChildProperties
(String autoChildName, Canvas properties) Sets the properties for creating aCanvas
AutoChild namedautoChildName
.setAutoChildProperties
(String autoChildName, FormItem properties) Sets the properties for creating aFormItem
AutoChild namedautoChildName
.setAutoChildVisibility
(String autoChildName, boolean visible) Sets whether to create and show the AutoChild namedautoChildName
.Set the minimum value for height.setAutoMaskComponents
(Boolean autoMaskComponents) Deprecated.As of Smart GWT version 10.0, deprecated in favor ofEditProxy.autoMaskChildren
setAutoParent
(String autoParent) This initialization property allows developers to create a canvas using the Class.addAutoChild() method, and have it added as a child to some other component.setAutoPopulateData
(Boolean autoPopulateData) If adataContext
is provided, should subcomponents automatically bind to the data?static void
setAutoResizeAutoChildAttributes
(boolean autoResize) static void
setAutoResizeIcons
(boolean autoResizeIcons) setAutoShowParent
(Boolean autoShowParent) If set to true, the widget's parent (if any) will automatically be shown whenever the widget is shown.Set the minimum value for width.setBackgroundColor
(String backgroundColor) The background color for this widget.setBackgroundImage
(String backgroundImage) URL for a background image for this widget (corresponding to the CSS "background-image" attribute).setBackgroundPosition
(String backgroundPosition) Specifies how the background image should be positioned on the widget.setBackgroundRepeat
(BackgroundRepeat backgroundRepeat) Specifies how the background image should be tiled if this widget is larger than the image.Set the CSS border of this component, as a CSS string including border-width, border-style, and/or color (eg "2px solid blue").setBorderRadius
(String borderRadius) The CSS border-radius for this widget.void
setBottom
(int bottom) Resizes the widget vertically to position its bottom edge at the specified coordinate.setCanAcceptDrop
(Boolean canAcceptDrop) Indicates that this object can receive dropped widgets (i.e.setCanAdaptHeight
(Boolean canAdaptHeight) SeecanAdaptWidth
.setCanAdaptWidth
(Boolean canAdaptWidth) Indicates that this component is able to render itself at multiple possible sizes, in order to fit into less space when very little space is available, or to display more information or provide more immediate access to functionality when more space is available.setCanDrag
(Boolean canDrag) Indicates whether this widget can initiate custom drag-and-drop operations (other than reposition or resize).setCanDragReposition
(Boolean canDragReposition) Indicates whether this widget can be moved by a user of your application by simply dragging with the mouse.setCanDragResize
(Boolean canDragResize) Indicates whether this widget can be resized by dragging on the edges and/or corners of the widget with the mouse.setCanDragScroll
(boolean canDragScroll) If this Canvas is canAcceptDrop:true, when the user drags a droppable widget over an edge of the widget, should we scroll to show the rest of the widget's content? Returned from canvas.shouldDragScroll() if there are scrollbars.setCanDrop
(Boolean canDrop) Indicates that this object can be dropped on top of other widgets.setCanDropBefore
(Boolean canDropBefore) When explicitly set to false, disallows drop before this member in the Layout.setCanFocus
(Boolean canFocus) Can this widget be allowed to become the target of keyboard events?setCanHover
(Boolean canHover) Will this Canvas fire hover events when the user hovers over it, or one of its children?setCanSelectText
(Boolean canSelectText) Whether native drag selection of contained text is allowed within this Canvas.setChildren
(Canvas... children) Array of all Canvii that are immediate children of this Canvas.setChildrenResizeSnapAlign
(Boolean childrenResizeSnapAlign) Flag to disable snapping to alignment when children of this Canvas are resizedsetChildrenSnapAlign
(Boolean childrenSnapAlign) If enabled whilechildrenSnapToGrid
is enabled, children dragged within this Canvas will also snap to positions where their edges or center lines would be aligned with the edges or centers of other components, and lines will be shown to point out the possible alignment (with appearance controlled bysnapAlignCenterLineStyle
andsnapAlignEdgeLineStyle
respectively.setChildrenSnapCenterAlign
(Boolean childrenSnapCenterAlign) SeechildrenSnapAlign
.setChildrenSnapEdgeAlign
(Boolean childrenSnapEdgeAlign) SeechildrenSnapAlign
.setChildrenSnapResizeToGrid
(Boolean childrenSnapResizeToGrid) If true, causes this canvas's children to snap to its grid when resizing.setChildrenSnapToGrid
(Boolean childrenSnapToGrid) If true, causes this canvas's children to snap to its grid when dragging.setComponentMaskDefaults
(Canvas componentMaskDefaults) Defaults for thecomponentMask
autoChild.setContents
(String contents) The contents of a canvas or label widget.setContextMenu
(Menu contextMenu) Context menu to show for this object, an instance of the Menu widget.setCorrectZoomOverflow
(Boolean correctZoomOverflow) Whether the Framework should correct for erroneous scrollHeight and scrollWidth values reported by the browser when zoomed (via browser or OS-level zoom) by allowingmaxZoomOverflowError
of overflow before enabling scrolling and displaying custom scrollbars.Specifies the css cursor image to display when the mouse pointer is over this component.setDataContext
(DataContext dataContext) A mapping fromDataSource
IDs to specificRecords
from those DataSources, thatDataBoundComponents
contained within this Canvas should automatically bind to if a DataSource is provided but data is not provided (directly or indirectly, for example, indirectly via settingListGrid.autoFetchData
.setDataPath
(String dataPath) A dataPath may be specified on any canvas.setDefaultHeight
(int defaultHeight) For custom components, establishes a default height for the component.static void
setDefaultPageSpace
(int newDefaultPageSpace) Changes the globaldefaultPageSpace
.static void
setDefaultProperties
(Canvas canvasProperties) Class level method to set the default properties of this class.static Canvas
setDefaultShowCustomScrollbars
(boolean showCS) Whether to use the browser's native scrollbars or SmartClient-based scrollbars by default for all canvases.setDefaultWidth
(int defaultWidth) For custom components, establishes a default width for the component.setDefiningProperty
(String definingProperty) This attribute denotes the name of a property to use as agetDefiningPropertyName()
for this property when generating and resolvingAutoTest locators with search segments
.setDefiningPropertyNameOptions
(String... definingPropertyNameOptions) If no explicitdefiningProperty
was specified for this component, this array denotes a list of options to use as adefining property
when generating and resolvingAutoTest locators with search segments
.setDisabled
(boolean disabled) If set to true, the widget will be disabled.setDisabledCursor
(Cursor disabledCursor) Specifies the cursor image to display when the mouse pointer is over this widget if this widget is disabled.setDisableTouchScrollingForDrag
(Boolean disableTouchScrollingForDrag) DisablesuseTouchScrolling
whenever a built-in drag operation has been enabled which is known to be non-functional if touch scrolling is enabled.setDoubleClickDelay
(int doubleClickDelay) Amount of time (in milliseconds) between which two clicks are considered a single clicksetDragAppearance
(DragAppearance dragAppearance) Visual appearance to show when the object is being dragged.setDragIntersectStyle
(DragIntersectStyle dragIntersectStyle) This indicates how the system will test for droppable targets: either by intersection with the mouse or intersection with the rectangle of the dragMoveTarget.setDragMaskType
(DragMaskType dragMaskType) This property controls what kind of mask is used in caseuseDragMask
is enabled.setDragMaxHeight
(int dragMaxHeight) Sets maximum height that this Canvas can be resized to by a user.setDragMaxWidth
(int dragMaxWidth) Maximum width that this Canvas can be resized to by a user.setDragMinHeight
(int dragMinHeight) Minimum height that this Canvas can be resized to by a user.setDragMinWidth
(int dragMinWidth) Minimum width that this Canvas can be resized to by a user.setDragOpacity
(Integer dragOpacity) If this widget has dragAppearance"target"
, this value specifies the opacity to render the target while it is being dragged.setDragRepositionAppearance
(DragAppearance dragRepositionAppearance) IfcanDragReposition
is true, this attribute specifies the visual appearance to show during drag reposition.setDragRepositionCursor
(Cursor dragRepositionCursor) Cursor to switch to if the mouse is over a widget that is drag repositionable.setDragResizeAppearance
(DragAppearance dragResizeAppearance) IfcanDragResize
is true, this attribute specifies the visual appearance to show during drag resize.setDragScrollDelay
(int dragScrollDelay) If this widget supports drag-scrolling, This property specifies how many ms the user must hover over the drag-scroll threshold before scrolling begins.setDragStartDistance
(int dragStartDistance) Number of pixels the cursor needs to move before the EventHandler starts a drag operation.setDragTarget
(Canvas dragTarget) A different widget that should be actually dragged when dragging initiates on this widget.setDragTarget
(String dragTarget) A different widget that should be actually dragged when dragging initiates on this widget.setDragType
(String dragType) Sets adragType
for this widget used, to be compared todropTypes
on possible drop target widgets.setDropTarget
(Canvas dropTarget) Delegates a different widget that should actually be dropped on if the cursor is over this widget when the drop completes.setDropTarget
(String dropTarget) Delegates a different widget that should actually be dropped on if the cursor is over this widget when the drop completes.setDropTypes
(String dropTypes) When a drag and drop interaction occurs, if adragType
is configured on the source widget, it is compared to thedropTypes
configured on the target widget, and a drop is only allowed if thedragType
is listed in the target widget'sdropTypes
array.setDropTypes
(String... dropTypes) When a drag and drop interaction occurs, if adragType
is configured on the source widget, it is compared to thedropTypes
configured on the target widget, and a drop is only allowed if thedragType
is listed in the target widget'sdropTypes
array.setDynamicContents
(Boolean dynamicContents) Dynamic contents allows the contents string to be treated as a simple but powerful template.setEdgeBackgroundColor
(String edgeBackgroundColor) Background color for the EdgedCanvas created to decorate this component.setEdgeCenterBackgroundColor
(String edgeCenterBackgroundColor) Background color for the center section only.setEdgeImage
(String edgeImage) Base name of images for edges.setEdgeMarginSize
(int edgeMarginSize) How far into the edge of an object do we consider the "edge" for drag resize purposes?setEdgeOffset
(Integer edgeOffset) Amount the contained Canvas should be offset.setEdgeOpacity
(Integer edgeOpacity) Opacity of the edges.setEdgeShowCenter
(Boolean edgeShowCenter) Whether to show media in the center section, that is, behind the decorated Canvas.setEdgeSize
(int edgeSize) Size in pixels for corners and edgesvoid
setEditMode
(boolean editingOn) Enable or disable edit mode for this component.void
setEditMode
(boolean editingOn, EditContext editContext) void
setEditMode
(boolean editingOn, EditContext editContext, EditNode editNode) Enable or disable edit mode for this component.setEditProxyConstructor
(String editProxyConstructor) Default class used to construct theEditProxy
for this component when the component isfirst placed into edit mode
.protected void
setElement
(Element elem) Normal usage of SmartGWT is to call draw() on SmartGWT widgets, not to use use RootPanel.add().setEnableWhen
(AdvancedCriteria enableWhen) Criteria to be evaluated to determine whether this Canvas should be enabled.setEndLine
(Boolean endLine) Whether this canvas should end the line it's in when used as a tile in aFlowLayout
.setExtraSpace
(int extraSpace) When this Canvas is included as a member in a Layout, extra blank space that should be left after this member in a Layout.setFacetId
(String facetId) If a Canvas is dropped onto aCubeGrid
, and it has a facetId property specified then the Cube treats this as adding that facetId at the drop location.setFloatingScrollbars
(boolean floatingScrollbars) IfshowCustomScrollbars
is true, should the scrollbars be drawn floating over the component handle, or should the handle shrink to accommodate them?setForwardSVGeventsToObject
(Boolean forwardSVGeventsToObject) If true, events sent to the SVG inside an object tag are forwarded to the object itself by Framework handlers.setGroupBorderCSS
(String groupBorderCSS) Sets the style for the grouping frame around the canvas.setGroupLabelBackgroundColor
(String groupLabelBackgroundColor) If set, the background color of the grouping label.setGroupLabelStyleName
(String groupLabelStyleName) Sets the style for the grouping label.setGroupPadding
(Integer groupPadding) Padding to apply inside the border when this canvas is showing a groupborder and label
.setGroupTitle
(String groupTitle) The title/label for the grouping.setHeight
(int height) Thecanvas.width
attribute specifies the size for a component's horizontal dimension;canvas.height
specifies the size for the vertical dimension.void
Thecanvas.width
attribute specifies the size for a component's horizontal dimension;canvas.height
specifies the size for the vertical dimension.Convenience method that sets the height to 100%.setHideUsingDisplayNone
(boolean hideUsingDisplayNone) When this widget is hidden (seevisibility
andhide()
), should display:none be applied to theouter element
?setHoverAlign
(Alignment hoverAlign) Ifthis.showHover
is true, this property can be used to customize the alignment of content in the hover canvas.setHoverAutoDestroy
(Boolean hoverAutoDestroy) Ifthis.showHover
is true andgetHoverComponent()
is implemented, should the hoverCanvas returned from it be automatically destroyed when it is hidden?setHoverAutoFitMaxWidth
(int hoverAutoFitMaxWidth) Maximum auto-fit width for a hover ifhoverAutoFitWidth
is enabled.setHoverAutoFitMaxWidth
(String hoverAutoFitMaxWidth) Maximum auto-fit width for a hover ifhoverAutoFitWidth
is enabled.setHoverAutoFitWidth
(Boolean hoverAutoFitWidth) ifshowHover
is true, this property will cause the specifiedhoverWidth
to be treated as a minimum width for the hover.setHoverDelay
(int hoverDelay) Ifthis.canHover
is true, how long should the mouse be kept over this widget before the hover event is firedsetHoverFocusKey
(String hoverFocusKey) For canvasesshowing a hover
, this attribute gives users a way to pin the hover in place so they can interact with it (scroll it, click embedded links, etc).setHoverHeight
(Integer hoverHeight) Ifthis.showHover
is true, this property can be used to customize the height of the hover canvas shown.setHoverMoveWithMouse
(Boolean hoverMoveWithMouse) Ifthis.showHover
is true, should this widget's hover canvas be moved with the mouse while visible?setHoverOpacity
(Integer hoverOpacity) Ifthis.showHover
is true, should the hover canvas be shown with opacity other than 100?setHoverPersist
(HoverPersistMode hoverPersist) Allows interaction with hovers when the cursor is positioned over them.setHoverScreen
(String hoverScreen) Screen to create (viacreateScreen()
) in lieu of callinggetHoverComponent()
.setHoverStyle
(String hoverStyle) Ifthis.showHover
is true, this property can be used to specify the css style to apply to the hover canvas.setHoverVAlign
(VerticalAlignment hoverVAlign) Ifthis.showHover
is true, this property can be used to customize the vertical alignment of content in the hover canvas.setHoverWidth
(int hoverWidth) Ifthis.showHover
is true, this property can be used to customize the width of the hover canvas shown.setHoverWrap
(Boolean hoverWrap) Ifthis.showHover
is true, this property can be used to customize the whether content in the hover canvas is displayed in a single line, or wraps.setHtmlElement
(Element htmlElement) If specified as a pointer to an HTML element present in the DOM, this canvas will be rendered inside that element ondraw()
.setHtmlElement
(String htmlElement) If specified as a pointer to an HTML element present in the DOM, this canvas will be rendered inside that element ondraw()
.setHtmlPosition
(DrawPosition htmlPosition) IfhtmlElement
is specified, this attribute specifies the position where the canvas should be inserted relative to thehtmlElement
in the DOM.void
Set the URL of an image or SVG object element by name.void
Set the URL of an image or SVG object element by name.void
setInitHandler
(CanvasInitHandler initHandler) Specify a notification method to fire when this Canvas is initialized in JavaScript.setIsGroup
(boolean isGroup) Should a grouping frame be shown around this canvas if a non-empty string has been specified forgroupTitle
.setIsRuleScope
(Boolean isRuleScope) Marks this Canvas as theruleScope
that will be discovered by any containedDataBoundComponent
s which do not specify an explicitruleScope
.setIsSnapAlignCandidate
(Boolean isSnapAlignCandidate) Flag to disable snapping to alignment against this Canvas when other Canvases dragged into the same parent whenchildrenSnapAlign
is enabled on this Canvas' parent.setKeepInParentRect
(Rectangle rectangle) setKeepInParentRect
(Boolean keepInParentRect) Constrains drag-resizing and drag-repositioning of this canvas to either the rect of its parent (if set to true) or an arbitrary rect based on its parent (if set to a [Left,Top,Width,Height] rect array).setKeepInParentRect
(Integer... keepInParentRect) Constrains drag-resizing and drag-repositioning of this canvas to either the rect of its parent (if set to true) or an arbitrary rect based on its parent (if set to a [Left,Top,Width,Height] rect array).setLayoutAlign
(Alignment layoutAlign) When this Canvas is included as a member in a Layout, layoutAlign controls alignment on the breadth axis of the layout.setLayoutAlign
(VerticalAlignment layoutAlign) When this Canvas is included as a member in a Layout, layoutAlign controls alignment on the breadth axis of the layout.setLeaveGroupLabelSpace
(Boolean leaveGroupLabelSpace) When showing this widget in agroup
, should any content be shifted down so that the group-label doesn't sit in front of it?setLeavePageSpace
(Integer leavePageSpace) If set, overrides the globaldefaultPageSpace
.setLeft
(int left) Number of pixels the left side of the widget is offset to the right from its default drawing context (either its parent's topleft corner, or the document flow, depending on the value of theposition
property).Number of pixels the left side of the widget is offset to the right from its default drawing context (either its parent's topleft corner, or the document flow, depending on the value of theposition
property).setLocateByIDOnly
(boolean locateByIDOnly) Iftrue
, when retrieving alocator
for this component always return a reference directly to this component bywidget ID
, using the compact format"///canvasID"
, ignoring any parent elements and ignoring any configuredtestRoot
.setLocateChildrenBy
(LocatorStrategy locateChildrenBy) Strategy to use when locating children in this canvas from an autoTest locator string.setLocateChildrenType
(LocatorTypeStrategy locateChildrenType) LocatorTypeStrategy
to use when finding children within this canvas.setLocatePeersBy
(LocatorStrategy locatePeersBy) Strategy to use when locating peers of this canvas from an autoTest locator string.setLocatePeersType
(LocatorTypeStrategy locatePeersType) LocatorTypeStrategy
to use when finding peers of this canvas.setLocatorName
(String locatorName) Local name for referencing this canvas from an autoTest locator string.boolean
setLocatorParent
(Canvas locatorParent, String childName) This method will set mark the target canvas as the "locator parent" for this canvas, using the specified child name.boolean
setLocatorParent
(Canvas locatorParent, String childName, String attributeName) This method will set mark the target canvas as the "locator parent" for this canvas, using the specified child name.Setter implementing theLogicalStructure
interface, which supports Eclipse's logical structure debugging facility.Set the CSS Margin, in pixels, for this component.setMatchElement
(Boolean matchElement) IfhtmlElement
is specified, should this canvas be drawn at the same dimensions as the htmlElement?
See alsomatchElementWidth
andmatchElementHeight
setMatchElementHeight
(MatchElementSizeMode matchElementHeight) For canvases with a specifiedhtmlElement
wherepersistentMatchElement
is set to true, how should the canvas match the element's height?setMatchElementWidth
(MatchElementSizeMode matchElementWidth) For canvases with a specifiedhtmlElement
wherepersistentMatchElement
is set to true, how should the canvas match the element's width?setMaxHeight
(int maxHeight) Maximum height available to this Canvas.setMaxWidth
(int maxWidth) Maximum width available to this Canvas.setMaxZoomOverflowError
(int maxZoomOverflowError) WhencorrectZoomOverflow
is true and browser or OS-level zoom is active, determines how much overflow must occur before the Framework enables scrolling for this canvas.setMenuConstructor
(String menuConstructor) Default class used to construct menus created by this component, including context menus.setMinHeight
(int minHeight) Minimum height available to this Canvas.setMinNonEdgeSize
(int minNonEdgeSize) If the widget has drag resize configured on one or more of it's edges, and the edgeMarginSize is large enough that the remaining space is less thanminNonEdgeSize
, the edgeMarginSize will be reduced such that the non-edge part of the widget is at least 1/3 of the total space (with two draggable edges) or half of it (with one draggable edge).setMinWidth
(int minWidth) Minimum width available to this Canvas.setMomentumScrollMinSpeed
(double momentumScrollMinSpeed) The minimum speed in pixels per second that must be reached for momentum scrolling to kick in.setMouseStillDownDelay
(int mouseStillDownDelay) Amount of time (in milliseconds) between repeated 'mouseStillDown' events for this canvas.setMouseStillDownInitialDelay
(int mouseStillDownInitialDelay) Amount of time (in milliseconds) before mouseStillDown events start to be fired repeatedly for this canvas.Optional name for the canvas, which can later be used to reference it.setNativeAutoHideScrollbars
(Boolean nativeAutoHideScrollbars) In some platform/browser configurations, scrollable regions do not show visible scrollbars until the user attempts to interact with the region.static void
setNeverUseFilters
(boolean neverUseFilters) Changes the system-wideneverUseFilters
setting.setNoDoubleClicks
(Boolean noDoubleClicks) If true, this canvas will receive all mouse-clicks as singleclick
events rather than asdoubleClick
events.setNoDropCursor
(Cursor noDropCursor) Specifies the cursor image to display when the user drags a droppable canvas over this if it is not a valid drop target for the event andshowNoDropIndicator
is true.setOpacity
(Integer opacity) Renders the widget to be partly transparent.setOverflow
(Overflow overflow) Controls what happens when the drawn size of the content of a Canvas is either greater or smaller than the specified size of the Canvas.setPadding
(Integer padding) Set the CSS padding of this component, in pixels.void
setPageLeft
(int left) Set the page-relative left coordinate of this widget.void
setPageTop
(int top) Set the page-relative top coordinate of this widget.void
setPanelContainer
(Canvas container) Sets this Canvas's "panel container".setParentCanvas
(Canvas parentCanvas) This Canvas's immediate parent, if any.setParentElement
(Canvas parentElement) Deprecated.As of Smartclient version 9.1, deprecated in favor ofparentCanvas
andgetParentCanvas()
Array of all Canvii that are peers of this Canvas.setPendingMarkerStyle
(String pendingMarkerStyle) CSS class used to apply additional styles to this canvas whenshowPendingMarker()
is called, or whenpendingMarkerVisible
has been set.setPendingMarkerVisible
(Boolean pendingMarkerVisible) This attribute indicates whether thepending marker class
should be appended to the list of CSS classes applied to this canvas.setPercentBox
(PercentBoxModel percentBox) Governs the model to be used when sizing canvases with percentage width or height, or positioning widgets with a specifiedsnapTo
.setPercentSource
(Canvas percentSource) If this canvas has its size specified as a percentage, this property allows the user to explicitly designate another canvas upon which sizing will be based.setPersistentMatchElement
(Boolean persistentMatchElement) If this canvas has a specifiedhtmlElement
andmatchElement
is set to true, should the canvas perform a one time resize to fit the target element on draw, or should it continue to match the target element as its size changes due to page reflows?setPointerSettings
(PointerSettings pointerSettings) Detail settings of thepointer
such as where it should be located along the outside of the canvas.setPointerTarget
(String pointerTarget) This property in conjunction with thepointerSettings.snapTo
places the canvas in relation to the target canvas.setPosition
(Positioning position) Absolute or relative, corresponding to the "absolute" (with respect to parent) or "relative" (with respect to document flow) values for the CSS position attribute.setPrintChildrenAbsolutelyPositioned
(Boolean printChildrenAbsolutelyPositioned) Should this canvas print its children absolutely positioned when generatingprintable HTML
.setPrintStyleName
(String printStyleName) The CSS class to apply when printing this widget.Prompt displayed in hover canvas ifshowHover
is true.setProportionalResizeModifiers
(String... proportionalResizeModifiers) IfproportionalResizing
is set toProportionalResizeMode.MODIFIER
orProportionalResizeMode.MODIFIER_OFF
then proportional resizing of the DrawItem is activated or deactivated, respectively, whenever at least one key in this set of modifier keys is pressed.setProportionalResizing
(ProportionalResizeMode proportionalResizing) IfcanDragResize
is true, this property specifies the conditions for when proportional resizing is used.setReceiveScrollbarEvents
(boolean receiveScrollbarEvents) Whether this canvas should receiveevents
from its scrollbars, which arepeers
.setRect
(int left, int top, int width, int height) Set all four coordinates, relative to the enclosing context, at once.Set all four coordinates, relative to the enclosing context, at once.setRedrawOnResize
(Boolean redrawOnResize) Should this element be redrawn in response to a resize?void
setRelativeTabPosition
(Integer position) Assign a relative tab position for this canvas.setResizeBarTarget
(String resizeBarTarget) When this Canvas is included as a member in a Layout, andshowResizeBar
is set totrue
so that a resizeBar is created,resizeBarTarget:"next"
can be set to indicate that the resizeBar should resize the next member of the layout rather than this one.setResizeFrom
(EdgeName... resizeFrom) When drag resizing is enabled viacanDragResize
, restricts resizes to only certain edges or corners.setResizeFrom
(String... resizeFrom) Deprecated.use#setResizeFrom(EdgeName)
instead.void
setRight
(int right) Resizes the widget horizontally to position its right side at the specified coordinate.setRuleScope
(String ruleScope) ID
of the component that gathers the context for evaluation of criteria-based rules specified by properties such asFormItem.visibleWhen
, Dynamic Properties, andDynamicCriteria
such asListGrid.initialCriteria
.setScrollbarConstructor
(String scrollbarConstructor) The class that will be used to create custom scrollbars for this component.setScrollbarSize
(int scrollbarSize) How thick should we make the scrollbars for this canvas.setShadowColor
(String shadowColor) Color for the css-based drop shadow shown ifuseCSSShadow
is true andshowShadow
is true.setShadowDepth
(int shadowDepth) Depth of the shadow, or the virtual height above the page of the widget throwing the shadow.setShadowHOffset
(Integer shadowHOffset) Horizontal offset for theshadow
.setShadowImage
(String shadowImage) IfuseCSSShadow
is false, (or for browsers that do not support css3), this property supplies the base name of the series of images for the sides, corners, and center of the shadow.setShadowOffset
(Integer shadowOffset) Offset of the shadow.setShadowSoftness
(Integer shadowSoftness) Softness, or degree of blurring, of the shadow.setShadowSpread
(Integer shadowSpread) Explicit spread for the css-based drop shadow shown ifuseCSSShadow
is true andshowShadow
is true.setShadowVOffset
(Integer shadowVOffset) Vertical offset for theshadow
.setShouldPrint
(Boolean shouldPrint) Whether this canvas should be included in a printable view.setShowCustomScrollbars
(boolean showCustomScrollbars) Whether to use the browser's native scrollbars or Smart GWT-based scrollbars.setShowDragShadow
(Boolean showDragShadow) When this widget is dragged, if its dragAppearance is"target"
, should we show a shadow behind the canvas during the drag.setShowEdges
(Boolean showEdges) Whether anEdgedCanvas
should be used to show image-based edges around this component.setShowHover
(Boolean showHover) Ifthis.canHover
is true, should we show the global hover canvas by default when the user hovers over this canvas?setShowHoverComponents
(Boolean showHoverComponents) When set to true, shows a widget hovering at the mouse point instead of the builtin hover label.setShowPointer
(Boolean showPointer) Should a pointer be shown? A pointer can be placed on the border to identify the target of the canvas contents.setShowResizeBar
(Boolean showResizeBar) When this Canvas is included as a member in aLayout
, whether a resizeBar should be shown after this member in the layout, to allow it to be resized.setShowShadow
(Boolean showShadow) Whether to show a drop shadow for this Canvas.setShowSnapGrid
(Boolean showSnapGrid) Whether to show a snap grid for this Canvas.setShrinkElementOnHide
(boolean shrinkElementOnHide) This is an advanced setting.setSizeMayChangeOnRedraw
(Boolean sizeMayChangeOnRedraw) Is it possible that a call toredraw()
on this widget will change its size?setSkinImgDir
(String skinImgDir) Default directory for skin images (those defined by the class), relative to the Page-wideskinDir
.setSmoothFade
(Boolean smoothFade) setSnapAlignCandidates
(Canvas... snapAlignCandidates) WhenchildrenSnapAlign
is enabled, list of candidates to check for alignment.setSnapAlignCenterLineStyle
(String snapAlignCenterLineStyle) CSS border declaration used for the line shown to indicate snapping to a center line whenchildrenSnapAlign
is set.setSnapAlignEdgeLineStyle
(String snapAlignEdgeLineStyle) CSS border declaration used for the line shown to indicate snapping to a edge line whenchildrenSnapAlign
is set.setSnapAxis
(String snapAxis) Describes which axes to apply snap-to-grid to.setSnapEdge
(String snapEdge) IfsnapTo
is defined to this widget, this property can be used to define which edge of this widget should be snapped to an edge of the master or parent element.setSnapGridLineProperties
(DrawLine snapGridLineProperties) Specifies line styling to use when drawing the grid of lines forSnapGridStyle
: "lines".setSnapGridStyle
(SnapGridStyle snapGridStyle) Specifies indication style to use for snap points, either a grid of lines or an array of crosses.setSnapHDirection
(String snapHDirection) The horizontal snap direction.setSnapHGap
(int snapHGap) The horizontal grid size to use, in pixels, when snap-to-grid is enabled.setSnapOffsetLeft
(Integer snapOffsetLeft) IfsnapTo
is defined for this widget, this property can be used to specify an offset in px or percentage for the left coordinate of this widget.setSnapOffsetTop
(Integer snapOffsetTop) IfsnapTo
is defined for this widget, this property can be used to specify an offset in px or percentage for the top coordinate of this widget.setSnapOnDrop
(Boolean snapOnDrop) When this canvas is dropped onto an object supporting snap-to-grid, should it snap to the grid (true, the default) or just drop wherever the mouse is (false).setSnapResizeToAlign
(Boolean snapResizeToAlign) Flag to disable snapping to alignment when this Canvas is resized.setSnapResizeToGrid
(Boolean snapResizeToGrid) Causes this canvas to snap to its parent's grid when resizing.Position this widget such that it is aligned with ("snapped to") an edge of itsmaster
(if specified), or itsparent canvas
.setSnapToAlign
(Boolean snapToAlign) Flag to disable snapping to alignment when this Canvas is dragged whenchildrenSnapAlign
is enabled on this Canvas' parent.setSnapToCenterAlign
(Boolean snapToCenterAlign) Flag to disable snapping to center alignment when this Canvas is dragged whenchildrenSnapAlign
is enabled on this Canvas' parent.setSnapToEdgeAlign
(Boolean snapToEdgeAlign) Flag to disable snapping to edge alignment when this Canvas is dragged whenchildrenSnapAlign
is enabled on this Canvas' parent.setSnapToGrid
(Boolean snapToGrid) Causes this canvas to snap to its parent's grid when dragging.setSnapVDirection
(String snapVDirection) The vertical snap direction.setSnapVGap
(int snapVGap) The vertical grid size to use, in pixels, when snap-to-grid is enabled.setStartLine
(Boolean startLine) Whether this canvas should always start a new line when used as a tile in aFlowLayout
.void
setStyleName
(String styleName) The CSS class applied to this widget as a whole.setTabIndex
(Integer tabIndex) If specified this governs the tabIndex of the widget in the page's tab order.setTestDataContext
(DataContext testDataContext) ADataContext
to be used if nodataContext
is provided (directly or indirectly via a parent).void
Synonym forsetPrompt(String)
setTooltip
(String tooltip) Synonym forsetPrompt(String)
setTop
(int top) Number of pixels the top of the widget is offset down from its default drawing context (either its parent's top-left corner, or the document flow, depending on the value of theposition
property).Number of pixels the top of the widget is offset down from its default drawing context (either its parent's top-left corner, or the document flow, depending on the value of theposition
property).setUpdateTabPositionOnDraw
(boolean updateTabPositionOnDraw) Should canvases with noparent canvas
be moved to the end of the TabIndexManager tree on draw()?setUpdateTabPositionOnReparent
(boolean updateTabPositionOnReparent) Should canvases with aparent canvas
be added to the TabIndexManager under the parent as described inupdateChildTabPositions()
andupdateChildTabPosition()
?setUseBackMask
(Boolean useBackMask) In earlier versions of Internet Explorer (pre IE9), a native limitation exists whereby if HTML elements are overlapping on the page, certain elements can appear to "burn through" elements in the same position with a higher z-index.setUseCSSShadow
(boolean useCSSShadow) IfshowShadow
is true, should we use the cssbox-shadow
property (where supported) to achieve the shadow?setUseDragMask
(boolean useDragMask) This flag controls whether we register the component as a maskable item with the EventHandler.setUseImageForSVG
(boolean useImageForSVG) If set, forces the main SVG image or icon in the canvas to be rendered in an image tag rather than an object tag, the default.setUseNativeDrag
(Boolean useNativeDrag) If set, native HTML5 drag and drop will be used for all drags initiated on this widget (on browsers where this is supported), and native HTML5 drop events occurring over this widget will be processed.setUseOpacityFilter
(Boolean useOpacityFilter) Configures where the Opacity filter is used for IE6-8.setUseTouchScrolling
(Boolean useTouchScrolling) Ontouch devices
, if thisCanvas
can be scrolled, should touch-dragging the content area result in scrolling? Set tofalse
if touch-dragging should not cause scrolling.setValuesManager
(ValuesManager valuesManager) ValuesManager
for managing values displayed in this component.setValuesManager
(String valuesManager) ValuesManager
for managing values displayed in this component.setVisibility
(Visibility visibility) Controls widget visibility when the widget is initialized.void
setVisible
(boolean visible) setVisibleWhen
(AdvancedCriteria visibleWhen) Criteria to be evaluated to determine whether this Canvas should be visible.setWidth
(int width) Thecanvas.width
attribute specifies the size for a component's horizontal dimension;canvas.height
specifies the size for the vertical dimension.void
Thecanvas.width
attribute specifies the size for a component's horizontal dimension;canvas.height
specifies the size for the vertical dimension.Convenience method that sets the width to 100%.setWorkflows
(Process... workflows) List of screen-globalworkflows
that can be shared by event handler workflows using aStartProcessTask
.setZIndex
(int newIndex) Set the z-Index of the canvas.void
If this widget is showing scrollbars, and a user drags close to the edge of the viewport, should we scroll the viewport in the appropriate direction? Returns this.canDragScroll if there are scrollbars, else false.void
show()
Sets this widget's visibility to "inherit", so that it becomes visible if all of its parents are visible or it has no parents.showClickMask
(Function clickActionCallback, ClickMaskMode mode, Canvas[] unmaskedTargets) Show a clickMask over the entire screen that intercepts mouse clicks and fires some action.void
Temporariy block all user interaction with children of this widget, with the exception of those passed in in theunmaskedChildren
parameter.void
showComponentMask
(Canvas... unmaskedChildren) Temporariy block all user interaction with children of this widget, with the exception of those passed in in theunmaskedChildren
parameter.void
showNextTo
(Canvas otherWidget) Show this widget next to another widget on the page, positioned such that it will not extend beyond the browser viewport.void
showNextTo
(Canvas otherWidget, String side) void
showNextTo
(Canvas otherWidget, String side, boolean canOcclude) void
showNextTo
(Canvas otherWidget, String side, boolean canOcclude, boolean skipAnimation) Show this widget next to another widget on the page, positioned such that it will not extend beyond the browser viewport.void
Manually move this component into the "pending changes" visual state (based on thependingMarker style
, or the Pending suffix in stateful components).static void
showPrintPreview
(Canvas component) Show a PrintWindow containing a printable view of the component passed in containing print HTML.static void
showPrintPreview
(Object[] components) Show a Print containing a printable view of the components passed in.static void
showPrintPreview
(Object[] components, PrintProperties printProperties, String title, PrintPreviewCallback callback) Show a Print containing a printable view of the components passed in.static void
showPrintPreview
(Object[] components, PrintProperties printProperties, String title, PrintPreviewCallback callback, Window printWindowProperties, String printButtonTitle) Show a Print containing a printable view of the components passed in.void
Recursively show the canvas and all its parents so the canvas will be visible.static void
startDebuggingOverflow
(DebugOverflowSettings settings) Start to track and report excessive overflow per the supplied settings.static void
Stop tracking and reporting excessive overflow.void
updateChildTabPosition
(Canvas child) Ensure that a specific child is slotted correctly into the page's tab order.void
Update the childrens' tab positions, slotting them under this widget in theTabIndexManager
, in the order defined bygetChildTabPosition()
.void
updateEditNode
(EditContext editContext, EditNode editNode) A callback invoked for eachliveObject
byEditContext
when the EditContext is being serialized.void
If this canvas is currently showing a hover (seehandleHover()
), this method can be called to update the HTML contents of the hover.void
updateHover
(String hoverHTML) If this canvas is currently showing a hover (seehandleHover()
), this method can be called to update the HTML contents of the hover.void
Update the canvas shadow.void
This method is executed on draw.visibleAtPoint
(int x, int y, boolean withinViewport, Canvas ignoreWidgets, Canvas upToParent) Does this widget contain the specified global (x,y) coordinates, and have no other widgets also at the specified position, obscuring this one? This is commonly used for (for example) drag and drop interactions.Returns true if the widget object being dragged can be dropped on this widget, and false or null otherwise.Methods inherited from class com.smartgwt.client.widgets.BaseWidget
addDrawHandler, addDynamicProperty, addDynamicProperty, addDynamicProperty, addDynamicProperty, applyFactoryProperties, clearDynamicProperty, completeCreation, destroy, doAddHandler, doInit, doOnRender, draw, equals, error, errorIfNotCreated, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDateArray, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsFloatArray, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getConfig, getDOM, getHandlerCount, getID, getInnerHTML, getJsObj, getOrCreateJsObj, getRef, getScClassName, hasAutoAssignedID, hasDynamicProperty, hashCode, initNativeObject, internalSetID, internalSetID, isConfigOnly, isCreated, isDrawn, isFactoryCreated, onBind, onDestroy, onDraw, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setDefaultProperties, setDragTracker, setFactoryCreated, setID, setJavaScriptObject, setLogicalStructure, setLogicalStructure, setNullProperty, setPosition, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setScClassName, toString
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
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
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 Details
-
Canvas
public Canvas() -
Canvas
-
Canvas
-
-
Method Details
-
getOrCreateRef
-
getPaletteDefaults
This method returns a Map of config properties suitable for use as the "defaults" attribute of aPaletteNode
. Use it when you need to work with PaletteNodes indirectly, such when setting upTileRecord
s that will be used in aTilePalette
. Seethe dev tools overview
for examples of how to assemble and acquire a suitable defaults object when you are creating a PaletteNode indirectly -
changeAutoChildDefaults
Changes the defaults for Canvas AutoChildren namedautoChildName
.- Parameters:
autoChildName
- name of an AutoChild to customize the defaults for.defaults
- Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, seeSGWTProperties
.- See Also:
-
changeAutoChildDefaults
Changes the defaults for FormItem AutoChildren namedautoChildName
.- Parameters:
autoChildName
- name of an AutoChild to customize the defaults for.defaults
- FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, seeSGWTProperties
.- See Also:
-
create
- Overrides:
create
in classBaseWidget
-
setAccessKey
If specified this governs the HTML accessKey for the widget.This should be set to a character - when a user hits the html accessKey modifier for the browser, plus this character, focus will be given to the widget in question. The accessKey modifier can vary by browser and platform.
The following list of default behavior is for reference only, developers should also consult browser documentation for additional information.
- Internet Explorer (all
platforms):
Alt
+ accessKey - Mozilla Firefox (Windows, Unix):
Alt+Shift
+ accessKey - Mozilla Firefox (Mac):
Ctrl+Opt
+ accessKey - Chrome and Safari (Windows, Unix):
Alt
+ accessKey - Chrome and Safari (Mac):
Ctrl+Opt
+ accessKey
If this method is called after the component has been drawn/initialized: Set the accessKey for this canvas.The accessKey can be set to any alphanumeric character (symbols not supported) Having set an accessKey, the canvas will be given focus when the user hits Alt+[accessKey], or in Mozilla Firefox 2.0 and above, Shift+Alt+[accessKey].
Note : This is an advanced setting
- Internet Explorer (all
platforms):
-
getAccessKey
If specified this governs the HTML accessKey for the widget.This should be set to a character - when a user hits the html accessKey modifier for the browser, plus this character, focus will be given to the widget in question. The accessKey modifier can vary by browser and platform.
The following list of default behavior is for reference only, developers should also consult browser documentation for additional information.
- Internet Explorer (all
platforms):
Alt
+ accessKey - Mozilla Firefox (Windows, Unix):
Alt+Shift
+ accessKey - Mozilla Firefox (Mac):
Ctrl+Opt
+ accessKey - Chrome and Safari (Windows, Unix):
Alt
+ accessKey - Chrome and Safari (Mac):
Ctrl+Opt
+ accessKey
- Returns:
- Current accessKey value. Default value is null
- See Also:
- Internet Explorer (all
platforms):
-
setAdaptiveHeightPriority
public Canvas setAdaptiveHeightPriority(Integer adaptiveHeightPriority) throws IllegalStateException - Parameters:
adaptiveHeightPriority
- New adaptiveHeightPriority value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getAdaptiveHeightPriority
- Returns:
- Current adaptiveHeightPriority value. Default value is null
-
setAdaptiveWidthPriority
If multiple widgets in the same Layout haveadaptive width
,adaptiveWidthPriority
can be set to indicate which of the components should be given priority access to space.The widget with the highest priority setting will be offered surplus space first, and asked to give up space last. Lack of a priority setting is treated as zero. Any adaptive widgets with the same priority setting will be asked to give up or release space according to their order in
Layout.members
.- Parameters:
adaptiveWidthPriority
- New adaptiveWidthPriority value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getAdaptiveWidthPriority
If multiple widgets in the same Layout haveadaptive width
,adaptiveWidthPriority
can be set to indicate which of the components should be given priority access to space.The widget with the highest priority setting will be offered surplus space first, and asked to give up space last. Lack of a priority setting is treated as zero. Any adaptive widgets with the same priority setting will be asked to give up or release space according to their order in
Layout.members
.- Returns:
- Current adaptiveWidthPriority value. Default value is null
- See Also:
-
setAlwaysShowScrollbars
Should this browser always show custom scrollbars ifshowCustomScrollbars
is true?On
touch devices
that support native touch scrolling, ifshowCustomScrollbars
istrue
and touch scrolling has not been disabled by theuseTouchScrolling
and/ordisableTouchScrollingForDrag
settings, should custom scrollbars and native touch scrolling be enabled for this component? Iffalse
or unset, then only native touch scrolling will be enabled. Iftrue
, then both scrolling mechanisms will be enabled.NOTE: Because native touch scrolling (also called momentum scrolling) is computationally intensive, some mobile browsers implement an optimization where the state of the DOM for the element being scrolled will be frozen or partially frozen during the scroll animation. This results in a delay between when the scroll position reaches a certain point in the animation and when the positions of the custom scrollbar thumbs are updated to reflect that scroll position.
For non-touch devices, setting this property to
true
will overridenativeAutoHideScrollbars
, and ensure custom scrollbars are shown for the componentNote : This is an advanced setting
- Parameters:
alwaysShowScrollbars
- New alwaysShowScrollbars value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getAlwaysShowScrollbars
Should this browser always show custom scrollbars ifshowCustomScrollbars
is true?On
touch devices
that support native touch scrolling, ifshowCustomScrollbars
istrue
and touch scrolling has not been disabled by theuseTouchScrolling
and/ordisableTouchScrollingForDrag
settings, should custom scrollbars and native touch scrolling be enabled for this component? Iffalse
or unset, then only native touch scrolling will be enabled. Iftrue
, then both scrolling mechanisms will be enabled.NOTE: Because native touch scrolling (also called momentum scrolling) is computationally intensive, some mobile browsers implement an optimization where the state of the DOM for the element being scrolled will be frozen or partially frozen during the scroll animation. This results in a delay between when the scroll position reaches a certain point in the animation and when the positions of the custom scrollbar thumbs are updated to reflect that scroll position.
For non-touch devices, setting this property to
true
will overridenativeAutoHideScrollbars
, and ensure custom scrollbars are shown for the component- Returns:
- Current alwaysShowScrollbars value. Default value is null
- See Also:
-
setAnimateAcceleration
Default acceleration effect to apply to all animations on this Canvas. Can be overridden by setting animationAcceleration for specific animations or by passing an acceleration function directly into the appropriate method.Note : This is an advanced setting
- Parameters:
animateAcceleration
- New animateAcceleration value. Default value is "smoothEnd"- Returns:
Canvas
instance, for chaining setter calls
-
getAnimateAcceleration
Default acceleration effect to apply to all animations on this Canvas. Can be overridden by setting animationAcceleration for specific animations or by passing an acceleration function directly into the appropriate method.- Returns:
- Current animateAcceleration value. Default value is "smoothEnd"
-
setAnimateFadeTime
Default time for performing an animated fade. If unset,this.animateTime
will be used by default insteadNote : This is an advanced setting
- Parameters:
animateFadeTime
- New animateFadeTime value. Default value is null- Returns:
Canvas
instance, for chaining setter calls
-
getAnimateFadeTime
Default time for performing an animated fade. If unset,this.animateTime
will be used by default instead- Returns:
- Current animateFadeTime value. Default value is null
-
setAnimateHideAcceleration
Default acceleration function for performing an animated hide. If unset,this.animateAcceleration
will be used by default insteadNote : This is an advanced setting
- Parameters:
animateHideAcceleration
- New animateHideAcceleration value. Default value is null- Returns:
Canvas
instance, for chaining setter calls
-
getAnimateHideAcceleration
Default acceleration function for performing an animated hide. If unset,this.animateAcceleration
will be used by default instead- Returns:
- Current animateHideAcceleration value. Default value is null
-
setAnimateHideTime
Default time for performing an animated hide. If unset,this.animateTime
will be used by default insteadNote : This is an advanced setting
- Parameters:
animateHideTime
- New animateHideTime value. Default value is null- Returns:
Canvas
instance, for chaining setter calls
-
getAnimateHideTime
Default time for performing an animated hide. If unset,this.animateTime
will be used by default instead- Returns:
- Current animateHideTime value. Default value is null
-
setAnimateMoveAcceleration
Default acceleration effect for performing an animated move. If unset,this.animateAcceleration
will be used by default insteadNote : This is an advanced setting
- Parameters:
animateMoveAcceleration
- New animateMoveAcceleration value. Default value is null- Returns:
Canvas
instance, for chaining setter calls
-
getAnimateMoveAcceleration
Default acceleration effect for performing an animated move. If unset,this.animateAcceleration
will be used by default instead- Returns:
- Current animateMoveAcceleration value. Default value is null
-
setAnimateMoveTime
Default time for performing an animated move. If unset,this.animateTime
will be used by default insteadNote : This is an advanced setting
- Parameters:
animateMoveTime
- New animateMoveTime value. Default value is null- Returns:
Canvas
instance, for chaining setter calls
-
getAnimateMoveTime
Default time for performing an animated move. If unset,this.animateTime
will be used by default instead- Returns:
- Current animateMoveTime value. Default value is null
-
setAnimateRectAcceleration
Default acceleration function for performing an animated move and resize. If unset,this.animateAcceleration
will be used by default insteadNote : This is an advanced setting
- Parameters:
animateRectAcceleration
- New animateRectAcceleration value. Default value is null- Returns:
Canvas
instance, for chaining setter calls
-
getAnimateRectAcceleration
Default acceleration function for performing an animated move and resize. If unset,this.animateAcceleration
will be used by default instead- Returns:
- Current animateRectAcceleration value. Default value is null
-
setAnimateRectTime
Default time for performing an animated setRect. If unset,this.animateTime
will be used by default insteadNote : This is an advanced setting
- Parameters:
animateRectTime
- New animateRectTime value. Default value is null- Returns:
Canvas
instance, for chaining setter calls
-
getAnimateRectTime
Default time for performing an animated setRect. If unset,this.animateTime
will be used by default instead- Returns:
- Current animateRectTime value. Default value is null
-
setAnimateResizeAcceleration
Default acceleration function for performing an animated resize. If unset,this.animateAcceleration
will be used by default insteadNote : This is an advanced setting
- Parameters:
animateResizeAcceleration
- New animateResizeAcceleration value. Default value is null- Returns:
Canvas
instance, for chaining setter calls
-
getAnimateResizeAcceleration
Default acceleration function for performing an animated resize. If unset,this.animateAcceleration
will be used by default instead- Returns:
- Current animateResizeAcceleration value. Default value is null
-
setAnimateResizeLayoutMode
When to update thechild layout
for asize animation
. Updating the child layout more often may improve appearance, but risks prohibitive overhead with more complicated widget hierarchies.Note : This is an advanced setting
- Parameters:
animateResizeLayoutMode
- New animateResizeLayoutMode value. Default value is "atEnd"- Returns:
Canvas
instance, for chaining setter calls
-
getAnimateResizeLayoutMode
When to update thechild layout
for asize animation
. Updating the child layout more often may improve appearance, but risks prohibitive overhead with more complicated widget hierarchies.- Returns:
- Current animateResizeLayoutMode value. Default value is "atEnd"
-
setAnimateResizeTime
Default time for performing an animated resize. If unset,this.animateTime
will be used by default insteadNote : This is an advanced setting
- Parameters:
animateResizeTime
- New animateResizeTime value. Default value is null- Returns:
Canvas
instance, for chaining setter calls
-
getAnimateResizeTime
Default time for performing an animated resize. If unset,this.animateTime
will be used by default instead- Returns:
- Current animateResizeTime value. Default value is null
-
setAnimateScrollAcceleration
Default acceleration function for performing an animated scroll. If unset,this.animateAcceleration
will be used by default insteadNote : This is an advanced setting
- Parameters:
animateScrollAcceleration
- New animateScrollAcceleration value. Default value is null- Returns:
Canvas
instance, for chaining setter calls
-
getAnimateScrollAcceleration
Default acceleration function for performing an animated scroll. If unset,this.animateAcceleration
will be used by default instead- Returns:
- Current animateScrollAcceleration value. Default value is null
-
setAnimateScrollTime
Default time for performing an animated scroll. If unset,this.animateTime
will be used by default insteadNote : This is an advanced setting
- Parameters:
animateScrollTime
- New animateScrollTime value. Default value is null- Returns:
Canvas
instance, for chaining setter calls
-
getAnimateScrollTime
Default time for performing an animated scroll. If unset,this.animateTime
will be used by default instead- Returns:
- Current animateScrollTime value. Default value is null
-
setAnimateShowAcceleration
Default acceleration function for performing an animated show. If unset,this.animateAcceleration
will be used by default insteadNote : This is an advanced setting
- Parameters:
animateShowAcceleration
- New animateShowAcceleration value. Default value is null- Returns:
Canvas
instance, for chaining setter calls
-
getAnimateShowAcceleration
Default acceleration function for performing an animated show. If unset,this.animateAcceleration
will be used by default instead- Returns:
- Current animateShowAcceleration value. Default value is null
-
setAnimateShowTime
Default time for performing an animated show. If unset,this.animateTime
will be used by default insteadNote : This is an advanced setting
- Parameters:
animateShowTime
- New animateShowTime value. Default value is null- Returns:
Canvas
instance, for chaining setter calls
-
getAnimateShowTime
Default time for performing an animated show. If unset,this.animateTime
will be used by default instead- Returns:
- Current animateShowTime value. Default value is null
-
setAnimateTime
Default total duration of animations. Can be overridden by setting animation times for specific animations, or by passing aduration
parameter into the appropriate animate...() method.Note : This is an advanced setting
- Parameters:
animateTime
- New animateTime value. Default value is 300- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getAnimateTime
public int getAnimateTime()Default total duration of animations. Can be overridden by setting animation times for specific animations, or by passing aduration
parameter into the appropriate animate...() method.- Returns:
- Current animateTime value. Default value is 300
- See Also:
-
setAppImgDir
Default directory for app-specific images, relative to the Page-wideappImgDir
.Note : This is an advanced setting
- Parameters:
appImgDir
- New appImgDir value. Default value is ""- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getAppImgDir
Default directory for app-specific images, relative to the Page-wideappImgDir
.- Returns:
- Current appImgDir value. Default value is ""
- See Also:
-
setAriaRole
ARIA role of this component. Usually does not need to be manually set - seeAccessibility
.- Parameters:
ariaRole
- New ariaRole value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getAriaRole
ARIA role of this component. Usually does not need to be manually set - seeAccessibility
.- Returns:
- Current ariaRole value. Default value is null
- See Also:
-
setAutoMaskComponents
Deprecated.As of Smart GWT version 10.0, deprecated in favor ofEditProxy.autoMaskChildren
When nodes are added to an EditContext, should they be masked by settingEditProxy.useEditMask
true
if not explicitly set?- Parameters:
autoMaskComponents
- New autoMaskComponents value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getAutoMaskComponents
Deprecated.As of Smart GWT version 10.0, deprecated in favor ofEditProxy.autoMaskChildren
When nodes are added to an EditContext, should they be masked by settingEditProxy.useEditMask
true
if not explicitly set?- Returns:
- Current autoMaskComponents value. Default value is null
-
setAutoParent
This initialization property allows developers to create a canvas using the Class.addAutoChild() method, and have it added as a child to some other component. This property may be set to thechildName
of another already-created auto-child, or"none"
to cause the component to be created without being added as a child to any other widget.
If unset, the canvas will be added as a child to the component on whichaddAutoChild(...)
was called.See
autoChildren
for an overview of the autoChild subsystem.Note : This is an advanced setting
- Parameters:
autoParent
- New autoParent value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
-
getAutoParent
This initialization property allows developers to create a canvas using the Class.addAutoChild() method, and have it added as a child to some other component. This property may be set to thechildName
of another already-created auto-child, or"none"
to cause the component to be created without being added as a child to any other widget.
If unset, the canvas will be added as a child to the component on whichaddAutoChild(...)
was called.See
autoChildren
for an overview of the autoChild subsystem.- Returns:
- Current autoParent value. Default value is null
-
setAutoPopulateData
If adataContext
is provided, should subcomponents automatically bind to the data?In general, if you provide a
primaryKey
value for a record, that specific record will be shown or edited, or have its related records loaded. If you provide other field values without the primaryKey value, those values will be treated as either criteria (for a grid) or as initial values (for a form).Components will respond to
dataContext
differently depending on whether they typically work with just a single record (such asform
or aDetailViewer
), or whether they usually work with lists of records (such asListGrid
orTileGrid
, which havecomponent.dataArity
set tomultipe
by default).Specifically, the following rules are used:
- for a singular component (eg forms,
detailViewers):
- if only the PK (primary key) value is provided, the component will fetch the singular record and display or edit it
- if the PK is provided along with other values, the component will assume it has a complete record, and display or edit it
- if only non-PK values are provided, the component will assume these are initial values
- for a multiple component (eg listGrid,
tileGrid):
- if only non-PK values are provided, the component will use these as criteria.
For example, a grid bound to an Orders DataSource with
dataContext
of Status:"In Process" would fetch records with that status - if the PK is provided, and the component's
DataSource is related to one of the DataSources in the
dataContext
, related records will be fetched, using the PK value (similarly to iffetchRelatedData()
had been called. For example, if an orderNumber value was provided, a grid bound to OrderDetail would fetch line items for that orderNumber. - if an array of multiple records is provided, that data is used as if setData() had been called on the component
- if only non-PK values are provided, the component will use these as criteria.
For example, a grid bound to an Orders DataSource with
autoPopulateData
to false on the specific component that should not be auto-populated.Specific examples, using the Order and OrderDetail sample DataSources, where OrderDetail records are associated (many-to-1) with Order records, and the PK of Order is orderNumber:
- a
form or DetailViewer bound to Order and a ListGrid bound to OrderDetail:
- if an orderNumber is provided, the form or DetailViewer would show that order, and the grid would show related OrderDetail records
- if only orderNumber is provided (no additional fields), the full Order record is automatically fetched for the form or DetailViewer
This fulfills a common use case of viewing or editing an Order and its related OrderDetail records.
- a grid bound to Order and a second grid bound to OrderDetail
- if values such as orderStatus : "On Hold" were provided, the Order grid uses those as criteria
- the OrderDetail grid does nothing
This fulfills a common use case of viewing Order records that match certain criteria. The OrderDetail grid would generally be populated only by an event handler installed on the Order grid, which would call
fetchRelatedData
. - a grid and form both bound
to Order
- if values such as orderStatus : "On Hold" were provided, the Order grid uses those as criteria, and the form uses those as initial values
This fulfills two possible use cases:
- the form is a SearchForm for searching the grid, so it should show the same criteria as are applied to the grid
- the form is for editing the selected record in
the grid, or adding new ones. It is ready to either add a new record, or for the user to select a record to
show in the form, typically via logic added to the grid (e.g.
recordClick
->form.editSelectedData()
.
By default,
autoPopulateData
is true for any component that is contained with a "screen"RPCManager.createScreen()
and false for any component that is ancom.smartgwt.client.types.AutoChild
.Note that, if there is a non-DBC in your screen that wants to access fields in the expected dataContext, the DynamicProperty can refer to properties that auto-populated DBCs will place into the ruleContext. For example, with a DynamicForm "itemEditor" bound to "supplyItem", a header above could use itemEditor.values.itemName to display the name of the item. The header will then show the expected value as soon as the DynamicForm is auto-populated.
Similarly, the
DataView.drawn()
StringMethod fires after auto-population has occurred, so any startup actions in a screen will likewise be able to utilize data from thedataContext
by just referring to it viaruleScope
.- Parameters:
autoPopulateData
- New autoPopulateData value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created
- for a singular component (eg forms,
detailViewers):
-
getAutoPopulateData
If adataContext
is provided, should subcomponents automatically bind to the data?In general, if you provide a
primaryKey
value for a record, that specific record will be shown or edited, or have its related records loaded. If you provide other field values without the primaryKey value, those values will be treated as either criteria (for a grid) or as initial values (for a form).Components will respond to
dataContext
differently depending on whether they typically work with just a single record (such asform
or aDetailViewer
), or whether they usually work with lists of records (such asListGrid
orTileGrid
, which havecomponent.dataArity
set tomultipe
by default).Specifically, the following rules are used:
- for a singular component (eg forms,
detailViewers):
- if only the PK (primary key) value is provided, the component will fetch the singular record and display or edit it
- if the PK is provided along with other values, the component will assume it has a complete record, and display or edit it
- if only non-PK values are provided, the component will assume these are initial values
- for a multiple component (eg listGrid,
tileGrid):
- if only non-PK values are provided, the component will use these as criteria.
For example, a grid bound to an Orders DataSource with
dataContext
of Status:"In Process" would fetch records with that status - if the PK is provided, and the component's
DataSource is related to one of the DataSources in the
dataContext
, related records will be fetched, using the PK value (similarly to iffetchRelatedData()
had been called. For example, if an orderNumber value was provided, a grid bound to OrderDetail would fetch line items for that orderNumber. - if an array of multiple records is provided, that data is used as if setData() had been called on the component
- if only non-PK values are provided, the component will use these as criteria.
For example, a grid bound to an Orders DataSource with
autoPopulateData
to false on the specific component that should not be auto-populated.Specific examples, using the Order and OrderDetail sample DataSources, where OrderDetail records are associated (many-to-1) with Order records, and the PK of Order is orderNumber:
- a
form or DetailViewer bound to Order and a ListGrid bound to OrderDetail:
- if an orderNumber is provided, the form or DetailViewer would show that order, and the grid would show related OrderDetail records
- if only orderNumber is provided (no additional fields), the full Order record is automatically fetched for the form or DetailViewer
This fulfills a common use case of viewing or editing an Order and its related OrderDetail records.
- a grid bound to Order and a second grid bound to OrderDetail
- if values such as orderStatus : "On Hold" were provided, the Order grid uses those as criteria
- the OrderDetail grid does nothing
This fulfills a common use case of viewing Order records that match certain criteria. The OrderDetail grid would generally be populated only by an event handler installed on the Order grid, which would call
fetchRelatedData
. - a grid and form both bound
to Order
- if values such as orderStatus : "On Hold" were provided, the Order grid uses those as criteria, and the form uses those as initial values
This fulfills two possible use cases:
- the form is a SearchForm for searching the grid, so it should show the same criteria as are applied to the grid
- the form is for editing the selected record in
the grid, or adding new ones. It is ready to either add a new record, or for the user to select a record to
show in the form, typically via logic added to the grid (e.g.
recordClick
->form.editSelectedData()
.
By default,
autoPopulateData
is true for any component that is contained with a "screen"RPCManager.createScreen()
and false for any component that is ancom.smartgwt.client.types.AutoChild
.Note that, if there is a non-DBC in your screen that wants to access fields in the expected dataContext, the DynamicProperty can refer to properties that auto-populated DBCs will place into the ruleContext. For example, with a DynamicForm "itemEditor" bound to "supplyItem", a header above could use itemEditor.values.itemName to display the name of the item. The header will then show the expected value as soon as the DynamicForm is auto-populated.
Similarly, the
DataView.drawn()
StringMethod fires after auto-population has occurred, so any startup actions in a screen will likewise be able to utilize data from thedataContext
by just referring to it viaruleScope
.- Returns:
- Current autoPopulateData value. Default value is null
- for a singular component (eg forms,
detailViewers):
-
setAutoShowParent
If set to true, the widget's parent (if any) will automatically be shown whenever the widget is shown.Note : This is an advanced setting
- Parameters:
autoShowParent
- New autoShowParent value. Default value is false- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getAutoShowParent
If set to true, the widget's parent (if any) will automatically be shown whenever the widget is shown.- Returns:
- Current autoShowParent value. Default value is false
- See Also:
-
setBackgroundColor
The background color for this widget. It corresponds to the CSS background-color attribute. You can set this property to an RGB value (e.g. #22AAFF) or a named color (e.g. red) from a list of browser supported color names.
If this method is called after the component has been drawn/initialized: Sets the background color of this component tonewColor
.- Parameters:
backgroundColor
- new background color, ornull
to remove the current background color. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getBackgroundColor
The background color for this widget. It corresponds to the CSS background-color attribute. You can set this property to an RGB value (e.g. #22AAFF) or a named color (e.g. red) from a list of browser supported color names.- Returns:
- Current backgroundColor value. Default value is null
- See Also:
-
setBackgroundImage
URL for a background image for this widget (corresponding to the CSS "background-image" attribute).
If this method is called after the component has been drawn/initialized: Sets the background to an image file given by newImage. This URL should be given as a string relative to the image directory for the page (./images by default).- Parameters:
backgroundImage
- new URL (local to Page image directory) for background image. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getBackgroundImage
URL for a background image for this widget (corresponding to the CSS "background-image" attribute).- Returns:
- Current backgroundImage value. Default value is null
- See Also:
-
setBackgroundPosition
Specifies how the background image should be positioned on the widget. It corresponds to the CSS background-position attribute. If unset, no background-position attribute is specified if a background image is specified.- Parameters:
backgroundPosition
- New backgroundPosition value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getBackgroundPosition
Specifies how the background image should be positioned on the widget. It corresponds to the CSS background-position attribute. If unset, no background-position attribute is specified if a background image is specified.- Returns:
- Current backgroundPosition value. Default value is null
- See Also:
-
setBackgroundRepeat
Specifies how the background image should be tiled if this widget is larger than the image. It corresponds to the CSSbackground-repeat
attribute.The default of null means no
background-repeat
CSS will be written out. SeeBackgroundRepeat
type for details on other settings.NOTE: this setting directly sets the CSS property
background-repeat
but does not attempt to work around various known bugs with this setting, or lack of support in IE6. If you need to apply CSS-based workarounds for browser limitations with this setting, it's best to do so via settingstyleName
.- Parameters:
backgroundRepeat
- New backgroundRepeat value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getBackgroundRepeat
Specifies how the background image should be tiled if this widget is larger than the image. It corresponds to the CSSbackground-repeat
attribute.The default of null means no
background-repeat
CSS will be written out. SeeBackgroundRepeat
type for details on other settings.NOTE: this setting directly sets the CSS property
background-repeat
but does not attempt to work around various known bugs with this setting, or lack of support in IE6. If you need to apply CSS-based workarounds for browser limitations with this setting, it's best to do so via settingstyleName
.- Returns:
- Current backgroundRepeat value. Default value is null
- See Also:
-
setBorder
Set the CSS border of this component, as a CSS string including border-width, border-style, and/or color (eg "2px solid blue").This property applies the same border to all four sides of this component. Different per-side borders can be set in a CSS style and applied via
styleName
.If a
grouping frame
is being shown then border is derived from thegroupBorderCSS
attribute, not from the explicit border property.
If this method is called after the component has been drawn/initialized: Set the CSS border of this component, as a CSS string including border-width, border-style, and/or color (eg "2px solid blue").This property applies the same border to all four sides of this component. Different per-side borders can be set in a CSS style and applied via
styleName
.- Parameters:
border
- new border to set to (eg: "2px solid black"). Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getBorder
Set the CSS border of this component, as a CSS string including border-width, border-style, and/or color (eg "2px solid blue").This property applies the same border to all four sides of this component. Different per-side borders can be set in a CSS style and applied via
styleName
.If a
grouping frame
is being shown then border is derived from thegroupBorderCSS
attribute, not from the explicit border property.- Returns:
- Current border value. Default value is null
- See Also:
-
setBorderRadius
The CSS border-radius for this widget. The value can be any variant of a CSS border-radius value - that is, from 1 to 4 space-separated px values, where one value affects all corners and 4 values affects individual corners. For example "10px" applies a 10px radius to all corners, where "5px 10px 15px 20px" applies a different radius to each corner, clockwise from Top-Left: "TL TR BR BL".- Parameters:
borderRadius
- New borderRadius value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getBorderRadius
The CSS border-radius for this widget. The value can be any variant of a CSS border-radius value - that is, from 1 to 4 space-separated px values, where one value affects all corners and 4 values affects individual corners. For example "10px" applies a 10px radius to all corners, where "5px 10px 15px 20px" applies a different radius to each corner, clockwise from Top-Left: "TL TR BR BL".- Returns:
- Current borderRadius value. Default value is null
- See Also:
-
setCanAcceptDrop
Indicates that this object can receive dropped widgets (i.e. other widgets can be dropped on top of it).Note : This is an advanced setting
- Parameters:
canAcceptDrop
- New canAcceptDrop value. Default value is false- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getCanAcceptDrop
Indicates that this object can receive dropped widgets (i.e. other widgets can be dropped on top of it).- Returns:
- Current canAcceptDrop value. Default value is false
- See Also:
-
setCanAdaptHeight
SeecanAdaptWidth
.- Parameters:
canAdaptHeight
- New canAdaptHeight value. Default value is null- Returns:
Canvas
instance, for chaining setter calls
-
getCanAdaptHeight
SeecanAdaptWidth
.- Returns:
- Current canAdaptHeight value. Default value is null
-
setCanAdaptWidth
Indicates that this component is able to render itself at multiple possible sizes, in order to fit into less space when very little space is available, or to display more information or provide more immediate access to functionality when more space is available.Unlike simply indicating a flexible size via width:"*", setting
canAdaptWidth
indicates that a component has 2 (or more) different ways of rendering itself with different discrete sizes, but does not have the ability to use every additional available pixel.For example, a menu embedded in a toolbar might show as only a fixed-size icon which reveals menu options when clicked, or if enough space is available, could show all of the menu options directly in the toolbar. In this example, the menu should either be allocated just enough space for an icon, or enough space for all options to appear inline; any other amount of space being allocated is just a waste.
When a component with
canAdaptWidth
is part of a Layout,AdaptWidthByCustomizer.adaptWidthBy()
will be called every time component sizes are being calculated, passing a positive or negative pixel value:- a
positive pixel value indicates a surplus - all other component's minimum sizes can be accommodated,
including any
minWidth
declared on thecanAdaptWidth
component itself - a negative pixel value indicates that the containing layout is
going to be forced to
Overflow
(introduce scrollbars, clip content, etc) unless some component or set of components gives up at least this many pixels
If a non-zero value is returned from
adaptWidthBy
, this means that the component is willing to shrink or expand by that many pixels. Returning 0 means that the component is unable to reduce size further, or for a surplus, cannot make good use of the surplus space.- A call to
AdaptWidthByCustomizer.adaptWidthBy()
may surrender as many pixels as desired (as long as the widget won't drop below its minimum allowed width), no matter whether a positive (surplus) or negative (overflow) pixel value is supplied, but - A call to
AdaptWidthByCustomizer.adaptWidthBy()
may not increase its size by more than the number of offered pixels - so if an overflow is present, it may not increase its size at all.
Note that when the initial width is specified as a stretch size (e.g. "*"), then after
AdaptWidthByCustomizer.adaptWidthBy()
is called, the Framework will stretch (but not shrink) the member like any other stretch-size Layout member, but theunadaptedWidth
argument will always reflect the unstretched width requested by the previous call toAdaptWidthByCustomizer.adaptWidthBy()
. This behavior may be disabled by specifying the initial width as a number, or leaving it unspecified.Behavior is slightly different for overflow: "visible" members - in this case the
unadaptedWidth
passed in will reflect the current visible width of the member, rather than the last width requested by the previous call toAdaptWidthByCustomizer.adaptWidthBy()
or the specified width (on the first call). However, note that the visible length will match your requested width unless the member is actually overflowed. Stretch sizing is not supported for adaptive-width members with overflow: "visible".Caution: you must either determine the current size of the canvas by maintaining your own internal state, or use the
unadaptedWidth
parameter passed toAdaptWidthByCustomizer.adaptWidthBy()
. You must not callgetWidth()
orgetVisibleWidth()
on the canvas itself insideAdaptWidthByCustomizer.adaptWidthBy()
as the size is in the processing of being determined, but you may draw children or callgetVisibleWidth()
on them, as we guarantee that the adaptive-width canvas is drawn before the first call toAdaptWidthByCustomizer.adaptWidthBy()
. An example of drawing children inAdaptWidthByCustomizer.adaptWidthBy()
to compute overall width may be seen in the Inlined Menu Mobile Sample.Note that reasonable settings for
minWidth
should be applied to all other flexible-sized members of a layout where acanAdaptWidth
component appears, because when too little space is available, acanAdaptWidth
component will absorb all available space until minimums for other components are hit (or thecanAdaptWidth
component reaches its maximum size). If more than onecanAdaptWidth
component is present,adaptiveWidthPriority
to give priority to a particular component when allocating space.All of the above behaviors are exactly the same for height, using
canAdaptHeight
andAdaptHeightByCustomizer.adaptHeightBy()
.- Parameters:
canAdaptWidth
- New canAdaptWidth value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
- a
positive pixel value indicates a surplus - all other component's minimum sizes can be accommodated,
including any
-
getCanAdaptWidth
Indicates that this component is able to render itself at multiple possible sizes, in order to fit into less space when very little space is available, or to display more information or provide more immediate access to functionality when more space is available.Unlike simply indicating a flexible size via width:"*", setting
canAdaptWidth
indicates that a component has 2 (or more) different ways of rendering itself with different discrete sizes, but does not have the ability to use every additional available pixel.For example, a menu embedded in a toolbar might show as only a fixed-size icon which reveals menu options when clicked, or if enough space is available, could show all of the menu options directly in the toolbar. In this example, the menu should either be allocated just enough space for an icon, or enough space for all options to appear inline; any other amount of space being allocated is just a waste.
When a component with
canAdaptWidth
is part of a Layout,AdaptWidthByCustomizer.adaptWidthBy()
will be called every time component sizes are being calculated, passing a positive or negative pixel value:- a
positive pixel value indicates a surplus - all other component's minimum sizes can be accommodated,
including any
minWidth
declared on thecanAdaptWidth
component itself - a negative pixel value indicates that the containing layout is
going to be forced to
Overflow
(introduce scrollbars, clip content, etc) unless some component or set of components gives up at least this many pixels
If a non-zero value is returned from
adaptWidthBy
, this means that the component is willing to shrink or expand by that many pixels. Returning 0 means that the component is unable to reduce size further, or for a surplus, cannot make good use of the surplus space.- A call to
AdaptWidthByCustomizer.adaptWidthBy()
may surrender as many pixels as desired (as long as the widget won't drop below its minimum allowed width), no matter whether a positive (surplus) or negative (overflow) pixel value is supplied, but - A call to
AdaptWidthByCustomizer.adaptWidthBy()
may not increase its size by more than the number of offered pixels - so if an overflow is present, it may not increase its size at all.
Note that when the initial width is specified as a stretch size (e.g. "*"), then after
AdaptWidthByCustomizer.adaptWidthBy()
is called, the Framework will stretch (but not shrink) the member like any other stretch-size Layout member, but theunadaptedWidth
argument will always reflect the unstretched width requested by the previous call toAdaptWidthByCustomizer.adaptWidthBy()
. This behavior may be disabled by specifying the initial width as a number, or leaving it unspecified.Behavior is slightly different for overflow: "visible" members - in this case the
unadaptedWidth
passed in will reflect the current visible width of the member, rather than the last width requested by the previous call toAdaptWidthByCustomizer.adaptWidthBy()
or the specified width (on the first call). However, note that the visible length will match your requested width unless the member is actually overflowed. Stretch sizing is not supported for adaptive-width members with overflow: "visible".Caution: you must either determine the current size of the canvas by maintaining your own internal state, or use the
unadaptedWidth
parameter passed toAdaptWidthByCustomizer.adaptWidthBy()
. You must not callgetWidth()
orgetVisibleWidth()
on the canvas itself insideAdaptWidthByCustomizer.adaptWidthBy()
as the size is in the processing of being determined, but you may draw children or callgetVisibleWidth()
on them, as we guarantee that the adaptive-width canvas is drawn before the first call toAdaptWidthByCustomizer.adaptWidthBy()
. An example of drawing children inAdaptWidthByCustomizer.adaptWidthBy()
to compute overall width may be seen in the Inlined Menu Mobile Sample.Note that reasonable settings for
minWidth
should be applied to all other flexible-sized members of a layout where acanAdaptWidth
component appears, because when too little space is available, acanAdaptWidth
component will absorb all available space until minimums for other components are hit (or thecanAdaptWidth
component reaches its maximum size). If more than onecanAdaptWidth
component is present,adaptiveWidthPriority
to give priority to a particular component when allocating space.All of the above behaviors are exactly the same for height, using
canAdaptHeight
andAdaptHeightByCustomizer.adaptHeightBy()
.- Returns:
- Current canAdaptWidth value. Default value is null
- See Also:
- a
positive pixel value indicates a surplus - all other component's minimum sizes can be accommodated,
including any
-
setCanDrag
Indicates whether this widget can initiate custom drag-and-drop operations (other than reposition or resize). NormallycanDragReposition
orcanDragResize
would be used instead of this property.Note: this property may be manipulated by higher-level dragging semantics.
If
useNativeDrag
is true and this widget has been drawn, then this widget must beredrawn
in order for a change of the value of this attribute to take effect.Note : This is an advanced setting
- Parameters:
canDrag
- New canDrag value. Default value is false- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getCanDrag
Indicates whether this widget can initiate custom drag-and-drop operations (other than reposition or resize). NormallycanDragReposition
orcanDragResize
would be used instead of this property.Note: this property may be manipulated by higher-level dragging semantics.
If
useNativeDrag
is true and this widget has been drawn, then this widget must beredrawn
in order for a change of the value of this attribute to take effect.- Returns:
- Current canDrag value. Default value is false
- See Also:
-
setCanDragReposition
Indicates whether this widget can be moved by a user of your application by simply dragging with the mouse.Note : This is an advanced setting
- Parameters:
canDragReposition
- New canDragReposition value. Default value is false- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getCanDragReposition
Indicates whether this widget can be moved by a user of your application by simply dragging with the mouse.- Returns:
- Current canDragReposition value. Default value is false
- See Also:
-
setCanDragResize
Indicates whether this widget can be resized by dragging on the edges and/or corners of the widget with the mouse.Note : This is an advanced setting
- Parameters:
canDragResize
- New canDragResize value. Default value is false- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getCanDragResize
Indicates whether this widget can be resized by dragging on the edges and/or corners of the widget with the mouse.- Returns:
- Current canDragResize value. Default value is false
- See Also:
-
setCanDragScroll
If this Canvas is canAcceptDrop:true, when the user drags a droppable widget over an edge of the widget, should we scroll to show the rest of the widget's content? Returned from canvas.shouldDragScroll() if there are scrollbars.Note : This is an advanced setting
- Parameters:
canDragScroll
- New canDragScroll value. Default value is true- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getCanDragScroll
public boolean getCanDragScroll()If this Canvas is canAcceptDrop:true, when the user drags a droppable widget over an edge of the widget, should we scroll to show the rest of the widget's content? Returned from canvas.shouldDragScroll() if there are scrollbars.- Returns:
- Current canDragScroll value. Default value is true
- See Also:
-
setCanDrop
Indicates that this object can be dropped on top of other widgets. Only valid if canDrag or canDragReposition is true.Note : This is an advanced setting
- Parameters:
canDrop
- New canDrop value. Default value is false- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getCanDrop
Indicates that this object can be dropped on top of other widgets. Only valid if canDrag or canDragReposition is true.- Returns:
- Current canDrop value. Default value is false
- See Also:
-
setCanDropBefore
When explicitly set to false, disallows drop before this member in the Layout.Note : This is an advanced setting
- Parameters:
canDropBefore
- New canDropBefore value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getCanDropBefore
When explicitly set to false, disallows drop before this member in the Layout.- Returns:
- Current canDropBefore value. Default value is null
- See Also:
-
setCanFocus
Can this widget be allowed to become the target of keyboard events?If canFocus is unset (the default), only scrollable widgets with visible scrollbars are focusable, to allow for keyboard scrolling.
A widget normally receives focus by being clicked on or tabbed to.
If this method is called after the component has been drawn/initialized: Change whether a widget can accept keyboard focus.Note : This is an advanced setting
- Parameters:
canFocus
- whether the widget should now accept focus. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getCanFocus
Can this widget be allowed to become the target of keyboard events?If canFocus is unset (the default), only scrollable widgets with visible scrollbars are focusable, to allow for keyboard scrolling.
A widget normally receives focus by being clicked on or tabbed to.
- Returns:
- Current canFocus value. Default value is null
- See Also:
-
setCanHover
Will this Canvas fire hover events when the user hovers over it, or one of its children?- Parameters:
canHover
- New canHover value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getCanHover
Will this Canvas fire hover events when the user hovers over it, or one of its children?- Returns:
- Current canHover value. Default value is null
- See Also:
-
setCanSelectText
Whether native drag selection of contained text is allowed within this Canvas.Note that setting this property to
false
will not avoid text selection which is initiated outside this Canvas from continuing into this Canvas, even if text selection began in another Canvas.Note : This is an advanced setting
- Parameters:
canSelectText
- New canSelectText value. Default value is false- Returns:
Canvas
instance, for chaining setter calls
-
getCanSelectText
Whether native drag selection of contained text is allowed within this Canvas.Note that setting this property to
false
will not avoid text selection which is initiated outside this Canvas from continuing into this Canvas, even if text selection began in another Canvas.- Returns:
- Current canSelectText value. Default value is false
-
getCanvasItem
If this canvas is being displayed in aCanvasItem
, this property will be set to point at the item. Otherwise this property will be null.Note : This method should be called only after the widget has been rendered.
- Returns:
- Current canvasItem value. Default value is null
- Throws:
IllegalStateException
- if this widget has not yet been rendered.
-
getChildren
Array of all Canvii that are immediate children of this Canvas.Use
addChild()
andremoveChild()
to add and remove children after a Canvas has been created/drawn.See
Containment
for an overview of parent/child relationships.- Returns:
- Current children value. Default value is null
- See Also:
-
setChildrenResizeSnapAlign
Flag to disable snapping to alignment when children of this Canvas are resized- Parameters:
childrenResizeSnapAlign
- New childrenResizeSnapAlign value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getChildrenResizeSnapAlign
Flag to disable snapping to alignment when children of this Canvas are resized- Returns:
- Current childrenResizeSnapAlign value. Default value is null
- See Also:
-
setChildrenSnapAlign
If enabled whilechildrenSnapToGrid
is enabled, children dragged within this Canvas will also snap to positions where their edges or center lines would be aligned with the edges or centers of other components, and lines will be shown to point out the possible alignment (with appearance controlled bysnapAlignCenterLineStyle
andsnapAlignEdgeLineStyle
respectively.By default, edge- or center-snapping is enabled for all components, but the set of eligible components can be explicitly set via
snapAlignCandidates
.See also
childrenSnapCenterAlign
andchildrenSnapEdgeAlign
for enabling or disabling center alignment or edge alignment individually.- Parameters:
childrenSnapAlign
- New childrenSnapAlign value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getChildrenSnapAlign
If enabled whilechildrenSnapToGrid
is enabled, children dragged within this Canvas will also snap to positions where their edges or center lines would be aligned with the edges or centers of other components, and lines will be shown to point out the possible alignment (with appearance controlled bysnapAlignCenterLineStyle
andsnapAlignEdgeLineStyle
respectively.By default, edge- or center-snapping is enabled for all components, but the set of eligible components can be explicitly set via
snapAlignCandidates
.See also
childrenSnapCenterAlign
andchildrenSnapEdgeAlign
for enabling or disabling center alignment or edge alignment individually.- Returns:
- Current childrenSnapAlign value. Default value is null
- See Also:
-
setChildrenSnapCenterAlign
SeechildrenSnapAlign
. This setting enables or disables snapping on center alignment only.- Parameters:
childrenSnapCenterAlign
- New childrenSnapCenterAlign value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getChildrenSnapCenterAlign
SeechildrenSnapAlign
. This setting enables or disables snapping on center alignment only.- Returns:
- Current childrenSnapCenterAlign value. Default value is null
- See Also:
-
setChildrenSnapEdgeAlign
SeechildrenSnapAlign
. This setting enables or disables snapping on edge alignment only.- Parameters:
childrenSnapEdgeAlign
- New childrenSnapEdgeAlign value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getChildrenSnapEdgeAlign
SeechildrenSnapAlign
. This setting enables or disables snapping on edge alignment only.- Returns:
- Current childrenSnapEdgeAlign value. Default value is null
- See Also:
-
setChildrenSnapResizeToGrid
If true, causes this canvas's children to snap to its grid when resizing. This behavior can be overridden on a per-child basis by setting thesnapToGrid
orsnapResizeToGrid
value on the child.- Parameters:
childrenSnapResizeToGrid
- New childrenSnapResizeToGrid value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getChildrenSnapResizeToGrid
If true, causes this canvas's children to snap to its grid when resizing. This behavior can be overridden on a per-child basis by setting thesnapToGrid
orsnapResizeToGrid
value on the child.- Returns:
- Current childrenSnapResizeToGrid value. Default value is null
- See Also:
-
setChildrenSnapToGrid
If true, causes this canvas's children to snap to its grid when dragging. This behavior can be overridden on a per-child basis by setting thesnapToGrid
value on the child.- Parameters:
childrenSnapToGrid
- New childrenSnapToGrid value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getChildrenSnapToGrid
If true, causes this canvas's children to snap to its grid when dragging. This behavior can be overridden on a per-child basis by setting thesnapToGrid
value on the child.- Returns:
- Current childrenSnapToGrid value. Default value is null
- See Also:
-
getComponentMask
Automatically generated mask canvas displayed whenshowComponentMask()
is called.This component is an AutoChild named "componentMask". For an overview of how to use and configure AutoChildren, see
Using AutoChildren
.- Returns:
- Current componentMask value. Default value is null
- Throws:
IllegalStateException
- if this widget has not yet been rendered.- See Also:
-
setComponentMaskDefaults
Defaults for thecomponentMask
autoChild. Default properties includebackgroundColor
being set to"black"
andopacity
being set to20
.- Parameters:
componentMaskDefaults
- New componentMaskDefaults value. Default value is {...}- Returns:
Canvas
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getComponentMaskDefaults
Defaults for thecomponentMask
autoChild. Default properties includebackgroundColor
being set to"black"
andopacity
being set to20
.- Returns:
- Current componentMaskDefaults value. Default value is {...}
-
setContents
The contents of a canvas or label widget. Any HTML string is acceptable.
If this method is called after the component has been drawn/initialized: Changes the contents of a widget to newContents, an HTML string.When
dynamicContents
is set,setContents()
can also be called with no arguments to cause contents to be re-evaluated.Note : This is an advanced setting
- Parameters:
contents
- an HTML string to be set as the contents of this widget. Default value is " "- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getContents
The contents of a canvas or label widget. Any HTML string is acceptable.- Returns:
- Returns the contents of a Canvas. The contents are an HTML string. Default value is " "
- See Also:
-
getContextMenu
Context menu to show for this object, an instance of the Menu widget.Note: if
destroy()
is called on a canvas, any specified context menu is not automatically destroyed as well. This is in contrast toMenuButton
s which automatically destroy their specifiedMenuButton.menu
by default. The behavior is intentional as context menus are commonly reused across components.- Returns:
- Current contextMenu value. Default value is null
- See Also:
-
setCorrectZoomOverflow
Whether the Framework should correct for erroneous scrollHeight and scrollWidth values reported by the browser when zoomed (via browser or OS-level zoom) by allowingmaxZoomOverflowError
of overflow before enabling scrolling and displaying custom scrollbars. Only relevant whenoverflow
is "auto".This property is defaulted to true in the
Canvas
prototype for those browsers where the situation has been observed, except for Firefox, where a better solution is applied that doesn't rely onmaxZoomOverflowError
and never clips any content. Setting this property false will disable the workaround for all browsers, including Firefox. Without a workaround, scrollbars may oscillate rapidly when the browser or OS is zoomed.Note : This is an advanced setting
- Parameters:
correctZoomOverflow
- New correctZoomOverflow value. Default value is varies- Returns:
Canvas
instance, for chaining setter calls
-
getCorrectZoomOverflow
Whether the Framework should correct for erroneous scrollHeight and scrollWidth values reported by the browser when zoomed (via browser or OS-level zoom) by allowingmaxZoomOverflowError
of overflow before enabling scrolling and displaying custom scrollbars. Only relevant whenoverflow
is "auto".This property is defaulted to true in the
Canvas
prototype for those browsers where the situation has been observed, except for Firefox, where a better solution is applied that doesn't rely onmaxZoomOverflowError
and never clips any content. Setting this property false will disable the workaround for all browsers, including Firefox. Without a workaround, scrollbars may oscillate rapidly when the browser or OS is zoomed.- Returns:
- Current correctZoomOverflow value. Default value is varies
-
setCursor
Specifies the css cursor image to display when the mouse pointer is over this component. SeeCursor
for valid values.Note that the cursor may also be controlled by the following attributes in various cases:
disabledCursor
noDropCursor
dragRepositionCursor
edgeCursorMap
If no cursor is explicitly specified for a component, the cursor will be derived from the component's
ancestors
. Ifcursor
is not explicitly set in the ancestor chain,"default"
will be used.
If this method is called after the component has been drawn/initialized: Sets the cursor for this widget to cursor. See the cursor property for possible values.Note : This is an advanced setting
- Parameters:
cursor
- new cursor. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getCursor
Specifies the css cursor image to display when the mouse pointer is over this component. SeeCursor
for valid values.Note that the cursor may also be controlled by the following attributes in various cases:
disabledCursor
noDropCursor
dragRepositionCursor
edgeCursorMap
If no cursor is explicitly specified for a component, the cursor will be derived from the component's
ancestors
. Ifcursor
is not explicitly set in the ancestor chain,"default"
will be used.- Returns:
- Current cursor value. Default value is null
- See Also:
-
setDataContext
A mapping fromDataSource
IDs to specificRecords
from those DataSources, thatDataBoundComponents
contained within this Canvas should automatically bind to if a DataSource is provided but data is not provided (directly or indirectly, for example, indirectly via settingListGrid.autoFetchData
.See
autoPopulateData
for details on how this is done.DataSources included in the
dataContext
are immediately provided torule context
when used if no other component has done so already. These records are found in rule context 'dataContext' section (ex.dataContext.Customer
for a Customer record indataContext
) so they do not conflict with normal DataSource records.
If this method is called after the component has been drawn/initialized: Provides a newDataContext
to the Canvas. If the DataContext is new,DataBoundComponents
contained within this Canvas will be automatically bound as described indataContext
. If the DataContext replaces an existing one, any contained components that were originally bound against the DataContext will be re-bound.- Parameters:
dataContext
- dataContext to use for automatic binding. Default value is null- Returns:
Canvas
instance, for chaining setter calls
-
getDataContext
A mapping fromDataSource
IDs to specificRecords
from those DataSources, thatDataBoundComponents
contained within this Canvas should automatically bind to if a DataSource is provided but data is not provided (directly or indirectly, for example, indirectly via settingListGrid.autoFetchData
.See
autoPopulateData
for details on how this is done.DataSources included in the
dataContext
are immediately provided torule context
when used if no other component has done so already. These records are found in rule context 'dataContext' section (ex.dataContext.Customer
for a Customer record indataContext
) so they do not conflict with normal DataSource records.- Returns:
- Current dataContext value. Default value is null
-
setDataPath
A dataPath may be specified on any canvas. This provides a straightforward way to display or edit complex nested data.NOTE: the dataPath feature is intended to help certain legacy architectures, such as systems that work in terms of exchanging large messages with several different entity types in one message, and are incapable of providing separate access to each entity type.
See theDataPath overview
for more information.For components which support displaying or editing data values, (such as
DynamicForm
orListGrid
components), the dataPath may be set to specify how the components data is accessed. In this case the dataPath essentially specifies a nested object to edit - typically a path to a field value within a dataSource record. Note that a ValuesManager will be required to handle connecting the dataBoundcomponent to the appropriate sub object. This may be explicitly specified on the component, or a parent of the component, or automatically generated if a DataSource is specified on either the component or a parent thereof.To provide a simple example - if a complex object existed with the following format:
Map values = new HashMap(); values.put("companyName", "Some company"); Map addressMap = new HashMap(); addressMap.put("street", "123 Main Street"); addressMap.put("city", "New York"); addressMap.put("state", "NY"); values.put("address", addressMap);
a developer could specify a DynamicForm instance with 'dataPath' set to "address" to edit the nested address object:ValuesManager vm = new ValuesManager(); Map values = new HashMap(); values.put("companyName", "Some company"); Map addressMap = new HashMap(); addressMap.put("street", "123 Main Street"); addressMap.put("city", "New York"); addressMap.put("state", "NY"); values.put("address", addressMap); vm.setValues(values); DynamicForm form = new DynamicForm(); form.setValuesManager(vm); form.setDataPath("address"); TextItem streetField = new TextItem("street"); TextItem cityField = new TextItem("city"); TextItem stateField = new TextItem("state"); form.setItems(streetField, cityField, stateField);
If a component is specified with adataPath
attribute but does not have an explicitly specified valuesManager, it will check its parent element chain for a specified valuesManager and automatically bind to that. This simplifies binding multiple components used to view or edit a nested data structure as the valuesManager needs only be defined once at a reasonably high level component. Here's an example of this approach:ValuesManager vm = new ValuesManager(); Map values = new HashMap(); values.put("companyName", "Some company"); Map addressMap = new HashMap(); addressMap.put("street", "123 Main Street"); addressMap.put("city", "New York"); addressMap.put("state", "NY"); values.put("address", addressMap); vm.setValues(values); Layout layout = new Layout(); layout.setValuesManager(vm); DynamicForm form = new DynamicForm(); form.setDataPath("/"); TextItem companyNameField = new TextItem("companyName"); form.setItems(companyNameField); DynamicForm form1 = new DynamicForm(); form1.setDataPath("address"); TextItem streetField = new TextItem("street"); TextItem cityField = new TextItem("city"); TextItem stateField = new TextItem("state"); form1.setItems(streetField, cityField, stateField); layout.addMember(form); layout.addMember(form1);
Note that in this case the valuesManager is specified on a Layout, which has no 'values' management behavior of its own, but contains items with a specified dataPath which do. In this example you'd see 2 forms allowing editing of the nested data structure.dataPaths from multiple nested components may also be combined. For example:
ValuesManager vm = new ValuesManager(); Map values = new HashMap(); values.put("companyName", "Some company"); Map addressMap = new HashMap(); addressMap.put("street", "123 Main Street"); addressMap.put("city", "New York"); addressMap.put("state", "NY"); values.put("address", addressMap); Map values1 = new HashMap(); values1.put("companyName", "Some Corporation"); Map addressMap1 = new HashMap(); addressMap1.put("street", "1 High Street"); addressMap1.put("city", "New York"); addressMap1.put("state", "NY"); values1.put("address", addressMap1); values.put("parentCompany", values1); vm.setValues(values); Layout layout = new Layout(); layout.setValuesManager(vm); DynamicForm form = new DynamicForm(); form.setDataPath("/"); TextItem companyNameField = new TextItem("companyName"); form.setItems(companyNameField); DynamicForm form1 = new DynamicForm(); form1.setDataPath("address"); TextItem streetField = new TextItem("street"); TextItem cityField = new TextItem("city"); TextItem stateField = new TextItem("state"); form1.setItems(streetField, cityField, stateField); Layout innerlayout = new Layout(); innerlayout.setDataPath("parentCompany"); DynamicForm form3 = new DynamicForm(); form3.setDataPath(""); StaticTextItem companyNameField1 = new StaticTextItem("companyName"); form3.setItems(companyNameField1); DetailViewer detailViewer = new DetailViewer(); detailViewer.setDataPath("address"); DetailViewerField streetDVField = new DetailViewerField("street"); DetailViewerField cityDVField = new DetailViewerField("city"); DetailViewerField stateDVField = new DetailViewerField("state"); detailViewer.setFields(streetDVField, cityDVField, stateDVField); innerlayout.addMember(form3); innerlayout.addMember(detailViewer); layout.addMember(form); layout.addMember(form1); layout.addMember(innerlayout);
In this example the detailViewer will display data from theparentCompany.address
object within the base record.Note that if a component has a specified dataSource and shows child components with a specified dataPath, there is no need to explicitly declare a valuesManager at all. If a component with a dataPath has a dataSource, or an ancestor with a dataSource specified, it will, a valuesManager will automatically be generated on the higher level component (and be available as
component.valuesManager
).Difference between "" and "/" - relative and absolute datapaths
In the above example, note how the form for entering the "main" company name is given a dataPath of "/", while the form for entering the parent company name is given a dataPath of "". The difference here is exactly the same as you would find in a filesystem path: a dataPath starting with "/" is absolute, so "/" by itself means "root". A dataPath that does not start with "/" is relative, and the empty string indicates that dataPaths for items below this one in the hierarchy should apply the dataPath so far from the hierarchy above.If that isn't clear, consider the form for entering the parent company name in the above example. The correct dataPath to the field is
/parentCompany/companyName
. We have the "parentCompany" part of that path provided by the containing Layout, so we cannot reiterate it on the form itself. However, if we omit the dataPath property altogether, the framework will not seek to apply dataPath at all. So, we specify the empty string, which tells Smart GWT to use dataPath and to retain the portion of the path derived so far from the containment hierarchy.One further clarification: relative paths are only different from absolute paths if they are relative to something other than the root. So in the above example, although we specify "/" as the dataPath of the "main" company name form, we would get exactly the same behavior by specifying it as "", because the correct dataPath for the companyName field is "/companyName" - ie, it is relative to the root.
If this method is called after the component has been drawn/initialized: Setter for thedataPath
attribute. This method may be called directly at runtime to set the dataPath on a component, and will also be re-run automatically whenever a canvas' parent changes due to a call to addChild(). This method handles automatically binding the component to the appropriate valuesManager if necessary.Note : This is an advanced setting
- Parameters:
dataPath
- new dataPath. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDataPath
A dataPath may be specified on any canvas. This provides a straightforward way to display or edit complex nested data.NOTE: the dataPath feature is intended to help certain legacy architectures, such as systems that work in terms of exchanging large messages with several different entity types in one message, and are incapable of providing separate access to each entity type.
See theDataPath overview
for more information.For components which support displaying or editing data values, (such as
DynamicForm
orListGrid
components), the dataPath may be set to specify how the components data is accessed. In this case the dataPath essentially specifies a nested object to edit - typically a path to a field value within a dataSource record. Note that a ValuesManager will be required to handle connecting the dataBoundcomponent to the appropriate sub object. This may be explicitly specified on the component, or a parent of the component, or automatically generated if a DataSource is specified on either the component or a parent thereof.To provide a simple example - if a complex object existed with the following format:
Map values = new HashMap(); values.put("companyName", "Some company"); Map addressMap = new HashMap(); addressMap.put("street", "123 Main Street"); addressMap.put("city", "New York"); addressMap.put("state", "NY"); values.put("address", addressMap);
a developer could specify a DynamicForm instance with 'dataPath' set to "address" to edit the nested address object:ValuesManager vm = new ValuesManager(); Map values = new HashMap(); values.put("companyName", "Some company"); Map addressMap = new HashMap(); addressMap.put("street", "123 Main Street"); addressMap.put("city", "New York"); addressMap.put("state", "NY"); values.put("address", addressMap); vm.setValues(values); DynamicForm form = new DynamicForm(); form.setValuesManager(vm); form.setDataPath("address"); TextItem streetField = new TextItem("street"); TextItem cityField = new TextItem("city"); TextItem stateField = new TextItem("state"); form.setItems(streetField, cityField, stateField);
If a component is specified with adataPath
attribute but does not have an explicitly specified valuesManager, it will check its parent element chain for a specified valuesManager and automatically bind to that. This simplifies binding multiple components used to view or edit a nested data structure as the valuesManager needs only be defined once at a reasonably high level component. Here's an example of this approach:ValuesManager vm = new ValuesManager(); Map values = new HashMap(); values.put("companyName", "Some company"); Map addressMap = new HashMap(); addressMap.put("street", "123 Main Street"); addressMap.put("city", "New York"); addressMap.put("state", "NY"); values.put("address", addressMap); vm.setValues(values); Layout layout = new Layout(); layout.setValuesManager(vm); DynamicForm form = new DynamicForm(); form.setDataPath("/"); TextItem companyNameField = new TextItem("companyName"); form.setItems(companyNameField); DynamicForm form1 = new DynamicForm(); form1.setDataPath("address"); TextItem streetField = new TextItem("street"); TextItem cityField = new TextItem("city"); TextItem stateField = new TextItem("state"); form1.setItems(streetField, cityField, stateField); layout.addMember(form); layout.addMember(form1);
Note that in this case the valuesManager is specified on a Layout, which has no 'values' management behavior of its own, but contains items with a specified dataPath which do. In this example you'd see 2 forms allowing editing of the nested data structure.dataPaths from multiple nested components may also be combined. For example:
ValuesManager vm = new ValuesManager(); Map values = new HashMap(); values.put("companyName", "Some company"); Map addressMap = new HashMap(); addressMap.put("street", "123 Main Street"); addressMap.put("city", "New York"); addressMap.put("state", "NY"); values.put("address", addressMap); Map values1 = new HashMap(); values1.put("companyName", "Some Corporation"); Map addressMap1 = new HashMap(); addressMap1.put("street", "1 High Street"); addressMap1.put("city", "New York"); addressMap1.put("state", "NY"); values1.put("address", addressMap1); values.put("parentCompany", values1); vm.setValues(values); Layout layout = new Layout(); layout.setValuesManager(vm); DynamicForm form = new DynamicForm(); form.setDataPath("/"); TextItem companyNameField = new TextItem("companyName"); form.setItems(companyNameField); DynamicForm form1 = new DynamicForm(); form1.setDataPath("address"); TextItem streetField = new TextItem("street"); TextItem cityField = new TextItem("city"); TextItem stateField = new TextItem("state"); form1.setItems(streetField, cityField, stateField); Layout innerlayout = new Layout(); innerlayout.setDataPath("parentCompany"); DynamicForm form3 = new DynamicForm(); form3.setDataPath(""); StaticTextItem companyNameField1 = new StaticTextItem("companyName"); form3.setItems(companyNameField1); DetailViewer detailViewer = new DetailViewer(); detailViewer.setDataPath("address"); DetailViewerField streetDVField = new DetailViewerField("street"); DetailViewerField cityDVField = new DetailViewerField("city"); DetailViewerField stateDVField = new DetailViewerField("state"); detailViewer.setFields(streetDVField, cityDVField, stateDVField); innerlayout.addMember(form3); innerlayout.addMember(detailViewer); layout.addMember(form); layout.addMember(form1); layout.addMember(innerlayout);
In this example the detailViewer will display data from theparentCompany.address
object within the base record.Note that if a component has a specified dataSource and shows child components with a specified dataPath, there is no need to explicitly declare a valuesManager at all. If a component with a dataPath has a dataSource, or an ancestor with a dataSource specified, it will, a valuesManager will automatically be generated on the higher level component (and be available as
component.valuesManager
).Difference between "" and "/" - relative and absolute datapaths
In the above example, note how the form for entering the "main" company name is given a dataPath of "/", while the form for entering the parent company name is given a dataPath of "". The difference here is exactly the same as you would find in a filesystem path: a dataPath starting with "/" is absolute, so "/" by itself means "root". A dataPath that does not start with "/" is relative, and the empty string indicates that dataPaths for items below this one in the hierarchy should apply the dataPath so far from the hierarchy above.If that isn't clear, consider the form for entering the parent company name in the above example. The correct dataPath to the field is
/parentCompany/companyName
. We have the "parentCompany" part of that path provided by the containing Layout, so we cannot reiterate it on the form itself. However, if we omit the dataPath property altogether, the framework will not seek to apply dataPath at all. So, we specify the empty string, which tells Smart GWT to use dataPath and to retain the portion of the path derived so far from the containment hierarchy.One further clarification: relative paths are only different from absolute paths if they are relative to something other than the root. So in the above example, although we specify "/" as the dataPath of the "main" company name form, we would get exactly the same behavior by specifying it as "", because the correct dataPath for the companyName field is "/companyName" - ie, it is relative to the root.
- Returns:
- Current dataPath value. Default value is null
- See Also:
-
setDefaultHeight
For custom components, establishes a default height for the component.For a component that should potentially be sized automatically by a Layout, set this property rather than
height
directly, because Layouts regard a height setting as an explicit size that shouldn't be changed.Note : This is an advanced setting
- Parameters:
defaultHeight
- New defaultHeight value. Default value is 100- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDefaultHeight
public int getDefaultHeight()For custom components, establishes a default height for the component.For a component that should potentially be sized automatically by a Layout, set this property rather than
height
directly, because Layouts regard a height setting as an explicit size that shouldn't be changed.- Returns:
- Current defaultHeight value. Default value is 100
- See Also:
-
setDefaultWidth
For custom components, establishes a default width for the component.For a component that should potentially be sized automatically by a Layout, set this property rather than
width
directly, because Layouts regard a width setting as an explicit size that shouldn't be changed.Note : This is an advanced setting
- Parameters:
defaultWidth
- New defaultWidth value. Default value is 100- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDefaultWidth
public int getDefaultWidth()For custom components, establishes a default width for the component.For a component that should potentially be sized automatically by a Layout, set this property rather than
width
directly, because Layouts regard a width setting as an explicit size that shouldn't be changed.- Returns:
- Current defaultWidth value. Default value is 100
- See Also:
-
setDefiningProperty
This attribute denotes the name of a property to use as agetDefiningPropertyName()
for this property when generating and resolvingAutoTest locators with search segments
.Note : This is an advanced setting
- Parameters:
definingProperty
- New definingProperty value. Default value is null- Returns:
Canvas
instance, for chaining setter calls
-
getDefiningProperty
This attribute denotes the name of a property to use as agetDefiningPropertyName()
for this property when generating and resolvingAutoTest locators with search segments
.- Returns:
- Current definingProperty value. Default value is null
-
setDefiningPropertyNameOptions
If no explicitdefiningProperty
was specified for this component, this array denotes a list of options to use as adefining property
when generating and resolvingAutoTest locators with search segments
. The first attribute in this array that is non-null for this component will be used as the defining property for locator search segments.The default set of options are as follows:
[ "locatorName", "dataSource" ]
Note : This is an advanced setting
- Parameters:
definingPropertyNameOptions
- New definingPropertyNameOptions value. Default value is [...]- Returns:
Canvas
instance, for chaining setter calls
-
getDefiningPropertyNameOptions
If no explicitdefiningProperty
was specified for this component, this array denotes a list of options to use as adefining property
when generating and resolvingAutoTest locators with search segments
. The first attribute in this array that is non-null for this component will be used as the defining property for locator search segments.The default set of options are as follows:
[ "locatorName", "dataSource" ]
- Returns:
- Current definingPropertyNameOptions value. Default value is [...]
-
getDestroyed
If this property is set totrue
, thedestroy()
method has been called on this canvas. This implies the canvas is no longer valid. Its ID has been removed from global scope, and calling standard canvas APIs on it is likely to result in errors.Note : This method should be called only after the widget has been rendered.
- Returns:
- Current destroyed value. Default value is null
- Throws:
IllegalStateException
- if this widget has not yet been rendered.- See Also:
-
getDestroying
This property is set to true when thedestroy()
method is called on a widget. If this property is true, butdestroyed
is not, this indicates the canvas is in the process of being destroyed.Note : This method should be called only after the widget has been rendered.
- Returns:
- Current destroying value. Default value is null
- Throws:
IllegalStateException
- if this widget has not yet been rendered.- See Also:
-
setDisabledCursor
Specifies the cursor image to display when the mouse pointer is over this widget if this widget is disabled. It corresponds to the CSS cursor attribute. See Cursor type for different cursors.Note : This is an advanced setting
- Parameters:
disabledCursor
- New disabledCursor value. Default value is Canvas.DEFAULT- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDisabledCursor
Specifies the cursor image to display when the mouse pointer is over this widget if this widget is disabled. It corresponds to the CSS cursor attribute. See Cursor type for different cursors.- Returns:
- Current disabledCursor value. Default value is Canvas.DEFAULT
- See Also:
-
setDisableTouchScrollingForDrag
public Canvas setDisableTouchScrollingForDrag(Boolean disableTouchScrollingForDrag) throws IllegalStateException DisablesuseTouchScrolling
whenever a built-in drag operation has been enabled which is known to be non-functional if touch scrolling is enabled. Default behavior is to leave touch scrolling enabled even if it makes other enabled drag operations non-functional, since anyaccessible
application must provide an alternative way to perform drag and drop operations anyway.disableTouchScrollingForDrag
exists so that applications can change the default setting on a per-component basis (viasetDefaultProperties
), in order to make a system-wide or per-component-type decision about whether to favor touch scrolling vs retaining the ability to drag and drop via finger drags, instead of having to setuseTouchScrolling
on each individual instance.See the
Mobile Development overview
for more background information.- Parameters:
disableTouchScrollingForDrag
- New disableTouchScrollingForDrag value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getDisableTouchScrollingForDrag
DisablesuseTouchScrolling
whenever a built-in drag operation has been enabled which is known to be non-functional if touch scrolling is enabled. Default behavior is to leave touch scrolling enabled even if it makes other enabled drag operations non-functional, since anyaccessible
application must provide an alternative way to perform drag and drop operations anyway.disableTouchScrollingForDrag
exists so that applications can change the default setting on a per-component basis (viasetDefaultProperties
), in order to make a system-wide or per-component-type decision about whether to favor touch scrolling vs retaining the ability to drag and drop via finger drags, instead of having to setuseTouchScrolling
on each individual instance.See the
Mobile Development overview
for more background information.- Returns:
- Current disableTouchScrollingForDrag value. Default value is null
- See Also:
-
setDoubleClickDelay
Amount of time (in milliseconds) between which two clicks are considered a single clickNote : This is an advanced setting
- Parameters:
doubleClickDelay
- New doubleClickDelay value. Default value is 250- Returns:
Canvas
instance, for chaining setter calls
-
getDoubleClickDelay
public int getDoubleClickDelay()Amount of time (in milliseconds) between which two clicks are considered a single click- Returns:
- Current doubleClickDelay value. Default value is 250
-
setDragAppearance
Visual appearance to show when the object is being dragged. May be overridden for dragResize or dragReposition events viadragResizeAppearance
anddragRepositionAppearance
.Note : This is an advanced setting
- Parameters:
dragAppearance
- New dragAppearance value. Default value is EventHandler.OUTLINE- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDragAppearance
Visual appearance to show when the object is being dragged. May be overridden for dragResize or dragReposition events viadragResizeAppearance
anddragRepositionAppearance
.- Returns:
- Current dragAppearance value. Default value is EventHandler.OUTLINE
- See Also:
-
setDragIntersectStyle
This indicates how the system will test for droppable targets: either by intersection with the mouse or intersection with the rectangle of the dragMoveTarget.Note : This is an advanced setting
- Parameters:
dragIntersectStyle
- New dragIntersectStyle value. Default value is "mouse"- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDragIntersectStyle
This indicates how the system will test for droppable targets: either by intersection with the mouse or intersection with the rectangle of the dragMoveTarget.- Returns:
- Current dragIntersectStyle value. Default value is "mouse"
- See Also:
-
setDragMaskType
This property controls what kind of mask is used in caseuseDragMask
is enabled.- Parameters:
dragMaskType
- New dragMaskType value. Default value is "div"- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDragMaskType
This property controls what kind of mask is used in caseuseDragMask
is enabled.- Returns:
- Current dragMaskType value. Default value is "div"
- See Also:
-
setDragMaxHeight
Sets maximum height that this Canvas can be resized to by a user. Actual limit will be minimum ofdragMaxHeight
andmaxHeight
.Note : This is an advanced setting
- Parameters:
dragMaxHeight
- New dragMaxHeight value. Default value is 10000- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDragMaxHeight
public int getDragMaxHeight()Sets maximum height that this Canvas can be resized to by a user. Actual limit will be minimum ofdragMaxHeight
andmaxHeight
.- Returns:
- Current dragMaxHeight value. Default value is 10000
- See Also:
-
setDragMaxWidth
Maximum width that this Canvas can be resized to by a user. Actual limit will be minimum ofdragMaxWidth
andmaxWidth
.Note : This is an advanced setting
- Parameters:
dragMaxWidth
- New dragMaxWidth value. Default value is 10000- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDragMaxWidth
public int getDragMaxWidth()Maximum width that this Canvas can be resized to by a user. Actual limit will be minimum ofdragMaxWidth
andmaxWidth
.- Returns:
- Current dragMaxWidth value. Default value is 10000
- See Also:
-
setDragMinHeight
Minimum height that this Canvas can be resized to by a user. SeedragMinWidth
for details of behavior.Note : This is an advanced setting
- Parameters:
dragMinHeight
- New dragMinHeight value. Default value is 10- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDragMinHeight
public int getDragMinHeight()Minimum height that this Canvas can be resized to by a user. SeedragMinWidth
for details of behavior.- Returns:
- Current dragMinHeight value. Default value is 10
- See Also:
-
setDragMinWidth
Minimum width that this Canvas can be resized to by a user. Actual limit will be maximum ofdragMinWidth
andminWidth
.Note that a Canvas with overflow:"visible" has an implicit minimize size based on it's contents.
Note that
dragMinWidth
affects only user-initiated drag resizes. To set the minimum width of a Canvas embedded in a Layout, you can set +{minWidth}, orLayout.minMemberLength
to constrain the minimum size along the length axis of all members of theLayout
.Note : This is an advanced setting
- Parameters:
dragMinWidth
- New dragMinWidth value. Default value is 10- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDragMinWidth
public int getDragMinWidth()Minimum width that this Canvas can be resized to by a user. Actual limit will be maximum ofdragMinWidth
andminWidth
.Note that a Canvas with overflow:"visible" has an implicit minimize size based on it's contents.
Note that
dragMinWidth
affects only user-initiated drag resizes. To set the minimum width of a Canvas embedded in a Layout, you can set +{minWidth}, orLayout.minMemberLength
to constrain the minimum size along the length axis of all members of theLayout
.- Returns:
- Current dragMinWidth value. Default value is 10
- See Also:
-
setDragOpacity
If this widget has dragAppearance"target"
, this value specifies the opacity to render the target while it is being dragged. A null value implies we do not modify the opacity.Note : This is an advanced setting
- Parameters:
dragOpacity
- New dragOpacity value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDragOpacity
If this widget has dragAppearance"target"
, this value specifies the opacity to render the target while it is being dragged. A null value implies we do not modify the opacity.- Returns:
- Current dragOpacity value. Default value is null
- See Also:
-
setDragRepositionAppearance
IfcanDragReposition
is true, this attribute specifies the visual appearance to show during drag reposition. If unsetdragAppearance
will be used.Note : This is an advanced setting
- Parameters:
dragRepositionAppearance
- New dragRepositionAppearance value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDragRepositionAppearance
IfcanDragReposition
is true, this attribute specifies the visual appearance to show during drag reposition. If unsetdragAppearance
will be used.- Returns:
- Current dragRepositionAppearance value. Default value is null
- See Also:
-
setDragRepositionCursor
Cursor to switch to if the mouse is over a widget that is drag repositionable.Note : This is an advanced setting
- Parameters:
dragRepositionCursor
- New dragRepositionCursor value. Default value is Canvas.MOVE- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDragRepositionCursor
Cursor to switch to if the mouse is over a widget that is drag repositionable.- Returns:
- Current dragRepositionCursor value. Default value is Canvas.MOVE
- See Also:
-
setDragResizeAppearance
IfcanDragResize
is true, this attribute specifies the visual appearance to show during drag resize. If unsetdragAppearance
will be used.Note : This is an advanced setting
- Parameters:
dragResizeAppearance
- New dragResizeAppearance value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDragResizeAppearance
IfcanDragResize
is true, this attribute specifies the visual appearance to show during drag resize. If unsetdragAppearance
will be used.- Returns:
- Current dragResizeAppearance value. Default value is null
- See Also:
-
setDragScrollDelay
If this widget supports drag-scrolling, This property specifies how many ms the user must hover over the drag-scroll threshold before scrolling begins.Note : This is an advanced setting
- Parameters:
dragScrollDelay
- New dragScrollDelay value. Default value is 100- Returns:
Canvas
instance, for chaining setter calls
-
getDragScrollDelay
public int getDragScrollDelay()If this widget supports drag-scrolling, This property specifies how many ms the user must hover over the drag-scroll threshold before scrolling begins.- Returns:
- Current dragScrollDelay value. Default value is 100
-
setDragStartDistance
Number of pixels the cursor needs to move before the EventHandler starts a drag operation.Note : This is an advanced setting
- Parameters:
dragStartDistance
- New dragStartDistance value. Default value is 5- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDragStartDistance
public int getDragStartDistance()Number of pixels the cursor needs to move before the EventHandler starts a drag operation.- Returns:
- Current dragStartDistance value. Default value is 5
- See Also:
-
setDragTarget
A different widget that should be actually dragged when dragging initiates on this widget. One example of this is to have a child widget that drags its parent, as with a drag box. Because the parent automatically repositions its children, setting the drag target of the child to the parent and then dragging the child will result in both widgets being moved.Valid
dragTarget
values are:null
(default) [this widget is its own drag target]- another widget, or widget ID
"parent"
drag target is this widget'sparentCanvas
"top"
drag target is this widget'stopElement
Note that for dragging to work as intended, the
resizeFrom
setting on thedragTarget
must be null or a superset of theresizeFrom
on this canvas.Note : This is an advanced setting
- Parameters:
dragTarget
- New dragTarget value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDragTarget
A different widget that should be actually dragged when dragging initiates on this widget. One example of this is to have a child widget that drags its parent, as with a drag box. Because the parent automatically repositions its children, setting the drag target of the child to the parent and then dragging the child will result in both widgets being moved.Valid
dragTarget
values are:null
(default) [this widget is its own drag target]- another widget, or widget ID
"parent"
drag target is this widget'sparentCanvas
"top"
drag target is this widget'stopElement
Note that for dragging to work as intended, the
resizeFrom
setting on thedragTarget
must be null or a superset of theresizeFrom
on this canvas.- Returns:
- Current dragTarget value. Default value is null
- See Also:
-
setDragTarget
A different widget that should be actually dragged when dragging initiates on this widget. One example of this is to have a child widget that drags its parent, as with a drag box. Because the parent automatically repositions its children, setting the drag target of the child to the parent and then dragging the child will result in both widgets being moved.Valid
dragTarget
values are:null
(default) [this widget is its own drag target]- another widget, or widget ID
"parent"
drag target is this widget'sparentCanvas
"top"
drag target is this widget'stopElement
Note that for dragging to work as intended, the
resizeFrom
setting on thedragTarget
must be null or a superset of theresizeFrom
on this canvas.Note : This is an advanced setting
- Parameters:
dragTarget
- New dragTarget value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDragTargetAsString
A different widget that should be actually dragged when dragging initiates on this widget. One example of this is to have a child widget that drags its parent, as with a drag box. Because the parent automatically repositions its children, setting the drag target of the child to the parent and then dragging the child will result in both widgets being moved.Valid
dragTarget
values are:null
(default) [this widget is its own drag target]- another widget, or widget ID
"parent"
drag target is this widget'sparentCanvas
"top"
drag target is this widget'stopElement
Note that for dragging to work as intended, the
resizeFrom
setting on thedragTarget
must be null or a superset of theresizeFrom
on this canvas.- Returns:
- Current dragTarget value. Default value is null
- See Also:
-
setDragType
Sets adragType
for this widget used, to be compared todropTypes
on possible drop target widgets. SeedropTypes
for a full explanation.Note : This is an advanced setting
- Parameters:
dragType
- New dragType value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDragType
Sets adragType
for this widget used, to be compared todropTypes
on possible drop target widgets. SeedropTypes
for a full explanation.- Returns:
- Current dragType value. Default value is null
- See Also:
-
setDropTarget
Delegates a different widget that should actually be dropped on if the cursor is over this widget when the drop completes. If you're building your own "drop indicator" widget, it may need this property set to the main canvas (receiving the drop) to avoid itself being considered a drop target (causing the indicator to flicker).Note : This is an advanced setting
- Parameters:
dropTarget
- New dropTarget value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDropTarget
Delegates a different widget that should actually be dropped on if the cursor is over this widget when the drop completes. If you're building your own "drop indicator" widget, it may need this property set to the main canvas (receiving the drop) to avoid itself being considered a drop target (causing the indicator to flicker).- Returns:
- Current dropTarget value. Default value is null
- See Also:
-
setDropTarget
Delegates a different widget that should actually be dropped on if the cursor is over this widget when the drop completes. If you're building your own "drop indicator" widget, it may need this property set to the main canvas (receiving the drop) to avoid itself being considered a drop target (causing the indicator to flicker).Note : This is an advanced setting
- Parameters:
dropTarget
- New dropTarget value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDropTargetAsString
Delegates a different widget that should actually be dropped on if the cursor is over this widget when the drop completes. If you're building your own "drop indicator" widget, it may need this property set to the main canvas (receiving the drop) to avoid itself being considered a drop target (causing the indicator to flicker).- Returns:
- Current dropTarget value. Default value is null
- See Also:
-
setDropTypes
When a drag and drop interaction occurs, if adragType
is configured on the source widget, it is compared to thedropTypes
configured on the target widget, and a drop is only allowed if thedragType
is listed in the target widget'sdropTypes
array.The default setting means any
dragType
is eligible for dropping on this widget, including nodragType
setting.See also
willAcceptDrop()
for dynamic determination of drop eligibility.Note : This is an advanced setting
- Parameters:
dropTypes
- New dropTypes value. Default value is Canvas.ANYTHING- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDropTypes
When a drag and drop interaction occurs, if adragType
is configured on the source widget, it is compared to thedropTypes
configured on the target widget, and a drop is only allowed if thedragType
is listed in the target widget'sdropTypes
array.The default setting means any
dragType
is eligible for dropping on this widget, including nodragType
setting.See also
willAcceptDrop()
for dynamic determination of drop eligibility.- Returns:
- Current dropTypes value. Default value is Canvas.ANYTHING
- See Also:
-
setDropTypes
When a drag and drop interaction occurs, if adragType
is configured on the source widget, it is compared to thedropTypes
configured on the target widget, and a drop is only allowed if thedragType
is listed in the target widget'sdropTypes
array.The default setting means any
dragType
is eligible for dropping on this widget, including nodragType
setting.See also
willAcceptDrop()
for dynamic determination of drop eligibility.Note : This is an advanced setting
- Parameters:
dropTypes
- New dropTypes value. Default value is Canvas.ANYTHING- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getDropTypesAsString
When a drag and drop interaction occurs, if adragType
is configured on the source widget, it is compared to thedropTypes
configured on the target widget, and a drop is only allowed if thedragType
is listed in the target widget'sdropTypes
array.The default setting means any
dragType
is eligible for dropping on this widget, including nodragType
setting.See also
willAcceptDrop()
for dynamic determination of drop eligibility.- Returns:
- Current dropTypes value. Default value is Canvas.ANYTHING
- See Also:
-
setDynamicContents
Dynamic contents allows the contents string to be treated as a simple but powerful template. When this attribute is set to true, JavaScript expressions may be embedded within the contents string, using the format:${[JavaScript to evaluate]}
.For example, to include the current date in a templated message,
canvas.contents
could be set to:
"Today's date is <b>${new Date().toUSShortDate()}</b>"
Embedded expressions will be evaluated when the canvas is drawn or redrawn, and the result of the evaluated expression will be displayed to the user. If the expression does not evaluate to a String, the
toString()
representation of the returned object will be displayed automaticallyDynamic expressions are evaluated in the scope of the canvas displaying the content, so the
this
keyword may be used within your expression to refer to the canvas. Developers may also explicitly supply values for variables to be used within the evaluation via thedynamicContentsVars
property.Notes:
- Calling markForRedraw() on the canvas will evaluate any embedded expressions.
- Multiple such expressions may be embedded within the contents string for a component.
- If
an error occurs during evaluation, a warning is logged to the
Developer Console
and the error string will be embedded in place of the expected value in the Canvas.
Note : This is an advanced setting
- Parameters:
dynamicContents
- New dynamicContents value. Default value is false- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
setContents(java.lang.String)
com.smartgwt.client.widgets.Canvas#setDynamicContentsVars
-
getDynamicContents
Dynamic contents allows the contents string to be treated as a simple but powerful template. When this attribute is set to true, JavaScript expressions may be embedded within the contents string, using the format:${[JavaScript to evaluate]}
.For example, to include the current date in a templated message,
canvas.contents
could be set to:
"Today's date is <b>${new Date().toUSShortDate()}</b>"
Embedded expressions will be evaluated when the canvas is drawn or redrawn, and the result of the evaluated expression will be displayed to the user. If the expression does not evaluate to a String, the
toString()
representation of the returned object will be displayed automaticallyDynamic expressions are evaluated in the scope of the canvas displaying the content, so the
this
keyword may be used within your expression to refer to the canvas. Developers may also explicitly supply values for variables to be used within the evaluation via thedynamicContentsVars
property.Notes:
- Calling markForRedraw() on the canvas will evaluate any embedded expressions.
- Multiple such expressions may be embedded within the contents string for a component.
- If
an error occurs during evaluation, a warning is logged to the
Developer Console
and the error string will be embedded in place of the expected value in the Canvas.
- Returns:
- Current dynamicContents value. Default value is false
- See Also:
-
getContents()
com.smartgwt.client.widgets.Canvas#getDynamicContentsVars
-
setEdgeBackgroundColor
Background color for the EdgedCanvas created to decorate this component. This can be used to provide an underlying "tint" color for translucent edge media- Parameters:
edgeBackgroundColor
- New edgeBackgroundColor value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getEdgeBackgroundColor
Background color for the EdgedCanvas created to decorate this component. This can be used to provide an underlying "tint" color for translucent edge media- Returns:
- Current edgeBackgroundColor value. Default value is null
- See Also:
-
setEdgeCenterBackgroundColor
public Canvas setEdgeCenterBackgroundColor(String edgeCenterBackgroundColor) throws IllegalStateException Background color for the center section only. Can be used as a surrogate background color for the decorated Canvas, if the Canvas is set to partially overlap the edges and hence can't show a background color itself without occluding media.- Parameters:
edgeCenterBackgroundColor
- New edgeCenterBackgroundColor value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getEdgeCenterBackgroundColor
Background color for the center section only. Can be used as a surrogate background color for the decorated Canvas, if the Canvas is set to partially overlap the edges and hence can't show a background color itself without occluding media.- Returns:
- Current edgeCenterBackgroundColor value. Default value is null
- See Also:
-
setEdgeImage
Base name of images for edges. Extensions for each corner or edge piece will be added to this image URL, before the extension. For example, with the default base name of "edge.gif", the top-left corner image will be "edge_TL.gif".The full list of extensions is: "_TL", "_TR", "_BL", "_BR", "_T", "_L", "_B", "_R", "_center".
- Parameters:
edgeImage
- New edgeImage value. Default value is "[SKIN]edge.gif"- Returns:
Canvas
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getEdgeImage
Base name of images for edges. Extensions for each corner or edge piece will be added to this image URL, before the extension. For example, with the default base name of "edge.gif", the top-left corner image will be "edge_TL.gif".The full list of extensions is: "_TL", "_TR", "_BL", "_BR", "_T", "_L", "_B", "_R", "_center".
- Returns:
- Current edgeImage value. Default value is "[SKIN]edge.gif"
- See Also:
-
setEdgeMarginSize
How far into the edge of an object do we consider the "edge" for drag resize purposes?Note : This is an advanced setting
- Parameters:
edgeMarginSize
- New edgeMarginSize value. Default value is 5- Returns:
Canvas
instance, for chaining setter calls- See Also:
-
getEdgeMarginSize
public int getEdgeMarginSize()How far into the edge of an object do we consider the "edge" for drag resize purposes?- Returns:
- Current edgeMarginSize value. Default value is 5
- See Also:
-
setEdgeOffset
Amount the contained Canvas should be offset. Defaults to edgeSize; set to less than edgeSize to allow the contained Canvas to overlap the edge and corner media.- Parameters:
edgeOffset
- New edgeOffset value. Default value is null- Returns:
Canvas
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getEdgeOffset
Amount the contained Canvas should be offset. Defaults to edgeSize; set to less than edgeSize to allow the contained Canvas to overlap the edge and corner media.- Returns:
- Current edgeOffset value. Default value is null
- See Also:
-
setEdgeOpacity
Opacity of the edges. Defaults to matching this.opacity. ifsetOpacity()
is called on a Canvas where edgeOpacity is set, edgeOpacity will be considered a percentage of the parent's opacity (so 50% opaque parent plus edgeOpacity 50 means 25% opaque edges)
If this method is called after the component has been drawn/initialized: Set theedgeOpacity
and mark the canvas for redraw- Parameters:
edgeOpacity
- new edge-opacity level. Default value is null- Returns:
Canvas
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getEdgeOpacity
Opacity of the edges. Defaults to matching this.opacity. ifsetOpacity()
is called on a Canvas where edgeOpacity is set, edgeOpacity will be considered a percentage of the parent's opacity (so 50% opaque parent plus edgeOpacity 50 means 25% opaque edges)- Returns:
- Current edgeOpacity value. Default value is null
- See Also:
-
setEdgeShowCenter
Whether to show media in the center section, that is, behind the decorated Canvas.- Parameters:
edgeShowCenter
- New edgeShowCenter value. Default value is false- Returns:
Canvas
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the component has been created- See Also:
-
getEdgeShowCenter
Whether to show media in the center section, that is, behind the decorated Canvas.- Returns:
- Current edgeShowCenter value. Default value is false
- See Also:
-
setEdgeSize
-
EditProxy.autoMaskChildren