public class Canvas extends BaseWidget implements HasClickHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasClearHandlers, HasDropHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers
FormItems
). Canvas provides:
draw()
and clear()
,
visibility via show()
and hide()
, z-layering via bringToFront()
and sendToBack()
. positioning
, sizing
and size
detection
, with automatic compensation for browser CSS behavior
differences
. overflow
key
and mouse
events, including mapping touch events
to mouse events moving
, resizing
, drag scrolling
and snap-to-grid
behavior. HTML content
or contain other Canvases
, including an edge-based positioning
and percent sizing system
for children. For more advanced layout
capabilities, see Layout
. cursors
, modal masking
, animation
, accessibility properties
, and settings
for automated testing
. config, configOnly, factoryCreated, factoryProperties, id, nativeObject, scClassName
Constructor and Description |
---|
Canvas() |
Canvas(com.google.gwt.core.client.JavaScriptObject jsObj) |
Canvas(java.lang.String id) |
Modifier and Type | Method and Description |
---|---|
Canvas |
addChild(Canvas newChild)
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.
|
Canvas |
addChild(Canvas newChild,
java.lang.String name) |
Canvas |
addChild(Canvas newChild,
java.lang.String name,
boolean autoDraw)
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.
|
Canvas |
addChild(Canvas newChild,
java.lang.String name,
java.lang.Boolean autoDraw)
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.
|
void |
addChild(com.google.gwt.user.client.ui.Widget widget)
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.
|
com.google.gwt.event.shared.HandlerRegistration |
addClearHandler(ClearHandler handler)
Add a clear handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addClickHandler(ClickHandler handler)
Add a click handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addDoubleClickHandler(DoubleClickHandler handler)
Add a doubleClick handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addDragMoveHandler(DragMoveHandler handler)
Add a dragMove handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addDragRepositionMoveHandler(DragRepositionMoveHandler handler)
Add a dragRepositionMove handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addDragRepositionStartHandler(DragRepositionStartHandler handler)
Add a dragRepositionStart handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addDragRepositionStopHandler(DragRepositionStopHandler handler)
Add a dragRepositionStop handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addDragResizeMoveHandler(DragResizeMoveHandler handler)
Add a dragResizeMove handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addDragResizeStartHandler(DragResizeStartHandler handler)
Add a dragResizeStart handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addDragResizeStopHandler(DragResizeStopHandler handler)
Add a dragResizeStop handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addDragStartHandler(DragStartHandler handler)
Add a dragStart handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addDragStopHandler(DragStopHandler handler)
Add a dragStop handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addDropHandler(DropHandler handler)
Add a drop handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addDropMoveHandler(DropMoveHandler handler)
Add a dropMove handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addDropOutHandler(DropOutHandler handler)
Add a dropOut handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addDropOverHandler(DropOverHandler handler)
Add a dropOver handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addFocusChangedHandler(FocusChangedHandler handler)
Add a focusChanged handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addHoverHandler(HoverHandler handler)
Add a hover handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addHoverHiddenHandler(HoverHiddenHandler handler)
Add a hoverHidden handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addKeyDownHandler(KeyDownHandler handler)
Add a keyDown handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addKeyPressHandler(KeyPressHandler handler)
Add a keyPress handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addMouseDownHandler(MouseDownHandler handler)
Add a mouseDown handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addMouseMoveHandler(MouseMoveHandler handler)
Add a mouseMove handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addMouseOutHandler(MouseOutHandler handler)
Add a mouseOut handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addMouseOverHandler(MouseOverHandler handler)
Add a mouseOver handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addMouseStillDownHandler(MouseStillDownHandler handler)
Add a mouseStillDown handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addMouseUpHandler(MouseUpHandler handler)
Add a mouseUp handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addMouseWheelHandler(MouseWheelHandler handler)
Add a mouseWheel handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addMovedHandler(MovedHandler handler)
Add a moved handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addParentMovedHandler(ParentMovedHandler handler)
Add a parentMoved handler.
|
Canvas |
addPeer(Canvas newPeer)
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.
|
Canvas |
addPeer(Canvas newPeer,
java.lang.String name) |
Canvas |
addPeer(Canvas newPeer,
java.lang.String name,
java.lang.Boolean autoDraw) |
Canvas |
addPeer(Canvas newPeer,
java.lang.String name,
java.lang.Boolean autoDraw,
java.lang.Boolean preDraw)
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.
|
com.google.gwt.event.shared.HandlerRegistration |
addResizedHandler(ResizedHandler handler)
Add a resized handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addRightMouseDownHandler(RightMouseDownHandler handler)
Add a rightMouseDown handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addRuleContextChangedHandler(RuleContextChangedHandler handler)
Add a ruleContextChanged handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addScrolledHandler(ScrolledHandler handler)
Add a scrolled handler.
|
com.google.gwt.event.shared.HandlerRegistration |
addShowContextMenuHandler(ShowContextMenuHandler handler)
Add a showContextMenu handler.
|
void |
addSnapAlignCandidate(Canvas newCandidate)
Add a candidate to
snapAlignCandidates . |
void |
addStyleName(java.lang.String style)
Multiple styles are currently not supported.
|
com.google.gwt.event.shared.HandlerRegistration |
addVisibilityChangedHandler(VisibilityChangedHandler handler)
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(java.lang.Integer opacity)
Animate a change in opacity from the widget's current opacity to the specified opacity.
|
void |
animateFade(java.lang.Integer opacity,
AnimationCallback callback) |
void |
animateFade(java.lang.Integer opacity,
AnimationCallback callback,
java.lang.Integer duration) |
void |
animateFade(java.lang.Integer opacity,
AnimationCallback callback,
java.lang.Integer duration,
AnimationAcceleration acceleration)
Animate a change in opacity from the widget's current opacity to the specified opacity.
|
void |
animateHide()
Hide a canvas by shrinking it with default effect specified by
animateHideEffect . |
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 |
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 |
animateMove(java.lang.Integer left,
java.lang.Integer top)
Animate a reposition of this canvas from its current position to the specified position
|
void |
animateMove(java.lang.Integer left,
java.lang.Integer top,
AnimationCallback callback) |
void |
animateMove(java.lang.Integer left,
java.lang.Integer top,
AnimationCallback callback,
java.lang.Integer duration) |
void |
animateMove(java.lang.Integer left,
java.lang.Integer top,
AnimationCallback callback,
java.lang.Integer duration,
AnimationAcceleration acceleration)
Animate a reposition of this canvas from its current position to the specified position
|
void |
animateRect(java.lang.Integer left,
java.lang.Integer top,
java.lang.Integer width,
java.lang.Integer height)
Animate a reposition / resize of this canvas from its current size and position.
|
void |
animateRect(java.lang.Integer left,
java.lang.Integer top,
java.lang.Integer width,
java.lang.Integer height,
AnimationCallback callback) |
void |
animateRect(java.lang.Integer left,
java.lang.Integer top,
java.lang.Integer width,
java.lang.Integer height,
AnimationCallback callback,
java.lang.Integer duration) |
void |
animateRect(java.lang.Integer left,
java.lang.Integer top,
java.lang.Integer width,
java.lang.Integer height,
AnimationCallback callback,
java.lang.Integer duration,
AnimationAcceleration acceleration)
Animate a reposition / resize of this canvas from its current size and position.
|
void |
animateResize(java.lang.Integer width,
java.lang.Integer height)
Animate a resize of this canvas from its current size to the specified size
|
void |
animateResize(java.lang.Integer width,
java.lang.Integer height,
AnimationCallback callback) |
void |
animateResize(java.lang.Integer width,
java.lang.Integer height,
AnimationCallback callback,
java.lang.Integer duration) |
void |
animateResize(java.lang.Integer width,
java.lang.Integer height,
AnimationCallback callback,
java.lang.Integer duration,
AnimationAcceleration acceleration)
Animate a resize of this canvas from its current size to the specified size
|
void |
animateScroll(java.lang.Integer scrollLeft,
java.lang.Integer scrollTop)
Animate a scroll from the current scroll position to the specified position.
|
void |
animateScroll(java.lang.Integer scrollLeft,
java.lang.Integer scrollTop,
AnimationCallback callback) |
void |
animateScroll(java.lang.Integer scrollLeft,
java.lang.Integer scrollTop,
AnimationCallback callback,
java.lang.Integer duration) |
void |
animateScroll(java.lang.Integer scrollLeft,
java.lang.Integer scrollTop,
AnimationCallback callback,
java.lang.Integer duration,
AnimationAcceleration acceleration)
Animate a scroll from the current scroll position to the specified position.
|
void |
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 |
animateShow()
Show a canvas by growing it with default effect specified by
animateShowEffect . |
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.
|
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.
|
static <T extends Canvas> |
asSGWTComponent(com.google.gwt.core.client.JavaScriptObject jsObj)
Returns the existing SGWT widget, or creates and returns one if none exist,
associated with the supplied
JavaScriptObject . |
void |
blur()
If this canvas has keyboard focus, blur it.
|
void |
bringToFront()
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(java.lang.String autoChildName,
Canvas defaults)
Changes the defaults for Canvas AutoChildren named
autoChildName . |
static void |
changeAutoChildDefaults(java.lang.String autoChildName,
FormItem defaults)
Changes the defaults for FormItem AutoChildren named
autoChildName . |
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 |
clearExplicitTabIndex()
If an explicit
tabIndex was assigned to this widget, clear it. |
java.lang.Boolean |
clickMaskUp()
Determines whether a clickmask is showing
|
java.lang.Boolean |
clickMaskUp(java.lang.String ID)
Determines whether a clickmask is showing
|
java.lang.Boolean |
contains(Canvas canvas)
Returns true if element is a descendant of this widget (i.e., exists below this widget in the containment
hierarchy); and false otherwise.
|
java.lang.Boolean |
contains(Canvas canvas,
java.lang.Boolean testSelf)
Returns true if element is a descendant of this widget (i.e., exists below this widget in the containment
hierarchy); and false otherwise.
|
java.lang.Boolean |
containsEvent()
Return true if the last event's mouse coordinates are within the bounds of this component.
|
java.lang.Boolean |
containsEventTarget()
Returns true if the current
mouse event target is this component
or a descendent of this component. |
java.lang.Boolean |
containsFocus()
Returns true if the keyboard focus is in this Canvas or any child of this Canvas.
|
java.lang.Boolean |
containsPoint(int x,
int y)
Return whether or not this object contains the specified global (x,y) coordinates.
|
java.lang.Boolean |
containsPoint(int x,
int y,
java.lang.Boolean withinViewport)
Return whether or not this object contains the specified global (x,y) coordinates.
|
protected com.google.gwt.core.client.JavaScriptObject |
create() |
void |
dataContextChanged()
Notification method fired when
DataContext 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 master
|
void |
disable()
Disables this widget and any children and peers of this widget.
|
void |
enable()
Enables this widget and any children / peers of this widget.
|
java.lang.Boolean |
encloses(Canvas other)
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 |
focusAfterGroup()
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 |
focusInNextTabElement()
Shifts focus to the next focusable element after this one.
|
void |
focusInPreviousTabElement()
Shifts focus to the previous focusable element before this one.
|
int |
getAbsoluteLeft()
This method is similar to
getPageLeft() . |
int |
getAbsoluteTop()
This method is similar to
getPageTop() . |
java.lang.String |
getAccessKey()
If specified this governs the HTML accessKey for the widget.
|
java.lang.Integer |
getAdaptiveHeightPriority()
|
java.lang.Integer |
getAdaptiveWidthPriority()
If multiple widgets in the same Layout have
adaptive width ,
adaptiveWidthPriority can be set to indicate which of the components should be given priority access to
space. |
java.lang.Boolean |
getAlwaysManageFocusNavigation()
Should focus navigation for this canvas and its descendents be handled explicitly by intercepting "Tab" key events and
calling the
TabIndexManager.shiftFocus() API? |
java.lang.Boolean |
getAlwaysShowScrollbars()
Should this browser always show custom scrollbars if
showCustomScrollbars is true? |
AnimationAcceleration |
getAnimateAcceleration()
Default acceleration effect to apply to all animations on this Canvas.
|
java.lang.Integer |
getAnimateFadeTime()
Default time for performing an animated fade.
|
AnimationAcceleration |
getAnimateHideAcceleration()
Default acceleration function for performing an animated hide.
|
AnimationEffect |
getAnimateHideEffect()
Default animation effect to use if
animateHide() is called without an explicit effect parameter. |
java.lang.Integer |
getAnimateHideTime()
Default time for performing an animated hide.
|
AnimationAcceleration |
getAnimateMoveAcceleration()
Default acceleration effect for performing an animated move.
|
java.lang.Integer |
getAnimateMoveTime()
Default time for performing an animated move.
|
AnimationAcceleration |
getAnimateRectAcceleration()
Default acceleration function for performing an animated move and resize.
|
java.lang.Integer |
getAnimateRectTime()
Default time for performing an animated setRect.
|
AnimationAcceleration |
getAnimateResizeAcceleration()
Default acceleration function for performing an animated resize.
|
AnimationLayoutMode |
getAnimateResizeLayoutMode()
When to update the
child layout for a size animation . |
java.lang.Integer |
getAnimateResizeTime()
Default time for performing an animated resize.
|
AnimationAcceleration |
getAnimateScrollAcceleration()
Default acceleration function for performing an animated scroll.
|
java.lang.Integer |
getAnimateScrollTime()
Default time for performing an animated scroll.
|
AnimationAcceleration |
getAnimateShowAcceleration()
Default acceleration function for performing an animated show.
|
AnimationEffect |
getAnimateShowEffect()
Default animation effect to use if
animateShow() is called without an explicit effect parameter. |
java.lang.Integer |
getAnimateShowTime()
Default time for performing an animated show.
|
int |
getAnimateTime()
Default total duration of animations.
|
java.lang.String |
getAppImgDir()
Default directory for app-specific images, relative to the Page-wide
appImgDir . |
java.lang.String |
getAriaHandleID()
Returns the DOM ID for the main element for this canvas which will have ARIA
role and attributes applied to it. |
java.lang.String |
getAriaRole()
ARIA role of this component.
|
java.util.Map |
getAriaStateDefaults()
Retrieves dynamically calculated default ARIA state properties for this canvas.
|
java.lang.Boolean |
getAutoMaskComponents()
Deprecated.
As of Smart GWT version 10.0, deprecated in favor of
EditProxy.autoMaskChildren |
java.lang.String |
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.
|
java.lang.Boolean |
getAutoPopulateData()
If a
dataContext is provided, should subcomponents
automatically bind to the data? |
java.lang.Boolean |
getAutoShowParent()
If set to true, the widget's parent (if any) will automatically be shown whenever the widget is shown.
|
java.lang.String |
getBackgroundColor()
The background color for this widget.
|
java.lang.String |
getBackgroundImage()
URL for a background image for this widget (corresponding to the CSS "background-image" attribute).
|
java.lang.String |
getBackgroundPosition()
Specifies how the background image should be positioned on the widget.
|
BackgroundRepeat |
getBackgroundRepeat()
Specifies how the background image should be tiled if this widget is larger than the image.
|
java.lang.String |
getBorder()
Set the CSS border of this component, as a CSS string including border-width, border-style, and/or color (eg "2px solid
blue").
|
java.lang.String |
getBorderRadius()
The CSS border-radius for this widget.
|
int |
getBottom()
Return the bottom coordinate of this object as rendered, relative to its enclosing context, in pixels.
|
static Canvas |
getById(java.lang.String ID)
Retrieve a Canvas by its global
ID . |
static Canvas |
getByJSObject(com.google.gwt.core.client.JavaScriptObject jsObj)
Retrieve a Canvas from its
JavaScriptObject . |
Canvas |
getByLocalId(java.lang.String ID)
Retrieve a child of this Canvas by it's local ID.
|
java.lang.Boolean |
getCanAcceptDrop()
Indicates that this object can receive dropped widgets (i.e.
|
java.lang.Boolean |
getCanAdaptHeight()
See
canAdaptWidth . |
java.lang.Boolean |
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.
|
java.lang.Boolean |
getCanDrag()
Indicates whether this widget can initiate custom drag-and-drop operations (other than reposition or resize).
|
java.lang.Boolean |
getCanDragReposition()
Indicates whether this widget can be moved by a user of your application by simply dragging with the mouse.
|
java.lang.Boolean |
getCanDragResize()
Indicates whether this widget can be resized by dragging on the edges and/or corners of the widget with the mouse.
|
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.
|
java.lang.Boolean |
getCanDrop()
Indicates that this object can be dropped on top of other widgets.
|
java.lang.Boolean |
getCanDropBefore()
When explicitly set to false, disallows drop before this member in the Layout.
|
java.lang.Boolean |
getCanFocus()
Can this widget be allowed to become the target of keyboard events?
|
java.lang.Boolean |
getCanHover()
Will this Canvas fire hover events when the user hovers over it, or one of its children?
|
java.lang.Boolean |
getCanSelectText()
Whether native drag selection of contained text is allowed within this Canvas.
|
Canvas |
getCanvasAutoChild(java.lang.String autoChildName)
Returns the
Canvas AutoChild named autoChildName if already created. |
CanvasItem |
getCanvasItem()
If this canvas is being displayed in a
CanvasItem , this property will be
set to point at the item. |
Canvas[] |
getChildren()
Array of all Canvii that are immediate children of this Canvas.
|
java.lang.Boolean |
getChildrenResizeSnapAlign()
Flag to disable snapping to alignment when children of this Canvas are resized
|
java.lang.Boolean |
getChildrenSnapAlign()
If enabled while
childrenSnapToGrid 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 by snapAlignCenterLineStyle and snapAlignEdgeLineStyle respectively. |
java.lang.Boolean |
getChildrenSnapCenterAlign()
See
childrenSnapAlign . |
java.lang.Boolean |
getChildrenSnapEdgeAlign()
See
childrenSnapAlign . |
java.lang.Boolean |
getChildrenSnapResizeToGrid()
If true, causes this canvas's children to snap to its grid when resizing.
|
java.lang.Boolean |
getChildrenSnapToGrid()
If true, causes this canvas's children to snap to its grid when dragging.
|
java.lang.Integer |
getChildTabPosition(Canvas child)
For a given child widget where
updateTabPositionOnReparent is true, return the expected tab position within this parent. |
java.lang.String |
getClassName()
Returns the JavaScript class name.
|
Canvas |
getComponentMask()
Automatically generated mask canvas displayed when
showComponentMask() is called. |
Canvas |
getComponentMaskDefaults()
Defaults for the
componentMask autoChild. |
com.google.gwt.dom.client.Element |
getContentElement()
Returns the DOM element for this Canvas which contains the
contents , or for parent components , the DOM elements for any
drawn children. |
java.lang.String |
getContents()
The contents of a canvas or label widget.
|
Menu |
getContextMenu()
Context menu to show for this object, an instance of the Menu widget.
|
java.lang.Boolean |
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 allowing
maxZoomOverflowError of overflow before enabling scrolling and displaying custom scrollbars. |
Cursor |
getCursor()
Specifies the css cursor image to
display when the mouse pointer is over this component.
|
DataContext |
getDataContext()
A mapping from
DataSource IDs to specific Records from those DataSources, that DataBoundComponents
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 setting ListGrid.autoFetchData . |
java.lang.String |
getDataPath()
A dataPath may be specified on any canvas.
|
int |
getDefaultHeight()
For custom components, establishes a default height for the component.
|
int |
getDefaultWidth()
For custom components, establishes a default width for the component.
|
java.lang.String |
getDefiningProperty()
This attribute denotes the name of a property to use as a
getDefiningPropertyName() for this property when generating
and resolving AutoTest locators with search segments . |
java.lang.String |
getDefiningPropertyName()
|
java.lang.String[] |
getDefiningPropertyNameOptions()
If no explicit
definingProperty was specified for this
component,
this array denotes a list of options to use as a
defining property when generating and resolving
AutoTest locators with search segments . |
java.lang.Boolean |
getDestroyed()
If this property is set to
true , the destroy() method
has been called on this canvas. |
java.lang.Boolean |
getDestroying()
This property is set to true when the
destroy() method is called on a
widget. |
boolean |
getDisabled()
If set to true, the widget will be disabled.
|
Cursor |
getDisabledCursor()
Specifies the cursor image to display when the mouse pointer is over this widget if this widget is disabled.
|
java.lang.Boolean |
getDisableTouchScrollingForDrag()
Disables
useTouchScrolling whenever a built-in drag
operation has been enabled which is known to be non-functional if touch scrolling is enabled. |
int |
getDoubleClickDelay()
Amount of time (in milliseconds) between which two clicks are considered a single click
|
DragAppearance |
getDragAppearance()
Visual appearance to show when the object is being dragged.
|
DragIntersectStyle |
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.
|
DragMaskType |
getDragMaskType()
This property controls what kind of mask is used in case
useDragMask is enabled. |
int |
getDragMaxHeight()
Sets maximum height that this Canvas can be resized to by a user.
|
int |
getDragMaxWidth()
Maximum width that this Canvas can be resized to by a user.
|
int |
getDragMinHeight()
Minimum height that this Canvas can be resized to by a user.
|
int |
getDragMinWidth()
Minimum width that this Canvas can be resized to by a user.
|
java.lang.Integer |
getDragOpacity()
If this widget has dragAppearance
"target" , this value specifies the opacity to render the target while it
is being dragged. |
DragAppearance |
getDragRepositionAppearance()
If
canDragReposition is true, this attribute specifies
the visual appearance to show during drag reposition. |
Cursor |
getDragRepositionCursor()
Cursor to switch to if the mouse is over a widget that is drag repositionable.
|
DragAppearance |
getDragResizeAppearance()
If
canDragResize is true, this attribute specifies the
visual appearance to show during drag resize. |
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.
|
int |
getDragStartDistance()
Number of pixels the cursor needs to move before the EventHandler starts a drag operation.
|
Canvas |
getDragTarget()
A different widget that should be actually dragged when dragging initiates on this widget.
|
java.lang.String |
getDragTargetAsString()
A different widget that should be actually dragged when dragging initiates on this widget.
|
java.lang.String |
getDragType()
Sets a
dragType for this widget used, to be compared to dropTypes on possible drop target widgets. |
Canvas |
getDropTarget()
Delegates a different widget that should actually be dropped on if the cursor is over this widget when the drop
completes.
|
java.lang.String |
getDropTargetAsString()
Delegates a different widget that should actually be dropped on if the cursor is over this widget when the drop
completes.
|
java.lang.String[] |
getDropTypes()
When a drag and drop interaction occurs, if a
dragType is
configured on the source widget, it is compared to the dropTypes configured on the target widget, and a
drop is only allowed if the dragType is listed in the target widget's dropTypes array. |
java.lang.String |
getDropTypesAsString()
When a drag and drop interaction occurs, if a
dragType is
configured on the source widget, it is compared to the dropTypes configured on the target widget, and a
drop is only allowed if the dragType is listed in the target widget's dropTypes array. |
java.lang.Boolean |
getDynamicContents()
Dynamic contents allows the contents string to be treated as a simple but powerful template.
|
java.lang.String |
getEdgeBackgroundColor()
Background color for the EdgedCanvas created to decorate this component.
|
java.lang.String |
getEdgeCenterBackgroundColor()
Background color for the center section only.
|
java.lang.String |
getEdgeImage()
Base name of images for edges.
|
int |
getEdgeMarginSize()
How far into the edge of an object do we consider the "edge" for drag resize purposes?
|
java.lang.Integer |
getEdgeOffset()
Amount the contained Canvas should be offset.
|
java.lang.Integer |
getEdgeOpacity()
Opacity of the edges.
|
java.lang.Boolean |
getEdgeShowCenter()
Whether to show media in the center section, that is, behind the decorated Canvas.
|
int |
getEdgeSize()
Size in pixels for corners and edges
|
EditNode |
getEditNode()
|
EditProxy |
getEditProxy()
An
EditProxy controls the behaviors of a component when it is placed into editing mode . |
java.lang.String |
getEditProxyConstructor()
Default class used to construct the
EditProxy for this component when the component is
first placed into edit mode . |
com.google.gwt.user.client.Element |
getElement()
Normal usage of SmartGWT is to call draw() on SmartGWT widgets, not to use use RootPanel.add().
|
com.google.gwt.user.client.Element |
getElement(boolean allowPreRender) |
AdvancedCriteria |
getEnableWhen()
Criteria to be evaluated to determine whether this Canvas should be enabled.
|
java.lang.Boolean |
getEndLine()
Whether this canvas should end the line it's in when used as a tile in a
FlowLayout . |
static EdgeName |
getEventEdge()
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 |
getExtraSpace()
When this Canvas is included as a member in a Layout, extra blank space that should be left after this member in a
Layout.
|
java.lang.String |
getFacetId()
|
boolean |
getFloatingScrollbars()
If
showCustomScrollbars is true, should the
scrollbars be drawn floating over the component handle, or should the handle shrink to accommodate them? |
FormItem |
getFormItemAutoChild(java.lang.String autoChildName)
Returns the
FormItem AutoChild named autoChildName if already created. |
java.lang.Boolean |
getForwardSVGeventsToObject()
If true, events sent to the SVG inside an object tag are forwarded to the object itself by Framework handlers.
|
java.lang.String |
getFullDataPath()
Returns a fully qualified
DataPath for this canvas. |
java.lang.String |
getGroupBorderCSS()
Sets the style for the grouping frame around the canvas.
|
java.lang.String |
getGroupLabelBackgroundColor()
If set, the background color of the grouping label.
|
java.lang.String |
getGroupLabelStyleName()
Sets the style for the grouping label.
|
java.lang.Integer |
getGroupPadding()
Padding to apply inside the border when this canvas is showing a group
border and label . |
java.lang.String |
getGroupTitle()
The title/label for the grouping.
|
java.lang.Integer |
getHeight()
The
canvas.width attribute specifies the size for a component's horizontal dimension;
canvas.height specifies the size for the vertical dimension. |
java.lang.String |
getHeightAsString() |
boolean |
getHideUsingDisplayNone()
When this widget is hidden (see
visibility and hide() ), should display:none be applied to the outer element ? |
Alignment |
getHoverAlign()
If
this.showHover is true, this property can be used to customize the alignment of content in the hover
canvas. |
java.lang.Boolean |
getHoverAutoDestroy()
If
this.showHover is true and getHoverComponent() is implemented, should the hoverCanvas returned from it be automatically destroyed when it is
hidden? |
int |
getHoverAutoFitMaxWidth()
Maximum auto-fit width for a hover if
hoverAutoFitWidth
is enabled. |
java.lang.String |
getHoverAutoFitMaxWidthAsString()
Maximum auto-fit width for a hover if
hoverAutoFitWidth
is enabled. |
java.lang.Boolean |
getHoverAutoFitWidth()
if
showHover is true, this property will cause the specified
hoverWidth to be treated as a minimum width for the hover. |
Canvas |
getHoverComponent()
When
showHoverComponents is true, this method is
called to get the component to show as a hover for this Canvas. |
int |
getHoverDelay()
If
this.canHover is true, how long should the mouse be kept over this widget before the hover event is
fired |
java.lang.String |
getHoverFocusKey()
For canvases
showing 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). |
java.lang.Integer |
getHoverHeight()
If
this.showHover is true, this property can be used to customize the height of the hover canvas shown. |
java.lang.String |
getHoverHTML()
If
this.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. |
java.lang.Boolean |
getHoverMoveWithMouse()
If
this.showHover is true, should this widget's hover canvas be moved with the mouse while visible? |
java.lang.Integer |
getHoverOpacity()
If
this.showHover is true, should the hover canvas be shown with opacity other than 100? |
HoverPersistMode |
getHoverPersist()
Allows interaction with hovers when the cursor is positioned over them.
|
java.lang.String |
getHoverScreen()
Screen to create (via
createScreen() ) in lieu of calling getHoverComponent() . |
java.lang.String |
getHoverStyle()
If
this.showHover is true, this property can be used to specify the css style to apply to the hover canvas. |
VerticalAlignment |
getHoverVAlign()
If
this.showHover is true, this property can be used to customize the vertical alignment of content in the
hover canvas. |
int |
getHoverWidth()
If
this.showHover is true, this property can be used to
customize the width of the hover canvas shown. |
java.lang.Boolean |
getHoverWrap()
If
this.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,
java.lang.String direction)
Override this method to provide a custom snap-to grid.
|
com.google.gwt.dom.client.Element |
getHtmlElement()
If specified as a pointer to an HTML element present in the DOM, this canvas will be rendered inside that element on
draw() . |
java.lang.String |
getHtmlElementAsString()
If specified as a pointer to an HTML element present in the DOM, this canvas will be rendered inside that element on
draw() . |
DrawPosition |
getHtmlPosition()
If
htmlElement is specified, this attribute specifies the
position where the canvas should be inserted relative to the htmlElement in the DOM. |
com.google.gwt.dom.client.Element |
getImage(java.lang.String identifier)
Retrieve a native image, SVG object element or the container for an SVG symbol or font-icon, by name.
|
static java.lang.String |
getImgURL(java.lang.String URL)
Return the full URL for an image to be drawn in this canvas.
|
static java.lang.String |
getImgURL(java.lang.String URL,
java.lang.String imgDir)
Return the full URL for an image to be drawn in this canvas.
|
int |
getInnerContentHeight()
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 |
getInnerContentWidth()
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 |
getInnerHeight()
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 |
getInnerWidth()
Returns the amount of space available for absolutely positioned child widget(s) or absolutely positioned HTML content,
without introducing clipping, scrolling or overflow.
|
boolean |
getIsGroup()
Should a grouping frame be shown around this canvas if a non-empty string has been specified for
groupTitle . |
java.lang.Boolean |
getIsPrinting()
This boolean flag will be set to true by framework logic while generating print HTML for this widget as a result to a
call to
showPrintPreview() (or just getPrintHTML() ). |
java.lang.Boolean |
getIsRuleScope()
Marks this Canvas as the
ruleScope that will be discovered by
any contained DataBoundComponent s which do not specify an explicit
ruleScope . |
java.lang.Boolean |
getIsSnapAlignCandidate()
Flag to disable snapping to alignment against this Canvas when other Canvases dragged into the same parent when
childrenSnapAlign is enabled on this Canvas' parent. |
java.lang.Boolean |
getKeepInParentRect()
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).
|
Alignment |
getLayoutAlign()
When this Canvas is included as a member in a Layout, layoutAlign controls alignment on the breadth axis of the layout.
|
java.lang.Boolean |
getLeaveGroupLabelSpace()
When showing this widget in a
group , should any content be shifted
down so that the group-label doesn't sit in front of it? |
java.lang.Integer |
getLeavePageSpace()
If set, overrides the global
defaultPageSpace . |
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 the
position property). |
java.lang.String |
getLeftAsString()
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 the
position property). |
java.lang.String |
getLocalId()
Retrieve the local ID of this canvas.
|
boolean |
getLocateByIDOnly()
If
true , when retrieving a locator for this component
always return a reference directly to this component by widget ID ,
using the compact format "///canvasID" , ignoring any parent elements and ignoring any configured
testRoot . |
LocatorStrategy |
getLocateChildrenBy()
Strategy to use when locating children in this canvas from an autoTest locator string.
|
LocatorTypeStrategy |
getLocateChildrenType()
LocatorTypeStrategy to use when finding children within this canvas. |
LocatorStrategy |
getLocatePeersBy()
Strategy to use when locating peers of this canvas from an autoTest locator string.
|
LocatorTypeStrategy |
getLocatePeersType()
LocatorTypeStrategy to use when finding peers of this canvas. |
java.lang.String |
getLocatorName()
Local name for referencing this canvas from an autoTest locator string.
|
com.smartgwt.logicalstructure.core.LogicalStructureObject |
getLogicalStructure()
Getter implementing the
LogicalStructure interface,
which supports Eclipse's logical structure debugging facility. |
java.lang.Integer |
getMargin()
Set the CSS Margin, in pixels, for this component.
|
Canvas |
getMasterCanvas()
Returns this canvas's "master" (the canvas to which it was added as a peer), if any.
|
Canvas |
getMasterElement()
Deprecated.
In favor or
getMasterCanvas() as of Smart GWT release 9.1 |
java.lang.Boolean |
getMatchElement()
If
htmlElement is specified, should this canvas be drawn at
the same dimensions as the htmlElement?See also matchElementWidth and matchElementHeight |
MatchElementSizeMode |
getMatchElementHeight()
For canvases with a specified
htmlElement where persistentMatchElement is set to true, how should the
canvas match the element's height? |
MatchElementSizeMode |
getMatchElementWidth()
For canvases with a specified
htmlElement where persistentMatchElement is set to true, how should the
canvas match the element's width? |
int |
getMaxHeight()
Maximum height available to this Canvas.
|
int |
getMaxWidth()
Maximum width available to this Canvas.
|
int |
getMaxZoomOverflowError()
When
correctZoomOverflow is true and browser or
OS-level zoom is active, determines how much overflow must occur before the Framework enables scrolling for this canvas. |
java.lang.String |
getMenuConstructor()
Default class used to construct menus created by this component, including context menus.
|
int |
getMinHeight()
Minimum height available to this Canvas.
|
int |
getMinNonEdgeSize()
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 than
minNonEdgeSize , 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 |
getMinWidth()
Minimum width available to this Canvas.
|
double |
getMomentumScrollMinSpeed()
The minimum speed in pixels per second that must be reached for momentum scrolling to kick in.
|
int |
getMouseStillDownDelay()
Amount of time (in milliseconds) between repeated 'mouseStillDown' events for this canvas.
|
int |
getMouseStillDownInitialDelay()
Amount of time (in milliseconds) before mouseStillDown events start to be fired repeatedly for this canvas.
|
java.lang.String |
getName()
Optional name for the canvas, which can later be used to reference it.
|
java.lang.Boolean |
getNativeAutoHideScrollbars()
In some platform/browser configurations, scrollable regions do not show visible scrollbars until the user attempts to
interact with the region.
|
int |
getNextZIndex()
get the next zIndex for the next item to be drawn.
|
java.lang.Boolean |
getNoDoubleClicks()
If true, this canvas will receive all mouse-clicks as single
click events rather than as doubleClick events. |
Cursor |
getNoDropCursor()
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 and
showNoDropIndicator is
true. |
int |
getOffsetHeight() |
int |
getOffsetWidth() |
int |
getOffsetX()
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 |
getOffsetY()
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() |
java.lang.Integer |
getOpacity()
Renders the widget to be partly transparent.
|
static Canvas |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj) |
com.google.gwt.dom.client.Element |
getOuterElement()
Returns the outer DOM element of this Canvas.
|
Overflow |
getOverflow()
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.
|
java.lang.Integer |
getPadding()
Set the CSS padding of this component, in pixels.
|
int |
getPageBottom()
Return the page-relative bottom coordinate of this object, in pixels.
|
int |
getPageLeft()
Returns the page-relative left coordinate of the widget on the page, in pixels.
|
Rectangle |
getPageRect() |
int |
getPageRight()
Return the page-relative right coordinate of this object, in pixels.
|
int |
getPageTop()
Returns the page-relative top coordinate of the widget on the page, in pixels
|
java.util.Map |
getPaletteDefaults()
This method returns a Map of config properties suitable for use as the "defaults"
attribute of a
PaletteNode . |
Canvas |
getPanelContainer()
Returns this Canvas's "panel container".
|
Canvas |
getParentCanvas()
This Canvas's immediate parent, if any.
|
Canvas |
getParentElement()
Deprecated.
As of Smartclient version 9.1, deprecated in favor of
parentCanvas and getParentCanvas() |
Canvas[] |
getPeers()
Array of all Canvii that are peers of this Canvas.
|
java.lang.String |
getPendingMarkerStyle()
CSS class used to apply additional styles to this canvas when
showPendingMarker() is called, or when pendingMarkerVisible has been set. |
java.lang.Boolean |
getPendingMarkerVisible()
This attribute indicates whether the
pending marker
class should be appended to the list of CSS classes applied to this canvas. |
PercentBoxModel |
getPercentBox()
Governs the model to be used when sizing canvases with percentage width or height, or positioning widgets with a
specified
snapTo . |
Canvas |
getPercentSource()
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.
|
java.lang.Boolean |
getPersistentMatchElement()
If this canvas has a specified
htmlElement and matchElement 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? |
PointerSettings |
getPointerSettings()
Detail settings of the
pointer such as where it should be
located along the outside of the canvas. |
java.lang.String |
getPointerTarget()
This property in conjunction with the
pointerSettings.snapTo places
the canvas in relation to the target canvas. |
java.lang.String |
getPointerTargetAsString()
This property in conjunction with the
pointerSettings.snapTo places
the canvas in relation to the target canvas. |
Positioning |
getPosition()
Absolute or relative, corresponding to the "absolute" (with respect to parent) or
"relative" (with respect to document flow) values for the CSS position attribute.
|
java.lang.String |
getPrefix() |
java.lang.Boolean |
getPrintChildrenAbsolutelyPositioned()
Should this canvas print its children absolutely positioned when generating
printable HTML . |
static void |
getPrintHTML(java.lang.Object[] components,
PrintProperties printProperties,
PrintHTMLCallback callback)
Returns print-formatted HTML for the specified list of components.
|
java.lang.String |
getPrintHTML(PrintProperties printProperties,
PrintHTMLCallback callback)
Retrieves printable HTML for this component and all printable subcomponents.
|
java.lang.String |
getPrintStyleName()
The CSS class to apply when printing this widget.
|
java.lang.String |
getPrompt()
Prompt displayed in hover canvas if
showHover is true. |
java.lang.String[] |
getProportionalResizeModifiers()
If
proportionalResizing is set to
ProportionalResizeMode.MODIFIER or
ProportionalResizeMode.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. |
ProportionalResizeMode |
getProportionalResizing()
If
canDragResize is true, this property specifies the
conditions for when proportional resizing is used. |
boolean |
getReceiveScrollbarEvents()
Whether this canvas should receive
events from its scrollbars, which are peers . |
Rectangle |
getRect()
Get all four coordinates, relative to the enclosing context, at one.
|
java.lang.Boolean |
getRedrawOnResize()
Should this element be redrawn in response to a resize?
|
java.lang.String |
getResizeBarTarget()
When this Canvas is included as a member in a Layout, and
showResizeBar is set to true 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[] |
getResizeFrom()
When drag resizing is enabled via
canDragResize , 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.
|
java.util.Map |
getRuleContext()
Get the current value of the rule context collected by the
ruleScope of this component (which may be this component itself or whatever component is managing the
ruleScope for this component). |
java.util.Map |
getRuleContext(boolean databoundOnly)
Get the current value of the rule context collected by the
ruleScope of this component (which may be this component itself or whatever component is managing the
ruleScope for this component). |
java.lang.String |
getRuleScope()
ID of the component that gathers the context for evaluation of
criteria-based
rules specified by properties such as FormItem.visibleWhen ,
Dynamic Properties, and DynamicCriteria such as
ListGrid.initialCriteria . |
int |
getScrollbarSize()
How thick should we make the scrollbars for this canvas.
|
int |
getScrollBottom()
Returns the scrollTop required to scroll vertically to the end of this widget's content.
|
int |
getScrollHeight()
Returns the scrollable height of the widget's contents, including children, ignoring clipping.
|
int |
getScrollLeft()
Get the number of pixels this Canvas is scrolled from its left edge.
|
int |
getScrollRight()
Returns the scrollLeft required to scroll horizontally to the end of this widget's content.
|
int |
getScrollTop()
Get the number of pixels this Canvas is scrolled from its top edge.
|
int |
getScrollWidth()
Returns the scrollable width of the widget's contents, including children, ignoring clipping.
|
java.lang.String |
getShadowColor()
Color for the css-based drop shadow shown if
useCSSShadow is
true and showShadow is true. |
int |
getShadowDepth()
Depth of the shadow, or the virtual height above the page of the widget throwing the shadow.
|
java.lang.Integer |
getShadowHOffset()
Horizontal offset for the
shadow . |
java.lang.String |
getShadowImage()
If
useCSSShadow 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. |
java.lang.Integer |
getShadowOffset()
Offset of the shadow.
|
java.lang.Integer |
getShadowSoftness()
Softness, or degree of blurring, of the shadow.
|
java.lang.Integer |
getShadowSpread()
Explicit spread for the css-based drop shadow shown if
useCSSShadow is true and showShadow is true. |
java.lang.Integer |
getShadowVOffset()
Vertical offset for the
shadow . |
java.lang.Boolean |
getShouldPrint()
Whether this canvas should be included in a printable view.
|
boolean |
getShowCustomScrollbars()
Whether to use the browser's native scrollbars or Smart GWT-based scrollbars.
|
java.lang.Boolean |
getShowDragShadow()
When this widget is dragged, if its dragAppearance is
"target" , should we show a shadow behind the canvas
during the drag. |
java.lang.Boolean |
getShowEdges()
Whether an
EdgedCanvas should be used to show image-based edges around this
component. |
java.lang.Boolean |
getShowHover()
If
this.canHover is true, should we show the global hover canvas by default when the user hovers over this
canvas? |
java.lang.Boolean |
getShowHoverComponents()
When set to true, shows a widget hovering at the mouse point instead of the builtin hover label.
|
java.lang.Boolean |
getShowPointer()
Should a pointer be shown? A pointer can be placed on the border to identify the target of the canvas contents.
|
java.lang.Boolean |
getShowResizeBar()
When this Canvas is included as a member in a
Layout , whether a resizeBar
should be shown after this member in the layout, to allow it to be resized. |
java.lang.Boolean |
getShowShadow()
Whether to show a drop shadow for this Canvas.
|
java.lang.Boolean |
getShowSnapGrid()
Whether to show a snap grid for this Canvas.
|
boolean |
getShrinkElementOnHide()
This is an advanced setting.
|
java.lang.Boolean |
getSizeMayChangeOnRedraw()
Is it possible that a call to
redraw() on this widget will change its
size? |
java.lang.String |
getSkinImgDir()
Default directory for skin images (those defined by the class), relative to the Page-wide
skinDir . |
Canvas[] |
getSnapAlignCandidates()
When
childrenSnapAlign is enabled, list of candidates to
check for alignment. |
java.lang.String |
getSnapAlignCenterLineStyle()
CSS border declaration used for the line shown to indicate snapping to a center line when
childrenSnapAlign is set. |
java.lang.String |
getSnapAlignEdgeLineStyle()
CSS border declaration used for the line shown to indicate snapping to a edge line when
childrenSnapAlign is set. |
java.lang.String |
getSnapAxis()
Describes which axes to apply snap-to-grid to.
|
java.lang.String |
getSnapEdge()
If
snapTo 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. |
DrawLine |
getSnapGridLineProperties()
Specifies line styling to use when drawing the grid of lines for
SnapGridStyle :
"lines". |
SnapGridStyle |
getSnapGridStyle()
Specifies indication style to use for snap points, either a grid of lines or an array of crosses.
|
java.lang.String |
getSnapHDirection()
The horizontal snap direction.
|
int |
getSnapHGap()
The horizontal grid size to use, in pixels, when snap-to-grid is enabled.
|
java.lang.Integer |
getSnapOffsetLeft()
If
snapTo 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. |
java.lang.Integer |
getSnapOffsetTop()
If
snapTo 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. |
java.lang.Boolean |
getSnapOnDrop()
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,
java.lang.String snapTo,
Canvas snapper)
Return the position for
snapper to be placed in order to "snap to" an edge or corner of
target , in the same sense as snapTo . |
static Point |
getSnapPosition(Canvas target,
java.lang.String snapTo,
Canvas snapper,
java.lang.String snapEdge)
Return the position for
snapper to be placed in order to "snap to" an edge or corner of
target , in the same sense as snapTo . |
java.lang.Boolean |
getSnapResizeToAlign()
Flag to disable snapping to alignment when this Canvas is resized.
|
java.lang.Boolean |
getSnapResizeToGrid()
Causes this canvas to snap to its parent's grid when resizing.
|
java.lang.String |
getSnapTo()
Position this widget such that it is aligned with ("snapped to") an edge of its
master (if specified), or its parent canvas . |
java.lang.Boolean |
getSnapToAlign()
Flag to disable snapping to alignment when this Canvas is dragged when
childrenSnapAlign is enabled on this Canvas' parent. |
java.lang.Boolean |
getSnapToCenterAlign()
Flag to disable snapping to center alignment when this Canvas is dragged when
childrenSnapAlign is enabled on this Canvas' parent. |
java.lang.Boolean |
getSnapToEdgeAlign()
Flag to disable snapping to edge alignment when this Canvas is dragged when
childrenSnapAlign is enabled on this Canvas' parent. |
java.lang.Boolean |
getSnapToGrid()
Causes this canvas to snap to its parent's grid when dragging.
|
java.lang.String |
getSnapVDirection()
The vertical snap direction.
|
int |
getSnapVGap()
The vertical grid size to use, in pixels, when snap-to-grid is enabled.
|
java.lang.Boolean |
getStartLine()
Whether this canvas should always start a new line when used as a tile in a
FlowLayout . |
java.lang.String |
getStyleName()
The CSS class applied to this widget as a whole.
|
java.lang.Integer |
getTabIndex()
If specified this governs the tabIndex of the widget in the page's tab order.
|
DataContext |
getTestDataContext()
A
DataContext to be used if no dataContext is provided (directly or indirectly via a parent). |
protected Canvas |
getTestInstance() |
java.lang.String |
getTitle()
Synonym for
getPrompt() |
java.lang.String |
getTooltip()
Synonym for
getPrompt() |
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 the
position property). |
java.lang.String |
getTopAsString()
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 the
position property). |
Canvas |
getTopElement()
The top-most Canvas (i.e., not a child of any other Canvas), if any, in this widget's containment hierarchy.
|
java.util.Map |
getUISummary(java.lang.String[] heirarchyExcluded,
java.lang.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 |
getUpdateTabPositionOnDraw()
Should canvases with no
parent canvas be moved to the end of
the TabIndexManager tree on draw()? |
boolean |
getUpdateTabPositionOnReparent()
Should canvases with a
parent canvas be added to the
TabIndexManager under the parent as described in updateChildTabPositions() and updateChildTabPosition() ? |
java.lang.Boolean |
getUseBackMask()
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 |
getUseCSSShadow()
If
showShadow is true, should we use the css
box-shadow property (where supported) to achieve the shadow? |
boolean |
getUseDragMask()
This flag controls whether we register the component as a maskable item with the EventHandler.
|
boolean |
getUseImageForSVG()
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.
|
java.lang.Boolean |
getUseNativeDrag()
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.
|
java.lang.Boolean |
getUseOpacityFilter()
Configures where the Opacity filter is used for IE6-8.
|
java.lang.Boolean |
getUseTouchScrolling()
On
touch devices , if this Canvas can be scrolled, should
touch-dragging the content area result in scrolling? Set to false if touch-dragging should not cause
scrolling. |
ValuesManager |
getValuesManager()
ValuesManager for managing values displayed in this component. |
java.lang.String |
getValuesManagerAsString()
ValuesManager for managing values displayed in this component. |
int |
getViewportHeight()
Returns the height of the viewport onto the scrollable content.
|
int |
getViewportWidth()
Returns the width of the viewport onto the scrollable content.
|
Visibility |
getVisibility()
Controls widget visibility when the widget is initialized.
|
int |
getVisibleHeight()
Return the visible height of the Canvas.
|
AdvancedCriteria |
getVisibleWhen()
Criteria to be evaluated to determine whether this Canvas should be visible.
|
int |
getVisibleWidth()
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,
java.lang.String direction)
Override this method to provide a custom snap-to grid.
|
java.lang.Integer |
getWidth()
The
canvas.width attribute specifies the size for a component's horizontal dimension;
canvas.height specifies the size for the vertical dimension. |
java.lang.String |
getWidthAsString() |
Process[] |
getWorkflows()
List of screen-global
workflows that can be shared by event handler
workflows using a StartProcessTask . |
int |
getZIndex()
Get the z-Index of this canvas.
|
int |
getZIndex(boolean resolveToNumber)
Get the z-Index of this canvas.
|
void |
handleHover()
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 |
hideClickMask()
Hides the click mask associated with this canvas.
|
void |
hideClickMask(java.lang.String ID)
Hides the click mask associated with this canvas.
|
void |
hideComponentMask()
Hide the
component level clickMask for this widget |
void |
hideComponentMask(boolean suppressFocusReset)
Hide the
component level clickMask for this widget |
void |
hideContextMenu()
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 java.lang.String |
imgHTML(java.lang.String src)
Generates the HTML for an image unique to this Canvas.
|
static java.lang.String |
imgHTML(java.lang.String src,
int width,
int height) |
static java.lang.String |
imgHTML(java.lang.String src,
int width,
int height,
java.lang.String name,
java.lang.String extraStuff,
java.lang.String imgDir)
Generates the HTML for an image unique to this Canvas.
|
void |
initComplete()
Notification method fired after
initWidget() , when canvas
initialization is complete. |
java.lang.Boolean |
intersects(Canvas other)
Returns true if the rectangles of this widget and the specified widget overlap.
|
java.lang.Boolean |
isDirty()
Returns whether a canvas is waiting to be redrawn.
|
java.lang.Boolean |
isDisabled()
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.
|
java.lang.Boolean |
isFocused()
Returns true if this Canvas has the keyboard focus.
|
boolean |
isVisible()
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.
|
java.lang.Boolean |
keyUp()
Executed when a key is released on a focusable widget (
canFocus :
true). |
void |
layoutChildren(java.lang.String reason)
layoutChildren() is where a Canvas should implement a sizing policy for it's Canvas children. |
java.lang.String |
linkHTML(java.lang.String href)
Generates the HTML for a standard link (anchor) element.
|
java.lang.String |
linkHTML(java.lang.String href,
java.lang.String text) |
java.lang.String |
linkHTML(java.lang.String href,
java.lang.String text,
java.lang.String target) |
java.lang.String |
linkHTML(java.lang.String href,
java.lang.String text,
java.lang.String target,
java.lang.String ID) |
java.lang.String |
linkHTML(java.lang.String href,
java.lang.String text,
java.lang.String target,
java.lang.String ID,
java.lang.Integer tabIndex) |
java.lang.String |
linkHTML(java.lang.String href,
java.lang.String text,
java.lang.String target,
java.lang.String ID,
java.lang.Integer tabIndex,
java.lang.String accessKey)
Generates the HTML for a standard link (anchor) element.
|
void |
markForDestroy()
destroy() this canvas on a timeout. |
void |
markForRedraw()
Marks the widget as "dirty" so that it will be added to a queue for redraw.
|
void |
markForRedraw(java.lang.String reason)
Marks the widget as "dirty" so that it will be added to a queue for redraw.
|
void |
moveAbove(Canvas canvas)
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 |
moveBelow(Canvas canvas)
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.
|
java.lang.Boolean |
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 |
pageScrollDown()
This method is the programmatic equivalent of the user pressing the "Page Down" key while this widget has the focus.
|
void |
pageScrollUp()
This method is the programmatic equivalent of the user pressing the "Page Up" key while this widget has the focus.
|
protected void |
parentResized()
Fires when the interior size of the parent changes, including parent resize and scrollbar introduction or removal.
|
void |
placeNear()
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 a
PrintWindow containing a PrintCanvas showing a printable view of this component. |
void |
print(PrintProperties printProperties) |
void |
print(PrintProperties printProperties,
PrintWindow printWindowProperties) |
void |
print(PrintProperties printProperties,
PrintWindow printWindowProperties,
java.lang.String callback)
Generate and show a
PrintWindow containing a PrintCanvas showing a printable view of this component. |
static void |
printComponents(java.lang.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(java.lang.String dataPath,
java.lang.Object data)
Provide data to the
com.smartgwt.client.widgets.Canvas#ruleScope component,
to be made available in the rule context at the specified path . |
void |
provideRuleContext(java.lang.String dataPath,
java.lang.Object data,
DataBoundComponent dbc)
Provide data to the
com.smartgwt.client.widgets.Canvas#ruleScope component,
to be made available in the rule context at the specified path . |
void |
redraw()
Redraws the widget immediately with its current property values.
|
void |
redraw(java.lang.String reason)
Redraws the widget immediately with its current property values.
|
static void |
registerFontScaledPaddingStyles(java.lang.String[] scaledStyles,
java.lang.String[] baselineStyles,
int targetSizeChange)
Registers one or more CSS classes to have their padding adjusted (independently on all edges)
according to the
padding size change applied to the page. |
void |
removeChild(Canvas child)
Remove a child from this parent.
|
void |
removeChild(Canvas child,
java.lang.String name)
Remove a child from this parent.
|
void |
removePeer(Canvas peer)
Remove a peer from this Canvas
|
void |
removePeer(Canvas peer,
java.lang.String name)
Remove a peer from this Canvas
|
void |
removeRuleContext(java.lang.String path)
Remove data in the rule context at the specified
path along with any user-provided schema. |
void |
removeSnapAlignCandidate(Canvas candidate)
Remove a candidate from
snapAlignCandidates . |
static void |
resizeAutoChildAttributes(java.lang.String policy,
int delta)
Change the value of attributes registered via
registerAutoChildSizingAttributes() by some number
of pixels. |
java.lang.Boolean |
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 calling
resizeControls() , 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,
java.lang.String styleSheets) |
static void |
resizeFonts(int sizeChange,
java.lang.String styleSheets,
java.lang.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 calling
resizeFonts() , but takes a final
target size instead of a delta representing the change from a current size. |
static void |
resizeIcons(java.lang.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,
java.lang.String styleSheets)
Modify the amount of padding for some CSS styles defined for the page.
|
java.lang.Boolean |
resizeTo(int width,
int height)
Resizes the widget to the specified width and height (moves the right and/ or bottom sides of the widget).
|
java.lang.Boolean |
resizeTo(java.lang.String width,
java.lang.String height)
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 as
TabSet have more useful implementations)
NOTE: This is an override point. |
void |
revealChild(java.lang.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 as
TabSet 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 |
scrollTo(java.lang.Integer left) |
void |
scrollTo(java.lang.Integer left,
java.lang.Integer top)
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 |
scrollToBottom()
Vertically scrolls the content of the widget to the end of its content
|
void |
scrollToLeft()
Horizontally scrolls the content of the widget to 0
|
void |
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 |
scrollToRight()
Horizontally scrolls the content of the widget to the end of its content
|
void |
scrollToTop()
Vertically scrolls the content of the widget to 0
|
void |
sendToBack()
Puts this widget at the bottom of the stacking order, so it appears behind all other widgets in the same parent.
|
Canvas |
setAccessKey(java.lang.String accessKey)
If specified this governs the HTML accessKey for the widget.
|
Canvas |
setAdaptHeightByCustomizer(AdaptHeightByCustomizer customizer)
Set customizer that defines
adaptHeightBy . |
Canvas |
setAdaptiveHeightPriority(java.lang.Integer adaptiveHeightPriority)
|
Canvas |
setAdaptiveWidthPriority(java.lang.Integer adaptiveWidthPriority)
If multiple widgets in the same Layout have
adaptive width ,
adaptiveWidthPriority can be set to indicate which of the components should be given priority access to
space. |
Canvas |
setAdaptWidthByCustomizer(AdaptWidthByCustomizer customizer)
Set customizer that defines
adaptWidthBy . |
Canvas |
setAlign(Alignment align) |
static void |
setAllowExternalFilters(boolean allExternalFilters)
Changes the system-wide
allowExternalFilters setting. |
Canvas |
setAlwaysManageFocusNavigation(java.lang.Boolean alwaysManageFocusNavigation)
Should focus navigation for this canvas and its descendents be handled explicitly by intercepting "Tab" key events and
calling the
TabIndexManager.shiftFocus() API? |
Canvas |
setAlwaysShowScrollbars(java.lang.Boolean alwaysShowScrollbars)
Should this browser always show custom scrollbars if
showCustomScrollbars is true? |
Canvas |
setAnimateAcceleration(AnimationAcceleration animateAcceleration)
Default acceleration effect to apply to all animations on this Canvas.
|
Canvas |
setAnimateFadeTime(java.lang.Integer animateFadeTime)
Default time for performing an animated fade.
|
Canvas |
setAnimateHideAcceleration(AnimationAcceleration animateHideAcceleration)
Default acceleration function for performing an animated hide.
|
Canvas |
setAnimateHideEffect(AnimationEffect animateHideEffect)
Default animation effect to use if
animateHide() is called without an explicit effect parameter. |
Canvas |
setAnimateHideTime(java.lang.Integer animateHideTime)
Default time for performing an animated hide.
|
Canvas |
setAnimateMoveAcceleration(AnimationAcceleration animateMoveAcceleration)
Default acceleration effect for performing an animated move.
|
Canvas |
setAnimateMoveTime(java.lang.Integer animateMoveTime)
Default time for performing an animated move.
|
Canvas |
setAnimateRectAcceleration(AnimationAcceleration animateRectAcceleration)
Default acceleration function for performing an animated move and resize.
|
Canvas |
setAnimateRectTime(java.lang.Integer animateRectTime)
Default time for performing an animated setRect.
|
Canvas |
setAnimateResizeAcceleration(AnimationAcceleration animateResizeAcceleration)
Default acceleration function for performing an animated resize.
|
Canvas |
setAnimateResizeLayoutMode(AnimationLayoutMode animateResizeLayoutMode)
When to update the
child layout for a size animation . |
Canvas |
setAnimateResizeTime(java.lang.Integer animateResizeTime)
Default time for performing an animated resize.
|
Canvas |
setAnimateScrollAcceleration(AnimationAcceleration animateScrollAcceleration)
Default acceleration function for performing an animated scroll.
|
Canvas |
setAnimateScrollTime(java.lang.Integer animateScrollTime)
Default time for performing an animated scroll.
|
Canvas |
setAnimateShowAcceleration(AnimationAcceleration animateShowAcceleration)
Default acceleration function for performing an animated show.
|
Canvas |
setAnimateShowEffect(AnimationEffect animateShowEffect)
Default animation effect to use if
animateShow() is called without an explicit effect parameter. |
Canvas |
setAnimateShowTime(java.lang.Integer animateShowTime)
Default time for performing an animated show.
|
Canvas |
setAnimateTime(int animateTime)
Default total duration of animations.
|
Canvas |
setAppImgDir(java.lang.String appImgDir)
Default directory for app-specific images, relative to the Page-wide
appImgDir . |
Canvas |
setAriaRole(java.lang.String ariaRole)
ARIA role of this component.
|
Canvas |
setAriaState(java.lang.String stateName,
java.lang.Object stateValue)
Set a specific ARIA state mapping for this component.
|
Canvas |
setAutoChildConstructor(java.lang.String autoChildName,
java.lang.String className)
Sets the SmartClient constructor for the AutoChild named
autoChildName . |
Canvas |
setAutoChildProperties(java.lang.String autoChildName,
Canvas properties)
Sets the properties for creating a
Canvas AutoChild named autoChildName . |
Canvas |
setAutoChildProperties(java.lang.String autoChildName,
EditContext properties)
Sets the properties for creating an AutoChild named
autoChildName . |
Canvas |
setAutoChildProperties(java.lang.String autoChildName,
EditProxy properties)
Sets the properties for creating an AutoChild named
autoChildName . |
Canvas |
setAutoChildProperties(java.lang.String autoChildName,
FormItem properties)
Sets the properties for creating a
FormItem AutoChild named autoChildName . |
Canvas |
setAutoChildVisibility(java.lang.String autoChildName,
boolean visible)
Sets whether to create and show the AutoChild named
autoChildName . |
Canvas |
setAutoHeight()
Set the minimum value for height.
|
Canvas |
setAutoMaskComponents(java.lang.Boolean autoMaskComponents)
Deprecated.
As of Smart GWT version 10.0, deprecated in favor of
EditProxy.autoMaskChildren |
Canvas |
setAutoParent(java.lang.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.
|
Canvas |
setAutoPopulateData(java.lang.Boolean autoPopulateData)
If a
dataContext is provided, should subcomponents
automatically bind to the data? |
static void |
setAutoResizeAutoChildAttributes(boolean autoResize)
|
static void |
setAutoResizeIcons(boolean autoResizeIcons)
|
Canvas |
setAutoShowParent(java.lang.Boolean autoShowParent)
If set to true, the widget's parent (if any) will automatically be shown whenever the widget is shown.
|
Canvas |
setAutoWidth()
Set the minimum value for width.
|
Canvas |
setBackgroundColor(java.lang.String backgroundColor)
The background color for this widget.
|
Canvas |
setBackgroundImage(java.lang.String backgroundImage)
URL for a background image for this widget (corresponding to the CSS "background-image" attribute).
|
Canvas |
setBackgroundPosition(java.lang.String backgroundPosition)
Specifies how the background image should be positioned on the widget.
|
Canvas |
setBackgroundRepeat(BackgroundRepeat backgroundRepeat)
Specifies how the background image should be tiled if this widget is larger than the image.
|
Canvas |
setBorder(java.lang.String border)
Set the CSS border of this component, as a CSS string including border-width, border-style, and/or color (eg "2px solid
blue").
|
Canvas |
setBorderRadius(java.lang.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.
|
Canvas |
setCanAcceptDrop(java.lang.Boolean canAcceptDrop)
Indicates that this object can receive dropped widgets (i.e.
|
Canvas |
setCanAdaptHeight(java.lang.Boolean canAdaptHeight)
See
canAdaptWidth . |
Canvas |
setCanAdaptWidth(java.lang.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.
|
Canvas |
setCanDrag(java.lang.Boolean canDrag)
Indicates whether this widget can initiate custom drag-and-drop operations (other than reposition or resize).
|
Canvas |
setCanDragReposition(java.lang.Boolean canDragReposition)
Indicates whether this widget can be moved by a user of your application by simply dragging with the mouse.
|
Canvas |
setCanDragResize(java.lang.Boolean canDragResize)
Indicates whether this widget can be resized by dragging on the edges and/or corners of the widget with the mouse.
|
Canvas |
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.
|
Canvas |
setCanDrop(java.lang.Boolean canDrop)
Indicates that this object can be dropped on top of other widgets.
|
Canvas |
setCanDropBefore(java.lang.Boolean canDropBefore)
When explicitly set to false, disallows drop before this member in the Layout.
|
Canvas |
setCanFocus(java.lang.Boolean canFocus)
Can this widget be allowed to become the target of keyboard events?
|
Canvas |
setCanHover(java.lang.Boolean canHover)
Will this Canvas fire hover events when the user hovers over it, or one of its children?
|
Canvas |
setCanSelectText(java.lang.Boolean canSelectText)
Whether native drag selection of contained text is allowed within this Canvas.
|
Canvas |
setChildren(Canvas... children)
Array of all Canvii that are immediate children of this Canvas.
|
Canvas |
setChildrenResizeSnapAlign(java.lang.Boolean childrenResizeSnapAlign)
Flag to disable snapping to alignment when children of this Canvas are resized
|
Canvas |
setChildrenSnapAlign(java.lang.Boolean childrenSnapAlign)
If enabled while
childrenSnapToGrid 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 by snapAlignCenterLineStyle and snapAlignEdgeLineStyle respectively. |
Canvas |
setChildrenSnapCenterAlign(java.lang.Boolean childrenSnapCenterAlign)
See
childrenSnapAlign . |
Canvas |
setChildrenSnapEdgeAlign(java.lang.Boolean childrenSnapEdgeAlign)
See
childrenSnapAlign . |
Canvas |
setChildrenSnapResizeToGrid(java.lang.Boolean childrenSnapResizeToGrid)
If true, causes this canvas's children to snap to its grid when resizing.
|
Canvas |
setChildrenSnapToGrid(java.lang.Boolean childrenSnapToGrid)
If true, causes this canvas's children to snap to its grid when dragging.
|
Canvas |
setComponentMaskDefaults(Canvas componentMaskDefaults)
Defaults for the
componentMask autoChild. |
Canvas |
setContents(java.lang.String contents)
The contents of a canvas or label widget.
|
Canvas |
setContextMenu(Menu contextMenu)
Context menu to show for this object, an instance of the Menu widget.
|
Canvas |
setCorrectZoomOverflow(java.lang.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 allowing
maxZoomOverflowError of overflow before enabling scrolling and displaying custom scrollbars. |
Canvas |
setCursor(Cursor cursor)
Specifies the css cursor image to
display when the mouse pointer is over this component.
|
Canvas |
setDataContext(DataContext dataContext)
A mapping from
DataSource IDs to specific Records from those DataSources, that DataBoundComponents
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 setting ListGrid.autoFetchData . |
Canvas |
setDataPath(java.lang.String dataPath)
A dataPath may be specified on any canvas.
|
Canvas |
setDefaultHeight(int defaultHeight)
For custom components, establishes a default height for the component.
|
static void |
setDefaultPageSpace(int newDefaultPageSpace)
Changes the global
defaultPageSpace . |
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.
|
Canvas |
setDefaultWidth(int defaultWidth)
For custom components, establishes a default width for the component.
|
Canvas |
setDefiningProperty(java.lang.String definingProperty)
This attribute denotes the name of a property to use as a
getDefiningPropertyName() for this property when generating
and resolving AutoTest locators with search segments . |
Canvas |
setDefiningPropertyNameOptions(java.lang.String... definingPropertyNameOptions)
If no explicit
definingProperty was specified for this
component,
this array denotes a list of options to use as a
defining property when generating and resolving
AutoTest locators with search segments . |
Canvas |
setDisabled(boolean disabled)
If set to true, the widget will be disabled.
|
Canvas |
setDisabledCursor(Cursor disabledCursor)
Specifies the cursor image to display when the mouse pointer is over this widget if this widget is disabled.
|
Canvas |
setDisableTouchScrollingForDrag(java.lang.Boolean disableTouchScrollingForDrag)
Disables
useTouchScrolling whenever a built-in drag
operation has been enabled which is known to be non-functional if touch scrolling is enabled. |
Canvas |
setDoubleClickDelay(int doubleClickDelay)
Amount of time (in milliseconds) between which two clicks are considered a single click
|
Canvas |
setDragAppearance(DragAppearance dragAppearance)
Visual appearance to show when the object is being dragged.
|
Canvas |
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.
|
Canvas |
setDragMaskType(DragMaskType dragMaskType)
This property controls what kind of mask is used in case
useDragMask is enabled. |
Canvas |
setDragMaxHeight(int dragMaxHeight)
Sets maximum height that this Canvas can be resized to by a user.
|
Canvas |
setDragMaxWidth(int dragMaxWidth)
Maximum width that this Canvas can be resized to by a user.
|
Canvas |
setDragMinHeight(int dragMinHeight)
Minimum height that this Canvas can be resized to by a user.
|
Canvas |
setDragMinWidth(int dragMinWidth)
Minimum width that this Canvas can be resized to by a user.
|
Canvas |
setDragOpacity(java.lang.Integer dragOpacity)
If this widget has dragAppearance
"target" , this value specifies the opacity to render the target while it
is being dragged. |
Canvas |
setDragRepositionAppearance(DragAppearance dragRepositionAppearance)
If
canDragReposition is true, this attribute specifies
the visual appearance to show during drag reposition. |
Canvas |
setDragRepositionCursor(Cursor dragRepositionCursor)
Cursor to switch to if the mouse is over a widget that is drag repositionable.
|
Canvas |
setDragResizeAppearance(DragAppearance dragResizeAppearance)
If
canDragResize is true, this attribute specifies the
visual appearance to show during drag resize. |
Canvas |
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.
|
Canvas |
setDragStartDistance(int dragStartDistance)
Number of pixels the cursor needs to move before the EventHandler starts a drag operation.
|
Canvas |
setDragTarget(Canvas dragTarget)
A different widget that should be actually dragged when dragging initiates on this widget.
|
Canvas |
setDragTarget(java.lang.String dragTarget)
A different widget that should be actually dragged when dragging initiates on this widget.
|
Canvas |
setDragType(java.lang.String dragType)
Sets a
dragType for this widget used, to be compared to dropTypes on possible drop target widgets. |
Canvas |
setDropTarget(Canvas dropTarget)
Delegates a different widget that should actually be dropped on if the cursor is over this widget when the drop
completes.
|
Canvas |
setDropTarget(java.lang.String dropTarget)
Delegates a different widget that should actually be dropped on if the cursor is over this widget when the drop
completes.
|
Canvas |
setDropTypes(java.lang.String... dropTypes)
When a drag and drop interaction occurs, if a
dragType is
configured on the source widget, it is compared to the dropTypes configured on the target widget, and a
drop is only allowed if the dragType is listed in the target widget's dropTypes array. |
Canvas |
setDropTypes(java.lang.String dropTypes)
When a drag and drop interaction occurs, if a
dragType is
configured on the source widget, it is compared to the dropTypes configured on the target widget, and a
drop is only allowed if the dragType is listed in the target widget's dropTypes array. |
Canvas |
setDynamicContents(java.lang.Boolean dynamicContents)
Dynamic contents allows the contents string to be treated as a simple but powerful template.
|
Canvas |
setEdgeBackgroundColor(java.lang.String edgeBackgroundColor)
Background color for the EdgedCanvas created to decorate this component.
|
Canvas |
setEdgeCenterBackgroundColor(java.lang.String edgeCenterBackgroundColor)
Background color for the center section only.
|
Canvas |
setEdgeImage(java.lang.String edgeImage)
Base name of images for edges.
|
Canvas |
setEdgeMarginSize(int edgeMarginSize)
How far into the edge of an object do we consider the "edge" for drag resize purposes?
|
Canvas |
setEdgeOffset(java.lang.Integer edgeOffset)
Amount the contained Canvas should be offset.
|
Canvas |
setEdgeOpacity(java.lang.Integer edgeOpacity)
Opacity of the edges.
|
Canvas |
setEdgeShowCenter(java.lang.Boolean edgeShowCenter)
Whether to show media in the center section, that is, behind the decorated Canvas.
|
Canvas |
setEdgeSize(int edgeSize)
Size in pixels for corners and edges
|
void |
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.
|
Canvas |
setEditProxyConstructor(java.lang.String editProxyConstructor)
Default class used to construct the
EditProxy for this component when the component is
first placed into edit mode . |
protected void |
setElement(com.google.gwt.user.client.Element elem)
Normal usage of SmartGWT is to call draw() on SmartGWT widgets, not to use use RootPanel.add().
|
Canvas |
setEnableWhen(AdvancedCriteria enableWhen)
Criteria to be evaluated to determine whether this Canvas should be enabled.
|
Canvas |
setEndLine(java.lang.Boolean endLine)
Whether this canvas should end the line it's in when used as a tile in a
FlowLayout . |
Canvas |
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.
|
Canvas |
setFacetId(java.lang.String facetId)
If a Canvas is dropped onto a
CubeGrid , and it has a facetId property specified then
the Cube treats this as adding that facetId at the drop location. |
Canvas |
setFloatingScrollbars(boolean floatingScrollbars)
If
showCustomScrollbars is true, should the
scrollbars be drawn floating over the component handle, or should the handle shrink to accommodate them? |
Canvas |
setForwardSVGeventsToObject(java.lang.Boolean forwardSVGeventsToObject)
If true, events sent to the SVG inside an object tag are forwarded to the object itself by Framework handlers.
|
Canvas |
setGroupBorderCSS(java.lang.String groupBorderCSS)
Sets the style for the grouping frame around the canvas.
|
Canvas |
setGroupLabelBackgroundColor(java.lang.String groupLabelBackgroundColor)
If set, the background color of the grouping label.
|
Canvas |
setGroupLabelStyleName(java.lang.String groupLabelStyleName)
Sets the style for the grouping label.
|
Canvas |
setGroupPadding(java.lang.Integer groupPadding)
Padding to apply inside the border when this canvas is showing a group
border and label . |
Canvas |
setGroupTitle(java.lang.String groupTitle)
The title/label for the grouping.
|
Canvas |
setHeight(int height) |
Canvas |
setHeight(java.lang.Integer height)
The
canvas.width attribute specifies the size for a component's horizontal dimension;
canvas.height specifies the size for the vertical dimension. |
void |
setHeight(java.lang.String height)
The
canvas.width attribute specifies the size for a component's horizontal dimension;
canvas.height specifies the size for the vertical dimension. |
Canvas |
setHeight100()
Convenience method that sets the height to 100%.
|
Canvas |
setHideUsingDisplayNone(boolean hideUsingDisplayNone)
When this widget is hidden (see
visibility and hide() ), should display:none be applied to the outer element ? |
Canvas |
setHoverAlign(Alignment hoverAlign)
If
this.showHover is true, this property can be used to customize the alignment of content in the hover
canvas. |
Canvas |
setHoverAutoDestroy(java.lang.Boolean hoverAutoDestroy)
If
this.showHover is true and getHoverComponent() is implemented, should the hoverCanvas returned from it be automatically destroyed when it is
hidden? |
Canvas |
setHoverAutoFitMaxWidth(int hoverAutoFitMaxWidth)
Maximum auto-fit width for a hover if
hoverAutoFitWidth
is enabled. |
Canvas |
setHoverAutoFitMaxWidth(java.lang.String hoverAutoFitMaxWidth)
Maximum auto-fit width for a hover if
hoverAutoFitWidth
is enabled. |
Canvas |
setHoverAutoFitWidth(java.lang.Boolean hoverAutoFitWidth)
if
showHover is true, this property will cause the specified
hoverWidth to be treated as a minimum width for the hover. |
Canvas |
setHoverDelay(int hoverDelay)
If
this.canHover is true, how long should the mouse be kept over this widget before the hover event is
fired |
Canvas |
setHoverFocusKey(java.lang.String hoverFocusKey)
For canvases
showing 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). |
Canvas |
setHoverHeight(java.lang.Integer hoverHeight)
If
this.showHover is true, this property can be used to customize the height of the hover canvas shown. |
Canvas |
setHoverMoveWithMouse(java.lang.Boolean hoverMoveWithMouse)
If
this.showHover is true, should this widget's hover canvas be moved with the mouse while visible? |
Canvas |
setHoverOpacity(java.lang.Integer hoverOpacity)
If
this.showHover is true, should the hover canvas be shown with opacity other than 100? |
Canvas |
setHoverPersist(HoverPersistMode hoverPersist)
Allows interaction with hovers when the cursor is positioned over them.
|
Canvas |
setHoverScreen(java.lang.String hoverScreen)
Screen to create (via
createScreen() ) in lieu of calling getHoverComponent() . |
Canvas |
setHoverStyle(java.lang.String hoverStyle)
If
this.showHover is true, this property can be used to specify the css style to apply to the hover canvas. |
Canvas |
setHoverVAlign(VerticalAlignment hoverVAlign)
If
this.showHover is true, this property can be used to customize the vertical alignment of content in the
hover canvas. |
Canvas |
setHoverWidth(int hoverWidth)
If
this.showHover is true, this property can be used to
customize the width of the hover canvas shown. |
Canvas |
setHoverWrap(java.lang.Boolean hoverWrap)
If
this.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. |
Canvas |
setHtmlElement(com.google.gwt.dom.client.Element htmlElement)
If specified as a pointer to an HTML element present in the DOM, this canvas will be rendered inside that element on
draw() . |
Canvas |
setHtmlElement(java.lang.String htmlElement)
If specified as a pointer to an HTML element present in the DOM, this canvas will be rendered inside that element on
draw() . |
Canvas |
setHtmlPosition(DrawPosition htmlPosition)
If
htmlElement is specified, this attribute specifies the
position where the canvas should be inserted relative to the htmlElement in the DOM. |
void |
setImage(java.lang.String identifier,
java.lang.String URL)
Set the URL of an image or SVG object element by name.
|
void |
setImage(java.lang.String identifier,
java.lang.String URL,
java.lang.String imgDir)
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.
|
Canvas |
setIsGroup(boolean isGroup)
Should a grouping frame be shown around this canvas if a non-empty string has been specified for
groupTitle . |
Canvas |
setIsRuleScope(java.lang.Boolean isRuleScope)
Marks this Canvas as the
ruleScope that will be discovered by
any contained DataBoundComponent s which do not specify an explicit
ruleScope . |
Canvas |
setIsSnapAlignCandidate(java.lang.Boolean isSnapAlignCandidate)
Flag to disable snapping to alignment against this Canvas when other Canvases dragged into the same parent when
childrenSnapAlign is enabled on this Canvas' parent. |
Canvas |
setKeepInParentRect(java.lang.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).
|
Canvas |
setKeepInParentRect(java.lang.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).
|
Canvas |
setKeepInParentRect(Rectangle rectangle) |
Canvas |
setLayoutAlign(Alignment layoutAlign)
When this Canvas is included as a member in a Layout, layoutAlign controls alignment on the breadth axis of the layout.
|
Canvas |
setLayoutAlign(VerticalAlignment layoutAlign)
When this Canvas is included as a member in a Layout, layoutAlign controls alignment on the breadth axis of the layout.
|
Canvas |
setLeaveGroupLabelSpace(java.lang.Boolean leaveGroupLabelSpace)
When showing this widget in a
group , should any content be shifted
down so that the group-label doesn't sit in front of it? |
Canvas |
setLeavePageSpace(java.lang.Integer leavePageSpace)
If set, overrides the global
defaultPageSpace . |
Canvas |
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 the
position property). |
Canvas |
setLeft(java.lang.String 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 the
position property). |
Canvas |
setLocateByIDOnly(boolean locateByIDOnly)
If
true , when retrieving a locator for this component
always return a reference directly to this component by widget ID ,
using the compact format "///canvasID" , ignoring any parent elements and ignoring any configured
testRoot . |
Canvas |
setLocateChildrenBy(LocatorStrategy locateChildrenBy)
Strategy to use when locating children in this canvas from an autoTest locator string.
|
Canvas |
setLocateChildrenType(LocatorTypeStrategy locateChildrenType)
LocatorTypeStrategy to use when finding children within this canvas. |
Canvas |
setLocatePeersBy(LocatorStrategy locatePeersBy)
Strategy to use when locating peers of this canvas from an autoTest locator string.
|
Canvas |
setLocatePeersType(LocatorTypeStrategy locatePeersType)
LocatorTypeStrategy to use when finding peers of this canvas. |
Canvas |
setLocatorName(java.lang.String locatorName)
Local name for referencing this canvas from an autoTest locator string.
|
boolean |
setLocatorParent(Canvas locatorParent,
java.lang.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,
java.lang.String childName,
java.lang.String attributeName)
This method will set mark the target canvas as the "locator parent" for this canvas, using the specified child name.
|
com.smartgwt.logicalstructure.core.LogicalStructureObject |
setLogicalStructure(com.smartgwt.logicalstructure.widgets.CanvasLogicalStructure s)
Setter implementing the
LogicalStructure interface,
which supports Eclipse's logical structure debugging facility. |
Canvas |
setMargin(java.lang.Integer margin)
Set the CSS Margin, in pixels, for this component.
|
Canvas |
setMatchElement(java.lang.Boolean matchElement)
If
htmlElement is specified, should this canvas be drawn at
the same dimensions as the htmlElement?See also matchElementWidth and matchElementHeight |
Canvas |
setMatchElementHeight(MatchElementSizeMode matchElementHeight)
For canvases with a specified
htmlElement where persistentMatchElement is set to true, how should the
canvas match the element's height? |
Canvas |
setMatchElementWidth(MatchElementSizeMode matchElementWidth)
For canvases with a specified
htmlElement where persistentMatchElement is set to true, how should the
canvas match the element's width? |
Canvas |
setMaxHeight(int maxHeight)
Maximum height available to this Canvas.
|
Canvas |
setMaxWidth(int maxWidth)
Maximum width available to this Canvas.
|
Canvas |
setMaxZoomOverflowError(int maxZoomOverflowError)
When
correctZoomOverflow is true and browser or
OS-level zoom is active, determines how much overflow must occur before the Framework enables scrolling for this canvas. |
Canvas |
setMenuConstructor(java.lang.String menuConstructor)
Default class used to construct menus created by this component, including context menus.
|
Canvas |
setMinHeight(int minHeight)
Minimum height available to this Canvas.
|
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 than
minNonEdgeSize , 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). |
Canvas |
setMinWidth(int minWidth)
Minimum width available to this Canvas.
|
Canvas |
setMomentumScrollMinSpeed(double momentumScrollMinSpeed)
The minimum speed in pixels per second that must be reached for momentum scrolling to kick in.
|
Canvas |
setMouseStillDownDelay(int mouseStillDownDelay)
Amount of time (in milliseconds) between repeated 'mouseStillDown' events for this canvas.
|
Canvas |
setMouseStillDownInitialDelay(int mouseStillDownInitialDelay)
Amount of time (in milliseconds) before mouseStillDown events start to be fired repeatedly for this canvas.
|
Canvas |
setName(java.lang.String name)
Optional name for the canvas, which can later be used to reference it.
|
Canvas |
setNativeAutoHideScrollbars(java.lang.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-wide
neverUseFilters setting. |
Canvas |
setNoDoubleClicks(java.lang.Boolean noDoubleClicks)
If true, this canvas will receive all mouse-clicks as single
click events rather than as doubleClick events. |
Canvas |
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 and
showNoDropIndicator is
true. |
Canvas |
setOpacity(java.lang.Integer opacity)
Renders the widget to be partly transparent.
|
Canvas |
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.
|
Canvas |
setPadding(java.lang.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".
|
Canvas |
setParentCanvas(Canvas parentCanvas)
This Canvas's immediate parent, if any.
|
Canvas |
setParentElement(Canvas parentElement)
Deprecated.
As of Smartclient version 9.1, deprecated in favor of
parentCanvas and getParentCanvas() |
Canvas |
setPeers(Canvas... peers)
Array of all Canvii that are peers of this Canvas.
|
Canvas |
setPendingMarkerStyle(java.lang.String pendingMarkerStyle)
CSS class used to apply additional styles to this canvas when
showPendingMarker() is called, or when pendingMarkerVisible has been set. |
Canvas |
setPendingMarkerVisible(java.lang.Boolean pendingMarkerVisible)
This attribute indicates whether the
pending marker
class should be appended to the list of CSS classes applied to this canvas. |
Canvas |
setPercentBox(PercentBoxModel percentBox)
Governs the model to be used when sizing canvases with percentage width or height, or positioning widgets with a
specified
snapTo . |
Canvas |
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.
|
Canvas |
setPersistentMatchElement(java.lang.Boolean persistentMatchElement)
If this canvas has a specified
htmlElement and matchElement 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? |
Canvas |
setPointerSettings(PointerSettings pointerSettings)
Detail settings of the
pointer such as where it should be
located along the outside of the canvas. |
Canvas |
setPointerTarget(java.lang.String pointerTarget)
This property in conjunction with the
pointerSettings.snapTo places
the canvas in relation to the target canvas. |
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.
|
Canvas |
setPrefix(java.lang.String prefix) |
Canvas |
setPrintChildrenAbsolutelyPositioned(java.lang.Boolean printChildrenAbsolutelyPositioned)
Should this canvas print its children absolutely positioned when generating
printable HTML . |
Canvas |
setPrintStyleName(java.lang.String printStyleName)
The CSS class to apply when printing this widget.
|
Canvas |
setPrompt(java.lang.String prompt)
Prompt displayed in hover canvas if
showHover is true. |
Canvas |
setProportionalResizeModifiers(java.lang.String... proportionalResizeModifiers)
If
proportionalResizing is set to
ProportionalResizeMode.MODIFIER or
ProportionalResizeMode.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. |
Canvas |
setProportionalResizing(ProportionalResizeMode proportionalResizing)
If
canDragResize is true, this property specifies the
conditions for when proportional resizing is used. |
Canvas |
setReceiveScrollbarEvents(boolean receiveScrollbarEvents)
Whether this canvas should receive
events from its scrollbars, which are peers . |
Canvas |
setRect(int left,
int top,
int width,
int height)
Set all four coordinates, relative to the enclosing context, at once.
|
Canvas |
setRect(Rectangle rectangle)
Set all four coordinates, relative to the enclosing context, at once.
|
Canvas |
setRedrawOnResize(java.lang.Boolean redrawOnResize)
Should this element be redrawn in response to a resize?
|
void |
setRelativeTabPosition(java.lang.Integer position)
Assign a relative tab position for this canvas.
|
Canvas |
setResizeBarTarget(java.lang.String resizeBarTarget)
When this Canvas is included as a member in a Layout, and
showResizeBar is set to true 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. |
Canvas |
setResizeFrom(EdgeName... resizeFrom)
When drag resizing is enabled via
canDragResize , restricts
resizes to only certain edges or corners. |
Canvas |
setResizeFrom(java.lang.String... resizeFrom)
Deprecated.
use
#setResizeFrom(EdgeName) instead. |
void |
setRight(int right)
Resizes the widget horizontally to position its right side at the specified coordinate.
|
Canvas |
setRuleScope(java.lang.String ruleScope)
ID of the component that gathers the context for evaluation of
criteria-based
rules specified by properties such as FormItem.visibleWhen ,
Dynamic Properties, and DynamicCriteria such as
ListGrid.initialCriteria . |
Canvas |
setScrollbarConstructor(java.lang.String scrollbarConstructor)
The class that will be used to create custom scrollbars for this component.
|
Canvas |
setScrollbarSize(int scrollbarSize)
How thick should we make the scrollbars for this canvas.
|
Canvas |
setShadowColor(java.lang.String shadowColor)
Color for the css-based drop shadow shown if
useCSSShadow is
true and showShadow is true. |
Canvas |
setShadowDepth(int shadowDepth)
Depth of the shadow, or the virtual height above the page of the widget throwing the shadow.
|
Canvas |
setShadowHOffset(java.lang.Integer shadowHOffset)
Horizontal offset for the
shadow . |
Canvas |
setShadowImage(java.lang.String shadowImage)
If
useCSSShadow 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. |
Canvas |
setShadowOffset(java.lang.Integer shadowOffset)
Offset of the shadow.
|
Canvas |
setShadowSoftness(java.lang.Integer shadowSoftness)
Softness, or degree of blurring, of the shadow.
|
Canvas |
setShadowSpread(java.lang.Integer shadowSpread)
Explicit spread for the css-based drop shadow shown if
useCSSShadow is true and showShadow is true. |
Canvas |
setShadowVOffset(java.lang.Integer shadowVOffset)
Vertical offset for the
shadow . |
Canvas |
setShouldPrint(java.lang.Boolean shouldPrint)
Whether this canvas should be included in a printable view.
|
Canvas |
setShowCustomScrollbars(boolean showCustomScrollbars)
Whether to use the browser's native scrollbars or Smart GWT-based scrollbars.
|
Canvas |
setShowDragShadow(java.lang.Boolean showDragShadow)
When this widget is dragged, if its dragAppearance is
"target" , should we show a shadow behind the canvas
during the drag. |
Canvas |
setShowEdges(java.lang.Boolean showEdges)
Whether an
EdgedCanvas should be used to show image-based edges around this
component. |
Canvas |
setShowHover(java.lang.Boolean showHover)
If
this.canHover is true, should we show the global hover canvas by default when the user hovers over this
canvas? |
Canvas |
setShowHoverComponents(java.lang.Boolean showHoverComponents)
When set to true, shows a widget hovering at the mouse point instead of the builtin hover label.
|
Canvas |
setShowPointer(java.lang.Boolean showPointer)
Should a pointer be shown? A pointer can be placed on the border to identify the target of the canvas contents.
|
Canvas |
setShowResizeBar(java.lang.Boolean showResizeBar)
When this Canvas is included as a member in a
Layout , whether a resizeBar
should be shown after this member in the layout, to allow it to be resized. |
Canvas |
setShowShadow(java.lang.Boolean showShadow)
Whether to show a drop shadow for this Canvas.
|
Canvas |
setShowSnapGrid(java.lang.Boolean showSnapGrid)
Whether to show a snap grid for this Canvas.
|
Canvas |
setShrinkElementOnHide(boolean shrinkElementOnHide)
This is an advanced setting.
|
Canvas |
setSizeMayChangeOnRedraw(java.lang.Boolean sizeMayChangeOnRedraw)
Is it possible that a call to
redraw() on this widget will change its
size? |
Canvas |
setSkinImgDir(java.lang.String skinImgDir)
Default directory for skin images (those defined by the class), relative to the Page-wide
skinDir . |
Canvas |
setSmoothFade(java.lang.Boolean smoothFade) |
Canvas |
setSnapAlignCandidates(Canvas... snapAlignCandidates)
When
childrenSnapAlign is enabled, list of candidates to
check for alignment. |
Canvas |
setSnapAlignCenterLineStyle(java.lang.String snapAlignCenterLineStyle)
CSS border declaration used for the line shown to indicate snapping to a center line when
childrenSnapAlign is set. |
Canvas |
setSnapAlignEdgeLineStyle(java.lang.String snapAlignEdgeLineStyle)
CSS border declaration used for the line shown to indicate snapping to a edge line when
childrenSnapAlign is set. |
Canvas |
setSnapAxis(java.lang.String snapAxis)
Describes which axes to apply snap-to-grid to.
|
Canvas |
setSnapEdge(java.lang.String snapEdge)
If
snapTo 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. |
Canvas |
setSnapGridLineProperties(DrawLine snapGridLineProperties)
Specifies line styling to use when drawing the grid of lines for
SnapGridStyle :
"lines". |
Canvas |
setSnapGridStyle(SnapGridStyle snapGridStyle)
Specifies indication style to use for snap points, either a grid of lines or an array of crosses.
|
Canvas |
setSnapHDirection(java.lang.String snapHDirection)
The horizontal snap direction.
|
Canvas |
setSnapHGap(int snapHGap)
The horizontal grid size to use, in pixels, when snap-to-grid is enabled.
|
Canvas |
setSnapOffsetLeft(java.lang.Integer snapOffsetLeft)
If
snapTo 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. |
Canvas |
setSnapOffsetTop(java.lang.Integer snapOffsetTop)
If
snapTo 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. |
Canvas |
setSnapOnDrop(java.lang.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).
|
Canvas |
setSnapResizeToAlign(java.lang.Boolean snapResizeToAlign)
Flag to disable snapping to alignment when this Canvas is resized.
|
Canvas |
setSnapResizeToGrid(java.lang.Boolean snapResizeToGrid)
Causes this canvas to snap to its parent's grid when resizing.
|
Canvas |
setSnapTo(java.lang.String snapTo)
Position this widget such that it is aligned with ("snapped to") an edge of its
master (if specified), or its parent canvas . |
Canvas |
setSnapToAlign(java.lang.Boolean snapToAlign)
Flag to disable snapping to alignment when this Canvas is dragged when
childrenSnapAlign is enabled on this Canvas' parent. |
Canvas |
setSnapToCenterAlign(java.lang.Boolean snapToCenterAlign)
Flag to disable snapping to center alignment when this Canvas is dragged when
childrenSnapAlign is enabled on this Canvas' parent. |
Canvas |
setSnapToEdgeAlign(java.lang.Boolean snapToEdgeAlign)
Flag to disable snapping to edge alignment when this Canvas is dragged when
childrenSnapAlign is enabled on this Canvas' parent. |
Canvas |
setSnapToGrid(java.lang.Boolean snapToGrid)
Causes this canvas to snap to its parent's grid when dragging.
|
Canvas |
setSnapVDirection(java.lang.String snapVDirection)
The vertical snap direction.
|
Canvas |
setSnapVGap(int snapVGap)
The vertical grid size to use, in pixels, when snap-to-grid is enabled.
|
Canvas |
setStartLine(java.lang.Boolean startLine)
Whether this canvas should always start a new line when used as a tile in a
FlowLayout . |
void |
setStyleName(java.lang.String styleName)
The CSS class applied to this widget as a whole.
|
Canvas |
setTabIndex(java.lang.Integer tabIndex)
If specified this governs the tabIndex of the widget in the page's tab order.
|
Canvas |
setTestDataContext(DataContext testDataContext)
A
DataContext to be used if no dataContext is provided (directly or indirectly via a parent). |
void |
setTitle(java.lang.String title)
Synonym for
setPrompt(String) |
Canvas |
setTooltip(java.lang.String tooltip)
Synonym for
setPrompt(String) |
Canvas |
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 the
position property). |
Canvas |
setTop(java.lang.String 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 the
position property). |
Canvas |
setUpdateTabPositionOnDraw(boolean updateTabPositionOnDraw)
Should canvases with no
parent canvas be moved to the end of
the TabIndexManager tree on draw()? |
Canvas |
setUpdateTabPositionOnReparent(boolean updateTabPositionOnReparent)
Should canvases with a
parent canvas be added to the
TabIndexManager under the parent as described in updateChildTabPositions() and updateChildTabPosition() ? |
Canvas |
setUseBackMask(java.lang.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.
|
Canvas |
setUseCSSShadow(boolean useCSSShadow)
If
showShadow is true, should we use the css
box-shadow property (where supported) to achieve the shadow? |
Canvas |
setUseDragMask(boolean useDragMask)
This flag controls whether we register the component as a maskable item with the EventHandler.
|
Canvas |
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.
|
Canvas |
setUseNativeDrag(java.lang.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.
|
Canvas |
setUseOpacityFilter(java.lang.Boolean useOpacityFilter)
Configures where the Opacity filter is used for IE6-8.
|
Canvas |
setUseTouchScrolling(java.lang.Boolean useTouchScrolling)
On
touch devices , if this Canvas can be scrolled, should
touch-dragging the content area result in scrolling? Set to false if touch-dragging should not cause
scrolling. |
Canvas |
setValuesManager(java.lang.String valuesManager)
ValuesManager for managing values displayed in this component. |
Canvas |
setValuesManager(ValuesManager valuesManager)
ValuesManager for managing values displayed in this component. |
Canvas |
setVisibility(Visibility visibility)
Controls widget visibility when the widget is initialized.
|
void |
setVisible(boolean visible) |
Canvas |
setVisibleWhen(AdvancedCriteria visibleWhen)
Criteria to be evaluated to determine whether this Canvas should be visible.
|
Canvas |
setWidth(int width) |
Canvas |
setWidth(java.lang.Integer width)
The
canvas.width attribute specifies the size for a component's horizontal dimension;
canvas.height specifies the size for the vertical dimension. |
void |
setWidth(java.lang.String width)
The
canvas.width attribute specifies the size for a component's horizontal dimension;
canvas.height specifies the size for the vertical dimension. |
Canvas |
setWidth100()
Convenience method that sets the width to 100%.
|
Canvas |
setWorkflows(Process... workflows)
List of screen-global
workflows that can be shared by event handler
workflows using a StartProcessTask . |
Canvas |
setZIndex(int newIndex)
Set the z-Index of the canvas.
|
void |
shouldDragScroll()
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.
|
java.lang.String |
showClickMask(Function clickActionCallback,
ClickMaskMode mode,
Canvas[] unmaskedTargets)
Show a clickMask over the entire screen that intercepts mouse clicks and fires some action.
|
void |
showComponentMask()
Temporariy block all user interaction with children of this widget, with the exception of those passed in in the
unmaskedChildren parameter. |
void |
showComponentMask(Canvas... unmaskedChildren)
Temporariy block all user interaction with children of this widget, with the exception of those passed in in the
unmaskedChildren 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,
java.lang.String side) |
void |
showNextTo(Canvas otherWidget,
java.lang.String side,
boolean canOcclude) |
void |
showNextTo(Canvas otherWidget,
java.lang.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 |
showPendingMarker()
Manually move this component into the "pending changes" visual state (based on the
pendingMarker 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(java.lang.Object[] components)
Show a Print containing a printable view of the components passed in.
|
static void |
showPrintPreview(java.lang.Object[] components,
PrintProperties printProperties,
java.lang.String title,
PrintPreviewCallback callback)
Show a Print containing a printable view of the components passed in.
|
static void |
showPrintPreview(java.lang.Object[] components,
PrintProperties printProperties,
java.lang.String title,
PrintPreviewCallback callback,
Window printWindowProperties,
java.lang.String printButtonTitle)
Show a Print containing a printable view of the components passed in.
|
void |
showRecursively()
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 |
stopDebuggingOverflow()
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 |
updateChildTabPositions()
Update the childrens' tab positions, slotting them under this widget in the
TabIndexManager , in the order defined by getChildTabPosition() . |
void |
updateEditNode(EditContext editContext,
EditNode editNode)
A callback invoked for each
liveObject by EditContext when the EditContext is being serialized. |
void |
updateHover()
If this canvas is currently showing a hover (see
handleHover() ),
this method can be called to update the HTML contents of the hover. |
void |
updateHover(java.lang.String hoverHTML)
If this canvas is currently showing a hover (see
handleHover() ),
this method can be called to update the HTML contents of the hover. |
void |
updateShadow()
Update the canvas shadow.
|
void |
updateTabPositionForDraw()
This method is executed on draw.
|
java.lang.Boolean |
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.
|
java.lang.Boolean |
willAcceptDrop()
Returns true if the widget object being dragged can be dropped on this widget, and false or null otherwise.
|
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
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent
public Canvas()
public Canvas(com.google.gwt.core.client.JavaScriptObject jsObj)
public Canvas(java.lang.String id)
public static Canvas getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public java.util.Map getPaletteDefaults()
PaletteNode
. Use it when you need to
work with PaletteNodes indirectly, such when setting up
TileRecord
s that will be used in a
TilePalette
. See
the dev tools overview
for examples of how to
assemble and acquire a suitable defaults object when you are creating a PaletteNode
indirectlypublic static void changeAutoChildDefaults(java.lang.String autoChildName, Canvas defaults)
autoChildName
.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, see SGWTProperties
.AutoChildUsage
public static void changeAutoChildDefaults(java.lang.String autoChildName, FormItem defaults)
autoChildName
.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, see SGWTProperties
.AutoChildUsage
protected com.google.gwt.core.client.JavaScriptObject create()
create
in class BaseWidget
public Canvas setAccessKey(java.lang.String accessKey)
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.
Alt
+ accessKeyAlt+Shift
+ accessKeyCtrl+Opt
+
accessKeyAlt
+ accessKeyCtrl+Opt
+ accessKeyThe 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
public java.lang.String getAccessKey()
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.
Alt
+ accessKeyAlt+Shift
+ accessKeyCtrl+Opt
+
accessKeyAlt
+ accessKeyCtrl+Opt
+ accessKeyFocus
public Canvas setAdaptiveHeightPriority(java.lang.Integer adaptiveHeightPriority) throws java.lang.IllegalStateException
adaptiveHeightPriority
- New adaptiveHeightPriority value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Integer getAdaptiveHeightPriority()
public Canvas setAdaptiveWidthPriority(java.lang.Integer adaptiveWidthPriority) throws java.lang.IllegalStateException
adaptive 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
.
adaptiveWidthPriority
- New adaptiveWidthPriority value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdsetCanAdaptWidth(java.lang.Boolean)
public java.lang.Integer getAdaptiveWidthPriority()
adaptive 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
.
getCanAdaptWidth()
public Canvas setAlwaysManageFocusNavigation(java.lang.Boolean alwaysManageFocusNavigation) throws java.lang.IllegalStateException
TabIndexManager.shiftFocus()
API? Setting
this property to true
will cause the registered TabIndexManager entry for this canvas to be marked as
useExplicitFocusNavigation:true
, and
will cause standard event handling for the canvas and its descendents to intercept Tab keystrokes and explicitly call
TabIndexManager.shiftFocus()
rather than relying on
native browser Tab navigation
alwaysManageFocusNavigation
- New alwaysManageFocusNavigation value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getAlwaysManageFocusNavigation()
TabIndexManager.shiftFocus()
API? Setting
this property to true
will cause the registered TabIndexManager entry for this canvas to be marked as
useExplicitFocusNavigation:true
, and
will cause standard event handling for the canvas and its descendents to intercept Tab keystrokes and explicitly call
TabIndexManager.shiftFocus()
rather than relying on
native browser Tab navigation
public Canvas setAlwaysShowScrollbars(java.lang.Boolean alwaysShowScrollbars) throws java.lang.IllegalStateException
showCustomScrollbars
is true? On touch devices
that support native
touch scrolling, if showCustomScrollbars
is
true
and touch scrolling has not been disabled by the useTouchScrolling
and/or disableTouchScrollingForDrag
settings, should custom
scrollbars and native touch scrolling be enabled for this component? If false
or unset, then only
native touch scrolling will be enabled. If true
, 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 override nativeAutoHideScrollbars
, and ensure custom scrollbars
are shown for the component
Note : This is an advanced setting
alwaysShowScrollbars
- New alwaysShowScrollbars value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdScrolling overview and related methods
public java.lang.Boolean getAlwaysShowScrollbars()
showCustomScrollbars
is true? On touch devices
that support native
touch scrolling, if showCustomScrollbars
is
true
and touch scrolling has not been disabled by the useTouchScrolling
and/or disableTouchScrollingForDrag
settings, should custom
scrollbars and native touch scrolling be enabled for this component? If false
or unset, then only
native touch scrolling will be enabled. If true
, 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 override nativeAutoHideScrollbars
, and ensure custom scrollbars
are shown for the component
Scrolling overview and related methods
public Canvas setAnimateAcceleration(AnimationAcceleration animateAcceleration)
Note : This is an advanced setting
animateAcceleration
- New animateAcceleration value. Default value is "smoothEnd"Canvas
instance, for chaining setter callspublic AnimationAcceleration getAnimateAcceleration()
public Canvas setAnimateFadeTime(java.lang.Integer animateFadeTime)
this.animateTime
will be used by default instead
Note : This is an advanced setting
animateFadeTime
- New animateFadeTime value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Integer getAnimateFadeTime()
this.animateTime
will be used by default insteadpublic Canvas setAnimateHideAcceleration(AnimationAcceleration animateHideAcceleration)
this.animateAcceleration
will be
used by default instead
Note : This is an advanced setting
animateHideAcceleration
- New animateHideAcceleration value. Default value is nullCanvas
instance, for chaining setter callspublic AnimationAcceleration getAnimateHideAcceleration()
this.animateAcceleration
will be
used by default insteadpublic Canvas setAnimateHideTime(java.lang.Integer animateHideTime)
this.animateTime
will be used by default instead
Note : This is an advanced setting
animateHideTime
- New animateHideTime value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Integer getAnimateHideTime()
this.animateTime
will be used by default insteadpublic Canvas setAnimateMoveAcceleration(AnimationAcceleration animateMoveAcceleration)
this.animateAcceleration
will be
used by default instead
Note : This is an advanced setting
animateMoveAcceleration
- New animateMoveAcceleration value. Default value is nullCanvas
instance, for chaining setter callspublic AnimationAcceleration getAnimateMoveAcceleration()
this.animateAcceleration
will be
used by default insteadpublic Canvas setAnimateMoveTime(java.lang.Integer animateMoveTime)
this.animateTime
will be used by default instead
Note : This is an advanced setting
animateMoveTime
- New animateMoveTime value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Integer getAnimateMoveTime()
this.animateTime
will be used by default insteadpublic Canvas setAnimateRectAcceleration(AnimationAcceleration animateRectAcceleration)
this.animateAcceleration
will be used by default instead
Note : This is an advanced setting
animateRectAcceleration
- New animateRectAcceleration value. Default value is nullCanvas
instance, for chaining setter callspublic AnimationAcceleration getAnimateRectAcceleration()
this.animateAcceleration
will be used by default insteadpublic Canvas setAnimateRectTime(java.lang.Integer animateRectTime)
this.animateTime
will be used by default
instead
Note : This is an advanced setting
animateRectTime
- New animateRectTime value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Integer getAnimateRectTime()
this.animateTime
will be used by default
insteadpublic Canvas setAnimateResizeAcceleration(AnimationAcceleration animateResizeAcceleration)
this.animateAcceleration
will
be used by default instead
Note : This is an advanced setting
animateResizeAcceleration
- New animateResizeAcceleration value. Default value is nullCanvas
instance, for chaining setter callspublic AnimationAcceleration getAnimateResizeAcceleration()
this.animateAcceleration
will
be used by default insteadpublic Canvas setAnimateResizeLayoutMode(AnimationLayoutMode animateResizeLayoutMode)
child layout
for a size 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
animateResizeLayoutMode
- New animateResizeLayoutMode value. Default value is "atEnd"Canvas
instance, for chaining setter callspublic AnimationLayoutMode getAnimateResizeLayoutMode()
child layout
for a size animation
. Updating the child layout more often may improve
appearance, but risks prohibitive overhead with more complicated widget hierarchies.public Canvas setAnimateResizeTime(java.lang.Integer animateResizeTime)
this.animateTime
will be used by default instead
Note : This is an advanced setting
animateResizeTime
- New animateResizeTime value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Integer getAnimateResizeTime()
this.animateTime
will be used by default insteadpublic Canvas setAnimateScrollAcceleration(AnimationAcceleration animateScrollAcceleration)
this.animateAcceleration
will
be used by default instead
Note : This is an advanced setting
animateScrollAcceleration
- New animateScrollAcceleration value. Default value is nullCanvas
instance, for chaining setter callspublic AnimationAcceleration getAnimateScrollAcceleration()
this.animateAcceleration
will
be used by default insteadpublic Canvas setAnimateScrollTime(java.lang.Integer animateScrollTime)
this.animateTime
will be used by default instead
Note : This is an advanced setting
animateScrollTime
- New animateScrollTime value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Integer getAnimateScrollTime()
this.animateTime
will be used by default insteadpublic Canvas setAnimateShowAcceleration(AnimationAcceleration animateShowAcceleration)
this.animateAcceleration
will be
used by default instead
Note : This is an advanced setting
animateShowAcceleration
- New animateShowAcceleration value. Default value is nullCanvas
instance, for chaining setter callspublic AnimationAcceleration getAnimateShowAcceleration()
this.animateAcceleration
will be
used by default insteadpublic Canvas setAnimateShowTime(java.lang.Integer animateShowTime)
this.animateTime
will be used by default instead
Note : This is an advanced setting
animateShowTime
- New animateShowTime value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Integer getAnimateShowTime()
this.animateTime
will be used by default insteadpublic Canvas setAnimateTime(int animateTime)
duration
parameter into the appropriate animate...() method.
Note : This is an advanced setting
animateTime
- New animateTime value. Default value is 300Canvas
instance, for chaining setter callspublic int getAnimateTime()
duration
parameter into the appropriate animate...() method.public Canvas setAppImgDir(java.lang.String appImgDir)
appImgDir
.
Note : This is an advanced setting
appImgDir
- New appImgDir value. Default value is ""Canvas
instance, for chaining setter callsURL
,
Images overview and related methods
public java.lang.String getAppImgDir()
appImgDir
.URL
,
Images overview and related methods
public Canvas setAriaRole(java.lang.String ariaRole) throws java.lang.IllegalStateException
Accessibility
.ariaRole
- New ariaRole value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdAccessibility / Section 508 compliance
public java.lang.String getAriaRole()
Accessibility
.Accessibility / Section 508 compliance
public Canvas setAutoMaskComponents(java.lang.Boolean autoMaskComponents) throws java.lang.IllegalStateException
EditProxy.autoMaskChildren
EditProxy.useEditMask
true
if not explicitly set?autoMaskComponents
- New autoMaskComponents value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getAutoMaskComponents()
EditProxy.autoMaskChildren
EditProxy.useEditMask
true
if not explicitly set?public Canvas setAutoParent(java.lang.String autoParent) throws java.lang.IllegalStateException
childName
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.addAutoChild(...)
was called. See autoChildren
for an overview of the autoChild subsystem.
Note : This is an advanced setting
autoParent
- New autoParent value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getAutoParent()
childName
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.addAutoChild(...)
was called. See autoChildren
for an overview of the autoChild subsystem.
public Canvas setAutoPopulateData(java.lang.Boolean autoPopulateData) throws java.lang.IllegalStateException
dataContext
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 as form
or a DetailViewer
), or whether they usually work with lists of records (such as ListGrid
or TileGrid
, which have component.dataArity
set to multipe
by
default).
Specifically, the following rules are used:
dataContext
of Status:"In
Process" would fetch records with that status dataContext
, related records
will be fetched, using the PK value (similarly to if fetchRelatedData()
had been called. For example,
if an orderNumber value was provided, a grid bound to OrderDetail would fetch line items
for that orderNumber. 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:
This fulfills a common use case of viewing or editing an Order and its related OrderDetail records.
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
.
This fulfills two possible use cases:
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 an com.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 the dataContext
by just referring to it via ruleScope
.
autoPopulateData
- New autoPopulateData value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getAutoPopulateData()
dataContext
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 as form
or a DetailViewer
), or whether they usually work with lists of records (such as ListGrid
or TileGrid
, which have component.dataArity
set to multipe
by
default).
Specifically, the following rules are used:
dataContext
of Status:"In
Process" would fetch records with that status dataContext
, related records
will be fetched, using the PK value (similarly to if fetchRelatedData()
had been called. For example,
if an orderNumber value was provided, a grid bound to OrderDetail would fetch line items
for that orderNumber. 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:
This fulfills a common use case of viewing or editing an Order and its related OrderDetail records.
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
.
This fulfills two possible use cases:
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 an com.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 the dataContext
by just referring to it via ruleScope
.
public Canvas setAutoShowParent(java.lang.Boolean autoShowParent)
Note : This is an advanced setting
autoShowParent
- New autoShowParent value. Default value is falseCanvas
instance, for chaining setter callsAppearance overview and related methods
public java.lang.Boolean getAutoShowParent()
Appearance overview and related methods
public Canvas setBackgroundColor(java.lang.String backgroundColor)
newColor
.backgroundColor
- new background color, or null
to remove the current background color. Default value is nullCanvas
instance, for chaining setter callsCSSColor
,
Appearance overview and related methods
public java.lang.String getBackgroundColor()
CSSColor
,
Appearance overview and related methods
public Canvas setBackgroundImage(java.lang.String backgroundImage)
backgroundImage
- new URL (local to Page image directory) for background image. Default value is nullCanvas
instance, for chaining setter callsSCImgURL
,
Appearance overview and related methods
public java.lang.String getBackgroundImage()
SCImgURL
,
Appearance overview and related methods
public Canvas setBackgroundPosition(java.lang.String backgroundPosition) throws java.lang.IllegalStateException
backgroundPosition
- New backgroundPosition value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdAppearance overview and related methods
public java.lang.String getBackgroundPosition()
Appearance overview and related methods
public Canvas setBackgroundRepeat(BackgroundRepeat backgroundRepeat)
background-repeat
attribute. The default of null means no background-repeat
CSS will be
written out. See BackgroundRepeat
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 setting styleName
.
backgroundRepeat
- New backgroundRepeat value. Default value is nullCanvas
instance, for chaining setter callsAppearance overview and related methods
public BackgroundRepeat getBackgroundRepeat()
background-repeat
attribute. The default of null means no background-repeat
CSS will be
written out. See BackgroundRepeat
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 setting styleName
.
Appearance overview and related methods
public Canvas setBorder(java.lang.String border)
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 the groupBorderCSS
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
.
border
- new border to set to (eg: "2px solid black"). Default value is nullCanvas
instance, for chaining setter callsAppearance overview and related methods
public java.lang.String getBorder()
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 the groupBorderCSS
attribute, not from the explicit border property.
Appearance overview and related methods
public Canvas setBorderRadius(java.lang.String borderRadius)
borderRadius
- New borderRadius value. Default value is nullCanvas
instance, for chaining setter callsAppearance overview and related methods
public java.lang.String getBorderRadius()
Appearance overview and related methods
public Canvas setCanAcceptDrop(java.lang.Boolean canAcceptDrop)
Note : This is an advanced setting
canAcceptDrop
- New canAcceptDrop value. Default value is falseCanvas
instance, for chaining setter callsDrag and Drop
,
Drag create Examplepublic java.lang.Boolean getCanAcceptDrop()
Drag and Drop
,
Drag create Examplepublic Canvas setCanAdaptHeight(java.lang.Boolean canAdaptHeight)
canAdaptWidth
.canAdaptHeight
- New canAdaptHeight value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Boolean getCanAdaptHeight()
canAdaptWidth
.public Canvas setCanAdaptWidth(java.lang.Boolean canAdaptWidth)
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:
minWidth
declared on the
canAdaptWidth
component itself 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.
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
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 the unadaptedWidth
argument will always reflect the unstretched width
requested by the previous call to AdaptWidthByCustomizer.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 to AdaptWidthByCustomizer.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 to AdaptWidthByCustomizer.adaptWidthBy()
. You must not
call getWidth()
or getVisibleWidth()
on the canvas itself inside AdaptWidthByCustomizer.adaptWidthBy()
as the size is in
the processing of being determined, but you may draw children or call getVisibleWidth()
on them, as we guarantee that the adaptive-width
canvas is drawn before the first call to AdaptWidthByCustomizer.adaptWidthBy()
. An example of drawing children in AdaptWidthByCustomizer.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 a canAdaptWidth
component appears, because when too little space is available, a
canAdaptWidth
component will absorb all available space until minimums for other components are hit (or the
canAdaptWidth
component reaches its maximum size). If more than one canAdaptWidth
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
and AdaptHeightByCustomizer.adaptHeightBy()
.
canAdaptWidth
- New canAdaptWidth value. Default value is nullCanvas
instance, for chaining setter callssetCanAdaptHeight(java.lang.Boolean)
,
AdaptWidthByCustomizer.adaptWidthBy(int, int)
,
AdaptHeightByCustomizer.adaptHeightBy(int, int)
,
Inlined Menu Examplepublic java.lang.Boolean getCanAdaptWidth()
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:
minWidth
declared on the
canAdaptWidth
component itself 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.
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
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 the unadaptedWidth
argument will always reflect the unstretched width
requested by the previous call to AdaptWidthByCustomizer.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 to AdaptWidthByCustomizer.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 to AdaptWidthByCustomizer.adaptWidthBy()
. You must not
call getWidth()
or getVisibleWidth()
on the canvas itself inside AdaptWidthByCustomizer.adaptWidthBy()
as the size is in
the processing of being determined, but you may draw children or call getVisibleWidth()
on them, as we guarantee that the adaptive-width
canvas is drawn before the first call to AdaptWidthByCustomizer.adaptWidthBy()
. An example of drawing children in AdaptWidthByCustomizer.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 a canAdaptWidth
component appears, because when too little space is available, a
canAdaptWidth
component will absorb all available space until minimums for other components are hit (or the
canAdaptWidth
component reaches its maximum size). If more than one canAdaptWidth
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
and AdaptHeightByCustomizer.adaptHeightBy()
.
getCanAdaptHeight()
,
AdaptWidthByCustomizer.adaptWidthBy(int, int)
,
AdaptHeightByCustomizer.adaptHeightBy(int, int)
,
Inlined Menu Examplepublic Canvas setCanDrag(java.lang.Boolean canDrag)
canDragReposition
or canDragResize
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 be redrawn
in order for a change of the value of this
attribute to take effect.
Note : This is an advanced setting
canDrag
- New canDrag value. Default value is falseCanvas
instance, for chaining setter callsDrag and Drop
,
Drag create Examplepublic java.lang.Boolean getCanDrag()
canDragReposition
or canDragResize
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 be redrawn
in order for a change of the value of this
attribute to take effect.
Drag and Drop
,
Drag create Examplepublic Canvas setCanDragReposition(java.lang.Boolean canDragReposition)
Note : This is an advanced setting
canDragReposition
- New canDragReposition value. Default value is falseCanvas
instance, for chaining setter callsDrag and Drop
,
Drag effects Examplepublic java.lang.Boolean getCanDragReposition()
Drag and Drop
,
Drag effects Examplepublic Canvas setCanDragResize(java.lang.Boolean canDragResize)
Note : This is an advanced setting
canDragResize
- New canDragResize value. Default value is falseCanvas
instance, for chaining setter callsDrag and Drop
,
Drag resize Examplepublic java.lang.Boolean getCanDragResize()
Drag and Drop
,
Drag resize Examplepublic Canvas setCanDragScroll(boolean canDragScroll)
Note : This is an advanced setting
canDragScroll
- New canDragScroll value. Default value is trueCanvas
instance, for chaining setter callsshouldDragScroll()
public boolean getCanDragScroll()
shouldDragScroll()
public Canvas setCanDrop(java.lang.Boolean canDrop)
Note : This is an advanced setting
canDrop
- New canDrop value. Default value is falseCanvas
instance, for chaining setter callsDrag and Drop
,
Drag create Examplepublic java.lang.Boolean getCanDrop()
Drag and Drop
,
Drag create Examplepublic Canvas setCanDropBefore(java.lang.Boolean canDropBefore)
Note : This is an advanced setting
canDropBefore
- New canDropBefore value. Default value is nullCanvas
instance, for chaining setter callsLayout
,
LayoutMember overview and related methods
public java.lang.Boolean getCanDropBefore()
Layout
,
LayoutMember overview and related methods
public Canvas setCanFocus(java.lang.Boolean canFocus)
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
canFocus
- whether the widget should now accept focus. Default value is nullCanvas
instance, for chaining setter callsFocus
,
Focus & Tabbing Examplepublic java.lang.Boolean getCanFocus()
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.
Focus
,
Focus & Tabbing Examplepublic Canvas setCanHover(java.lang.Boolean canHover)
canHover
- New canHover value. Default value is nullCanvas
instance, for chaining setter callssetShowHover(java.lang.Boolean)
,
HoverEvent
public java.lang.Boolean getCanHover()
getShowHover()
,
HoverEvent
public Canvas setCanSelectText(java.lang.Boolean canSelectText)
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
canSelectText
- New canSelectText value. Default value is falseCanvas
instance, for chaining setter callspublic java.lang.Boolean getCanSelectText()
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.
public CanvasItem getCanvasItem() throws java.lang.IllegalStateException
CanvasItem
, 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.
java.lang.IllegalStateException
- if this widget has not yet been rendered.public Canvas[] getChildren()
Use addChild()
and removeChild()
to add and remove children after a Canvas has been created/drawn.
See Containment
for an overview of parent/child relationships.
Component Containment and Hierarchy
public Canvas setChildrenResizeSnapAlign(java.lang.Boolean childrenResizeSnapAlign)
childrenResizeSnapAlign
- New childrenResizeSnapAlign value. Default value is nullCanvas
instance, for chaining setter callsSnapGridDragging overview and related methods
public java.lang.Boolean getChildrenResizeSnapAlign()
SnapGridDragging overview and related methods
public Canvas setChildrenSnapAlign(java.lang.Boolean childrenSnapAlign)
childrenSnapToGrid
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 by snapAlignCenterLineStyle
and snapAlignEdgeLineStyle
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
and childrenSnapEdgeAlign
for enabling or disabling center
alignment or edge alignment individually.
childrenSnapAlign
- New childrenSnapAlign value. Default value is nullCanvas
instance, for chaining setter callsSnapGridDragging overview and related methods
public java.lang.Boolean getChildrenSnapAlign()
childrenSnapToGrid
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 by snapAlignCenterLineStyle
and snapAlignEdgeLineStyle
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
and childrenSnapEdgeAlign
for enabling or disabling center
alignment or edge alignment individually.
SnapGridDragging overview and related methods
public Canvas setChildrenSnapCenterAlign(java.lang.Boolean childrenSnapCenterAlign)
childrenSnapAlign
. This setting enables or disables
snapping on center alignment only.childrenSnapCenterAlign
- New childrenSnapCenterAlign value. Default value is nullCanvas
instance, for chaining setter callsSnapGridDragging overview and related methods
public java.lang.Boolean getChildrenSnapCenterAlign()
childrenSnapAlign
. This setting enables or disables
snapping on center alignment only.SnapGridDragging overview and related methods
public Canvas setChildrenSnapEdgeAlign(java.lang.Boolean childrenSnapEdgeAlign)
childrenSnapAlign
. This setting enables or disables
snapping on edge alignment only.childrenSnapEdgeAlign
- New childrenSnapEdgeAlign value. Default value is nullCanvas
instance, for chaining setter callsSnapGridDragging overview and related methods
public java.lang.Boolean getChildrenSnapEdgeAlign()
childrenSnapAlign
. This setting enables or disables
snapping on edge alignment only.SnapGridDragging overview and related methods
public Canvas setChildrenSnapResizeToGrid(java.lang.Boolean childrenSnapResizeToGrid)
snapToGrid
or snapResizeToGrid
value on the child.childrenSnapResizeToGrid
- New childrenSnapResizeToGrid value. Default value is nullCanvas
instance, for chaining setter callsSnapGridDragging overview and related methods
public java.lang.Boolean getChildrenSnapResizeToGrid()
snapToGrid
or snapResizeToGrid
value on the child.SnapGridDragging overview and related methods
public Canvas setChildrenSnapToGrid(java.lang.Boolean childrenSnapToGrid)
snapToGrid
value on the child.childrenSnapToGrid
- New childrenSnapToGrid value. Default value is nullCanvas
instance, for chaining setter callsSnapGridDragging overview and related methods
public java.lang.Boolean getChildrenSnapToGrid()
snapToGrid
value on the child.SnapGridDragging overview and related methods
public Canvas getComponentMask() throws java.lang.IllegalStateException
showComponentMask()
is called.
This component is an AutoChild named "componentMask". For an overview of how to use and
configure AutoChildren, see Using AutoChildren
.
java.lang.IllegalStateException
- if this widget has not yet been rendered.getComponentMaskDefaults()
public Canvas setComponentMaskDefaults(Canvas componentMaskDefaults) throws java.lang.IllegalStateException
componentMask
autoChild. Default properties
include backgroundColor
being set to "black"
and opacity
being set to 20
.componentMaskDefaults
- New componentMaskDefaults value. Default value is {...}Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdSGWTProperties
public Canvas getComponentMaskDefaults()
componentMask
autoChild. Default properties
include backgroundColor
being set to "black"
and opacity
being set to 20
.public Canvas setContents(java.lang.String contents)
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
contents
- an HTML string to be set as the contents of this widget. Default value is " "Canvas
instance, for chaining setter callssetDynamicContents(java.lang.Boolean)
,
HTMLString
public java.lang.String getContents()
getDynamicContents()
,
HTMLString
public Canvas setContextMenu(Menu contextMenu)
Note: if destroy()
is called on a canvas, any specified context menu is not
automatically destroyed as well. This is in contrast to MenuButton
s which
automatically destroy their specified MenuButton.menu
by
default. The behavior is intentional as context menus are commonly reused across components.
Note : This is an advanced setting
contextMenu
- New contextMenu value. Default value is nullCanvas
instance, for chaining setter callsShowContextMenuEvent
,
Cues overview and related methods
,
Context menus Examplepublic Menu getContextMenu()
Note: if destroy()
is called on a canvas, any specified context menu is not
automatically destroyed as well. This is in contrast to MenuButton
s which
automatically destroy their specified MenuButton.menu
by
default. The behavior is intentional as context menus are commonly reused across components.
ShowContextMenuEvent
,
Cues overview and related methods
,
Context menus Examplepublic Canvas setCorrectZoomOverflow(java.lang.Boolean correctZoomOverflow)
maxZoomOverflowError
of overflow before enabling scrolling and displaying custom scrollbars. Only relevant when overflow
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 on maxZoomOverflowError
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
correctZoomOverflow
- New correctZoomOverflow value. Default value is variesCanvas
instance, for chaining setter callspublic java.lang.Boolean getCorrectZoomOverflow()
maxZoomOverflowError
of overflow before enabling scrolling and displaying custom scrollbars. Only relevant when overflow
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 on maxZoomOverflowError
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.
public Canvas setCursor(Cursor cursor)
Cursor
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
. If cursor
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
cursor
- new cursor. Default value is nullCanvas
instance, for chaining setter callsCues overview and related methods
,
Drag create Example,
Cursors Examplepublic Cursor getCursor()
Cursor
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
. If cursor
is not explicitly set in the
ancestor chain, "default"
will be used.
Cues overview and related methods
,
Drag create Example,
Cursors Examplepublic Canvas setDataContext(DataContext dataContext)
DataSource
IDs to specific Records
from those DataSources, that DataBoundComponents
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 setting ListGrid.autoFetchData
. See autoPopulateData
for
details on how this is done.
DataSources included in the dataContext
are immediately provided to rule 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 in
dataContext
) so they do not conflict with normal DataSource records.
If this method is called after the component has been drawn/initialized:
Provides a new DataContext
to the Canvas. If the DataContext is new, DataBoundComponents
contained within this Canvas will be automatically bound as described in dataContext
. If the DataContext replaces an existing one, any contained components that were originally bound against the DataContext will be re-bound.
dataContext
- dataContext to use for automatic binding. Default value is nullCanvas
instance, for chaining setter callspublic DataContext getDataContext()
DataSource
IDs to specific Records
from those DataSources, that DataBoundComponents
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 setting ListGrid.autoFetchData
. See autoPopulateData
for
details on how this is done.
DataSources included in the dataContext
are immediately provided to rule 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 in
dataContext
) so they do not conflict with normal DataSource records.
public Canvas setDataPath(java.lang.String dataPath)
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 the DataPath overview
for more information.
For components which support displaying or editing data values, (such as DynamicForm
or
ListGrid
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 a
dataPath
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 the
parentCompany.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
).
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 the dataPath
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
dataPath
- new dataPath. Default value is nullCanvas
instance, for chaining setter callssetRuleScope(java.lang.String)
,
DataPath
public java.lang.String getDataPath()
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 the DataPath overview
for more information.
For components which support displaying or editing data values, (such as DynamicForm
or
ListGrid
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 a
dataPath
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 the
parentCompany.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
).
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.
getRuleScope()
,
DataPath
public Canvas setDefaultHeight(int defaultHeight)
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
defaultHeight
- New defaultHeight value. Default value is 100Canvas
instance, for chaining setter callsSizing overview and related methods
public int getDefaultHeight()
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.
Sizing overview and related methods
public Canvas setDefaultWidth(int defaultWidth)
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
defaultWidth
- New defaultWidth value. Default value is 100Canvas
instance, for chaining setter callsSizing overview and related methods
public int getDefaultWidth()
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.
Sizing overview and related methods
public Canvas setDefiningProperty(java.lang.String definingProperty)
getDefiningPropertyName()
for this property when generating
and resolving AutoTest locators with search segments
.
Note : This is an advanced setting
definingProperty
- New definingProperty value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.String getDefiningProperty()
getDefiningPropertyName()
for this property when generating
and resolving AutoTest locators with search segments
.public Canvas setDefiningPropertyNameOptions(java.lang.String... definingPropertyNameOptions)
definingProperty
was specified for this
component,
this array denotes a list of options to use as a
defining property
when generating and resolving
AutoTest 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
definingPropertyNameOptions
- New definingPropertyNameOptions value. Default value is [...]Canvas
instance, for chaining setter callspublic java.lang.String[] getDefiningPropertyNameOptions()
definingProperty
was specified for this
component,
this array denotes a list of options to use as a
defining property
when generating and resolving
AutoTest 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" ]
public java.lang.Boolean getDestroyed() throws java.lang.IllegalStateException
true
, the destroy()
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.
java.lang.IllegalStateException
- if this widget has not yet been rendered.BaseWidget.destroy()
public java.lang.Boolean getDestroying() throws java.lang.IllegalStateException
destroy()
method is called on a
widget. If this property is true, but destroyed
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.
java.lang.IllegalStateException
- if this widget has not yet been rendered.BaseWidget.destroy()
public Canvas setDisabledCursor(Cursor disabledCursor)
Note : This is an advanced setting
disabledCursor
- New disabledCursor value. Default value is Canvas.DEFAULTCanvas
instance, for chaining setter callsCues overview and related methods
public Cursor getDisabledCursor()
Cues overview and related methods
public Canvas setDisableTouchScrollingForDrag(java.lang.Boolean disableTouchScrollingForDrag) throws java.lang.IllegalStateException
useTouchScrolling
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 any accessible
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 (via setDefaultProperties
), 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 set useTouchScrolling
on each individual instance.
See the Mobile Development overview
for more background information.
disableTouchScrollingForDrag
- New disableTouchScrollingForDrag value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdScrolling overview and related methods
public java.lang.Boolean getDisableTouchScrollingForDrag()
useTouchScrolling
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 any accessible
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 (via setDefaultProperties
), 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 set useTouchScrolling
on each individual instance.
See the Mobile Development overview
for more background information.
Scrolling overview and related methods
public Canvas setDoubleClickDelay(int doubleClickDelay)
Note : This is an advanced setting
doubleClickDelay
- New doubleClickDelay value. Default value is 250Canvas
instance, for chaining setter callspublic int getDoubleClickDelay()
public Canvas setDragAppearance(DragAppearance dragAppearance)
dragResizeAppearance
and dragRepositionAppearance
.
Note : This is an advanced setting
dragAppearance
- New dragAppearance value. Default value is EventHandler.OUTLINECanvas
instance, for chaining setter callsDrag and Drop
public DragAppearance getDragAppearance()
dragResizeAppearance
and dragRepositionAppearance
.Drag and Drop
public Canvas setDragIntersectStyle(DragIntersectStyle dragIntersectStyle)
Note : This is an advanced setting
dragIntersectStyle
- New dragIntersectStyle value. Default value is "mouse"Canvas
instance, for chaining setter callsDrag and Drop
public DragIntersectStyle getDragIntersectStyle()
Drag and Drop
public Canvas setDragMaskType(DragMaskType dragMaskType)
useDragMask
is enabled.dragMaskType
- New dragMaskType value. Default value is "div"Canvas
instance, for chaining setter callsDrag and Drop
public DragMaskType getDragMaskType()
useDragMask
is enabled.Drag and Drop
public Canvas setDragMaxHeight(int dragMaxHeight)
dragMaxHeight
and maxHeight
.
Note : This is an advanced setting
dragMaxHeight
- New dragMaxHeight value. Default value is 10000Canvas
instance, for chaining setter callsSizing overview and related methods
public int getDragMaxHeight()
dragMaxHeight
and maxHeight
.Sizing overview and related methods
public Canvas setDragMaxWidth(int dragMaxWidth)
dragMaxWidth
and maxWidth
.
Note : This is an advanced setting
dragMaxWidth
- New dragMaxWidth value. Default value is 10000Canvas
instance, for chaining setter callsSizing overview and related methods
public int getDragMaxWidth()
dragMaxWidth
and maxWidth
.Sizing overview and related methods
public Canvas setDragMinHeight(int dragMinHeight)
dragMinWidth
for details of behavior.
Note : This is an advanced setting
dragMinHeight
- New dragMinHeight value. Default value is 10Canvas
instance, for chaining setter callssetMinHeight(int)
,
Sizing overview and related methods
public int getDragMinHeight()
dragMinWidth
for details of behavior.getMinHeight()
,
Sizing overview and related methods
public Canvas setDragMinWidth(int dragMinWidth)
dragMinWidth
and minWidth
. 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}, or Layout.minMemberLength
to constrain the minimum size along
the length axis of all members of the Layout
.
Note : This is an advanced setting
dragMinWidth
- New dragMinWidth value. Default value is 10Canvas
instance, for chaining setter callsSizing overview and related methods
public int getDragMinWidth()
dragMinWidth
and minWidth
. 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}, or Layout.minMemberLength
to constrain the minimum size along
the length axis of all members of the Layout
.
Sizing overview and related methods
public Canvas setDragOpacity(java.lang.Integer dragOpacity)
"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
dragOpacity
- New dragOpacity value. Default value is nullCanvas
instance, for chaining setter callsDrag and Drop
,
Drag effects Examplepublic java.lang.Integer getDragOpacity()
"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.Drag and Drop
,
Drag effects Examplepublic Canvas setDragRepositionAppearance(DragAppearance dragRepositionAppearance)
canDragReposition
is true, this attribute specifies
the visual appearance to show during drag reposition. If unset dragAppearance
will be used.
Note : This is an advanced setting
dragRepositionAppearance
- New dragRepositionAppearance value. Default value is nullCanvas
instance, for chaining setter callsDrag and Drop
public DragAppearance getDragRepositionAppearance()
canDragReposition
is true, this attribute specifies
the visual appearance to show during drag reposition. If unset dragAppearance
will be used.Drag and Drop
public Canvas setDragRepositionCursor(Cursor dragRepositionCursor)
Note : This is an advanced setting
dragRepositionCursor
- New dragRepositionCursor value. Default value is Canvas.MOVECanvas
instance, for chaining setter callsDrag and Drop
public Cursor getDragRepositionCursor()
Drag and Drop
public Canvas setDragResizeAppearance(DragAppearance dragResizeAppearance)
canDragResize
is true, this attribute specifies the
visual appearance to show during drag resize. If unset dragAppearance
will be used.
Note : This is an advanced setting
dragResizeAppearance
- New dragResizeAppearance value. Default value is nullCanvas
instance, for chaining setter callsDrag and Drop
public DragAppearance getDragResizeAppearance()
canDragResize
is true, this attribute specifies the
visual appearance to show during drag resize. If unset dragAppearance
will be used.Drag and Drop
public Canvas setDragScrollDelay(int dragScrollDelay)
Note : This is an advanced setting
dragScrollDelay
- New dragScrollDelay value. Default value is 100Canvas
instance, for chaining setter callspublic int getDragScrollDelay()
public Canvas setDragStartDistance(int dragStartDistance)
Note : This is an advanced setting
dragStartDistance
- New dragStartDistance value. Default value is 5Canvas
instance, for chaining setter callsDrag and Drop
public int getDragStartDistance()
Drag and Drop
public Canvas setDragTarget(Canvas dragTarget)
Valid dragTarget
values are:
null
(default) [this widget is its own
drag target] "parent"
drag target is this widget's parentCanvas
"top"
drag target is this widget's
topElement
Note that for dragging to work as intended,
the resizeFrom
setting on the dragTarget
must be
null or a superset of the resizeFrom
on this canvas.
Note : This is an advanced setting
dragTarget
- New dragTarget value. Default value is nullCanvas
instance, for chaining setter callsEventHandler.getDragTarget()
,
Drag and Drop
public Canvas getDragTarget()
Valid dragTarget
values are:
null
(default) [this widget is its own
drag target] "parent"
drag target is this widget's parentCanvas
"top"
drag target is this widget's
topElement
Note that for dragging to work as intended,
the resizeFrom
setting on the dragTarget
must be
null or a superset of the resizeFrom
on this canvas.
EventHandler.getDragTarget()
,
Drag and Drop
public Canvas setDragTarget(java.lang.String dragTarget)
Valid dragTarget
values are:
null
(default) [this widget is its own
drag target] "parent"
drag target is this widget's parentCanvas
"top"
drag target is this widget's
topElement
Note that for dragging to work as intended,
the resizeFrom
setting on the dragTarget
must be
null or a superset of the resizeFrom
on this canvas.
Note : This is an advanced setting
dragTarget
- New dragTarget value. Default value is nullCanvas
instance, for chaining setter callsEventHandler.getDragTarget()
,
Drag and Drop
public java.lang.String getDragTargetAsString()
Valid dragTarget
values are:
null
(default) [this widget is its own
drag target] "parent"
drag target is this widget's parentCanvas
"top"
drag target is this widget's
topElement
Note that for dragging to work as intended,
the resizeFrom
setting on the dragTarget
must be
null or a superset of the resizeFrom
on this canvas.
EventHandler.getDragTarget()
,
Drag and Drop
public Canvas setDragType(java.lang.String dragType)
dragType
for this widget used, to be compared to dropTypes
on possible drop target widgets. See dropTypes
for a full explanation.
Note : This is an advanced setting
dragType
- New dragType value. Default value is nullCanvas
instance, for chaining setter callsDrag and Drop
public java.lang.String getDragType()
dragType
for this widget used, to be compared to dropTypes
on possible drop target widgets. See dropTypes
for a full explanation.Drag and Drop
public Canvas setDropTarget(Canvas dropTarget)
Note : This is an advanced setting
dropTarget
- New dropTarget value. Default value is nullCanvas
instance, for chaining setter callsEventHandler.getDragTarget()
,
setDragTarget(com.smartgwt.client.widgets.Canvas)
,
Drag and Drop
public Canvas getDropTarget()
EventHandler.getDragTarget()
,
getDragTarget()
,
Drag and Drop
public Canvas setDropTarget(java.lang.String dropTarget)
Note : This is an advanced setting
dropTarget
- New dropTarget value. Default value is nullCanvas
instance, for chaining setter callsEventHandler.getDragTarget()
,
setDragTarget(com.smartgwt.client.widgets.Canvas)
,
Drag and Drop
public java.lang.String getDropTargetAsString()
EventHandler.getDragTarget()
,
getDragTarget()
,
Drag and Drop
public Canvas setDropTypes(java.lang.String... dropTypes)
dragType
is
configured on the source widget, it is compared to the dropTypes
configured on the target widget, and a
drop is only allowed if the dragType
is listed in the target widget's dropTypes
array. The
default setting means any dragType
is eligible for dropping on this widget, including no
dragType
setting.
See also willAcceptDrop()
for dynamic determination of drop eligibility.
Note : This is an advanced setting
dropTypes
- New dropTypes value. Default value is Canvas.ANYTHINGCanvas
instance, for chaining setter callsDrag and Drop
public java.lang.String[] getDropTypes()
dragType
is
configured on the source widget, it is compared to the dropTypes
configured on the target widget, and a
drop is only allowed if the dragType
is listed in the target widget's dropTypes
array. The
default setting means any dragType
is eligible for dropping on this widget, including no
dragType
setting.
See also willAcceptDrop()
for dynamic determination of drop eligibility.
Drag and Drop
public Canvas setDropTypes(java.lang.String dropTypes)
dragType
is
configured on the source widget, it is compared to the dropTypes
configured on the target widget, and a
drop is only allowed if the dragType
is listed in the target widget's dropTypes
array. The
default setting means any dragType
is eligible for dropping on this widget, including no
dragType
setting.
See also willAcceptDrop()
for dynamic determination of drop eligibility.
Note : This is an advanced setting
dropTypes
- New dropTypes value. Default value is Canvas.ANYTHINGCanvas
instance, for chaining setter callsDrag and Drop
public java.lang.String getDropTypesAsString()
dragType
is
configured on the source widget, it is compared to the dropTypes
configured on the target widget, and a
drop is only allowed if the dragType
is listed in the target widget's dropTypes
array. The
default setting means any dragType
is eligible for dropping on this widget, including no
dragType
setting.
See also willAcceptDrop()
for dynamic determination of drop eligibility.
Drag and Drop
public Canvas setDynamicContents(java.lang.Boolean dynamicContents)
${[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 automatically
Dynamic 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 the dynamicContentsVars
property.
Notes:
Developer
Console
and the error string will be embedded in place of the expected value in the Canvas. Note : This is an advanced setting
dynamicContents
- New dynamicContents value. Default value is falseCanvas
instance, for chaining setter callssetContents(java.lang.String)
,
com.smartgwt.client.widgets.Canvas#setDynamicContentsVars
public java.lang.Boolean getDynamicContents()
${[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 automatically
Dynamic 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 the dynamicContentsVars
property.
Notes:
Developer
Console
and the error string will be embedded in place of the expected value in the Canvas. getContents()
,
com.smartgwt.client.widgets.Canvas#getDynamicContentsVars
public Canvas setEdgeBackgroundColor(java.lang.String edgeBackgroundColor) throws java.lang.IllegalStateException
public java.lang.String getEdgeBackgroundColor()
CSSColor
public Canvas setEdgeCenterBackgroundColor(java.lang.String edgeCenterBackgroundColor) throws java.lang.IllegalStateException
public java.lang.String getEdgeCenterBackgroundColor()
CSSColor
public Canvas setEdgeImage(java.lang.String edgeImage) throws java.lang.IllegalStateException
The full list of extensions is: "_TL", "_TR", "_BL", "_BR", "_T", "_L", "_B", "_R", "_center".
edgeImage
- New edgeImage value. Default value is "[SKIN]edge.gif"Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdSCImgURL
,
Edges Examplepublic java.lang.String getEdgeImage()
The full list of extensions is: "_TL", "_TR", "_BL", "_BR", "_T", "_L", "_B", "_R", "_center".
SCImgURL
,
Edges Examplepublic Canvas setEdgeMarginSize(int edgeMarginSize)
Note : This is an advanced setting
edgeMarginSize
- New edgeMarginSize value. Default value is 5Canvas
instance, for chaining setter callsDrag and Drop
,
Drag resize Examplepublic int getEdgeMarginSize()
Drag and Drop
,
Drag resize Examplepublic Canvas setEdgeOffset(java.lang.Integer edgeOffset) throws java.lang.IllegalStateException
edgeOffset
- New edgeOffset value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Integer getEdgeOffset()
public Canvas setEdgeOpacity(java.lang.Integer edgeOpacity) throws java.lang.IllegalStateException
setOpacity()
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)
edgeOpacity
and mark the canvas for redrawedgeOpacity
- new edge-opacity level. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Integer getEdgeOpacity()
setOpacity()
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)public Canvas setEdgeShowCenter(java.lang.Boolean edgeShowCenter) throws java.lang.IllegalStateException
edgeShowCenter
- New edgeShowCenter value. Default value is falseCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getEdgeShowCenter()
public Canvas setEdgeSize(int edgeSize) throws java.lang.IllegalStateException
edgeSize
- New edgeSize value. Default value is 10Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic int getEdgeSize()
public EditNode getEditNode() throws java.lang.IllegalStateException
EditNode
for a component that has been created by a Palette
from a PaletteNode
.
Note : This method should be called only after the widget has been rendered.
java.lang.IllegalStateException
- if this widget has not yet been rendered.public EditProxy getEditProxy() throws java.lang.IllegalStateException
EditProxy
controls the behaviors of a component when it is placed into editing mode
. The editProxy
AutoChild is created when a component is
first placed into edit mode via setEditMode()
.
editProxy
properties can be supplied on a PaletteNode
or EditNode
as editProxyProperties
, but must be provided before the component is first placed into edit mode.
Most editable
components use a custom EditProxy. See the documentation for each class' editProxyConstructor
to determine the class.
This component is an AutoChild named "editProxy". For an overview of how to use and
configure AutoChildren, see Using AutoChildren
.
java.lang.IllegalStateException
- if this widget has not yet been rendered.setEditMode(boolean)
public Canvas setEditProxyConstructor(java.lang.String editProxyConstructor) throws java.lang.IllegalStateException
EditProxy
for this component when the component is
first placed into edit mode
.editProxyConstructor
- New editProxyConstructor value. Default value is "CanvasEditProxy"Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdSCClassName
public java.lang.String getEditProxyConstructor()
EditProxy
for this component when the component is
first placed into edit mode
.SCClassName
public Canvas setEnableWhen(AdvancedCriteria enableWhen) throws java.lang.IllegalStateException
ruleScope
changes. A basic criteria uses textMatchStyle:"exact".
When specified in Component XML
this property allows shorthand formats
for defining criteria.
enableWhen
- New enableWhen value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdDynamic Rules
public AdvancedCriteria getEnableWhen()
ruleScope
changes. A basic criteria uses textMatchStyle:"exact".
When specified in Component XML
this property allows shorthand formats
for defining criteria.
Dynamic Rules
public Canvas setEndLine(java.lang.Boolean endLine)
FlowLayout
. This property is not supported in a TileLayout
with TileLayout.layoutPolicy
: "fit" or if databound (i.e.TileGrid
).endLine
- New endLine value. Default value is falseCanvas
instance, for chaining setter callsTileLayout.setAutoWrapLines(java.lang.Boolean)
public java.lang.Boolean getEndLine()
FlowLayout
. This property is not supported in a TileLayout
with TileLayout.layoutPolicy
: "fit" or if databound (i.e.TileGrid
).TileLayout.getAutoWrapLines()
public Canvas setExtraSpace(int extraSpace) throws java.lang.IllegalStateException
extraSpace
- New extraSpace value. Default value is 0Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdLayoutSpacer
,
LayoutMember overview and related methods
public int getExtraSpace()
LayoutSpacer
,
LayoutMember overview and related methods
public Canvas setFloatingScrollbars(boolean floatingScrollbars) throws java.lang.IllegalStateException
showCustomScrollbars
is true, should the
scrollbars be drawn floating over the component handle, or should the handle shrink to accommodate them? Floating
scrollbars are typically only appropriate for scrollbars that are hidden by default and get shown as the user actively
scrolls the widget handle, such as in the nativeAutoHideScrollbars
case. If floating scrollbars are permanently visible over the component handle, they may
block some of the widget's content.
Note : This is an advanced setting
floatingScrollbars
- New floatingScrollbars value. Default value is falseCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic boolean getFloatingScrollbars()
showCustomScrollbars
is true, should the
scrollbars be drawn floating over the component handle, or should the handle shrink to accommodate them? Floating
scrollbars are typically only appropriate for scrollbars that are hidden by default and get shown as the user actively
scrolls the widget handle, such as in the nativeAutoHideScrollbars
case. If floating scrollbars are permanently visible over the component handle, they may
block some of the widget's content.
public Canvas setForwardSVGeventsToObject(java.lang.Boolean forwardSVGeventsToObject) throws java.lang.IllegalStateException
The advantage of forwarding events is that it allows hover CSS or any other event-driven logic on the SVG to work as expected. If "pointer-events:none" is written out, no GUI interaction will trigger events in the SVG, including hover CSS. The disadvantage is that only a few critical events are forwarded, such as "mouseDown", "mouseMove", and "mouseUp" for non-touch platforms, and "click" for touch platforms. Other events will be delivered to the SVG, but not forwarded up to the parent document/object tag.
Note : This is an advanced setting
forwardSVGeventsToObject
- New forwardSVGeventsToObject value. Default value is trueCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdEventHandler
,
setUseImageForSVG(boolean)
,
Images overview and related methods
public java.lang.Boolean getForwardSVGeventsToObject()
The advantage of forwarding events is that it allows hover CSS or any other event-driven logic on the SVG to work as expected. If "pointer-events:none" is written out, no GUI interaction will trigger events in the SVG, including hover CSS. The disadvantage is that only a few critical events are forwarded, such as "mouseDown", "mouseMove", and "mouseUp" for non-touch platforms, and "click" for touch platforms. Other events will be delivered to the SVG, but not forwarded up to the parent document/object tag.
EventHandler
,
getUseImageForSVG()
,
Images overview and related methods
public Canvas setGroupBorderCSS(java.lang.String groupBorderCSS) throws java.lang.IllegalStateException
grouping frame
.groupBorderCSS
- New groupBorderCSS value. Default value is "2px solid black"Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdAppearance overview and related methods
public java.lang.String getGroupBorderCSS()
grouping frame
.Appearance overview and related methods
public Canvas setGroupLabelBackgroundColor(java.lang.String groupLabelBackgroundColor)
grouping frame
. This corresponds to the CSS background-color property on the grouping label. 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.
The getter for this attribute, getGroupLabelBackgroundColor()
, returns
the color that will actually be used; i.e. if groupLabelBackgroundColor is left unset or is set to null, then
getGroupLabelBackgroundColor() returns the color string that will be used.
If this method is called after the component has been drawn/initialized:
Setter for groupLabelBackgroundColor
.
groupLabelBackgroundColor
- the new grouping label background color. Default value is nullCanvas
instance, for chaining setter callsCSSColor
,
Appearance overview and related methods
public java.lang.String getGroupLabelBackgroundColor()
grouping frame
. This corresponds to the CSS background-color property on the grouping label. 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.
The getter for this attribute, getGroupLabelBackgroundColor()
, returns
the color that will actually be used; i.e. if groupLabelBackgroundColor is left unset or is set to null, then
getGroupLabelBackgroundColor() returns the color string that will be used.
CSSColor
,
Appearance overview and related methods
public Canvas setGroupLabelStyleName(java.lang.String groupLabelStyleName) throws java.lang.IllegalStateException
grouping frame
. Note that groupLabelBackgroundColor
overrides any
background-color of this style.
groupLabelStyleName
- New groupLabelStyleName value. Default value is "groupLabel"Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdCSSStyleName
,
Appearance overview and related methods
public java.lang.String getGroupLabelStyleName()
grouping frame
. Note that groupLabelBackgroundColor
overrides any
background-color of this style.
CSSStyleName
,
Appearance overview and related methods
public Canvas setGroupPadding(java.lang.Integer groupPadding) throws java.lang.IllegalStateException
border and label
.groupPadding
- New groupPadding value. Default value is 10Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdsetIsGroup(boolean)
,
Appearance overview and related methods
public java.lang.Integer getGroupPadding()
border and label
.getIsGroup()
,
Appearance overview and related methods
public Canvas setGroupTitle(java.lang.String groupTitle)
isGroup
is
set to true. No grouping frame
or title/label will be shown
unless this property is a non-empty string.
groupTitle
.groupTitle
- The new title for the grouping. Default value is nullCanvas
instance, for chaining setter callsHTMLString
,
Appearance overview and related methods
public java.lang.String getGroupTitle()
isGroup
is
set to true. No grouping frame
or title/label will be shown
unless this property is a non-empty string.HTMLString
,
Appearance overview and related methods
public Canvas setHeight(java.lang.Integer height)
canvas.width
attribute specifies the size for a component's horizontal dimension;
canvas.height
specifies the size for the vertical dimension. May be set to an integer value (a number of pixels), a percentage value like "50%", or "*".
See PercentSizing
for details
on how percentage or "*"
values are resolved actual size.
If overflow
is set to "visible", the specified size acts as a minimum, and
the component may overflow to show all content and/or children.
Note that developers wishing to set a default width
or height for a component class should set defaultWidth
or
defaultHeight
instead of specifying an explicit default
width
or height
. This is important for components added to a Layout
as members - it allows the Layout to determine whether the canvas has an
explicitly specified size that must be respected, or whether it can participate in its sizing policies
.
If this method is called after the component has been drawn/initialized:
Resizes the widget vertically to the specified height (moves the bottom side of the widget). The height parameter can be expressed as a percentage of viewport size or as the number of pixels.
NOTE: if you're setting multiple coordinates, use resizeTo() or setRect() instead
height
- new height. Default value is nullCanvas
instance, for chaining setter callsSizing overview and related methods
public java.lang.Integer getHeight()
canvas.width
attribute specifies the size for a component's horizontal dimension;
canvas.height
specifies the size for the vertical dimension. May be set to an integer value (a number of pixels), a percentage value like "50%", or "*".
See PercentSizing
for details
on how percentage or "*"
values are resolved actual size.
If overflow
is set to "visible", the specified size acts as a minimum, and
the component may overflow to show all content and/or children.
Note that developers wishing to set a default width
or height for a component class should set defaultWidth
or
defaultHeight
instead of specifying an explicit default
width
or height
. This is important for components added to a Layout
as members - it allows the Layout to determine whether the canvas has an
explicitly specified size that must be respected, or whether it can participate in its sizing policies
.
See GettingCanvasSize
. Default value is null
Sizing overview and related methods
public void setHeight(java.lang.String height)
canvas.width
attribute specifies the size for a component's horizontal dimension;
canvas.height
specifies the size for the vertical dimension. May be set to an integer value (a number of pixels), a percentage value like "50%", or "*".
See PercentSizing
for details
on how percentage or "*"
values are resolved actual size.
If overflow
is set to "visible", the specified size acts as a minimum, and
the component may overflow to show all content and/or children.
Note that developers wishing to set a default width
or height for a component class should set defaultWidth
or
defaultHeight
instead of specifying an explicit default
width
or height
. This is important for components added to a Layout
as members - it allows the Layout to determine whether the canvas has an
explicitly specified size that must be respected, or whether it can participate in its sizing policies
.
If this method is called after the component has been drawn/initialized:
Resizes the widget vertically to the specified height (moves the bottom side of the widget). The height parameter can be expressed as a percentage of viewport size or as the number of pixels.
NOTE: if you're setting multiple coordinates, use resizeTo() or setRect() instead
setHeight
in class com.google.gwt.user.client.ui.UIObject
height
- new height. Default value is nullSizing overview and related methods
public Canvas setHideUsingDisplayNone(boolean hideUsingDisplayNone) throws java.lang.IllegalStateException
visibility
and hide()
), should display:none be applied to the outer element
? This setting is not supported for general use, but in certain cases, it has been shown that display:none is a work-around for browser bugs involving burn-through of iframes or plugins, where the content of the iframe or plugin may still be visible despite the containing widget being hidden.
Note : This is an advanced setting
hideUsingDisplayNone
- New hideUsingDisplayNone value. Default value is falseCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdVisibility
,
Appearance overview and related methods
public boolean getHideUsingDisplayNone()
visibility
and hide()
), should display:none be applied to the outer element
? This setting is not supported for general use, but in certain cases, it has been shown that display:none is a work-around for browser bugs involving burn-through of iframes or plugins, where the content of the iframe or plugin may still be visible despite the containing widget being hidden.
Visibility
,
Appearance overview and related methods
public Canvas setHoverAlign(Alignment hoverAlign)
this.showHover
is true, this property can be used to customize the alignment of content in the hover
canvas.hoverAlign
- New hoverAlign value. Default value is nullCanvas
instance, for chaining setter callssetShowHover(java.lang.Boolean)
public Alignment getHoverAlign()
this.showHover
is true, this property can be used to customize the alignment of content in the hover
canvas.getShowHover()
public Canvas setHoverAutoDestroy(java.lang.Boolean hoverAutoDestroy)
this.showHover
is true and getHoverComponent()
is implemented, should the hoverCanvas returned from it be automatically destroyed when it is
hidden? The default of null indicates that the component will be automatically destroyed. Set to false to prevent this.
hoverAutoDestroy
- New hoverAutoDestroy value. Default value is nullCanvas
instance, for chaining setter callssetShowHover(java.lang.Boolean)
public java.lang.Boolean getHoverAutoDestroy()
this.showHover
is true and getHoverComponent()
is implemented, should the hoverCanvas returned from it be automatically destroyed when it is
hidden? The default of null indicates that the component will be automatically destroyed. Set to false to prevent this.
getShowHover()
public Canvas setHoverAutoFitMaxWidth(int hoverAutoFitMaxWidth)
hoverAutoFitWidth
is enabled. May be specified as a pixel value, or a percentage of page width.hoverAutoFitMaxWidth
- New hoverAutoFitMaxWidth value. Default value is 200Canvas
instance, for chaining setter callspublic int getHoverAutoFitMaxWidth()
hoverAutoFitWidth
is enabled. May be specified as a pixel value, or a percentage of page width.public Canvas setHoverAutoFitMaxWidth(java.lang.String hoverAutoFitMaxWidth)
hoverAutoFitWidth
is enabled. May be specified as a pixel value, or a percentage of page width.hoverAutoFitMaxWidth
- New hoverAutoFitMaxWidth value. Default value is 200Canvas
instance, for chaining setter callspublic java.lang.String getHoverAutoFitMaxWidthAsString()
hoverAutoFitWidth
is enabled. May be specified as a pixel value, or a percentage of page width.public Canvas setHoverAutoFitWidth(java.lang.Boolean hoverAutoFitWidth)
showHover
is true, this property will cause the specified
hoverWidth
to be treated as a minimum width for the hover. If
the hover content string exceeds this, the hover will expand to accommodate it up to hoverAutoFitMaxWidth
(without the text wrapping). Using
this settings differs from simply disabling wrapping via hoverWrap:false
as the content will wrap if the hoverAutoFitMaxWidth
is exceeded.
Note : This is an advanced setting
hoverAutoFitWidth
- New hoverAutoFitWidth value. Default value is trueCanvas
instance, for chaining setter callssetShowHover(java.lang.Boolean)
public java.lang.Boolean getHoverAutoFitWidth()
showHover
is true, this property will cause the specified
hoverWidth
to be treated as a minimum width for the hover. If
the hover content string exceeds this, the hover will expand to accommodate it up to hoverAutoFitMaxWidth
(without the text wrapping). Using
this settings differs from simply disabling wrapping via hoverWrap:false
as the content will wrap if the hoverAutoFitMaxWidth
is exceeded.
getShowHover()
public Canvas setHoverDelay(int hoverDelay)
this.canHover
is true, how long should the mouse be kept over this widget before the hover event is
firedhoverDelay
- New hoverDelay value. Default value is 300Canvas
instance, for chaining setter callssetCanHover(java.lang.Boolean)
,
HoverEvent
public int getHoverDelay()
this.canHover
is true, how long should the mouse be kept over this widget before the hover event is
firedgetCanHover()
,
HoverEvent
public Canvas setHoverFocusKey(java.lang.String hoverFocusKey)
showing 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). Clicking outside the
hover (on some other component) will still dismiss it. When enabled, the standard hover canvas will display the
focusKeyHintLabel
to prompt the user on how to give the
hover focus. This behavior may be disabled by setting showFocusKeyHint
to false
Note that setting a hoverFocusKey also sets hoverPersist
to "clickPin". This makes hovers stay visible while
the cursor is over them, and become pinned if clicked, the same as pressing the hoverFocusKey.
public java.lang.String getHoverFocusKey()
showing 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). Clicking outside the
hover (on some other component) will still dismiss it. When enabled, the standard hover canvas will display the
focusKeyHintLabel
to prompt the user on how to give the
hover focus. This behavior may be disabled by setting showFocusKeyHint
to false
Note that setting a hoverFocusKey also sets hoverPersist
to "clickPin". This makes hovers stay visible while
the cursor is over them, and become pinned if clicked, the same as pressing the hoverFocusKey.
KeyName
public Canvas setHoverHeight(java.lang.Integer hoverHeight)
this.showHover
is true, this property can be used to customize the height of the hover canvas shown.hoverHeight
- New hoverHeight value. Default value is nullCanvas
instance, for chaining setter callssetShowHover(java.lang.Boolean)
public java.lang.Integer getHoverHeight()
this.showHover
is true, this property can be used to customize the height of the hover canvas shown.getShowHover()
public Canvas setHoverMoveWithMouse(java.lang.Boolean hoverMoveWithMouse)
this.showHover
is true, should this widget's hover canvas be moved with the mouse while visible?hoverMoveWithMouse
- New hoverMoveWithMouse value. Default value is nullCanvas
instance, for chaining setter callssetShowHover(java.lang.Boolean)
public java.lang.Boolean getHoverMoveWithMouse()
this.showHover
is true, should this widget's hover canvas be moved with the mouse while visible?getShowHover()
public Canvas setHoverOpacity(java.lang.Integer hoverOpacity)
this.showHover
is true, should the hover canvas be shown with opacity other than 100?hoverOpacity
- New hoverOpacity value. Default value is nullCanvas
instance, for chaining setter callssetShowHover(java.lang.Boolean)
,
Hovers / Tooltips Examplepublic java.lang.Integer getHoverOpacity()
this.showHover
is true, should the hover canvas be shown with opacity other than 100?getShowHover()
,
Hovers / Tooltips Examplepublic Canvas setHoverPersist(HoverPersistMode hoverPersist)
hoverPersist
- New hoverPersist value. Default value is nullCanvas
instance, for chaining setter callscom.smartgwt.client.widgets.Hover#persistent
public HoverPersistMode getHoverPersist()
com.smartgwt.client.widgets.Hover#persistent
public Canvas setHoverScreen(java.lang.String hoverScreen) throws java.lang.IllegalStateException
createScreen()
) in lieu of calling getHoverComponent()
.hoverScreen
- New hoverScreen value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getHoverScreen()
createScreen()
) in lieu of calling getHoverComponent()
.public Canvas setHoverStyle(java.lang.String hoverStyle)
this.showHover
is true, this property can be used to specify the css style to apply to the hover canvas.hoverStyle
- New hoverStyle value. Default value is nullCanvas
instance, for chaining setter callssetShowHover(java.lang.Boolean)
,
CSSStyleName
,
Hovers / Tooltips Examplepublic java.lang.String getHoverStyle()
this.showHover
is true, this property can be used to specify the css style to apply to the hover canvas.getShowHover()
,
CSSStyleName
,
Hovers / Tooltips Examplepublic Canvas setHoverVAlign(VerticalAlignment hoverVAlign)
this.showHover
is true, this property can be used to customize the vertical alignment of content in the
hover canvas.hoverVAlign
- New hoverVAlign value. Default value is nullCanvas
instance, for chaining setter callssetShowHover(java.lang.Boolean)
public VerticalAlignment getHoverVAlign()
this.showHover
is true, this property can be used to customize the vertical alignment of content in the
hover canvas.getShowHover()
public Canvas setHoverWidth(int hoverWidth)
this.showHover
is true, this property can be used to
customize the width of the hover canvas shown. See also hoverAutoFitWidth
and hoverAutoFitMaxWidth
.hoverWidth
- New hoverWidth value. Default value is 1Canvas
instance, for chaining setter callssetShowHover(java.lang.Boolean)
,
Hovers / Tooltips Examplepublic int getHoverWidth()
this.showHover
is true, this property can be used to
customize the width of the hover canvas shown. See also hoverAutoFitWidth
and hoverAutoFitMaxWidth
.getShowHover()
,
Hovers / Tooltips Examplepublic Canvas setHoverWrap(java.lang.Boolean hoverWrap)
this.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. Note that if developers wish to have hovers expand horizontally to fit
their text without wrapping *up to some maximum*, and then wrap rather than exceeding that maximum, the hoverAutoFitWidth
and hoverAutoFitMaxWidth
attributes may be used instead of
simply setting hoverWrap to false.
hoverWrap
- New hoverWrap value. Default value is nullCanvas
instance, for chaining setter callssetShowHover(java.lang.Boolean)
public java.lang.Boolean getHoverWrap()
this.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. Note that if developers wish to have hovers expand horizontally to fit
their text without wrapping *up to some maximum*, and then wrap rather than exceeding that maximum, the hoverAutoFitWidth
and hoverAutoFitMaxWidth
attributes may be used instead of
simply setting hoverWrap to false.
getShowHover()
public Canvas setHtmlElement(com.google.gwt.dom.client.Element htmlElement)
draw()
. If provided as a String, the String will be replaced by a DOM
node as returned from document.getElementById(htmlElement) on initialization. NOTES:
This feature is
intended for integration with other JavaScript frameworks and legacy page architectures only; the native browser's
reaction to DOM insertion is unspecified and unsupported. For consistent cross-browser layout and positioning semantics,
use Canvas parents (especially Layouts) and use absolute positioning at top level.
In some cases, the target element may need a specified height to be rendered correctly. In this cases, you can expect to find a message like the following in the JavaScript console: "isc_DataView_0:can't resize to height: 0; clamping to 1 [enable 'sizing' log for stack trace]"
Persistence of htmlElement: If htmlPosition
is set to "replace"
the htmlElement will be removed from the DOM when the canvas is drawn - therefore the
htmlElement attribute will be cleared at this time. Otherwise if a Canvas is clear()d and then draw()n again it will be
rendered inside the same htmlElement.
If a Canvas is added as a child to Canvas parent, its htmlElement will be
dropped.
position
should typically be set to
"relative"
if the widget is to be rendered inline within a standard page.
If this method is called after the component has been drawn/initialized:
Setter for the htmlElement
.
Note : This is an advanced setting
setHtmlElement
in class BaseWidget
htmlElement
- New htmlElement for this canvas or Null to clear the existing htmlElement. You may also provide a string with
the elements ID, which will have the effect of setting htmlElement
to the node returned by document.getElementById(element). Note that you may need to set
position:relative explicitly following a call to this function. Default value is nullCanvas
instance, for chaining setter callsPositioning overview and related methods
public com.google.gwt.dom.client.Element getHtmlElement()
draw()
. If provided as a String, the String will be replaced by a DOM
node as returned from document.getElementById(htmlElement) on initialization. NOTES:
This feature is
intended for integration with other JavaScript frameworks and legacy page architectures only; the native browser's
reaction to DOM insertion is unspecified and unsupported. For consistent cross-browser layout and positioning semantics,
use Canvas parents (especially Layouts) and use absolute positioning at top level.
In some cases, the target element may need a specified height to be rendered correctly. In this cases, you can expect to find a message like the following in the JavaScript console: "isc_DataView_0:can't resize to height: 0; clamping to 1 [enable 'sizing' log for stack trace]"
Persistence of htmlElement: If htmlPosition
is set to "replace"
the htmlElement will be removed from the DOM when the canvas is drawn - therefore the
htmlElement attribute will be cleared at this time. Otherwise if a Canvas is clear()d and then draw()n again it will be
rendered inside the same htmlElement.
If a Canvas is added as a child to Canvas parent, its htmlElement will be
dropped.
position
should typically be set to
"relative"
if the widget is to be rendered inline within a standard page.
Positioning overview and related methods
public Canvas setHtmlElement(java.lang.String htmlElement)
draw()
. If provided as a String, the String will be replaced by a DOM
node as returned from document.getElementById(htmlElement) on initialization. NOTES:
This feature is
intended for integration with other JavaScript frameworks and legacy page architectures only; the native browser's
reaction to DOM insertion is unspecified and unsupported. For consistent cross-browser layout and positioning semantics,
use Canvas parents (especially Layouts) and use absolute positioning at top level.
In some cases, the target element may need a specified height to be rendered correctly. In this cases, you can expect to find a message like the following in the JavaScript console: "isc_DataView_0:can't resize to height: 0; clamping to 1 [enable 'sizing' log for stack trace]"
Persistence of htmlElement: If htmlPosition
is set to "replace"
the htmlElement will be removed from the DOM when the canvas is drawn - therefore the
htmlElement attribute will be cleared at this time. Otherwise if a Canvas is clear()d and then draw()n again it will be
rendered inside the same htmlElement.
If a Canvas is added as a child to Canvas parent, its htmlElement will be
dropped.
position
should typically be set to
"relative"
if the widget is to be rendered inline within a standard page.
If this method is called after the component has been drawn/initialized:
Setter for the htmlElement
.
Note : This is an advanced setting
htmlElement
- New htmlElement for this canvas or Null to clear the existing htmlElement. You may also provide a string with
the elements ID, which will have the effect of setting htmlElement
to the node returned by document.getElementById(element). Note that you may need to set
position:relative explicitly following a call to this function. Default value is nullCanvas
instance, for chaining setter callsPositioning overview and related methods
public java.lang.String getHtmlElementAsString()
draw()
. If provided as a String, the String will be replaced by a DOM
node as returned from document.getElementById(htmlElement) on initialization. NOTES:
This feature is
intended for integration with other JavaScript frameworks and legacy page architectures only; the native browser's
reaction to DOM insertion is unspecified and unsupported. For consistent cross-browser layout and positioning semantics,
use Canvas parents (especially Layouts) and use absolute positioning at top level.
In some cases, the target element may need a specified height to be rendered correctly. In this cases, you can expect to find a message like the following in the JavaScript console: "isc_DataView_0:can't resize to height: 0; clamping to 1 [enable 'sizing' log for stack trace]"
Persistence of htmlElement: If htmlPosition
is set to "replace"
the htmlElement will be removed from the DOM when the canvas is drawn - therefore the
htmlElement attribute will be cleared at this time. Otherwise if a Canvas is clear()d and then draw()n again it will be
rendered inside the same htmlElement.
If a Canvas is added as a child to Canvas parent, its htmlElement will be
dropped.
position
should typically be set to
"relative"
if the widget is to be rendered inline within a standard page.
Positioning overview and related methods
public Canvas setHtmlPosition(DrawPosition htmlPosition)
htmlElement
is specified, this attribute specifies the
position where the canvas should be inserted relative to the htmlElement
in the DOM.
htmlPosition
.
Note : This is an advanced setting
htmlPosition
- New htmlPosition for this canvas. Default value is "afterBegin"Canvas
instance, for chaining setter callsPositioning overview and related methods
public DrawPosition getHtmlPosition()
htmlElement
is specified, this attribute specifies the
position where the canvas should be inserted relative to the htmlElement
in the DOM.Positioning overview and related methods
public Canvas setIsGroup(boolean isGroup) throws java.lang.IllegalStateException
groupTitle
.isGroup
- New isGroup value. Default value is trueCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdsetGroupBorderCSS(java.lang.String)
,
setGroupLabelStyleName(java.lang.String)
,
setGroupLabelBackgroundColor(java.lang.String)
,
Appearance overview and related methods
public boolean getIsGroup()
groupTitle
.getGroupBorderCSS()
,
getGroupLabelStyleName()
,
getGroupLabelBackgroundColor()
,
Appearance overview and related methods
public java.lang.Boolean getIsPrinting() throws java.lang.IllegalStateException
showPrintPreview()
(or just getPrintHTML()
). Note that this flag is set recursively as parent
widgets generate print HTML for their children. This is a read-only property and should not be modified by application code.
Note : This method should be called only after the widget has been rendered.
java.lang.IllegalStateException
- if this widget has not yet been rendered.public Canvas setIsRuleScope(java.lang.Boolean isRuleScope) throws java.lang.IllegalStateException
ruleScope
that will be discovered by
any contained DataBoundComponent
s which do not specify an explicit
ruleScope
.isRuleScope
- New isRuleScope value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getIsRuleScope()
ruleScope
that will be discovered by
any contained DataBoundComponent
s which do not specify an explicit
ruleScope
.public Canvas setIsSnapAlignCandidate(java.lang.Boolean isSnapAlignCandidate)
childrenSnapAlign
is enabled on this Canvas' parent.isSnapAlignCandidate
- New isSnapAlignCandidate value. Default value is nullCanvas
instance, for chaining setter callsSnapGridDragging overview and related methods
public java.lang.Boolean getIsSnapAlignCandidate()
childrenSnapAlign
is enabled on this Canvas' parent.SnapGridDragging overview and related methods
public Canvas setKeepInParentRect(java.lang.Boolean keepInParentRect)
If this canvas has no parent, constrains dragging to within the browser window.
Affects target and outline dragAppearance, not tracker.
Note: keepInParentRect affects only user drag interactions, not programmatic moves.
Example use cases:
keepInParentRect: true
-
confine to parent
keepInParentRect: [0, 0, 500, 500]
- confine to top left 500x500 region within
parent
keepInParentRect: [0, 0, 10000, 10000]
- in combination with overflow: "auto", confine to
parent, but allow moving off the right and bottom of the parent to force scrolling (and hence enlarge the scrollWidth of
the parent).
Note : This is an advanced setting
keepInParentRect
- New keepInParentRect value. Default value is nullCanvas
instance, for chaining setter callsDrag and Drop
,
Drag create Examplepublic java.lang.Boolean getKeepInParentRect()
If this canvas has no parent, constrains dragging to within the browser window.
Affects target and outline dragAppearance, not tracker.
Note: keepInParentRect affects only user drag interactions, not programmatic moves.
Example use cases:
keepInParentRect: true
-
confine to parent
keepInParentRect: [0, 0, 500, 500]
- confine to top left 500x500 region within
parent
keepInParentRect: [0, 0, 10000, 10000]
- in combination with overflow: "auto", confine to
parent, but allow moving off the right and bottom of the parent to force scrolling (and hence enlarge the scrollWidth of
the parent).
Drag and Drop
,
Drag create Examplepublic Canvas setKeepInParentRect(java.lang.Integer... keepInParentRect)
If this canvas has no parent, constrains dragging to within the browser window.
Affects target and outline dragAppearance, not tracker.
Note: keepInParentRect affects only user drag interactions, not programmatic moves.
Example use cases:
keepInParentRect: true
-
confine to parent
keepInParentRect: [0, 0, 500, 500]
- confine to top left 500x500 region within
parent
keepInParentRect: [0, 0, 10000, 10000]
- in combination with overflow: "auto", confine to
parent, but allow moving off the right and bottom of the parent to force scrolling (and hence enlarge the scrollWidth of
the parent).
Note : This is an advanced setting
keepInParentRect
- New keepInParentRect value. Default value is nullCanvas
instance, for chaining setter callsDrag and Drop
,
Drag create Examplepublic Canvas setLayoutAlign(Alignment layoutAlign)
layoutAlign
- New layoutAlign value. Default value is nullCanvas
instance, for chaining setter callsLayoutMember overview and related methods
public Alignment getLayoutAlign()
LayoutMember overview and related methods
public Canvas setLayoutAlign(VerticalAlignment layoutAlign)
layoutAlign
- New layoutAlign value. Default value is nullCanvas
instance, for chaining setter callsLayoutMember overview and related methods
public Canvas setLeaveGroupLabelSpace(java.lang.Boolean leaveGroupLabelSpace) throws java.lang.IllegalStateException
group
, should any content be shifted
down so that the group-label doesn't sit in front of it?leaveGroupLabelSpace
- New leaveGroupLabelSpace value. Default value is trueCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdAppearance overview and related methods
public java.lang.Boolean getLeaveGroupLabelSpace()
group
, should any content be shifted
down so that the group-label doesn't sit in front of it?Appearance overview and related methods
public Canvas setLeavePageSpace(java.lang.Integer leavePageSpace)
defaultPageSpace
.
leavePageSpace
.
Note : This is an advanced setting
leavePageSpace
- new value for leavePageSpace
. Default value is nullCanvas
instance, for chaining setter callsPositioning overview and related methods
public java.lang.Integer getLeavePageSpace()
defaultPageSpace
.Positioning overview and related methods
public Canvas setLeft(int left)
position
property). Can also be set as a percentage, specified as a
String ending in '%', eg, "50%". In this case the top coordinate is considered as a percentage of the specified width
of the parent
.
If this method is called after the component has been drawn/initialized:
Set the left coordinate of this object, relative to its enclosing context, in pixels. NOTE: if you're setting multiple coordinates, use setRect(), moveTo() or resizeTo() instead
left
- new left coordinate. Default value is 0Canvas
instance, for chaining setter callsPositioning overview and related methods
public int getLeft()
position
property). Can also be set as a percentage, specified as a
String ending in '%', eg, "50%". In this case the top coordinate is considered as a percentage of the specified width
of the parent
.
Positioning overview and related methods
public Canvas setLeft(java.lang.String left)
position
property). Can also be set as a percentage, specified as a
String ending in '%', eg, "50%". In this case the top coordinate is considered as a percentage of the specified width
of the parent
.
If this method is called after the component has been drawn/initialized:
Set the left coordinate of this object, relative to its enclosing context, in pixels. NOTE: if you're setting multiple coordinates, use setRect(), moveTo() or resizeTo() instead
left
- new left coordinate. Default value is 0Canvas
instance, for chaining setter callsPositioning overview and related methods
public Canvas setLocateByIDOnly(boolean locateByIDOnly)
true
, when retrieving a locator
for this component
always return a reference directly to this component by widget ID
,
using the compact format "///canvasID"
, ignoring any parent elements and ignoring any configured
testRoot
. This format of locator will always be resolved back to the
component by ID regardless of any changes in its position in the UI structure of an application. This setting is
appropriate for components which are expected to always be present in an application with a stable ID
.
Note : This is an advanced setting
locateByIDOnly
- New locateByIDOnly value. Default value is falseCanvas
instance, for chaining setter callspublic boolean getLocateByIDOnly()
true
, when retrieving a locator
for this component
always return a reference directly to this component by widget ID
,
using the compact format "///canvasID"
, ignoring any parent elements and ignoring any configured
testRoot
. This format of locator will always be resolved back to the
component by ID regardless of any changes in its position in the UI structure of an application. This setting is
appropriate for components which are expected to always be present in an application with a stable ID
.
public Canvas setLocateChildrenBy(LocatorStrategy locateChildrenBy)
Note : This is an advanced setting
locateChildrenBy
- New locateChildrenBy value. Default value is nullCanvas
instance, for chaining setter callspublic LocatorStrategy getLocateChildrenBy()
public Canvas setLocateChildrenType(LocatorTypeStrategy locateChildrenType)
LocatorTypeStrategy
to use when finding children within this canvas.
Note : This is an advanced setting
locateChildrenType
- New locateChildrenType value. Default value is nullCanvas
instance, for chaining setter callspublic LocatorTypeStrategy getLocateChildrenType()
LocatorTypeStrategy
to use when finding children within this canvas.public Canvas setLocatePeersBy(LocatorStrategy locatePeersBy)
Note : This is an advanced setting
locatePeersBy
- New locatePeersBy value. Default value is nullCanvas
instance, for chaining setter callspublic LocatorStrategy getLocatePeersBy()
public Canvas setLocatePeersType(LocatorTypeStrategy locatePeersType)
LocatorTypeStrategy
to use when finding peers of this canvas.
Note : This is an advanced setting
locatePeersType
- New locatePeersType value. Default value is nullCanvas
instance, for chaining setter callspublic LocatorTypeStrategy getLocatePeersType()
LocatorTypeStrategy
to use when finding peers of this canvas.public Canvas setLocatorName(java.lang.String locatorName)
index
if
found. This name must by unique within the parent component. By setting a static ID on certain top-level components and then using locatorName in contained components, stable locators can be created for these components without the need to pervasively assign IDs.
Note : This is an advanced setting
locatorName
- New locatorName value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.String getLocatorName()
index
if
found. This name must by unique within the parent component. By setting a static ID on certain top-level components and then using locatorName in contained components, stable locators can be created for these components without the need to pervasively assign IDs.
public Canvas setMargin(java.lang.Integer margin)
This property
sets the same thickness of margin on every side. Differing per-side margins can be set in a CSS style and applied via
styleName
.
Note that the specified size of the widget will
be the size including the margin thickness on each side.
If this method is called after the component has been drawn/initialized:
Set the CSS Margin, in pixels, for this component. Margin provides blank space outside of the border.
This property sets the same thickness of margin on every side. Differing per-side margins can be set in a CSS style and applied via styleName
.
Note that the specified size of the widget will be the size including the margin thickness on each side.
margin
- new margin in pixels. Default value is nullCanvas
instance, for chaining setter callsAppearance overview and related methods
public java.lang.Integer getMargin()
This property
sets the same thickness of margin on every side. Differing per-side margins can be set in a CSS style and applied via
styleName
.
Note that the specified size of the widget will be the size including the margin thickness on each side.
Appearance overview and related methods
public Canvas getMasterElement() throws java.lang.IllegalStateException
getMasterCanvas()
as of Smart GWT release 9.1Note : This method should be called only after the widget has been rendered.
java.lang.IllegalStateException
- if this widget has not yet been rendered.Component Containment and Hierarchy
public Canvas setMatchElement(java.lang.Boolean matchElement)
htmlElement
is specified, should this canvas be drawn at
the same dimensions as the htmlElement?matchElementWidth
and matchElementHeight
By
default, if htmlPosition
is anything other than
"replace"
, setting this property will cause the canvas resize with the element if the element itself
subsequently resizes (for example due to page reflow).
To disable this behavior for backwards compatibility or other
reasons, use persistentMatchElement
Note : This is an advanced setting
matchElement
- New matchElement value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Boolean getMatchElement()
htmlElement
is specified, should this canvas be drawn at
the same dimensions as the htmlElement?matchElementWidth
and matchElementHeight
By
default, if htmlPosition
is anything other than
"replace"
, setting this property will cause the canvas resize with the element if the element itself
subsequently resizes (for example due to page reflow).
To disable this behavior for backwards compatibility or other
reasons, use persistentMatchElement
public Canvas setMatchElementHeight(MatchElementSizeMode matchElementHeight) throws java.lang.IllegalStateException
htmlElement
where persistentMatchElement
is set to true, how should the
canvas match the element's height?
Note : This is an advanced setting
matchElementHeight
- New matchElementHeight value. Default value is "matchElement"Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic MatchElementSizeMode getMatchElementHeight()
htmlElement
where persistentMatchElement
is set to true, how should the
canvas match the element's height?public Canvas setMatchElementWidth(MatchElementSizeMode matchElementWidth) throws java.lang.IllegalStateException
htmlElement
where persistentMatchElement
is set to true, how should the
canvas match the element's width?
Note : This is an advanced setting
matchElementWidth
- New matchElementWidth value. Default value is "matchElement"Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic MatchElementSizeMode getMatchElementWidth()
htmlElement
where persistentMatchElement
is set to true, how should the
canvas match the element's width?public Canvas setMaxHeight(int maxHeight)
maxWidth
for
details of behavior.
Note : This is an advanced setting
maxHeight
- New maxHeight value. Default value is 10000Canvas
instance, for chaining setter callssetDragMaxHeight(int)
,
Sizing overview and related methods
public int getMaxHeight()
maxWidth
for
details of behavior.getDragMaxHeight()
,
Sizing overview and related methods
public Canvas setMaxWidth(int maxWidth)
The maxWidth
and maxHeight
settings apply to:
Layout
, the maximum size the layout should apply to the
canvas. CanvasItem
(maxHeight
only) drag resizing
ListGrid recordComponents
.
Note : This is an advanced setting
maxWidth
- New maxWidth value. Default value is 10000Canvas
instance, for chaining setter callssetDragMaxWidth(int)
,
Sizing overview and related methods
public int getMaxWidth()
The maxWidth
and maxHeight
settings apply to:
Layout
, the maximum size the layout should apply to the
canvas. CanvasItem
(maxHeight
only) drag resizing
ListGrid recordComponents
.getDragMaxWidth()
,
Sizing overview and related methods
public Canvas setMaxZoomOverflowError(int maxZoomOverflowError)
correctZoomOverflow
is true and browser or
OS-level zoom is active, determines how much overflow must occur before the Framework enables scrolling for this canvas.
The larger the value, the more clipping that can occur before scrolling is enabled. So, this property should never be set larger than the minimum amount needed to prevent scrollbar oscillation when zoomed - which is the maximum scrollHeight or scrollWidth error.
Note : This is an advanced setting
maxZoomOverflowError
- New maxZoomOverflowError value. Default value is variesCanvas
instance, for chaining setter callspublic int getMaxZoomOverflowError()
correctZoomOverflow
is true and browser or
OS-level zoom is active, determines how much overflow must occur before the Framework enables scrolling for this canvas.
The larger the value, the more clipping that can occur before scrolling is enabled. So, this property should never be set larger than the minimum amount needed to prevent scrollbar oscillation when zoomed - which is the maximum scrollHeight or scrollWidth error.
public Canvas setMenuConstructor(java.lang.String menuConstructor) throws java.lang.IllegalStateException
menuConstructor
- New menuConstructor value. Default value is "Menu"Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdShowContextMenuEvent
,
SCClassName
,
Cues overview and related methods
public java.lang.String getMenuConstructor()
ShowContextMenuEvent
,
SCClassName
,
Cues overview and related methods
public Canvas setMinHeight(int minHeight)
minWidth
for details.
minHeight
.
Note : This is an advanced setting
minHeight
- new minimum height. Default value is 0Canvas
instance, for chaining setter callssetDragMinHeight(int)
,
Sizing overview and related methods
public int getMinHeight()
minWidth
for details.getDragMinHeight()
,
Sizing overview and related methods
public Canvas setMinNonEdgeSize(int minNonEdgeSize)
minNonEdgeSize
, 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).
Note : This is an advanced setting
minNonEdgeSize
- New minNonEdgeSize value. Default value is 0Canvas
instance, for chaining setter callsDrag and Drop
,
Drag resize Examplepublic int getMinNonEdgeSize()
minNonEdgeSize
, 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).Drag and Drop
,
Drag resize Examplepublic Canvas setMinWidth(int minWidth)
The minWidth
and minHeight
settings apply to:
Layout
, the minimum size the layout should apply to the
canvas. CanvasItem
(minHeight
only) drag resizing
Overflow
"visible" outside of a Layout - minimum size will be the greater of this
setting or the minimum size needed to make all content visible Minimum sizes do not apply in various
other circumstances where sizes are being determined, such as ListGrid recordComponents
.
See also Layout.minMemberLength
as a way of establishing minimum
sizes along the length axis for all members of a Layout
with a single
setting.
If this method is called after the component has been drawn/initialized:
Resizes the widget horizontally if required to satisfy the specified minWidth
.
Note : This is an advanced setting
minWidth
- new minimum width. Default value is 0Canvas
instance, for chaining setter callssetDragMinWidth(int)
,
Sizing overview and related methods
public int getMinWidth()
The minWidth
and minHeight
settings apply to:
Layout
, the minimum size the layout should apply to the
canvas. CanvasItem
(minHeight
only) drag resizing
Overflow
"visible" outside of a Layout - minimum size will be the greater of this
setting or the minimum size needed to make all content visible Minimum sizes do not apply in various
other circumstances where sizes are being determined, such as ListGrid recordComponents
.
See also Layout.minMemberLength
as a way of establishing minimum
sizes along the length axis for all members of a Layout
with a single
setting.
getDragMinWidth()
,
Sizing overview and related methods
public Canvas setMomentumScrollMinSpeed(double momentumScrollMinSpeed)
Note : This is an advanced setting
momentumScrollMinSpeed
- New momentumScrollMinSpeed value. Default value is 200Canvas
instance, for chaining setter callspublic double getMomentumScrollMinSpeed()
public Canvas setMouseStillDownDelay(int mouseStillDownDelay)
Canvas.mouseStillDown()
for details.
Note : This is an advanced setting
mouseStillDownDelay
- New mouseStillDownDelay value. Default value is 100Canvas
instance, for chaining setter callspublic int getMouseStillDownDelay()
Canvas.mouseStillDown()
for details.public Canvas setMouseStillDownInitialDelay(int mouseStillDownInitialDelay)
Canvas.mouseStillDown()
for details.
Note : This is an advanced setting
mouseStillDownInitialDelay
- New mouseStillDownInitialDelay value. Default value is 400Canvas
instance, for chaining setter callspublic int getMouseStillDownInitialDelay()
Canvas.mouseStillDown()
for details.public Canvas setName(java.lang.String name) throws java.lang.IllegalStateException
parent
to get defined results for Layout.getMember()
and Layout.getMemberNumber()
.name
- New name value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdBaseWidget.setID(java.lang.String)
,
Identifier
public java.lang.String getName()
parent
to get defined results for Layout.getMember()
and Layout.getMemberNumber()
.BaseWidget.getID()
,
Identifier
public Canvas setNativeAutoHideScrollbars(java.lang.Boolean nativeAutoHideScrollbars) throws java.lang.IllegalStateException
If nativeAutoHideScrollbars
is set to true, we
detect platforms that show scrollbars dynamically on user interaction and for components with showCustomScrollbars
we ignore the specified scrollbarConstructor
, and instead create system-managed
native scrollbars via the special NativeScrollbar class, and set floatingScrollbars
to true.
Not applicable to touch devices
Has no impact if alwaysShowScrollbars
is true.
If showCustomScrollbars
is false, this setting will have no
effect (we would be showing custom scrollbars in any case)
Also does not apply to touch scrolling interfaces
(where scrollbars are always hidden
unless alwaysShowScrollbars
is true).
Note : This is an advanced setting
nativeAutoHideScrollbars
- New nativeAutoHideScrollbars value. Default value is falseCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdScrolling overview and related methods
public java.lang.Boolean getNativeAutoHideScrollbars()
If nativeAutoHideScrollbars
is set to true, we
detect platforms that show scrollbars dynamically on user interaction and for components with showCustomScrollbars
we ignore the specified scrollbarConstructor
, and instead create system-managed
native scrollbars via the special NativeScrollbar class, and set floatingScrollbars
to true.
Not applicable to touch devices
Has no impact if alwaysShowScrollbars
is true.
If showCustomScrollbars
is false, this setting will have no
effect (we would be showing custom scrollbars in any case)
Also does not apply to touch scrolling interfaces
(where scrollbars are always hidden
unless alwaysShowScrollbars
is true).
Scrolling overview and related methods
public Canvas setNoDoubleClicks(java.lang.Boolean noDoubleClicks)
click
events rather than as doubleClick
events.
Note : This is an advanced setting
noDoubleClicks
- New noDoubleClicks value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Boolean getNoDoubleClicks()
click
events rather than as doubleClick
events.public Canvas setNoDropCursor(Cursor noDropCursor)
showNoDropIndicator
is
true.
Note : This is an advanced setting
noDropCursor
- New noDropCursor value. Default value is Canvas.NOT_ALLOWEDCanvas
instance, for chaining setter callsCues overview and related methods
public Cursor getNoDropCursor()
showNoDropIndicator
is
true.Cues overview and related methods
public Canvas setOpacity(java.lang.Integer opacity)
In older versions of Internet
Explorer (Pre IE9 / HTML5), opacity is achieved through proprietary filters. If filters have been disabled
within this application developers
must set useOpacityFilter
to true for specific components
on which opacity support is required.
Also note that opacity is incompatible with backMasks
.
If this method is called after the component has been drawn/initialized:
Sets the opacity for the widget to the newOpacity value. This newOpacity value must be within the range of 0 (transparent) to 100 (opaque). Null means don't specify opacity directly. Note that heavy use of opacity may have a performance impact on some older browsers.
In older versions of Internet Explorer (Pre IE9 / HTML5), opacity is achieved through proprietary filters. If filters have been disabled
within this application developers must set useOpacityFilter
to true for specific components on which opacity support is required.
Also note that opacity is incompatible with backMasks
.
Note : This is an advanced setting
opacity
- new opacity level. Default value is nullCanvas
instance, for chaining setter callsCues overview and related methods
public java.lang.Integer getOpacity()
In older versions of Internet
Explorer (Pre IE9 / HTML5), opacity is achieved through proprietary filters. If filters have been disabled
within this application developers
must set useOpacityFilter
to true for specific components
on which opacity support is required.
Also note that opacity is incompatible with backMasks
.
Cues overview and related methods
public Canvas setOverflow(Overflow overflow)
overflow
of a Canvas after it has been created.overflow
- New overflow value. Default value is Canvas.VISIBLECanvas
instance, for chaining setter callsSizing overview and related methods
public Overflow getOverflow()
Sizing overview and related methods
public Canvas setPadding(java.lang.Integer padding)
This property sets the same thickness of padding on every side. Differing per-side padding can be set in
a CSS style and applied via styleName
.
Note that CSS padding
does not affect the placement of children
. To provide a blank
area around children, either use CSS margins
or use a Layout
as the parent instead, and use properties such as Layout.layoutMargin
to create blank space.
If this method is called after the component has been drawn/initialized:
Set the CSS padding of this component, in pixels. Padding provides space between the border and the component's contents.
This property sets the same thickness of padding on every side. Differing per-side padding can be set in a CSS style and applied via styleName
.
padding
- new padding in pixels. Default value is nullCanvas
instance, for chaining setter callsAppearance overview and related methods
public java.lang.Integer getPadding()
This property sets the same thickness of padding on every side. Differing per-side padding can be set in
a CSS style and applied via styleName
.
Note that CSS padding
does not affect the placement of children
. To provide a blank
area around children, either use CSS margins
or use a Layout
as the parent instead, and use properties such as Layout.layoutMargin
to create blank space.
Appearance overview and related methods
public Canvas setParentCanvas(Canvas parentCanvas) throws java.lang.IllegalStateException
addChild()
and removeChild()
calls on the parent. The parent Canvas should be fetched using getParentCanvas()
. See Containment
for an overview of parent/child relationships.
parentCanvas
- New parentCanvas value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdComponent Containment and Hierarchy
public Canvas getParentCanvas()
addChild()
and removeChild()
calls on the parent. The parent Canvas should be fetched using getParentCanvas()
. See Containment
for an overview of parent/child relationships.
See Containment
for an overview of
parent/child relationships. Default value is null
Component Containment and Hierarchy
public Canvas setParentElement(Canvas parentElement) throws java.lang.IllegalStateException
parentCanvas
and getParentCanvas()
addChild()
and removeChild()
calls on the parent.
Note : This is an advanced setting
parentElement
- New parentElement value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdComponent Containment and Hierarchy
public Canvas getParentElement()
parentCanvas
and getParentCanvas()
addChild()
and removeChild()
calls on the parent.Component Containment and Hierarchy
public Canvas setPeers(Canvas... peers) throws java.lang.IllegalStateException
Use addPeer()
and removePeer()
to add and remove peers after a Canvas has been
created/drawn.
See Containment
for an overview of master/peer relationships.
Note : This is an advanced setting
peers
- New peers value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdComponent Containment and Hierarchy
public Canvas[] getPeers()
Use addPeer()
and removePeer()
to add and remove peers after a Canvas has been
created/drawn.
See Containment
for an overview of master/peer relationships.
Component Containment and Hierarchy
public Canvas setPendingMarkerStyle(java.lang.String pendingMarkerStyle)
showPendingMarker()
is called, or when pendingMarkerVisible
has been set. The default
pendingMarkerStyle
, pendingMarker, renders a small triangle in the top-left of the Canvas. You can
modify this class or provide a custom one to achieve a different display.
pendingMarkerStyle
- New pendingMarkerStyle value. Default value is "pendingMarker"Canvas
instance, for chaining setter callsCSSStyleName
public java.lang.String getPendingMarkerStyle()
showPendingMarker()
is called, or when pendingMarkerVisible
has been set. The default
pendingMarkerStyle
, pendingMarker, renders a small triangle in the top-left of the Canvas. You can
modify this class or provide a custom one to achieve a different display.
CSSStyleName
public Canvas setPendingMarkerVisible(java.lang.Boolean pendingMarkerVisible)
pending marker
class
should be appended to the list of CSS classes applied to this canvas. By default, this extra class overlays a
small shape in the corner of this canvas.pendingMarkerVisible
- New pendingMarkerVisible value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Boolean getPendingMarkerVisible()
pending marker
class
should be appended to the list of CSS classes applied to this canvas. By default, this extra class overlays a
small shape in the corner of this canvas.public Canvas setPercentBox(PercentBoxModel percentBox) throws java.lang.IllegalStateException
snapTo
. Only affects widgets with a a specified
percentSource
, or widgets that have snapTo
set and are peers of some other canvas
.
Determines whether the coordinates used for sizing
(for percentage sized widgets) and positioning (if snapTo
is set) should be relative to the visible size or
the viewport size of the percentSource or master canvas
widget.
Note : This is an advanced setting
percentBox
- New percentBox value. Default value is "visible"Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdSizing overview and related methods
public PercentBoxModel getPercentBox()
snapTo
. Only affects widgets with a a specified
percentSource
, or widgets that have snapTo
set and are peers of some other canvas
.
Determines whether the coordinates used for sizing
(for percentage sized widgets) and positioning (if snapTo
is set) should be relative to the visible size or
the viewport size of the percentSource or master canvas
widget.
Sizing overview and related methods
public Canvas setPercentSource(Canvas percentSource)
If unset percentage sizing is based on
- the master canvas
if there is one and snapTo
is set,
- otherwise on the amount of space available in this
widget's parent canvas, if this is a child of some other widget
- otherwise the page size.
If this method is called after the component has been drawn/initialized:
Setter method for the percentSource
attribute.
Note : This is an advanced setting
percentSource
- eterNew percent source (if omitted existing percentSource will just be cleared). Default value is nullCanvas
instance, for chaining setter callssetPercentBox(com.smartgwt.client.types.PercentBoxModel)
,
Sizing overview and related methods
public Canvas getPercentSource()
If unset percentage sizing is based on
- the master canvas
if there is one and snapTo
is set,
- otherwise on the amount of space available in this
widget's parent canvas, if this is a child of some other widget
- otherwise the page size.
getPercentBox()
,
Sizing overview and related methods
public Canvas setPersistentMatchElement(java.lang.Boolean persistentMatchElement) throws java.lang.IllegalStateException
htmlElement
and matchElement
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?
Note : This is an advanced setting
persistentMatchElement
- New persistentMatchElement value. Default value is trueCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getPersistentMatchElement()
htmlElement
and matchElement
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?public Canvas setPointerSettings(PointerSettings pointerSettings) throws java.lang.IllegalStateException
pointer
such as where it should be
located along the outside of the canvas.pointerSettings
- New pointerSettings value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic PointerSettings getPointerSettings()
pointer
such as where it should be
located along the outside of the canvas.public Canvas setPointerTarget(java.lang.String pointerTarget) throws java.lang.IllegalStateException
pointerSettings.snapTo
places
the canvas in relation to the target canvas. Depending on the pointerSettings.snapTo
and the pointerSettings.targetSnapTo
the canvas will be positioned so the pointer
correctly points to the target.
A pointerTarget
can be specified ether as an AutoTestLocator
or a GlobalId
.
pointerTarget
- New pointerTarget value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdAutoTestLocator
public java.lang.String getPointerTarget()
pointerSettings.snapTo
places
the canvas in relation to the target canvas. Depending on the pointerSettings.snapTo
and the pointerSettings.targetSnapTo
the canvas will be positioned so the pointer
correctly points to the target.
A pointerTarget
can be specified ether as an AutoTestLocator
or a GlobalId
.
AutoTestLocator
public java.lang.String getPointerTargetAsString()
pointerSettings.snapTo
places
the canvas in relation to the target canvas. Depending on the pointerSettings.snapTo
and the pointerSettings.targetSnapTo
the canvas will be positioned so the pointer
correctly points to the target.
A pointerTarget
can be specified ether as an AutoTestLocator
or a GlobalId
.
AutoTestLocator
,
GlobalId
public Canvas setPosition(Positioning position)
Setting position:"relative"
enables Smart GWT components to be embedded
directly into the native HTML flow of a page, causing the component to be rendered
within an existing DOM structure.
This attribute should only be set to "relative"
on a top level component
(a component with no getParentCanvas()
).
There are 2 ways to embed relatively positioned canvases in the DOM - by default the
component will be written out inline when it gets drawn()n
. For example
to embed a canvas in an HTML table you could use this code:
<table> <tr> <td> <script> isc.Canvas.create({autoDraw:true, backgroundColor:"red", position:"relative"}); </script> <td> </tr> </table>Alternatively you can make use of the
htmlElement
attribute.
Relative positioning is intended as a short-term integration scenario while incrementally
upgrading existing applications.
Note that relative positioning is not used to manage layout within Smart GWT components -
instead the Layout
class would typically be used.
For best consistency and flexibility across browsers, all Smart GWT layout managers
use absolute positioning.
For canvases with a specified htmlElement
, this attribute
defaults to
"relative"
. In all other cases the default value will be
"absolute"
. Note that if you plan to call setHtmlElement()
after
init, you will need to set this value to "relative" explicitly.
Note : This is an advanced setting
position
- New position value. Default value is nullCanvas
instance, for chaining setter callsPositioning overview and related methods
public Positioning getPosition()
Setting position:"relative"
enables Smart GWT components to be embedded
directly into the native HTML flow of a page, causing the component to be rendered
within an existing DOM structure.
This attribute should only be set to "relative"
on a top level component
(a component with no getParentCanvas()
).
There are 2 ways to embed relatively positioned canvases in the DOM - by default the
component will be written out inline when it gets drawn()n
. For example
to embed a canvas in an HTML table you could use this code:
<table> <tr> <td> <script> isc.Canvas.create({autoDraw:true, backgroundColor:"red", position:"relative"}); </script> <td> </tr> </table>Alternatively you can make use of the
htmlElement
attribute.
Relative positioning is intended as a short-term integration scenario while incrementally
upgrading existing applications.
Note that relative positioning is not used to manage layout within Smart GWT components -
instead the Layout
class would typically be used.
For best consistency and flexibility across browsers, all Smart GWT layout managers
use absolute positioning.
For canvases with a specified htmlElement
, this attribute
defaults to
"relative"
. In all other cases the default value will be
"absolute"
. Note that if you plan to call setHtmlElement()
after
init, you will need to set this value to "relative" explicitly.
Positioning overview and related methods
public Canvas setPrintChildrenAbsolutelyPositioned(java.lang.Boolean printChildrenAbsolutelyPositioned)
printable HTML
. By default explicitly specified absolute positioning and sizing is ignored when generating print HTML. This is done intentionally: there is no way for the framework to predict how explicit sizes will translate to a the printed page and if HTML for printing includes the same absolute positioning and sizing as is displayed within an application it is very common to encounter undesirable effects, such as seeing tables get broken over several pages horizontally when there is enough room to print them on a single page of paper.
In some cases, however, a developer may wish to have explicit sizing and positioning respected
within the print-view. Setting this attribute to true
will cause this to occur.
Note : This is an advanced setting
public java.lang.Boolean getPrintChildrenAbsolutelyPositioned()
printable HTML
. By default explicitly specified absolute positioning and sizing is ignored when generating print HTML. This is done intentionally: there is no way for the framework to predict how explicit sizes will translate to a the printed page and if HTML for printing includes the same absolute positioning and sizing as is displayed within an application it is very common to encounter undesirable effects, such as seeing tables get broken over several pages horizontally when there is enough room to print them on a single page of paper.
In some cases, however, a developer may wish to have explicit sizing and positioning respected
within the print-view. Setting this attribute to true
will cause this to occur.
Printing
public Canvas setPrintStyleName(java.lang.String printStyleName)
specified style
.printStyleName
- New printStyleName value. Default value is nullCanvas
instance, for chaining setter callsCSSStyleName
,
Appearance overview and related methods
public java.lang.String getPrintStyleName()
specified style
.print style
, if specified, falling back to the specified style
otherwise. Default value is nullCSSStyleName
,
Appearance overview and related methods
public Canvas setPrompt(java.lang.String prompt)
showHover
is true.prompt
- New prompt value. Default value is nullCanvas
instance, for chaining setter callsHTMLString
,
Hovers / Tooltips Examplepublic java.lang.String getPrompt()
showHover
is true.HTMLString
,
Hovers / Tooltips Examplepublic Canvas setProportionalResizing(ProportionalResizeMode proportionalResizing) throws java.lang.IllegalStateException
canDragResize
is true, this property specifies the
conditions for when proportional resizing is used. The default is ProportionalResizeMode.MODIFIER_OFF
, which means that proportional resizing is disabled.proportionalResizing
- New proportionalResizing value. Default value is "none"Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdsetProportionalResizeModifiers(java.lang.String...)
,
Drag and Drop
public ProportionalResizeMode getProportionalResizing()
canDragResize
is true, this property specifies the
conditions for when proportional resizing is used. The default is ProportionalResizeMode.MODIFIER_OFF
, which means that proportional resizing is disabled.getProportionalResizeModifiers()
,
Drag and Drop
public Canvas setReceiveScrollbarEvents(boolean receiveScrollbarEvents) throws java.lang.IllegalStateException
events
from its scrollbars, which are peers
. Normally, a canvas only gets bubbled events from its children
. Note that this property only has an impact if showCustomScrollbars
is true.
receiveScrollbarEvents
- New receiveScrollbarEvents value. Default value is trueCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdsetShowCustomScrollbars(boolean)
,
Scrolling overview and related methods
public boolean getReceiveScrollbarEvents()
events
from its scrollbars, which are peers
. Normally, a canvas only gets bubbled events from its children
. Note that this property only has an impact if showCustomScrollbars
is true.
getShowCustomScrollbars()
,
Scrolling overview and related methods
public Canvas setRedrawOnResize(java.lang.Boolean redrawOnResize)
Should be set to true for components whose inner HTML
will not automatically reflow to fit the component's new
size.
Note : This is an advanced setting
redrawOnResize
- New redrawOnResize value. Default value is nullCanvas
instance, for chaining setter callsDrawing overview and related methods
public java.lang.Boolean getRedrawOnResize()
Should be set to true for components whose inner HTML
will not automatically reflow to fit the component's new
size.
Drawing overview and related methods
public Canvas setResizeBarTarget(java.lang.String resizeBarTarget) throws java.lang.IllegalStateException
showResizeBar
is set to true
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. For resizeBars
that support hiding their target member when clicked on, resizeBarTarget:"next"
also means that the next
member will be the one hidden. This is typically used to create a 3-way split pane, where left and right-hand sections can be resized or hidden to allow a center section to expand.
NOTE: as with any Layout, to ensure all available space is used, one or more members must maintain a flexible size (eg 75%, or *). In a two pane Layout with a normal resize bar, to fill all space after a user resizes, the member on the right should have flexible size. With resizeBarTarget:"next", the member on the left should have flexible size.
resizeBarTarget
- New resizeBarTarget value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdsetShowResizeBar(java.lang.Boolean)
,
LayoutMember overview and related methods
public java.lang.String getResizeBarTarget()
showResizeBar
is set to true
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. For resizeBars
that support hiding their target member when clicked on, resizeBarTarget:"next"
also means that the next
member will be the one hidden. This is typically used to create a 3-way split pane, where left and right-hand sections can be resized or hidden to allow a center section to expand.
NOTE: as with any Layout, to ensure all available space is used, one or more members must maintain a flexible size (eg 75%, or *). In a two pane Layout with a normal resize bar, to fill all space after a user resizes, the member on the right should have flexible size. With resizeBarTarget:"next", the member on the left should have flexible size.
getShowResizeBar()
,
LayoutMember overview and related methods
public Canvas setResizeFrom(EdgeName... resizeFrom)
canDragResize
, restricts
resizes to only certain edges or corners. The default of null indicates the widget can be resized from any corner or
edge (if canDragResize
is true).
To restrict resizing to only certain corners, set
resizeFrom
to an Array of EdgeName
s.
Note : This is an advanced setting
resizeFrom
- New resizeFrom value. Default value is nullCanvas
instance, for chaining setter callsDrag and Drop
,
Drag resize Examplepublic EdgeName[] getResizeFrom()
canDragResize
, restricts
resizes to only certain edges or corners. The default of null indicates the widget can be resized from any corner or
edge (if canDragResize
is true).
To restrict resizing to only certain corners, set
resizeFrom
to an Array of EdgeName
s.
Drag and Drop
,
Drag resize Examplepublic Canvas setRuleScope(java.lang.String ruleScope) throws java.lang.IllegalStateException
ID
of the component that gathers the context for evaluation of
criteria-based
rules specified by properties such as FormItem.visibleWhen
,
Dynamic Properties, and DynamicCriteria
such as
ListGrid.initialCriteria
.
If ruleScope
is not specified, this component will search through its parentCanvas
chain until it either reaches the top or reaches a parent marked isRuleScope
.
This means that typically, ruleScope
does not have to be explicitly specified, since
components that want to reference each other often have the same top-level parent (eg, they are
part of the same screen). However, you would need to specify ruleScope
in scenarios
such as a modal Window that wants to reference values in the component it was launched from.
Determination of the ruleScope
happens when the component is first drawn.
The component designated as the ruleScope
manages a nested data structure called
the "rule context" which contains information from all DataBoundComponent
s that are
registered with the ruleScope
. By specifying Criterion.fieldName
as a
DataPath
, AdvancedCriteria defined in properties such as
FormItem.visibleWhen
can access any part of the
rule context.
By default, the rule context contains data as follows:
DataBoundComponent
that has a DataSource contributes the values of the
selected record or record being edited under the ID of the DataSource. For any collision
an editable display (such as a form or editable grid) wins over a static display (such as
a non-editable grid with a selection.) Hidden or cleared components have lowest priority
even if editable. For two editable components the first becomes the contributor.
ID
will contribute the values of the selected record under
<componentId>.selectedRecord
, the values of the grid summary record
under <componentId>.summaryRecord
, and also contributes 3 flags for
checking for selection: anySelected
, multiSelected
,
numSelected
. The selected record can also be identified by row number:
<componentId>.selectedRowNum
which also applies to the edit row
since editing implies selection by default.
ID
contributes its current values under
<componentId>.values
, and contributes a flag hasChanges
.
ID
contributes a value <componentId>.focusField
. When present the value
indicates the component has focus along with the name of the field that has focus. Its absense
indicates the component does not have focus at all.
ID
contributes a
flag
isGrouped
under <componentId>
.
DataContext
or testDataContext
that is
being used for this ruleScope contributes the values into the dataContext
section of the ruleContext (ex. dataContext.Customer
) so the values do
not conflict with normal DataSource contributions. Note that the dataContext
is immutable so only the first contribution is actually saved.
In addition to data contributed by DataBoundComponent, the ruleScope also contains entries
contributed by the Authentication class, such as the authenticated userId and roles -
see Authentication
for details. Characteristics of the current
device is also included as:
{ device : { isPhone : false, isTablet : false, isDesktop : true, isLandscape : true } }
For example, given a screen where:
supplyItem
sample DataSource
getRuleContext()
,
expressed as JSON, would be:
{ supplyItem : { itemID : "654321", itemName : "Sewing Machine", price : 5.50, // note: user change ..other properties.. }, itemForm.values : { itemID : "654321", itemName : "Sewing Machine", price : 5.50, // note: user change ..other properties.. }, itemForm.focusField : "itemName", itemForm.hasChanges : true, itemGrid.selectedRecord : { itemID : "654321", itemName : "Sewing Machine", price : 3.50, // note: old price ..other properties.. }, itemGrid.anySelected : true, itemGrid.multiSelected : false, itemGrid.numSelected : 1, itemGrid.isGrouped : false, device : { isPhone : false, isTablet : false, isDesktop : true, isLandscape : true }, auth : { currentUser : { userId: "lisa", firstName: "Lisa", lastName: "Admin", roles: "admin", ..other properties.. }, roles : ['admin'], isSuperUser : false } }In addition, an application can put custom data into the ruleScope via
provideRuleContext()
.
provideRuleContext()
and removeRuleContext()
. Users of rule context
are the criteria-based rules noted above.
A number of Log categories are provided to make diagnosing ruleScope issues easier:
Smart GWT Developer Console
. By default none of these categories
are included in the Logging Preferences
category choices. To add one or more of these
categories, select More...
then click Add...
. Be sure to enter the category
with the correct capitalization.
At the Info log priority one or two basic log messages are generated per action. The Debug priority generally includes additional information like the full criteria or a message for each evaluation even when no change is made.
Below are some example Info log messages:
16:53:39.032:TMR8[E0]:INFO:whenRules:Hide Canvas 'isc_Canvas_1' 16:53:39.034:TMR8[E1]:INFO:whenRules:Disabling Canvas 'isc_Button_3' 16:53:39.509:TMR9[E0]:INFO:whenRules:Hide Canvas 'isc_Canvas_2' 16:53:39.510:TMR9[E1]:INFO:whenRules:Hide Canvas 'isc_Button_4' 16:53:39.527:TMR4:INFO:whenRules:Show Canvas 'isc_Canvas_2' 16:53:39.527:TMR4:INFO:whenRules:Show Canvas 'isc_Button_4' 16:53:39.528:TMR4:INFO:whenRules:Disabling Canvas 'isc_Button_4' 16:53:39.529:TMR4:INFO:whenRules:Set read-only (appearance disabled) FormItem 'itemForm3.field2' 16:53:39.974:TMR6:INFO:whenRules:Set editable (appearance disabled) FormItem 'itemForm3.field2' 16:53:40.540:TMR2:INFO:whenRules:Enabling FormItemIcon 'itemForm4.field2.remove' 16:53:40.541:TMR2:INFO:whenRules:Hide FormItemIcon 'itemForm4.field4.edit'These indicate various responses to
visibleWhen
, enableWhen
, and
readOnlyWhen
actions.
By setting the priority to Debug you can see the creation of the rule for the criteria and the evaluation of the criteria before action is taken:
16:53:41.569:TMR7:DEBUG:whenRules:itemForm6:Create whenRule: itemForm6_field2_readOnly, applyWhen { "_constructor":"AdvancedCriteria", "operator":"and", "criteria":[ { "fieldName":"layout1.date1", "operator":"greaterOrEqualField", "value":"layout1.date2" } ] } to target {component: [DynamicForm ID:itemForm6], fieldName: "field2", formIconName: undef} 16:53:41.571:TMR7:DEBUG:whenRules:isc_RulesEngine_5:Applying readOnly rule 'itemForm6_field2_readOnly' for FormItem itemForm6.field2 with action result true. applyWhen criteria matched: { "__normalized":true, "_constructor":"AdvancedCriteria", "operator":"and", "criteria":[ { "__normalized":true, "fieldName":"layout1.date1", "operator":"greaterOrEqualField", "value":"layout1.date2" } ] } 16:53:41.571:TMR7:DEBUG:whenRules:Set read-only (appearance disabled) FormItem 'itemForm6.field2'dynamicProperties are similar:
16:59:13.588:XRP8:INFO:dynamicProperties:Set (populateFromDataPath) 'isc_Button_0.title' to [initial value]: Special Title 16:59:13.650:TMR2:WARN:Class:isc_Class_0:Attempt to evaluate formulaFunction itemForm.values.count * 2 + 10 failed. Error message:undefined is not an object (evaluating 'itemForm.values') 16:59:13.657:TMR9:INFO:dynamicProperties:Set (populate) 'isc_Class_0.contents' to [initial value]: 34This example shows a failed formula indicating that the 'itemForm.values' isn't valid in the ruleContext. In this case the form values haven't been provided to ruleContext yet. When they are the next log message shows the result.
ruleContextChanged
event)
a log entry is made:
14:54:46.436:INP9:INFO:dynamicCriteria:isc_ListGrid_0:Evaluated dynamic criteria: filterCriteriaThis indicates that dynamicCriteria for isc_ListGrid_0 is being evaluated/re-evaluated. By changing the priority to Debug the resolved criteria is also included:
14:55:16.231:INP9:DEBUG:dynamicCriteria:isc_ListGrid_0:Evaluated dynamic criteria: filterCriteria { "fieldName":"orderNumber", "operator":"equals", "valuePath":"orderSearchForm.values.orderNumber", "value":10104, "_constructor":"AdvancedCriteria" }Note the valuePath of
orderSearchForm.values.orderNumber
is resolved to the value of
10104
.
For example, below are the rule context changes that occurred to trigger the above dynamicCriteria messages above:
14:54:46.432:INP9:INFO:ruleContext:isc_SearchForm_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_SearchForm_0]: Order.orderNumber = 10104 14:54:46.433:INP9:INFO:ruleContext:isc_SearchForm_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_SearchForm_0]: orderSearchForm.values.orderNumber = 10104 14:54:46.434:INP9:INFO:ruleContext:isc_SearchForm_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_SearchForm_0]: orderSearchForm.hasChanges = trueThis indicates that isc_SearchForm_0 updated rule context with three changed values. There is no indication of when a
ruleContextChanged
event is raised. If that is important, change
the log priority to Debug to see more details:
15:16:43.291:INP9:DEBUG:ruleContext:isc_SearchForm_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_SearchForm_0] START TRANSACTION 15:16:43.292:INP9:DEBUG:ruleContext:isc_SearchForm_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_SearchForm_0]: Order.orderNumber = 10104 15:16:43.292:INP9:DEBUG:ruleContext:isc_SearchForm_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_SearchForm_0]: orderSearchForm.values.orderNumber = 10104 15:16:43.293:INP9:DEBUG:ruleContext:isc_SearchForm_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_SearchForm_0]: orderSearchForm.hasChanges = true 15:16:43.294:INP9:DEBUG:ruleContext:isc_SearchForm_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_SearchForm_0] END TRANSACTIONHere the isc_SearchForm_0 provides rule context changes as part of a 'transaction'. That is, the three values are provided separately but a single
ruleContextChanged
event is raised at the end
of the 'transaction'. If only one change is part of a 'transaction' the start/end log messages are
suppressed. For example, the isc_ListGrid_0 updates rule context as a result of the change in the
dynamic criteria. The criteria is provided to rule context separately from dataLoading
updates:
15:16:43.305:INP9:DEBUG:ruleContext:isc_ListGrid_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_ListGrid_0]: orderDetailGrid.criteria = {fieldName: "orderNumber", operator: "equals", valuePath: "orderSearchForm.values.orderNumber", value: 10104, _constructor: "AdvancedCriteria"} 15:16:43.317:INP9:DEBUG:ruleContext:isc_ListGrid_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_ListGrid_0]: orderDetailGrid.dataLoading = true 15:16:44.228:TMR2:DEBUG:ruleContext:isc_ListGrid_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_ListGrid_0]: orderDetailGrid.dataLoading = null
ruleScope
- New ruleScope value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.String getRuleScope()
ID
of the component that gathers the context for evaluation of
criteria-based
rules specified by properties such as FormItem.visibleWhen
,
Dynamic Properties, and DynamicCriteria
such as
ListGrid.initialCriteria
.
If ruleScope
is not specified, this component will search through its parentCanvas
chain until it either reaches the top or reaches a parent marked isRuleScope
.
This means that typically, ruleScope
does not have to be explicitly specified, since
components that want to reference each other often have the same top-level parent (eg, they are
part of the same screen). However, you would need to specify ruleScope
in scenarios
such as a modal Window that wants to reference values in the component it was launched from.
Determination of the ruleScope
happens when the component is first drawn.
The component designated as the ruleScope
manages a nested data structure called
the "rule context" which contains information from all DataBoundComponent
s that are
registered with the ruleScope
. By specifying Criterion.fieldName
as a
DataPath
, AdvancedCriteria defined in properties such as
FormItem.visibleWhen
can access any part of the
rule context.
By default, the rule context contains data as follows:
DataBoundComponent
that has a DataSource contributes the values of the
selected record or record being edited under the ID of the DataSource. For any collision
an editable display (such as a form or editable grid) wins over a static display (such as
a non-editable grid with a selection.) Hidden or cleared components have lowest priority
even if editable. For two editable components the first becomes the contributor.
ID
will contribute the values of the selected record under
<componentId>.selectedRecord
, the values of the grid summary record
under <componentId>.summaryRecord
, and also contributes 3 flags for
checking for selection: anySelected
, multiSelected
,
numSelected
. The selected record can also be identified by row number:
<componentId>.selectedRowNum
which also applies to the edit row
since editing implies selection by default.
ID
contributes its current values under
<componentId>.values
, and contributes a flag hasChanges
.
ID
contributes a value <componentId>.focusField
. When present the value
indicates the component has focus along with the name of the field that has focus. Its absense
indicates the component does not have focus at all.
ID
contributes a
flag
isGrouped
under <componentId>
.
DataContext
or testDataContext
that is
being used for this ruleScope contributes the values into the dataContext
section of the ruleContext (ex. dataContext.Customer
) so the values do
not conflict with normal DataSource contributions. Note that the dataContext
is immutable so only the first contribution is actually saved.
In addition to data contributed by DataBoundComponent, the ruleScope also contains entries
contributed by the Authentication class, such as the authenticated userId and roles -
see Authentication
for details. Characteristics of the current
device is also included as:
{ device : { isPhone : false, isTablet : false, isDesktop : true, isLandscape : true } }
For example, given a screen where:
supplyItem
sample DataSource
getRuleContext()
,
expressed as JSON, would be:
{ supplyItem : { itemID : "654321", itemName : "Sewing Machine", price : 5.50, // note: user change ..other properties.. }, itemForm.values : { itemID : "654321", itemName : "Sewing Machine", price : 5.50, // note: user change ..other properties.. }, itemForm.focusField : "itemName", itemForm.hasChanges : true, itemGrid.selectedRecord : { itemID : "654321", itemName : "Sewing Machine", price : 3.50, // note: old price ..other properties.. }, itemGrid.anySelected : true, itemGrid.multiSelected : false, itemGrid.numSelected : 1, itemGrid.isGrouped : false, device : { isPhone : false, isTablet : false, isDesktop : true, isLandscape : true }, auth : { currentUser : { userId: "lisa", firstName: "Lisa", lastName: "Admin", roles: "admin", ..other properties.. }, roles : ['admin'], isSuperUser : false } }In addition, an application can put custom data into the ruleScope via
provideRuleContext()
.
provideRuleContext()
and removeRuleContext()
. Users of rule context
are the criteria-based rules noted above.
A number of Log categories are provided to make diagnosing ruleScope issues easier:
Smart GWT Developer Console
. By default none of these categories
are included in the Logging Preferences
category choices. To add one or more of these
categories, select More...
then click Add...
. Be sure to enter the category
with the correct capitalization.
At the Info log priority one or two basic log messages are generated per action. The Debug priority generally includes additional information like the full criteria or a message for each evaluation even when no change is made.
Below are some example Info log messages:
16:53:39.032:TMR8[E0]:INFO:whenRules:Hide Canvas 'isc_Canvas_1' 16:53:39.034:TMR8[E1]:INFO:whenRules:Disabling Canvas 'isc_Button_3' 16:53:39.509:TMR9[E0]:INFO:whenRules:Hide Canvas 'isc_Canvas_2' 16:53:39.510:TMR9[E1]:INFO:whenRules:Hide Canvas 'isc_Button_4' 16:53:39.527:TMR4:INFO:whenRules:Show Canvas 'isc_Canvas_2' 16:53:39.527:TMR4:INFO:whenRules:Show Canvas 'isc_Button_4' 16:53:39.528:TMR4:INFO:whenRules:Disabling Canvas 'isc_Button_4' 16:53:39.529:TMR4:INFO:whenRules:Set read-only (appearance disabled) FormItem 'itemForm3.field2' 16:53:39.974:TMR6:INFO:whenRules:Set editable (appearance disabled) FormItem 'itemForm3.field2' 16:53:40.540:TMR2:INFO:whenRules:Enabling FormItemIcon 'itemForm4.field2.remove' 16:53:40.541:TMR2:INFO:whenRules:Hide FormItemIcon 'itemForm4.field4.edit'These indicate various responses to
visibleWhen
, enableWhen
, and
readOnlyWhen
actions.
By setting the priority to Debug you can see the creation of the rule for the criteria and the evaluation of the criteria before action is taken:
16:53:41.569:TMR7:DEBUG:whenRules:itemForm6:Create whenRule: itemForm6_field2_readOnly, applyWhen { "_constructor":"AdvancedCriteria", "operator":"and", "criteria":[ { "fieldName":"layout1.date1", "operator":"greaterOrEqualField", "value":"layout1.date2" } ] } to target {component: [DynamicForm ID:itemForm6], fieldName: "field2", formIconName: undef} 16:53:41.571:TMR7:DEBUG:whenRules:isc_RulesEngine_5:Applying readOnly rule 'itemForm6_field2_readOnly' for FormItem itemForm6.field2 with action result true. applyWhen criteria matched: { "__normalized":true, "_constructor":"AdvancedCriteria", "operator":"and", "criteria":[ { "__normalized":true, "fieldName":"layout1.date1", "operator":"greaterOrEqualField", "value":"layout1.date2" } ] } 16:53:41.571:TMR7:DEBUG:whenRules:Set read-only (appearance disabled) FormItem 'itemForm6.field2'dynamicProperties are similar:
16:59:13.588:XRP8:INFO:dynamicProperties:Set (populateFromDataPath) 'isc_Button_0.title' to [initial value]: Special Title 16:59:13.650:TMR2:WARN:Class:isc_Class_0:Attempt to evaluate formulaFunction itemForm.values.count * 2 + 10 failed. Error message:undefined is not an object (evaluating 'itemForm.values') 16:59:13.657:TMR9:INFO:dynamicProperties:Set (populate) 'isc_Class_0.contents' to [initial value]: 34This example shows a failed formula indicating that the 'itemForm.values' isn't valid in the ruleContext. In this case the form values haven't been provided to ruleContext yet. When they are the next log message shows the result.
ruleContextChanged
event)
a log entry is made:
14:54:46.436:INP9:INFO:dynamicCriteria:isc_ListGrid_0:Evaluated dynamic criteria: filterCriteriaThis indicates that dynamicCriteria for isc_ListGrid_0 is being evaluated/re-evaluated. By changing the priority to Debug the resolved criteria is also included:
14:55:16.231:INP9:DEBUG:dynamicCriteria:isc_ListGrid_0:Evaluated dynamic criteria: filterCriteria { "fieldName":"orderNumber", "operator":"equals", "valuePath":"orderSearchForm.values.orderNumber", "value":10104, "_constructor":"AdvancedCriteria" }Note the valuePath of
orderSearchForm.values.orderNumber
is resolved to the value of
10104
.
For example, below are the rule context changes that occurred to trigger the above dynamicCriteria messages above:
14:54:46.432:INP9:INFO:ruleContext:isc_SearchForm_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_SearchForm_0]: Order.orderNumber = 10104 14:54:46.433:INP9:INFO:ruleContext:isc_SearchForm_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_SearchForm_0]: orderSearchForm.values.orderNumber = 10104 14:54:46.434:INP9:INFO:ruleContext:isc_SearchForm_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_SearchForm_0]: orderSearchForm.hasChanges = trueThis indicates that isc_SearchForm_0 updated rule context with three changed values. There is no indication of when a
ruleContextChanged
event is raised. If that is important, change
the log priority to Debug to see more details:
15:16:43.291:INP9:DEBUG:ruleContext:isc_SearchForm_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_SearchForm_0] START TRANSACTION 15:16:43.292:INP9:DEBUG:ruleContext:isc_SearchForm_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_SearchForm_0]: Order.orderNumber = 10104 15:16:43.292:INP9:DEBUG:ruleContext:isc_SearchForm_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_SearchForm_0]: orderSearchForm.values.orderNumber = 10104 15:16:43.293:INP9:DEBUG:ruleContext:isc_SearchForm_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_SearchForm_0]: orderSearchForm.hasChanges = true 15:16:43.294:INP9:DEBUG:ruleContext:isc_SearchForm_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_SearchForm_0] END TRANSACTIONHere the isc_SearchForm_0 provides rule context changes as part of a 'transaction'. That is, the three values are provided separately but a single
ruleContextChanged
event is raised at the end
of the 'transaction'. If only one change is part of a 'transaction' the start/end log messages are
suppressed. For example, the isc_ListGrid_0 updates rule context as a result of the change in the
dynamic criteria. The criteria is provided to rule context separately from dataLoading
updates:
15:16:43.305:INP9:DEBUG:ruleContext:isc_ListGrid_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_ListGrid_0]: orderDetailGrid.criteria = {fieldName: "orderNumber", operator: "equals", valuePath: "orderSearchForm.values.orderNumber", value: 10104, _constructor: "AdvancedCriteria"} 15:16:43.317:INP9:DEBUG:ruleContext:isc_ListGrid_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_ListGrid_0]: orderDetailGrid.dataLoading = true 15:16:44.228:TMR2:DEBUG:ruleContext:isc_ListGrid_0:provideRuleContext [ruleScope: isc_DataView_0, dbcID: isc_ListGrid_0]: orderDetailGrid.dataLoading = null
public Canvas setScrollbarConstructor(java.lang.String scrollbarConstructor) throws java.lang.IllegalStateException
When spriting is enabled
and supported by the skin, the default
scrollbarConstructor
is changed to a different scrollbar class which handles scrollbar spriting. Spriting
of the scrollbars of an individual component can therefore be disabled by creating the component with
scrollbarConstructor
set to the "Scrollbar" class. "Scrollbar" is a basic scrollbar class that does not
employ spriting.
Note : This is an advanced setting
scrollbarConstructor
- New scrollbarConstructor value. Default value is "Scrollbar"Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdScrolling overview and related methods
public Canvas setScrollbarSize(int scrollbarSize)
showCustomScrollbars
is true
.
NOTE: When spriting is enabled
, changing the
scrollbarSize
may cause tiling of certain images and backgrounds that make up the custom scrollbar. This
can be fixed for a component by creating it with scrollbarConstructor
set to "Scrollbar"—a basic scrollbar class that does not employ spriting.
Note : This is an advanced setting
scrollbarSize
- New scrollbarSize value. Default value is 16Canvas
instance, for chaining setter callsgetScrollbarSize()
,
Scrolling overview and related methods
public int getScrollbarSize()
showCustomScrollbars
is true
.
NOTE: When spriting is enabled
, changing the
scrollbarSize
may cause tiling of certain images and backgrounds that make up the custom scrollbar. This
can be fixed for a component by creating it with scrollbarConstructor
set to "Scrollbar"—a basic scrollbar class that does not employ spriting.
this.scrollbarSize
. Default value is 16getScrollbarSize()
,
Scrolling overview and related methods
public Canvas setShadowColor(java.lang.String shadowColor)
useCSSShadow
is
true and showShadow
is true. Has no effect if we are not
using css-based shadows - in that case, use shadowImage
instead.
Note : This is an advanced setting
public java.lang.String getShadowColor()
useCSSShadow
is
true and showShadow
is true. Has no effect if we are not
using css-based shadows - in that case, use shadowImage
instead.
CSSColor
public Canvas setShadowDepth(int shadowDepth) throws java.lang.IllegalStateException
This is a single
parameter that can be used to control both shadowSoftness
and shadowOffset
.
shadowDepth
- New shadowDepth value. Default value is 4Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic int getShadowDepth()
This is a single
parameter that can be used to control both shadowSoftness
and shadowOffset
.
public Canvas setShadowHOffset(java.lang.Integer shadowHOffset)
shadow
. Takes precedence over shadowOffset
if set. Has no effect if css-shadows
are not being used for this canvas.
Note : This is an advanced setting
shadowHOffset
- New shadowHOffset value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Integer getShadowHOffset()
shadow
. Takes precedence over shadowOffset
if set. Has no effect if css-shadows
are not being used for this canvas.public Canvas setShadowImage(java.lang.String shadowImage) throws java.lang.IllegalStateException
useCSSShadow
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. The actual image names fetched for the dropShadow combine the segment name and the shadowDepth
setting. For example, given "ds.png" as the base name, a depth of 4, and the top-left segment of the shadow, we'd use
"ds4_TL.png".
The names for segments are the same as those given for controlling resizable edges; see resizeFrom
. The center segment has the name "center". The center
segment is the only segment that doesn't include the depth in the URL, so the final image name for the center given a
baseName of "ds.png" would be just "ds_center.png".
Note : This is an advanced setting
public java.lang.String getShadowImage()
useCSSShadow
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. The actual image names fetched for the dropShadow combine the segment name and the shadowDepth
setting. For example, given "ds.png" as the base name, a depth of 4, and the top-left segment of the shadow, we'd use
"ds4_TL.png".
The names for segments are the same as those given for controlling resizable edges; see resizeFrom
. The center segment has the name "center". The center
segment is the only segment that doesn't include the depth in the URL, so the final image name for the center given a
baseName of "ds.png" would be just "ds_center.png".
SCImgURL
public Canvas setShadowOffset(java.lang.Integer shadowOffset)
shadowDepth
if unset. Because of the blurred edges, a shadow
is larger than the originating component by 2xsoftness. An shadowOffset
of 0 means that the shadow will
extend around the originating component equally in all directions.
If css shadows
are being used, separate vertical and horizontal offsets
may be specified via shadowHOffset
and shadowVOffset
.
Note : This is an advanced setting
shadowOffset
- New shadowOffset value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Integer getShadowOffset()
shadowDepth
if unset. Because of the blurred edges, a shadow
is larger than the originating component by 2xsoftness. An shadowOffset
of 0 means that the shadow will
extend around the originating component equally in all directions.
If css shadows
are being used, separate vertical and horizontal offsets
may be specified via shadowHOffset
and shadowVOffset
.
public Canvas setShadowSoftness(java.lang.Integer shadowSoftness)
A shadow with softness:x
is 2x pixels larger in each
direction than the element throwing the shadow, and the media for each edge should be x pixels wide/tall.
Defaults
to shadowDepth
if unset.
Note : This is an advanced setting
shadowSoftness
- New shadowSoftness value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Integer getShadowSoftness()
A shadow with softness:x
is 2x pixels larger in each
direction than the element throwing the shadow, and the media for each edge should be x pixels wide/tall.
Defaults
to shadowDepth
if unset.
public Canvas setShadowSpread(java.lang.Integer shadowSpread)
useCSSShadow
is true and showShadow
is true. This property
governs how much larger than the widget the shadow will appear. A negative value (coupled with an explicit offset) will
result in a smaller shadow. Has no effect if we are not using css-based shadows - in that case, use shadowImage
instead.
Note : This is an advanced setting
shadowSpread
- New shadowSpread value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Integer getShadowSpread()
useCSSShadow
is true and showShadow
is true. This property
governs how much larger than the widget the shadow will appear. A negative value (coupled with an explicit offset) will
result in a smaller shadow. Has no effect if we are not using css-based shadows - in that case, use shadowImage
instead.
public Canvas setShadowVOffset(java.lang.Integer shadowVOffset)
shadow
. Takes precedence over shadowOffset
if set. Has no effect if css-shadows
are not being used for this canvas.
Note : This is an advanced setting
shadowVOffset
- New shadowVOffset value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Integer getShadowVOffset()
shadow
. Takes precedence over shadowOffset
if set. Has no effect if css-shadows
are not being used for this canvas.public Canvas setShouldPrint(java.lang.Boolean shouldPrint)
Default is to:
PrintProperties.omitControls
) public java.lang.Boolean getShouldPrint()
Default is to:
PrintProperties.omitControls
) Printing
public Canvas setShowCustomScrollbars(boolean showCustomScrollbars) throws java.lang.IllegalStateException
Smart GWT-based scrollbars are skinnable, giving you complete control over look and
feel. Smart GWT-based scrollbars also enable some interactions not possible with
native scrollbars, such as variable height
records
in grids in combination with data paging
.
Native browser scrollbars are slightly faster simply because there are less Smart GWT components that need to be created, drawn and updated. Each visible Smart GWT-based scrollbar on the screen has roughly the impact of two StretchImgButtons.
Smart GWT is always aware of the size of the scrollbar, regardless of whether native
or custom scrollbars are used, and regardless of what operating system and/or operating
system "theme" or "skin" is in use. This means Smart GWT will correctly report the
viewport size
, that is, the interior area of the
widget excluding space taken by scrollbars, which is key for exactly filling a component
with content without creating unnecessary scrolling.
The showCustomScrollbars
setting is typically overridden in load_skin.js in
order to change the default for all Smart GWT components at once.
This may be achieved via the static setDefaultShowCustomScrollbars(boolean)
method or
calling setProperty() , like so:
Canvas canvas = new Canvas(); canvas.setProperty("showCustomScrollbars", false);
On touch devices
, custom scrollbars are disabled in favor of enabling
native touch scrolling if available. However, custom scrollbars and native touch
scrolling can be enabled for the component by setting alwaysShowScrollbars
to true
.
Note : This is an advanced setting
showCustomScrollbars
- New showCustomScrollbars value. Default value is trueCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdsetReceiveScrollbarEvents(boolean)
,
Scrolling overview and related methods
public boolean getShowCustomScrollbars()
Smart GWT-based scrollbars are skinnable, giving you complete control over look and
feel. Smart GWT-based scrollbars also enable some interactions not possible with
native scrollbars, such as variable height
records
in grids in combination with data paging
.
Native browser scrollbars are slightly faster simply because there are less Smart GWT components that need to be created, drawn and updated. Each visible Smart GWT-based scrollbar on the screen has roughly the impact of two StretchImgButtons.
Smart GWT is always aware of the size of the scrollbar, regardless of whether native
or custom scrollbars are used, and regardless of what operating system and/or operating
system "theme" or "skin" is in use. This means Smart GWT will correctly report the
viewport size
, that is, the interior area of the
widget excluding space taken by scrollbars, which is key for exactly filling a component
with content without creating unnecessary scrolling.
The showCustomScrollbars
setting is typically overridden in load_skin.js in
order to change the default for all Smart GWT components at once.
This may be achieved via the static setDefaultShowCustomScrollbars(boolean)
method or
calling setProperty() , like so:
Canvas canvas = new Canvas(); canvas.setProperty("showCustomScrollbars", false);
On touch devices
, custom scrollbars are disabled in favor of enabling
native touch scrolling if available. However, custom scrollbars and native touch
scrolling can be enabled for the component by setting alwaysShowScrollbars
to true
.
getReceiveScrollbarEvents()
,
Scrolling overview and related methods
public Canvas setShowDragShadow(java.lang.Boolean showDragShadow)
"target"
, should we show a shadow behind the canvas
during the drag.
Note : This is an advanced setting
showDragShadow
- New showDragShadow value. Default value is nullCanvas
instance, for chaining setter callsDrag and Drop
,
Drag effects Examplepublic java.lang.Boolean getShowDragShadow()
"target"
, should we show a shadow behind the canvas
during the drag.Drag and Drop
,
Drag effects Examplepublic Canvas setShowEdges(java.lang.Boolean showEdges) throws java.lang.IllegalStateException
EdgedCanvas
should be used to show image-based edges around this
component.showEdges
- New showEdges value. Default value is falseCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic java.lang.Boolean getShowEdges()
EdgedCanvas
should be used to show image-based edges around this
component.public Canvas setShowHover(java.lang.Boolean showHover)
this.canHover
is true, should we show the global hover canvas by default when the user hovers over this
canvas?showHover
- New showHover value. Default value is trueCanvas
instance, for chaining setter callsgetHoverHTML()
public java.lang.Boolean getShowHover()
this.canHover
is true, should we show the global hover canvas by default when the user hovers over this
canvas?getHoverHTML()
public Canvas setShowHoverComponents(java.lang.Boolean showHoverComponents)
getHoverComponent
to provide the Canvas to show as the
hoverComponent.
Note : This is an advanced setting
showHoverComponents
- New showHoverComponents value. Default value is falseCanvas
instance, for chaining setter callspublic java.lang.Boolean getShowHoverComponents()
getHoverComponent
to provide the Canvas to show as the
hoverComponent.public Canvas setShowPointer(java.lang.Boolean showPointer)
pointerSettings
. If a pointerTarget
is specified, showPointer
will be
enabled unless it is explicitly set to false
.
If this method is called after the component has been drawn/initialized:
Set the showPointer property.
showPointer
- New showPointer value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Boolean getShowPointer()
pointerSettings
. If a pointerTarget
is specified, showPointer
will be
enabled unless it is explicitly set to false
.
public Canvas setShowResizeBar(java.lang.Boolean showResizeBar)
Layout
, whether a resizeBar
should be shown after this member in the layout, to allow it to be resized. Whether a resizeBar is actually shown
also depends on the defaultResizeBars
attribute
of the layout, and whether this Canvas is the last layout member.
By default the resize bar acts on the Canvas that
it is declared on. If you want the resize bar to instead act on the next member of the Layout (e.g. to collapse down or
to the right), set resizeBarTarget
as well.
If this method is called after the component has been drawn/initialized:
When this Canvas is included as a member in a Layout
, dynamically updates whether a resizeBar should be shown after this member in the layout, to allow it to be resized.
Whether a resizeBar is actually shown also depends on the defaultResizeBars
attribute of the layout, and whether this Canvas is the last layout member.
showResizeBar
- setting for this.showResizeBar. Default value is falseCanvas
instance, for chaining setter callssetResizeBarTarget(java.lang.String)
,
Layout.setDefaultResizeBars(com.smartgwt.client.types.LayoutResizeBarPolicy)
,
LayoutMember overview and related methods
,
Nesting Examplepublic java.lang.Boolean getShowResizeBar()
Layout
, whether a resizeBar
should be shown after this member in the layout, to allow it to be resized. Whether a resizeBar is actually shown
also depends on the defaultResizeBars
attribute
of the layout, and whether this Canvas is the last layout member.
By default the resize bar acts on the Canvas that
it is declared on. If you want the resize bar to instead act on the next member of the Layout (e.g. to collapse down or
to the right), set resizeBarTarget
as well.
getResizeBarTarget()
,
Layout.getDefaultResizeBars()
,
LayoutMember overview and related methods
,
Nesting Examplepublic Canvas setShowShadow(java.lang.Boolean showShadow)
Shadows may be rendered using css
or via images. The appearance of shadows can be customized via
shadowColor
(for css-based shadows) or shadowImage
(for image based shadows), shadowDepth
, shadowOffset
and shadowSoftness
.
When useCSSShadow
is false, developers should be aware that the drop
shadow is rendered as a peer
and is drawn outside the specified
width and height of the widget meaning a widget with shadows takes up a little more space than it otherwise would. A
full screen canvas with showShadow set to true as this would be likely to cause browser scrollbars to appear -
developers can handle this by either setting this property to false on full-screen widgets, or by setting overflow to
"hidden" on the <body> element if browser-level scrolling is never intended to occur.
If this method is called after the component has been drawn/initialized:
Method to update showShadow
.
showShadow
- true if the shadow should be visible false if not. Default value is falseCanvas
instance, for chaining setter callspublic java.lang.Boolean getShowShadow()
Shadows may be rendered using css
or via images. The appearance of shadows can be customized via
shadowColor
(for css-based shadows) or shadowImage
(for image based shadows), shadowDepth
, shadowOffset
and shadowSoftness
.
When useCSSShadow
is false, developers should be aware that the drop
shadow is rendered as a peer
and is drawn outside the specified
width and height of the widget meaning a widget with shadows takes up a little more space than it otherwise would. A
full screen canvas with showShadow set to true as this would be likely to cause browser scrollbars to appear -
developers can handle this by either setting this property to false on full-screen widgets, or by setting overflow to
"hidden" on the <body> element if browser-level scrolling is never intended to occur.
public Canvas setShowSnapGrid(java.lang.Boolean showSnapGrid)
childrenSnapToGrid
or childrenSnapResizeToGrid
is true
. Grid
is based on snapHGap
and snapVGap
properties.
If this method is called after the component has been drawn/initialized:
Set the showSnapGrid property.
showSnapGrid
- New showSnapGrid value. Default value is nullCanvas
instance, for chaining setter callsSnapGridDragging overview and related methods
public java.lang.Boolean getShowSnapGrid()
childrenSnapToGrid
or childrenSnapResizeToGrid
is true
. SnapGridDragging overview and related methods
public Canvas setShrinkElementOnHide(boolean shrinkElementOnHide)
true
, when a widget is hidden
, the widget's handle will be resized such that it takes up no space, in
addition to having its css visibility
property set to "hidden"
. In addition to preventing
the size of this widget from impacting the scroll size
of any
parent widget while hidden, this setting works around a native bug observed in Internet Explorer 10, whereby an
<IFRAME>
element with visibility set to hidden can cause rendering problems, if the HTML loaded by
the <IFRAME>
contains a <frameset>
. In this case the browser may refuse to draw
other elements at the same coordinates with a lower z-index than the hidden frame. Setting this property to
true
works around this problem for cases where an <IFRAME>
containing a
<frameset
will be rendered out, for example in an HTMLFlow
with
contentsType
set to "page"
.
Note : This is an advanced setting
shrinkElementOnHide
- New shrinkElementOnHide value. Default value is falseCanvas
instance, for chaining setter callsVisibility overview and related methods
public boolean getShrinkElementOnHide()
true
, when a widget is hidden
, the widget's handle will be resized such that it takes up no space, in
addition to having its css visibility
property set to "hidden"
. In addition to preventing
the size of this widget from impacting the scroll size
of any
parent widget while hidden, this setting works around a native bug observed in Internet Explorer 10, whereby an
<IFRAME>
element with visibility set to hidden can cause rendering problems, if the HTML loaded by
the <IFRAME>
contains a <frameset>
. In this case the browser may refuse to draw
other elements at the same coordinates with a lower z-index than the hidden frame. Setting this property to
true
works around this problem for cases where an <IFRAME>
containing a
<frameset
will be rendered out, for example in an HTMLFlow
with
contentsType
set to "page"
.
Visibility overview and related methods
public Canvas setSizeMayChangeOnRedraw(java.lang.Boolean sizeMayChangeOnRedraw)
redraw()
on this widget will change its
size? Used by framework layout code when determining whether a component which has been marked as dirty
needs an immediate redraw to determine its drawn size.
If unset, default behavior assumes any component with overflow set to "visible" may change size on redraw, and any component with overflow set to "hidden", "scroll", or "auto" will not. This property overrides that behavior, and may be used to indicate that some component with non visible overflow can change size on redraw. An example use case would be a custom component with an override to explicitly resize the component as part of the redraw() flow.
Note : This is an advanced setting
sizeMayChangeOnRedraw
- New sizeMayChangeOnRedraw value. Default value is nullCanvas
instance, for chaining setter callspublic java.lang.Boolean getSizeMayChangeOnRedraw()
redraw()
on this widget will change its
size? Used by framework layout code when determining whether a component which has been marked as dirty
needs an immediate redraw to determine its drawn size.
If unset, default behavior assumes any component with overflow set to "visible" may change size on redraw, and any component with overflow set to "hidden", "scroll", or "auto" will not. This property overrides that behavior, and may be used to indicate that some component with non visible overflow can change size on redraw. An example use case would be a custom component with an override to explicitly resize the component as part of the redraw() flow.
public Canvas setSkinImgDir(java.lang.String skinImgDir)
skinDir
.
Note : This is an advanced setting
skinImgDir
- New skinImgDir value. Default value is "images/"Canvas
instance, for chaining setter callsSCImgURL
,
Images overview and related methods
public java.lang.String getSkinImgDir()
skinDir
.SCImgURL
,
Images overview and related methods
public Canvas setSnapAlignCandidates(Canvas... snapAlignCandidates)
childrenSnapAlign
is enabled, list of candidates to
check for alignment. If a list of snapAlignCandidates
is never provided, the default is to use all
children that are not explicitly excluded via isSnapAlignCandidate
, including automatically adding newly added children as candidates, and ignoring children that
have been removed. Use addSnapAlignCandidate()
and
removeSnapAlignCandidate()
to add and remove special
candidates while retaining all children as default candidates.
Possible candidates which are not drawn or are hidden are automatically ignored.
snapAlignCandidates
- New snapAlignCandidates value. Default value is nullCanvas
instance, for chaining setter callsSnapGridDragging overview and related methods
public Canvas[] getSnapAlignCandidates()
childrenSnapAlign
is enabled, list of candidates to
check for alignment. If a list of snapAlignCandidates
is never provided, the default is to use all
children that are not explicitly excluded via isSnapAlignCandidate
, including automatically adding newly added children as candidates, and ignoring children that
have been removed. Use addSnapAlignCandidate()
and
removeSnapAlignCandidate()
to add and remove special
candidates while retaining all children as default candidates.
Possible candidates which are not drawn or are hidden are automatically ignored.
SnapGridDragging overview and related methods
public Canvas setSnapAlignCenterLineStyle(java.lang.String snapAlignCenterLineStyle) throws java.lang.IllegalStateException
childrenSnapAlign
is set.snapAlignCenterLineStyle
- New snapAlignCenterLineStyle value. Default value is "1px solid blue"Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdSnapGridDragging overview and related methods
public java.lang.String getSnapAlignCenterLineStyle()
childrenSnapAlign
is set.SnapGridDragging overview and related methods
public Canvas setSnapAlignEdgeLineStyle(java.lang.String snapAlignEdgeLineStyle) throws java.lang.IllegalStateException
childrenSnapAlign
is set.snapAlignEdgeLineStyle
- New snapAlignEdgeLineStyle value. Default value is "1px solid #555555"Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdSnapGridDragging overview and related methods
public java.lang.String getSnapAlignEdgeLineStyle()
childrenSnapAlign
is set.SnapGridDragging overview and related methods
public Canvas setSnapAxis(java.lang.String snapAxis)
snapAxis
- New snapAxis value. Default value is "both"Canvas
instance, for chaining setter callssetSnapToGrid(java.lang.Boolean)
,
setSnapResizeToGrid(java.lang.Boolean)
,
setChildrenSnapToGrid(java.lang.Boolean)
,
setChildrenSnapResizeToGrid(java.lang.Boolean)
,
SnapGridDragging overview and related methods
public java.lang.String getSnapAxis()
getSnapToGrid()
,
getSnapResizeToGrid()
,
getChildrenSnapToGrid()
,
getChildrenSnapResizeToGrid()
,
SnapGridDragging overview and related methods
public Canvas setSnapEdge(java.lang.String snapEdge)
snapTo
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. If unspecified the,
default snapTo behavior is set up to align the "snapTo" edge of this widget with the snapTo edge of the master or
parent.
If this method is called after the component has been drawn/initialized:
Set the snapEdge property of this canvas, and handle repositioning.
snapEdge
- new snapEdge value. Default value is nullCanvas
instance, for chaining setter callssetSnapTo(java.lang.String)
,
SnapPositioning overview and related methods
public java.lang.String getSnapEdge()
snapTo
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. If unspecified the, default snapTo behavior is set up to align the "snapTo" edge of this widget with the snapTo edge of the master or parent.
getSnapTo()
,
SnapPositioning overview and related methods
public Canvas setSnapGridLineProperties(DrawLine snapGridLineProperties) throws java.lang.IllegalStateException
SnapGridStyle
:
"lines".snapGridLineProperties
- New snapGridLineProperties value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdSnapGridDragging overview and related methods
,
SGWTProperties
public DrawLine getSnapGridLineProperties()
SnapGridStyle
:
"lines".SnapGridDragging overview and related methods
public Canvas setSnapGridStyle(SnapGridStyle snapGridStyle) throws java.lang.IllegalStateException
snapGridLineProperties
.snapGridStyle
- New snapGridStyle value. Default value is "crosses"Canvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdSnapGridDragging overview and related methods
public SnapGridStyle getSnapGridStyle()
snapGridLineProperties
.SnapGridDragging overview and related methods
public Canvas setSnapHDirection(java.lang.String snapHDirection)
snapHDirection
- New snapHDirection value. Default value is "after"Canvas
instance, for chaining setter callssetSnapToGrid(java.lang.Boolean)
,
setSnapResizeToGrid(java.lang.Boolean)
,
setChildrenSnapToGrid(java.lang.Boolean)
,
setChildrenSnapResizeToGrid(java.lang.Boolean)
,
SnapGridDragging overview and related methods
public java.lang.String getSnapHDirection()
getSnapToGrid()
,
getSnapResizeToGrid()
,
getChildrenSnapToGrid()
,
getChildrenSnapResizeToGrid()
,
SnapGridDragging overview and related methods
public Canvas setSnapHGap(int snapHGap)
snapHGap
- New snapHGap value. Default value is 20Canvas
instance, for chaining setter callssetSnapToGrid(java.lang.Boolean)
,
setSnapResizeToGrid(java.lang.Boolean)
,
setChildrenSnapToGrid(java.lang.Boolean)
,
setChildrenSnapResizeToGrid(java.lang.Boolean)
,
SnapGridDragging overview and related methods
public int getSnapHGap()
getSnapToGrid()
,
getSnapResizeToGrid()
,
getChildrenSnapToGrid()
,
getChildrenSnapResizeToGrid()
,
SnapGridDragging overview and related methods
public Canvas setSnapOffsetLeft(java.lang.Integer snapOffsetLeft)
snapTo
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. For example if snapTo
is
specified as "L"
and snapOffsetLeft
is set to 6, this widget will be rendered 6px inside the
left edge of its parent or master element. Alternatively if snapTo
was set to "R"
, a
snapOffsetLeft
value of -6 would cause the component to be rendered 6px inside the right edge of its parent
or master canvas
.
If this method is called after the component has been drawn/initialized:
Setter for snapOffsetLeft
.
snapOffsetLeft
- new snapOffsetLeft value. Default value is nullCanvas
instance, for chaining setter callssetSnapTo(java.lang.String)
,
SnapPositioning overview and related methods
public java.lang.Integer getSnapOffsetLeft()
snapTo
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. For example if snapTo
is
specified as "L"
and snapOffsetLeft
is set to 6, this widget will be rendered 6px inside the
left edge of its parent or master element. Alternatively if snapTo
was set to "R"
, a
snapOffsetLeft
value of -6 would cause the component to be rendered 6px inside the right edge of its parent
or master canvas
.
getSnapTo()
,
SnapPositioning overview and related methods
public Canvas setSnapOffsetTop(java.lang.Integer snapOffsetTop)
snapTo
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. For example if snapTo
is
specified as "T"
and snapOffsetTop
is set to 6, this widget will be rendered 6px below the top
edge of its parent or master element. Alternatively if snapTo
was set to "B"
, a
snapOffsetTop
value of -6 would cause the component to be rendered 6px inside the bottom edge of its parent
or master canvas
.
If this method is called after the component has been drawn/initialized:
Setter for snapOffsetTop
.
snapOffsetTop
- new snapOffsetTop value. Default value is nullCanvas
instance, for chaining setter callssetSnapTo(java.lang.String)
,
SnapPositioning overview and related methods
public java.lang.Integer getSnapOffsetTop()
snapTo
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. For example if snapTo
is
specified as "T"
and snapOffsetTop
is set to 6, this widget will be rendered 6px below the top
edge of its parent or master element. Alternatively if snapTo
was set to "B"
, a
snapOffsetTop
value of -6 would cause the component to be rendered 6px inside the bottom edge of its parent
or master canvas
.
getSnapTo()
,
SnapPositioning overview and related methods
public Canvas setSnapOnDrop(java.lang.Boolean snapOnDrop)
Note : This is an advanced setting
snapOnDrop
- New snapOnDrop value. Default value is trueCanvas
instance, for chaining setter callssetSnapToGrid(java.lang.Boolean)
,
com.smartgwt.client.widgets.Canvas#shouldSnapOnDrop
,
SnapGridDragging overview and related methods
public java.lang.Boolean getSnapOnDrop()
getSnapToGrid()
,
com.smartgwt.client.widgets.Canvas#shouldSnapOnDrop
,
SnapGridDragging overview and related methods
public Canvas setSnapResizeToAlign(java.lang.Boolean snapResizeToAlign)
To control snapping to align for the children
resized within this Canvas, see childrenResizeSnapAlign
instead.
snapResizeToAlign
- New snapResizeToAlign value. Default value is nullCanvas
instance, for chaining setter callsSnapGridDragging overview and related methods
public java.lang.Boolean getSnapResizeToAlign()
To control snapping to align for the children
resized within this Canvas, see childrenResizeSnapAlign
instead.
SnapGridDragging overview and related methods
public Canvas setSnapResizeToGrid(java.lang.Boolean snapResizeToGrid)
snapToGrid
value if undefined.snapResizeToGrid
- New snapResizeToGrid value. Default value is nullCanvas
instance, for chaining setter callsSnapGridDragging overview and related methods
public java.lang.Boolean getSnapResizeToGrid()
snapToGrid
value if undefined.SnapGridDragging overview and related methods
public Canvas setSnapTo(java.lang.String snapTo)
master
(if specified), or its parent canvas
. Note that this property also impacts the sizing
of this widget. If this widgets size is specified as a percent value, and has no explicit percentSource
, sizing will be calculated based on the size of the
master canvas
when snapTo is set.
Possible values: BR, BL, TR, TL, R, L, B, T, C where B=Bottom, T=Top, L=Left, R=right and C=center
Standard snapTo behavior will attach
the outer edge of the widget to the parent or master element - for example setting snapTo
to
"B"
would align the bottom edge of this component with the bottom edge of the master or parent element (and
center this component horizontally over its master or parent element). snapEdge
can be specified to change this behavior allowing the developer
to, for example, align the top edge of this component with the bottom edge of its master canvas
.
snapOffsetLeft
and snapOffsetTop
may also be specified to offset the element from
exact snapTo alignment.
If this method is called after the component has been drawn/initialized:
Set the snapTo property of this canvas, and handle repositioning.
snapTo
- new snapTo value. Default value is nullCanvas
instance, for chaining setter callssetSnapEdge(java.lang.String)
,
setPercentBox(com.smartgwt.client.types.PercentBoxModel)
,
SnapPositioning overview and related methods
public java.lang.String getSnapTo()
master
(if specified), or its parent canvas
. Note that this property also impacts the sizing
of this widget. If this widgets size is specified as a percent value, and has no explicit percentSource
, sizing will be calculated based on the size of the
master canvas
when snapTo is set.
Possible values: BR, BL, TR, TL, R, L, B, T, C where B=Bottom, T=Top, L=Left, R=right and C=center
Standard snapTo behavior will attach
the outer edge of the widget to the parent or master element - for example setting snapTo
to
"B"
would align the bottom edge of this component with the bottom edge of the master or parent element (and
center this component horizontally over its master or parent element). snapEdge
can be specified to change this behavior allowing the developer
to, for example, align the top edge of this component with the bottom edge of its master canvas
.
snapOffsetLeft
and snapOffsetTop
may also be specified to offset the element from
exact snapTo alignment.
getSnapEdge()
,
getPercentBox()
,
SnapPositioning overview and related methods
public Canvas setSnapToAlign(java.lang.Boolean snapToAlign)
childrenSnapAlign
is enabled on this Canvas' parent. To
control snapping to align for the children dragged within this Canvas, see childrenSnapAlign
instead.
snapToAlign
- New snapToAlign value. Default value is nullCanvas
instance, for chaining setter callsSnapGridDragging overview and related methods
public java.lang.Boolean getSnapToAlign()
childrenSnapAlign
is enabled on this Canvas' parent. To
control snapping to align for the children dragged within this Canvas, see childrenSnapAlign
instead.
SnapGridDragging overview and related methods
public Canvas setSnapToCenterAlign(java.lang.Boolean snapToCenterAlign)
childrenSnapAlign
is enabled on this Canvas' parent.snapToCenterAlign
- New snapToCenterAlign value. Default value is nullCanvas
instance, for chaining setter callsSnapGridDragging overview and related methods
public java.lang.Boolean getSnapToCenterAlign()
childrenSnapAlign
is enabled on this Canvas' parent.SnapGridDragging overview and related methods
public Canvas setSnapToEdgeAlign(java.lang.Boolean snapToEdgeAlign)
childrenSnapAlign
is enabled on this Canvas' parent.snapToEdgeAlign
- New snapToEdgeAlign value. Default value is nullCanvas
instance, for chaining setter callsSnapGridDragging overview and related methods
public java.lang.Boolean getSnapToEdgeAlign()
childrenSnapAlign
is enabled on this Canvas' parent.SnapGridDragging overview and related methods
public Canvas setSnapToGrid(java.lang.Boolean snapToGrid)
snapToGrid
- New snapToGrid value. Default value is nullCanvas
instance, for chaining setter callssetChildrenSnapToGrid(java.lang.Boolean)
,
SnapGridDragging overview and related methods
public java.lang.Boolean getSnapToGrid()
getChildrenSnapToGrid()
,
SnapGridDragging overview and related methods
public Canvas setSnapVDirection(java.lang.String snapVDirection)
snapVDirection
- New snapVDirection value. Default value is "after"Canvas
instance, for chaining setter callssetSnapToGrid(java.lang.Boolean)
,
setSnapResizeToGrid(java.lang.Boolean)
,
setChildrenSnapToGrid(java.lang.Boolean)
,
setChildrenSnapResizeToGrid(java.lang.Boolean)
,
SnapGridDragging overview and related methods
public java.lang.String getSnapVDirection()
getSnapToGrid()
,
getSnapResizeToGrid()
,
getChildrenSnapToGrid()
,
getChildrenSnapResizeToGrid()
,
SnapGridDragging overview and related methods
public Canvas setSnapVGap(int snapVGap)
snapVGap
- New snapVGap value. Default value is 20Canvas
instance, for chaining setter callssetSnapToGrid(java.lang.Boolean)
,
setSnapResizeToGrid(java.lang.Boolean)
,
setChildrenSnapToGrid(java.lang.Boolean)
,
setChildrenSnapResizeToGrid(java.lang.Boolean)
,
SnapGridDragging overview and related methods
public int getSnapVGap()
getSnapToGrid()
,
getSnapResizeToGrid()
,
getChildrenSnapToGrid()
,
getChildrenSnapResizeToGrid()
,
SnapGridDragging overview and related methods
public Canvas setStartLine(java.lang.Boolean startLine)
FlowLayout
. This property is not supported in a TileLayout
with TileLayout.layoutPolicy
: "fit" or if databound (i.e. for a TileGrid
).startLine
- New startLine value. Default value is falseCanvas
instance, for chaining setter callsTileLayout.setAutoWrapLines(java.lang.Boolean)
public java.lang.Boolean getStartLine()
FlowLayout
. This property is not supported in a TileLayout
with TileLayout.layoutPolicy
: "fit" or if databound (i.e. for a TileGrid
).TileLayout.getAutoWrapLines()
public void setStyleName(java.lang.String styleName)
setStyleName
in class com.google.gwt.user.client.ui.UIObject
styleName
- new CSS style name. Default value is "normal"CSSStyleName
,
Appearance overview and related methods
,
CSS styles Examplepublic java.lang.String getStyleName()
getStyleName
in class com.google.gwt.user.client.ui.UIObject
CSSStyleName
,
Appearance overview and related methods
,
CSS styles Examplepublic Canvas setTabIndex(java.lang.Integer tabIndex)
-1
will
ensure the canvas does not show up in the page's tab order, though if canFocus
is true, the user may still give it keyboard focus by clicking
on the widget directly. By default Smart GWT auto-assigns tab-indices, ensuring focusable widgets are reachable by tabbing in an intuitive order based on widget hierarchy and draw order. Specifying an explicit tab index means a widget will not participate in this automatic tab position allocation and is typically not recommended except for very simple cases.
For more information on automatic tab index assignment, including recommended approaches for customizing tab
order assignation, see the TabOrderOverview
. Developers may call clearExplicitTabIndex()
to clear any explicitly assigned tab
index, and have the widget participate in automatic tab position allocation.
canvas.tabIndex
cannot be
set to greater than TAB_INDEX_FLOOR
- as we reserve the
values above this range for auto-assigned tab-indices.
If this method is called after the component has been drawn/initialized:
Assign an explicit tabIndex
to this widget at runtime.
Developers may also call clearExplicitTabIndex()
to clear any explicitly assigned tab index, and have the widget participate in automatic tab position allocation. For more information see tabIndex
Note : This is an advanced setting
public java.lang.Integer getTabIndex()
-1
will
ensure the canvas does not show up in the page's tab order, though if canFocus
is true, the user may still give it keyboard focus by clicking
on the widget directly. By default Smart GWT auto-assigns tab-indices, ensuring focusable widgets are reachable by tabbing in an intuitive order based on widget hierarchy and draw order. Specifying an explicit tab index means a widget will not participate in this automatic tab position allocation and is typically not recommended except for very simple cases.
For more information on automatic tab index assignment, including recommended approaches for customizing tab
order assignation, see the TabOrderOverview
. Developers may call clearExplicitTabIndex()
to clear any explicitly assigned tab
index, and have the widget participate in automatic tab position allocation.
canvas.tabIndex
cannot be
set to greater than TAB_INDEX_FLOOR
- as we reserve the
values above this range for auto-assigned tab-indices.
Focus
public Canvas setTestDataContext(DataContext testDataContext) throws java.lang.IllegalStateException
DataContext
to be used if no dataContext
is provided (directly or indirectly via a parent). If a
DataContext is provided it completely replaces the testDataContext
. DataSources included in the
testDataContext
are immediately provided to rule
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 in testDataContext
) so they do not
conflict with normal DataSource records.
testDataContext
- New testDataContext value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdDataContext
public DataContext getTestDataContext()
DataContext
to be used if no dataContext
is provided (directly or indirectly via a parent). If a
DataContext is provided it completely replaces the testDataContext
. DataSources included in the
testDataContext
are immediately provided to rule
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 in testDataContext
) so they do not
conflict with normal DataSource records.
DataContext
public Canvas setTop(int top)
position
property). Can also be set as a percentage, specified as a String ending in '%', eg, "50%". In this case
the top coordinate is considered as a percentage of the specified height of the parent
.
If this method is called after the component has been drawn/initialized:
Set the top coordinate of this object, relative to its enclosing context, in pixels.
NOTE: if you're setting multiple coordinates, use setRect() or moveTo() instead
top
- new top coordinate. Default value is 0Canvas
instance, for chaining setter callsPositioning overview and related methods
public int getTop()
position
property). Can also be set as a percentage, specified as a String ending in '%', eg, "50%". In this case
the top coordinate is considered as a percentage of the specified height of the parent
.
Positioning overview and related methods
public Canvas setTop(java.lang.String top)
position
property). Can also be set as a percentage, specified as a String ending in '%', eg, "50%". In this case
the top coordinate is considered as a percentage of the specified height of the parent
.
If this method is called after the component has been drawn/initialized:
Set the top coordinate of this object, relative to its enclosing context, in pixels.
NOTE: if you're setting multiple coordinates, use setRect() or moveTo() instead
top
- new top coordinate. Default value is 0Canvas
instance, for chaining setter callsPositioning overview and related methods
public Canvas getTopElement() throws java.lang.IllegalStateException
Note : This method should be called only after the widget has been rendered.
java.lang.IllegalStateException
- if this widget has not yet been rendered.Component Containment and Hierarchy
public Canvas setUpdateTabPositionOnDraw(boolean updateTabPositionOnDraw)
parent canvas
be moved to the end of
the TabIndexManager tree on draw()? If set to false, the tab-position will not be modified on draw.
This property is useful for cases where the tab position of a widget will be managed by some explicit tabIndex management code.
Note : This is an advanced setting
updateTabPositionOnDraw
- New updateTabPositionOnDraw value. Default value is trueCanvas
instance, for chaining setter callspublic boolean getUpdateTabPositionOnDraw()
parent canvas
be moved to the end of
the TabIndexManager tree on draw()? If set to false, the tab-position will not be modified on draw.
This property is useful for cases where the tab position of a widget will be managed by some explicit tabIndex management code.
public Canvas setUpdateTabPositionOnReparent(boolean updateTabPositionOnReparent)
parent canvas
be added to the
TabIndexManager under the parent as described in updateChildTabPositions()
and updateChildTabPosition()
? If set to false, the tab-position will not be modified on parent change.
This
property is useful for cases where the tab position of a widget will be managed by something other than the parent
canvas, for example for canvasItem canvases
.
If this method is called after the component has been drawn/initialized:
Setter for the updateTabPositionOnReparent
attribute.
Note : This is an advanced setting
updateTabPositionOnReparent
- new value for canvas.updateTabPositionOnReparent. Default value is trueCanvas
instance, for chaining setter callspublic boolean getUpdateTabPositionOnReparent()
parent canvas
be added to the
TabIndexManager under the parent as described in updateChildTabPositions()
and updateChildTabPosition()
? If set to false, the tab-position will not be modified on parent change.
This
property is useful for cases where the tab position of a widget will be managed by something other than the parent
canvas, for example for canvasItem canvases
.
public Canvas setUseBackMask(java.lang.Boolean useBackMask)
The backMask is a workaround for this issue. If useBackMask
is set to
true
, the component will render an empty <IFRAME> element behind the canvas, which prevents this
effect in all known cases.
Has no effect in other browsers.
Note : This is an advanced setting
useBackMask
- New useBackMask value. Default value is falseCanvas
instance, for chaining setter callspublic java.lang.Boolean getUseBackMask()
The backMask is a workaround for this issue. If useBackMask
is set to
true
, the component will render an empty <IFRAME> element behind the canvas, which prevents this
effect in all known cases.
Has no effect in other browsers.
public Canvas setUseCSSShadow(boolean useCSSShadow) throws java.lang.IllegalStateException
showShadow
is true, should we use the css
box-shadow
property (where supported) to achieve the shadow? Set this property to false to switch to a
media-based approach, achieved by rendering the shadowImage
in
an automatically generated peer. This approach is also used regardless of this property value in older browsers where
the css box-shadow
property isn't supported.
See also shadowColor
, shadowDepth
, shadowOffset
, shadowSoftness
and shadowSpread
Note : This is an advanced setting
useCSSShadow
- New useCSSShadow value. Default value is trueCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic boolean getUseCSSShadow()
showShadow
is true, should we use the css
box-shadow
property (where supported) to achieve the shadow? Set this property to false to switch to a
media-based approach, achieved by rendering the shadowImage
in
an automatically generated peer. This approach is also used regardless of this property value in older browsers where
the css box-shadow
property isn't supported.
See also shadowColor
, shadowDepth
, shadowOffset
, shadowSoftness
and shadowSpread
public Canvas setUseDragMask(boolean useDragMask)
Note that this property will be defaulted to false unless the canvas contains an IFrame, in which case it will be defaulted to true.
The dragMaskType
property controls what kind of
mask is used in case useDragMask is enabled.
useDragMask
- New useDragMask value. Default value is falseCanvas
instance, for chaining setter callsDrag and Drop
public boolean getUseDragMask()
Note that this property will be defaulted to false unless the canvas contains an IFrame, in which case it will be defaulted to true.
The dragMaskType
property controls what kind of
mask is used in case useDragMask is enabled.
Drag and Drop
public Canvas setUseImageForSVG(boolean useImageForSVG) throws java.lang.IllegalStateException
Img
or ImgButton
, or the icon of a Button
. Rendering via
object tag provides the maximum support for CSS in SVG, but may result in a flicker at the browser level when changing
images - either manually such as with setImage()
or via state change
from rollover, mouseDown, etc. Using image tags to inline the images breaks CSS support but may avoid flickering.
If this property is not set, then you can also control whether an SVG image is rendered in an object or image tag
by setting the query param "tag" on the image URL - see SCImgURL
for details.
Note
that if multiple icons are potentially present in a canvas (e.g. removeIcons
in the cells of a grid body), then setting this
property on the widget instance may have no effect. In such case, the Canvas
prototype is consulted.
Note : This is an advanced setting
useImageForSVG
- New useImageForSVG value. Default value is falseCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdImg.setSrc(java.lang.String)
,
Button.setIcon(java.lang.String)
,
setForwardSVGeventsToObject(java.lang.Boolean)
,
Images overview and related methods
public boolean getUseImageForSVG()
Img
or ImgButton
, or the icon of a Button
. Rendering via
object tag provides the maximum support for CSS in SVG, but may result in a flicker at the browser level when changing
images - either manually such as with setImage()
or via state change
from rollover, mouseDown, etc. Using image tags to inline the images breaks CSS support but may avoid flickering.
If this property is not set, then you can also control whether an SVG image is rendered in an object or image tag
by setting the query param "tag" on the image URL - see SCImgURL
for details.
Note
that if multiple icons are potentially present in a canvas (e.g. removeIcons
in the cells of a grid body), then setting this
property on the widget instance may have no effect. In such case, the Canvas
prototype is consulted.
Img.getSrc()
,
Button.getIcon()
,
getForwardSVGeventsToObject()
,
Images overview and related methods
public Canvas setUseNativeDrag(java.lang.Boolean useNativeDrag) throws java.lang.IllegalStateException
When using native HTML5
drags, the same series of events fires as for a normal drag (Canvas.dragStart()
, Canvas.dropMove()
, etc.), and the dragType
/ dropTypes
system works. dragAppearance
is not supported;
however, basic customization of the browser's tracker image is supported in certain browsers via the EventHandler.setDragTrackerImage()
API.
The primary difference with a native drag is that it can be cross-frame; that is, the user can drag out of the current browser window and drop into a different window or tab.
To provide information that will be available to a foreign frame,
use EventHandler.setNativeDragData()
. This API must be
called when the Canvas.dragStart()
event fires, and will
not work if called at any other time.
However, due to browser bugs and/or browser-imposed limitations, the
information provided to setNativeDragData
cannot be accessed in the foreign frame until the actual drop
occurs (mouse button released). This means drop eligibility cannot be determined dynamically based on the dragged data;
instead, eligibility can only be determined based on the dragType
/ dropTypes
system. For this reason, a dragType
must be set on the source of a drag.
NOTE: Although Internet Explorer 10+ supports a subset of the HTML5 drag and drop standard, native drag and drop is disabled in IE (and Microsoft Edge Legacy) because cross-window drags—the primary purpose of this API—are not possible.
useNativeDrag
- New useNativeDrag value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdDrag and Drop
,
Native Drag Create Examplepublic java.lang.Boolean getUseNativeDrag()
When using native HTML5
drags, the same series of events fires as for a normal drag (Canvas.dragStart()
, Canvas.dropMove()
, etc.), and the dragType
/ dropTypes
system works. dragAppearance
is not supported;
however, basic customization of the browser's tracker image is supported in certain browsers via the EventHandler.setDragTrackerImage()
API.
The primary difference with a native drag is that it can be cross-frame; that is, the user can drag out of the current browser window and drop into a different window or tab.
To provide information that will be available to a foreign frame,
use EventHandler.setNativeDragData()
. This API must be
called when the Canvas.dragStart()
event fires, and will
not work if called at any other time.
However, due to browser bugs and/or browser-imposed limitations, the
information provided to setNativeDragData
cannot be accessed in the foreign frame until the actual drop
occurs (mouse button released). This means drop eligibility cannot be determined dynamically based on the dragged data;
instead, eligibility can only be determined based on the dragType
/ dropTypes
system. For this reason, a dragType
must be set on the source of a drag.
NOTE: Although Internet Explorer 10+ supports a subset of the HTML5 drag and drop standard, native drag and drop is disabled in IE (and Microsoft Edge Legacy) because cross-window drags—the primary purpose of this API—are not possible.
Drag and Drop
,
Native Drag Create Examplepublic Canvas setUseOpacityFilter(java.lang.Boolean useOpacityFilter) throws java.lang.IllegalStateException
With the default of null, opacity filters are used unless
neverUseFilters
has been set. When set explicitly to true,
opacity filters are used even if neverUseFilters
is true.
See IEFilters
for background.
useOpacityFilter
- New useOpacityFilter value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdInternet Explorer "filter" effects
public java.lang.Boolean getUseOpacityFilter()
With the default of null, opacity filters are used unless
neverUseFilters
has been set. When set explicitly to true,
opacity filters are used even if neverUseFilters
is true.
See IEFilters
for background.
Internet Explorer "filter" effects
public Canvas setUseTouchScrolling(java.lang.Boolean useTouchScrolling) throws java.lang.IllegalStateException
touch devices
, if this Canvas
can be scrolled, should
touch-dragging the content area result in scrolling? Set to false
if touch-dragging should not cause
scrolling. Note that setting to false
enables the use of custom scrollbars
on touch devices.
useTouchScrolling
can default to false
if disableTouchScrollingForDrag
is true
and various built-in drag operations are enabled that normally interfere with touch scrolling (e.g. ListGrid.canDragSelect
and ListGrid.canReorderRecords
).
When touch scrolling is
disabled, it can be difficult to interact with parts of the custom scrollbars at their default size of 16 pixels. In
touch browsers, any touch 8px before the thumb of a custom scrollbar
will
be mapped to the thumb, but the other parts of the scrollbar do not have a similar tolerance applied. The width of the
custom scrollbars can be increased by setting the scrollbarSize
to a larger value, but note that when spriting is enabled
,
changing the scrollbarSize
may cause tiling of certain images and backgrounds that make up the custom
scrollbar. This can be fixed for a component by creating it with scrollbarConstructor
set to "Scrollbar"—a basic
scrollbar class that does not employ spriting.
Note : This is an advanced setting
useTouchScrolling
- New useTouchScrolling value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdScrolling overview and related methods
public java.lang.Boolean getUseTouchScrolling()
touch devices
, if this Canvas
can be scrolled, should
touch-dragging the content area result in scrolling? Set to false
if touch-dragging should not cause
scrolling. Note that setting to false
enables the use of custom scrollbars
on touch devices.
useTouchScrolling
can default to false
if disableTouchScrollingForDrag
is true
and various built-in drag operations are enabled that normally interfere with touch scrolling (e.g. ListGrid.canDragSelect
and ListGrid.canReorderRecords
).
When touch scrolling is
disabled, it can be difficult to interact with parts of the custom scrollbars at their default size of 16 pixels. In
touch browsers, any touch 8px before the thumb of a custom scrollbar
will
be mapped to the thumb, but the other parts of the scrollbar do not have a similar tolerance applied. The width of the
custom scrollbars can be increased by setting the scrollbarSize
to a larger value, but note that when spriting is enabled
,
changing the scrollbarSize
may cause tiling of certain images and backgrounds that make up the custom
scrollbar. This can be fixed for a component by creating it with scrollbarConstructor
set to "Scrollbar"—a basic
scrollbar class that does not employ spriting.
Scrolling overview and related methods
public Canvas setValuesManager(ValuesManager valuesManager)
ValuesManager
for managing values displayed in this component. If specified at
initialization time, this component will be added to the valuesManager via ValuesManager.addMember()
. ValuesManagers allow different fields of a single object to be displayed or edited across multiple UI components. Given a single values object, a valuesManager will handle determining the appropriate field values for its member components and displaying them / responding to edits if the components support this.
Data may be derived simply from the specified fieldNames within
the member components, or for complex nested data structures can be specified by both component and field-level DataPath
.
Note that components may be automatically bound to an existing valuesManager
attached to a parent component if dataPath is specified. See dataPath
for more information. Also note that if a databound component has a specified dataSource and dataPath but no
specified valuesManager object one will be automatically generated as part of the databinding process
If this method is called after the component has been drawn/initialized:
Setter for the valuesManager
attribute. This method may be called directly at runtime to set the ValuesManager for a component; it has the same effect as calling ValuesManager.addMember()
, passing in this DataBoundComponent.
Note : This is an advanced setting
valuesManager
- new dataPath. Default value is nullCanvas
instance, for chaining setter callspublic ValuesManager getValuesManager()
ValuesManager
for managing values displayed in this component. If specified at
initialization time, this component will be added to the valuesManager via ValuesManager.addMember()
. ValuesManagers allow different fields of a single object to be displayed or edited across multiple UI components. Given a single values object, a valuesManager will handle determining the appropriate field values for its member components and displaying them / responding to edits if the components support this.
Data may be derived simply from the specified fieldNames within
the member components, or for complex nested data structures can be specified by both component and field-level DataPath
.
Note that components may be automatically bound to an existing valuesManager
attached to a parent component if dataPath is specified. See dataPath
for more information. Also note that if a databound component has a specified dataSource and dataPath but no
specified valuesManager object one will be automatically generated as part of the databinding process
public Canvas setValuesManager(java.lang.String valuesManager)
ValuesManager
for managing values displayed in this component. If specified at
initialization time, this component will be added to the valuesManager via ValuesManager.addMember()
. ValuesManagers allow different fields of a single object to be displayed or edited across multiple UI components. Given a single values object, a valuesManager will handle determining the appropriate field values for its member components and displaying them / responding to edits if the components support this.
Data may be derived simply from the specified fieldNames within
the member components, or for complex nested data structures can be specified by both component and field-level DataPath
.
Note that components may be automatically bound to an existing valuesManager
attached to a parent component if dataPath is specified. See dataPath
for more information. Also note that if a databound component has a specified dataSource and dataPath but no
specified valuesManager object one will be automatically generated as part of the databinding process
If this method is called after the component has been drawn/initialized:
Setter for the valuesManager
attribute. This method may be called directly at runtime to set the ValuesManager for a component; it has the same effect as calling ValuesManager.addMember()
, passing in this DataBoundComponent.
Note : This is an advanced setting
public java.lang.String getValuesManagerAsString()
ValuesManager
for managing values displayed in this component. If specified at
initialization time, this component will be added to the valuesManager via ValuesManager.addMember()
. ValuesManagers allow different fields of a single object to be displayed or edited across multiple UI components. Given a single values object, a valuesManager will handle determining the appropriate field values for its member components and displaying them / responding to edits if the components support this.
Data may be derived simply from the specified fieldNames within
the member components, or for complex nested data structures can be specified by both component and field-level DataPath
.
Note that components may be automatically bound to an existing valuesManager
attached to a parent component if dataPath is specified. See dataPath
for more information. Also note that if a databound component has a specified dataSource and dataPath but no
specified valuesManager object one will be automatically generated as part of the databinding process
GlobalId
public Canvas setVisibility(Visibility visibility)
Visibility
type for
details. Specifying "visible" sets the CSS visiblity to "visible", forcing a child to be visible even if the parent is hidden. Not supported for use with Smart GWT layouts, scrolling or auto-sizing but may be useful when working with third-party or legacy DOM layout systems.
Note that if hideUsingDisplayNone
is set for a hidden ancestor, setting
visibility
will have no effect at all until that ancestor becomes visible.
If this method is called after the component has been drawn/initialized:
Sets this widget's visibility to "inherit", so that it becomes visible if all of its parents are visible or it has no parents.
If the widget has not yet been drawn (and doesn't have a parent or master), this method calls the draw method as well.
visibility
- New visibility value. Default value is Canvas.INHERITCanvas
instance, for chaining setter callsAppearance overview and related methods
public Visibility getVisibility()
Visibility
type for
details. Specifying "visible" sets the CSS visiblity to "visible", forcing a child to be visible even if the parent is hidden. Not supported for use with Smart GWT layouts, scrolling or auto-sizing but may be useful when working with third-party or legacy DOM layout systems.
Note that if hideUsingDisplayNone
is set for a hidden ancestor, setting
visibility
will have no effect at all until that ancestor becomes visible.
NOTE: Undrawn widgets will report themselves as visible if they would be visible if drawn. Default value is Canvas.INHERIT
Appearance overview and related methods
public Canvas setVisibleWhen(AdvancedCriteria visibleWhen) throws java.lang.IllegalStateException
ruleScope
changes. A basic criteria uses textMatchStyle:"exact".
When specified in Component XML
this property allows shorthand formats
for defining criteria.
visibleWhen
- New visibleWhen value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdDynamic Rules
public AdvancedCriteria getVisibleWhen()
ruleScope
changes. A basic criteria uses textMatchStyle:"exact".
When specified in Component XML
this property allows shorthand formats
for defining criteria.
Dynamic Rules
public Canvas setWidth(java.lang.Integer width)
canvas.width
attribute specifies the size for a component's horizontal dimension;
canvas.height
specifies the size for the vertical dimension. May be set to an integer value (a number of pixels), a percentage value like "50%", or "*".
See PercentSizing
for details
on how percentage or "*"
values are resolved actual size.
If overflow
is set to "visible", the specified size acts as a minimum, and
the component may overflow to show all content and/or children.
Note that developers wishing to set a default width
or height for a component class should set defaultWidth
or
defaultHeight
instead of specifying an explicit default
width
or height
. This is important for components added to a Layout
as members - it allows the Layout to determine whether the canvas has an
explicitly specified size that must be respected, or whether it can participate in its sizing policies
.
If this method is called after the component has been drawn/initialized:
Resizes the widget horizontally to the specified width (moves the right side of the widget). The width parameter can be expressed as a percentage of viewport size or as the number of pixels.
NOTE: if you're setting multiple coordinates, use resizeTo() or setRect() instead
width
- new width. Default value is nullCanvas
instance, for chaining setter callsSizing overview and related methods
public java.lang.Integer getWidth()
canvas.width
attribute specifies the size for a component's horizontal dimension;
canvas.height
specifies the size for the vertical dimension. May be set to an integer value (a number of pixels), a percentage value like "50%", or "*".
See PercentSizing
for details
on how percentage or "*"
values are resolved actual size.
If overflow
is set to "visible", the specified size acts as a minimum, and
the component may overflow to show all content and/or children.
Note that developers wishing to set a default width
or height for a component class should set defaultWidth
or
defaultHeight
instead of specifying an explicit default
width
or height
. This is important for components added to a Layout
as members - it allows the Layout to determine whether the canvas has an
explicitly specified size that must be respected, or whether it can participate in its sizing policies
.
See GettingCanvasSize
. Default value is null
Sizing overview and related methods
public void setWidth(java.lang.String width)
canvas.width
attribute specifies the size for a component's horizontal dimension;
canvas.height
specifies the size for the vertical dimension. May be set to an integer value (a number of pixels), a percentage value like "50%", or "*".
See PercentSizing
for details
on how percentage or "*"
values are resolved actual size.
If overflow
is set to "visible", the specified size acts as a minimum, and
the component may overflow to show all content and/or children.
Note that developers wishing to set a default width
or height for a component class should set defaultWidth
or
defaultHeight
instead of specifying an explicit default
width
or height
. This is important for components added to a Layout
as members - it allows the Layout to determine whether the canvas has an
explicitly specified size that must be respected, or whether it can participate in its sizing policies
.
If this method is called after the component has been drawn/initialized:
Resizes the widget horizontally to the specified width (moves the right side of the widget). The width parameter can be expressed as a percentage of viewport size or as the number of pixels.
NOTE: if you're setting multiple coordinates, use resizeTo() or setRect() instead
setWidth
in class com.google.gwt.user.client.ui.UIObject
width
- new width. Default value is nullSizing overview and related methods
public Canvas setWorkflows(Process... workflows) throws java.lang.IllegalStateException
workflows
that can be shared by event handler
workflows using a StartProcessTask
. Each workflow must be assigned an ID
for lookup.workflows
- New workflows value. Default value is nullCanvas
instance, for chaining setter callsjava.lang.IllegalStateException
- this property cannot be changed after the component has been createdpublic Process[] getWorkflows()
workflows
that can be shared by event handler
workflows using a StartProcessTask
. Each workflow must be assigned an ID
for lookup.public Canvas addChild(Canvas newChild)
If newChild has a parent it will be removed from it. If it has a master, it will be detached from it if the master is a child of a different parent. If newChild has peers, they'll be added to this widget as children as well.
newChild
- new child canvas to addComponent Containment and Hierarchy
public Canvas addChild(Canvas newChild, java.lang.String name, java.lang.Boolean autoDraw)
If newChild has a parent it will be removed from it. If it has a master, it will be detached from it if the master is a child of a different parent. If newChild has peers, they'll be added to this widget as children as well.
newChild
- new child canvas to addname
- name to assign to child (eg: this[name] == child)autoDraw
- if false, child will not automatically be drawn (only for advanced use)Component Containment and Hierarchy
public Canvas addPeer(Canvas newPeer)
The widget to be added as a peer will be removed from its old master and/or parent, if any, and it will be added as a child to the parent of this canvas (if any)
newPeer
- new peer widget to addComponent Containment and Hierarchy
public Canvas addPeer(Canvas newPeer, java.lang.String name, java.lang.Boolean autoDraw, java.lang.Boolean preDraw)
The widget to be added as a peer will be removed from its old master and/or parent, if any, and it will be added as a child to the parent of this canvas (if any)
newPeer
- new peer widget to addname
- name to assign to peer (eg: this[peer] == child)autoDraw
- if false, peer will not automatically be drawn (only for advanced use)preDraw
- if true, when draw is called on the master widget, the peer will be drawn before the masterComponent Containment and Hierarchy
public void addSnapAlignCandidate(Canvas newCandidate)
snapAlignCandidates
. Duplicates
are automatically avoided.newCandidate
- public void adjustForContent(boolean immediate)
adjustForContent()
, specify sizes on replaced elements wherever possible. DOM-level Integration overview
. Note that only contents supplied to a widget via contents
or via an override of getInnerHTML()
should be manipulated directly. Contents automatically
generated by Smart GWT components (such as the basic structure of a Button) should never be manipulated: these
structures are considered internal, differ by platform, and will change without notice. immediate
- By default the adjustment will occur on a small delay for performance reasons. Pass in this parameter to force
immediate adjustment.Sizing overview and related methods
public void animateFade(java.lang.Integer opacity)
opacity
- desired final opacitypublic void animateFade(java.lang.Integer opacity, AnimationCallback callback)
animateFade(java.lang.Integer)
public void animateFade(java.lang.Integer opacity, AnimationCallback callback, java.lang.Integer duration)
animateFade(java.lang.Integer)
public void animateFade(java.lang.Integer opacity, AnimationCallback callback, java.lang.Integer duration, AnimationAcceleration acceleration)
opacity
- desired final opacitycallback
- When the fade completes this callback will be fired. Single 'earlyFinish' parameter will be
passed if the animation was cut short, for example by a call to the non-animated
API setOpacity()
.duration
- Duration in ms of the animated fadeacceleration
- Optional animation acceleration to bias the ratiospublic void animateMove(java.lang.Integer left, java.lang.Integer top)
left
- new left position (or null for unchanged)top
- new top position (or null for unchanged)public void animateMove(java.lang.Integer left, java.lang.Integer top, AnimationCallback callback)
public void animateMove(java.lang.Integer left, java.lang.Integer top, AnimationCallback callback, java.lang.Integer duration)
public void animateMove(java.lang.Integer left, java.lang.Integer top, AnimationCallback callback, java.lang.Integer duration, AnimationAcceleration acceleration)
left
- new left position (or null for unchanged)top
- new top position (or null for unchanged)callback
- When the move completes this callback will be fired. Single 'earlyFinish' parameter will be passed
if the animation was cut short, for example by a call to the non-animated
APIs moveTo()
or moveBy()
.duration
- Duration in ms of the animated moveacceleration
- Optional acceleration effect to bias the ratiospublic void animateRect(java.lang.Integer left, java.lang.Integer top, java.lang.Integer width, java.lang.Integer height)
left
- new left position (or null for unchanged)top
- new top position (or null for unchanged)width
- new width (or null for unchanged)height
- new height (or null for unchanged)public void animateRect(java.lang.Integer left, java.lang.Integer top, java.lang.Integer width, java.lang.Integer height, AnimationCallback callback)
public void animateRect(java.lang.Integer left, java.lang.Integer top, java.lang.Integer width, java.lang.Integer height, AnimationCallback callback, java.lang.Integer duration)
public void animateRect(java.lang.Integer left, java.lang.Integer top, java.lang.Integer width, java.lang.Integer height, AnimationCallback callback, java.lang.Integer duration, AnimationAcceleration acceleration)
left
- new left position (or null for unchanged)top
- new top position (or null for unchanged)width
- new width (or null for unchanged)height
- new height (or null for unchanged)callback
- When the setRect completes this callback will be fired. Single 'earlyFinish' parameter will be
passed if the animation was cut short, for example by a call to the non-animated
API setRect()
.duration
- Duration in ms of the animated setRectacceleration
- Optional acceleration effect to apply to the animationpublic void animateResize(java.lang.Integer width, java.lang.Integer height)
Note that animateResizeLayoutMode
allows you to control whether
child layout is rerun during every step of the animation, or just at the end, since the former may incur significant
overhead depending on the widget hierarchy.
width
- new width (or null for unchanged)height
- new height (or null for unchanged)public void animateResize(java.lang.Integer width, java.lang.Integer height, AnimationCallback callback)
public void animateResize(java.lang.Integer width, java.lang.Integer height, AnimationCallback callback, java.lang.Integer duration)
public void animateResize(java.lang.Integer width, java.lang.Integer height, AnimationCallback callback, java.lang.Integer duration, AnimationAcceleration acceleration)
Note that animateResizeLayoutMode
allows you to control whether
child layout is rerun during every step of the animation, or just at the end, since the former may incur significant
overhead depending on the widget hierarchy.
width
- new width (or null for unchanged)height
- new height (or null for unchanged)callback
- When the resize completes this callback will be fired. Single 'earlyFinish' parameter will be
passed if the animation was cut short, for example by a call to the non-animated
APIs resizeTo()
or resizeBy()
.duration
- Duration in ms of the animated resizeacceleration
- Optional acceleration effect to apply to the resizepublic void animateScroll(java.lang.Integer scrollLeft, java.lang.Integer scrollTop)
scrollLeft
- desired final left scroll positionscrollTop
- desired final top scroll positionpublic void animateScroll(java.lang.Integer scrollLeft, java.lang.Integer scrollTop, AnimationCallback callback)
public void animateScroll(java.lang.Integer scrollLeft, java.lang.Integer scrollTop, AnimationCallback callback, java.lang.Integer duration)
public void animateScroll(java.lang.Integer scrollLeft, java.lang.Integer scrollTop, AnimationCallback callback, java.lang.Integer duration, AnimationAcceleration acceleration)
scrollLeft
- desired final left scroll positionscrollTop
- desired final top scroll positioncallback
- When the scroll completes this callback will be fired. Single 'earlyFinish' parameter will be
passed if the animation was cut short, for example by a call to the non-animated
APIs scrollTo()
or scrollBy()
.duration
- Duration in ms of the animated scrollacceleration
- Optional acceleration to bias the animation ratiospublic void blur()
Focus
public void bringToFront()
ZIndex overview and related methods
,
Layer Examplepublic void clear()
This is more expensive than hide(), because in order to become visible
again, the Canvas must be draw()n again. Generally, application code has no reason to call clear() unless it is
attempting to do advanced memory management. If you want to temporarily hide a Canvas, use hide() and show(), and if
you want to permanently destroy a Canvas, use destroy()
.
You would only use clear() if you were managing a very large pool of components and you wanted to reclaim some of the memory used by components that had not been used in a while, while still being able to just draw() them to make them active and visible again.
Note: a clear() will happen as part of moving a Canvas to a different parent. See addChild()
.
public void clearExplicitTabIndex()
tabIndex
was assigned to this widget, clear it.
This will enable automatic tab index managment behaviors via the TabIndexManager
class as described in the TabOrderOverview
public com.google.gwt.event.shared.HandlerRegistration addClickHandler(ClickHandler handler)
Executed when the left mouse is clicked (pressed and then released) on this widget. No default implementation.
addClickHandler
in interface HasClickHandlers
handler
- the click handlerHandlerRegistration
used to remove this handlerpublic java.lang.Boolean clickMaskUp()
showClickMask(com.smartgwt.client.core.Function, com.smartgwt.client.types.ClickMaskMode, com.smartgwt.client.widgets.Canvas[])
public java.lang.Boolean clickMaskUp(java.lang.String ID)
ID
- optional ID of specific clickMask to check. If not passed, checks for the click mask associated
with this widget only.showClickMask(com.smartgwt.client.core.Function, com.smartgwt.client.types.ClickMaskMode, com.smartgwt.client.widgets.Canvas[])
public java.lang.Boolean contains(Canvas canvas)
canvas
- the canvas to be testedComponent Containment and Hierarchy
public java.lang.Boolean contains(Canvas canvas, java.lang.Boolean testSelf)
canvas
- the canvas to be testedtestSelf
- If passed this method will return true if the canvas parameter is a pointer to this
widget.Component Containment and Hierarchy
public java.lang.Boolean containsEvent()
NOTE: Z-ordering is not considered for the purposes of this test. If the coordinate you're testing is occluded by other component, but the X,Y coordinates are still within the bounds that component, this method will return true.
See the related containsEventTarget()
method for checking whether a canvas
contains the target canvas for the current mouse event.
Positioning overview and related methods
public java.lang.Boolean containsEventTarget()
mouse event target
is this component
or a descendent of this component. Note that, unlike containsEvent()
, this method is not based on reported event coordinates and there are cases where
containsEvent()
and containsEventTarget()
will return different values, including when the
mouse is within the bounds of a target component, but another canvas is rendered in front of it in the page's z-order.
public java.lang.Boolean containsFocus()
Focus
public java.lang.Boolean containsPoint(int x, int y)
Will return false if any parent canvas does not contain the specified point, (EG: you're hovering over an element's absolute location, but it is scrolled out of view in a parent element)
x
- GLOBAL x-coordinatey
- GLOBAL y-coordinatePositioning overview and related methods
public java.lang.Boolean containsPoint(int x, int y, java.lang.Boolean withinViewport)
Will return false if any parent canvas does not contain the specified point, (EG: you're hovering over an element's absolute location, but it is scrolled out of view in a parent element)
x
- GLOBAL x-coordinatey
- GLOBAL y-coordinatewithinViewport
- point lies specifically within our viewport (drawn area excluding margins
and scrollbars if present)Positioning overview and related methods
public void dataContextChanged()
DataContext
is bound. This can occur on the initial
draw or by an explicit call to setDataContext()
. This
feature allows the use of the dataContext
as a general-purpose API to the screen. For example, if you
wanted your screen to support dynamically showing or hiding parts of itself based on a button that is external
to the screen, you could do that by implementing this handler to show/hide that part of the screen based on the current
state of the dataContext
.
public void deparent()
Component Containment and Hierarchy
public void depeer()
Component Containment and Hierarchy
public void disable()
Enabling and Disabling
public com.google.gwt.event.shared.HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler)
Executed when the left mouse button is clicked twice in rapid succession (within Canvas.doubleClickDelay
by default) in this object.
addDoubleClickHandler
in interface HasDoubleClickHandlers
handler
- the doubleClick handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addDragMoveHandler(DragMoveHandler handler)
Executed every time the mouse moves while dragging this canvas.
addDragMoveHandler
in interface HasDragMoveHandlers
handler
- the dragMove handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addDragRepositionMoveHandler(DragRepositionMoveHandler handler)
Executed every time the mouse moves while drag-repositioning. If this method does not Call DragRepositionMoveEvent.cancel()
from within DragRepositionMoveHandler.onDragRepositionMove(com.smartgwt.client.widgets.events.DragRepositionMoveEvent)
, the Canvas.dragTarget
(or outline if Canvas.dragAppearance
is set to "outline") will automatically be
moved as appropriate whenever the mouse moves.
addDragRepositionMoveHandler
in interface HasDragRepositionMoveHandlers
handler
- the dragRepositionMove handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addDragRepositionStartHandler(DragRepositionStartHandler handler)
Executed when dragging first starts. No default implementation. Create this handler to set things up for the drag reposition.
addDragRepositionStartHandler
in interface HasDragRepositionStartHandlers
handler
- the dragRepositionStart handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addDragRepositionStopHandler(DragRepositionStopHandler handler)
Executed when the mouse button is released at the end of the drag. Your widget can use this opportunity to fire custom code based upon where the mouse button was released, etc.
Returning true from this handler will cause the Canvas.dragTarget
(or outline if Canvas.dragAppearance
is set to "outline") to be left in its
current location. Returning false from this handler will cause it to snap back to its original location.
addDragRepositionStopHandler
in interface HasDragRepositionStopHandlers
handler
- the dragRepositionStop handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addDragResizeMoveHandler(DragResizeMoveHandler handler)
Executed every time the mouse moves while drag-resizing. If this method does not Call DragResizeMoveEvent.cancel()
from within DragResizeMoveHandler.onDragResizeMove(com.smartgwt.client.widgets.events.DragResizeMoveEvent)
, the Canvas.dragTarget
(or outline if Canvas.dragAppearance
is set to "outline") will automatically be
moved as appropriate whenever the mouse moves.
addDragResizeMoveHandler
in interface HasDragResizeMoveHandlers
handler
- the dragResizeMove handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addDragResizeStartHandler(DragResizeStartHandler handler)
Executed when resize dragging first starts. No default implementation. Create this handler to set things up for the drag resize.
addDragResizeStartHandler
in interface HasDragResizeStartHandlers
handler
- the dragResizeStart handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addDragResizeStopHandler(DragResizeStopHandler handler)
Executed when the mouse button is released at the end of the drag resize. Your widget can use this opportunity to fire custom code based upon where the mouse button was released, etc.
Returning true from this handler will cause the
Canvas.dragTarget
(or outline if Canvas.dragAppearance
is set to "outline") to be left at its
current size. Returning false from this handler will cause it to snap back to its original location size
addDragResizeStopHandler
in interface HasDragResizeStopHandlers
handler
- the dragResizeStop handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addDragStartHandler(DragStartHandler handler)
Executed when dragging first starts. Your widget can use this opportunity to set things up for the drag, such as setting the drag tracker. Returning false from this event handler will cancel the drag action entirely.
A drag action is
considered to be begin when the mouse has moved Canvas.dragStartDistance
with the left mouse down.
addDragStartHandler
in interface HasDragStartHandlers
handler
- the dragStart handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addDragStopHandler(DragStopHandler handler)
Executed when the mouse button is released at the end of the drag. Your widget can use this opportunity to fire code based on the last location of the drag or reset any visual state that was sent.
addDragStopHandler
in interface HasDragStopHandlers
handler
- the dragStop handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addDropMoveHandler(DropMoveHandler handler)
Executed whenever the compatible dragged object is moved over this drop target. You can use this to show a custom visual
indication of where the drop would occur within the widget, or to show the no-drop cursor
to indicate that this is not a valid drop target,
typically if Canvas.willAcceptDrop()
returns false.
For
details on showing a 'no drop' cursor when the user drags over all invalid drop targets, see showNoDropIndicator
.
addDropMoveHandler
in interface HasDropMoveHandlers
handler
- the dropMove handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addDropOutHandler(DropOutHandler handler)
Executed when the dragged object is no longer over this drop target, including when the drag interaction is ending with a drop on this drop target. If you have set a visual indication in dropOver or dropMove, you should reset it to its normal state in dropOut.
addDropOutHandler
in interface HasDropOutHandlers
handler
- the dropOut handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addDropOverHandler(DropOverHandler handler)
Executed when the compatible dragged object is first moved over this drop target. Your implementation can use this to show a custom visual indication that the object can be dropped here.
addDropOverHandler
in interface HasDropOverHandlers
handler
- the dropOver handlerHandlerRegistration
used to remove this handlerpublic void enable()
Enabling and Disabling
public java.lang.Boolean encloses(Canvas other)
other
- other canvas to test for enclosurePositioning overview and related methods
public void focus()
Focus
public void focusAfterGroup()
This method makes use of the TabIndexManager.shiftFocusAfterGroup()
method to
request focus be changed to the next registered entry. By default standard focusable Smart GWT UI elements, including
Canvases, FormItems, FormItemIcons, etc are registered with the TabIndexManager in the appropriate order, and will
accept focus if focusable
, and not disabled
or masked
.
This method differs from focusInNextTabElement()
in that it will skip any descendants
of this widget in the TabIndexManager's hierarchy of potential focus target. By default this means focus will be moved
to the next target on the page which is not a descendant of this widget.
FormItems support a similar method: FormItem.focusAfterItem()
.
NOTE: Focusable
elements created directly in the raw HTML bootstrap or by application code will not be passed focus by this method
unless they have also been explicitly registered with the TabIndexManager. See the TabOrderOverview
for more information.
getTabIndex()
,
focusInNextTabElement()
,
Focus
public void focusAtEnd(boolean start)
This method makes use of the TabIndexManager.shiftFocusWithinGroup()
API to
request focus be changed within the set of focusable targets registered under this canvas.
If the start
parameter is true, if the canvas itself is focusable it will be given focus, otherwise the first focusable descendant
will be given focus. If the start
parameter is false, the last focusable descendant will be given focus (or
if the canvas itself is focusable but there are no focusable descendants, it will receive focus).
A use case for this might be to programmatically shift focus to the first or last button in a toolbar or similar.
start
- Should we focus at the start or the end of this widget and its descendants.public com.google.gwt.event.shared.HandlerRegistration addFocusChangedHandler(FocusChangedHandler handler)
Notification function fired when this widget receives or loses keyboard focus.
addFocusChangedHandler
in interface HasFocusChangedHandlers
handler
- the focusChanged handlerHandlerRegistration
used to remove this handlerpublic void focusInNextTabElement()
clickMask
is up to ensure focus does not move to any masked elements in the UI. This method makes use of the TabIndexManager.shiftFocus()
method to request focus be changed
to the adjacent registered entry. By default standard focusable Smart GWT UI elements, including Canvases, FormItems,
FormItemIcons, etc are registered with the TabIndexManager in the appropriate order, and will accept focus if focusable
, and not disabled
or masked
.
The TabIndexManager maintains a hierarchy of focusable
targets - so if a parent canvas contains focusable children, they will typically be nested under the parent canvas in
this hierarchy. If you want to shift focus to the next target outside this hierarchy (IE: skip any children and put
focus into the next widget on the page outside this one), you can use use focusAfterGroup()
.
NOTE: Focusable elements created
directly in the raw HTML bootstrap or by application code will not be passed focus by this method unless they have also
been explicitly registered with the TabIndexManager. See the TabOrderOverview
for more
information.
getTabIndex()
,
focusInPreviousTabElement()
,
focusAfterGroup()
,
Focus
public void focusInPreviousTabElement()
This method makes use of the TabIndexManager.shiftFocus()
method to request focus be changed to the adjacent registered entry. By default standard
focusable Smart GWT UI elements, including Canvases, FormItems, FormItemIcons, etc are registered with the
TabIndexManager in the appropriate order, and will accept focus if focusable
, and not disabled
or masked
.
NOTE: Focusable elements created directly in the
raw HTML bootstrap or by application code will not be passed focus by this method unless they have also been explicitly
registered with the TabIndexManager. See the TabOrderOverview
for more information.
getTabIndex()
,
focusInNextTabElement()
,
Focus
public java.lang.String getAriaHandleID()
role
and attributes
applied to it. This can be useful when applying custom aria state attributes
which need to refer to the DOM handle of another canvas, such as aria-controls. Note
that we do not recommend using this ID to identify the element in the DOM for integration with automated testing tools.
The AutoTest.getLocator()
and AutoTest.getElement()
APIs should be used instead. These locators are much
finer grained - they allow developers to identify sub-elements within the widget handle that map to specific logical
Smart GWT objects (for example FormItem Icons within a DynamicForm). They are also more stable - AutoTest locators are
able to reliably identify components based on their position in the application hierarchy and other context, while the
DOM element IDs are not guaranteed not to change across page reloads.
public java.util.Map getAriaStateDefaults()
explicitly specified aria state
and applied to the widget handle as
described in getAriaState()
. For disabled canvases
, this method returns an object with
disabled
set to true. May be overridden to apply additional defaults in canvas subclasses.
public int getBottom()
Positioning overview and related methods
public java.lang.Integer getChildTabPosition(Canvas child)
updateTabPositionOnReparent
is true, return the expected tab position within this parent. Default implementation will
any explicit relative tab position specified by setRelativeTabPosition()
, and otherwise put children in the same order as defined in the children array Overridden
in the Layout
class to return the position in the members array.
child
- Child to get local tab position forpublic com.google.gwt.dom.client.Element getContentElement()
contents
, or for parent components
, the DOM elements for any
drawn children. This method is provided for the very rare cases where a programmer needs to examine the DOM hierarchy
created by a drawn Smart GWT component. Direct manipulation of the DOM elements created by Smart GWT components is
not supported. Smart GWT components should be rendered or cleared using standard methods such as draw()
, clear()
. If direct
integration with existing DOM structures is required, this should be achieved via the htmlElement
attribute, rather than by attempting to move the
component's outer element via native browser APIs.
The content of Smart GWT components' DOM elements should also not
be directly manipulated using native browser APIs - standard methods such as setContents()
, addChild()
, removeChild()
, markForRedraw()
and redraw()
should be used instead.
In some cases, the element returned may match the element returned by getOuterElement()
, but this will not always be the case.
If the
widget is undrawn, this method will return null
.
public java.lang.String getDefiningPropertyName()
AutoTest
system to use as the
definingProperty
when generating locators
. If the
value for the attribute returned by this method is non null, the AutoTest.getLocator()
method will use this property name and value in the locators it generates to search the widget
hierarchy for this component.
The default implementation will return this.definingProperty
if specified, otherwise the first entry in
this.definingPropertyNameOptions
that has a
non empty value for this component.
public java.lang.String getFullDataPath()
DataPath
for this canvas. This is calculated by combining the
canvas' specified DataPath
with the dataPath
of any parent canvases up to
whichever canvas has a specified valuesManager
specified to
actually manage values from this component.DataPath
public java.lang.String getHoverHTML()
this.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. This method returns the contents of that hover canvas. Default
implementation returns this.prompt
- override for custom hover HTML. Note that returning null
or an empty string will suppress the hover canvas altogether.HTMLString
getShowHover()
public int getHSnapPosition(int coordinate)
snapHGap
and snapVGap
. You should only override this method if you want to provide support for a grid of irregularly-placed pointscoordinate
- x-coordinate of the drag event relative to the inside of this widgetDrag and Drop
public int getHSnapPosition(int coordinate, java.lang.String direction)
snapHGap
and snapVGap
. You should only override this method if you want to provide support for a grid of irregularly-placed pointscoordinate
- x-coordinate of the drag event relative to the inside of this widgetdirection
- "before" or "after" denoting whether the returned coordinate should match the left or right edge of the current
square. If unset snapHDirection
will be used by defaultDrag and Drop
public com.google.gwt.dom.client.Element getImage(java.lang.String identifier)
The element
must have been created from HTML generated by calling imgHTML()
on
this particular Canvas.
identifier
- name of the image or container element to get, as originally passed to
imgHTML()
Images overview and related methods
public int getInnerContentHeight()
getInnerContentWidth()
,
getInnerHeight()
,
getInnerWidth()
,
Sizing overview and related methods
public int getInnerContentWidth()
getInnerContentHeight()
,
getInnerHeight()
,
getInnerWidth()
,
Sizing overview and related methods
public int getInnerHeight()
This is the space within the viewport of the widget (including padding, but excluding margins, borders or scrollbars) rendered at its specified size.
getInnerWidth()
,
getInnerContentHeight()
,
getInnerContentWidth()
,
Sizing overview and related methods
public int getInnerWidth()
This is the space within the viewport of the widget (including padding, but excluding margins, borders or scrollbars) rendered at its specified size.
getInnerHeight()
,
getInnerContentHeight()
,
getInnerContentWidth()
,
Sizing overview and related methods
public java.lang.String getLocalId()
getID()
. A "local ID" originates as an
explicit ID assigned to a widget created in Reify. These IDs assigned by Reify become local IDs when a screen is loaded
by RPCManager.loadScreen()
or RPCManager.cacheScreens()
and RPCManager.createScreen()
. A local ID is unique only within the scope
of a widget's screen, and is not globally unique as is required for ID
.
public Canvas getMasterCanvas()
See Containment
for an overview of master/peer relationships.
Component Containment and Hierarchy
public int getOffsetX()
Positioning overview and related methods
public int getOffsetY()
Positioning overview and related methods
public com.google.gwt.dom.client.Element getOuterElement()
Direct manipulation of the DOM elements created
by Smart GWT components is not supported. Smart GWT components should be rendered or cleared using standard methods such
as draw()
, clear()
. If
direct integration with existing DOM structures is required, this should be achieved via the htmlElement
attribute, rather than by attempting to move the
component's outer element via native browser APIs.
The content of Smart GWT components' DOM elements should also not
be directly manipulated using native browser APIs - standard methods such as setContents()
, addChild()
, removeChild()
, markForRedraw()
and redraw()
should be used instead.
In some cases, the element returned may match the element returned by getContentElement()
, but this will not always be the case.
If
the widget is undrawn, this method will return null
.
public int getPageBottom()
Positioning overview and related methods
public int getPageLeft()
Positioning overview and related methods
public int getPageRight()
Positioning overview and related methods
public int getPageTop()
Positioning overview and related methods
public Canvas getPanelContainer()
TabSet
or SectionStack
. If this
Canvas is not a child of such a panel container, this method returns null.public int getRight()
Positioning overview and related methods
public java.util.Map getRuleContext()
ruleScope
of this component (which may be this component itself or whatever component is managing the
ruleScope
for this component). If the databoundOnly
parameter is passed as true, only data
from components that actually have a DataSource
is included.
Use Canvas.ruleContextChanged()
to get a notification of
changes to the rule context.
public java.util.Map getRuleContext(boolean databoundOnly)
ruleScope
of this component (which may be this component itself or whatever component is managing the
ruleScope
for this component). If the databoundOnly
parameter is passed as true, only data
from components that actually have a DataSource
is included.
Use Canvas.ruleContextChanged()
to get a notification of
changes to the rule context.
databoundOnly
- whether to include only data from components that have a DataSource
public int getScrollBottom()
Scrolling overview and related methods
public int getScrollHeight()
Sizing overview and related methods
public int getScrollLeft()
Scrolling overview and related methods
public int getScrollRight()
Scrolling overview and related methods
public int getScrollTop()
Scrolling overview and related methods
public int getScrollWidth()
Sizing overview and related methods
public java.util.Map getUISummary(java.lang.String[] heirarchyExcluded, java.lang.String[] thisCanvasExcluded)
heirarchyExcluded
- property names to exclude from entire hierarchythisCanvasExcluded
- property names to exclude from this canvaspublic int getViewportHeight()
Sizing overview and related methods
public int getViewportWidth()
Sizing overview and related methods
public int getVisibleHeight()
Sizing overview and related methods
public int getVisibleWidth()
Sizing overview and related methods
public int getVSnapPosition(int coordinate)
snapHGap
and snapVGap
. You should only override this method if you want to provide support for a grid of irregularly-placed pointscoordinate
- y-coordinate of the drag event relative to the inside of this widgetSnapGridDragging overview and related methods
public int getVSnapPosition(int coordinate, java.lang.String direction)
snapHGap
and snapVGap
. You should only override this method if you want to provide support for a grid of irregularly-placed pointscoordinate
- y-coordinate of the drag event relative to the inside of this widgetdirection
- "before" or "after" denoting whether the returned coordinate should match the top or bottom edge of the current
square. If unset snapHDirection
will be used by defaultSnapGridDragging overview and related methods
public int getZIndex(boolean resolveToNumber)
resolveToNumber
- If passed true
, for undrawn widgets, resolve "auto" to the next available zIndex.ZIndex overview and related methods
public void handleHover()
this.hover()
(if defined), and handle showing the hover canvas if this.showHover
is true.getCanHover()
,
getShowHover()
,
HoverEvent
public void hide()
public void hideClickMask()
public void hideClickMask(java.lang.String ID)
ID
- optional ID of specific clickMask to hide. If not passed, defaults to hiding the click mask
associated with this widget only.showClickMask(com.smartgwt.client.core.Function, com.smartgwt.client.types.ClickMaskMode, com.smartgwt.client.widgets.Canvas[])
public void hideComponentMask()
component level clickMask
for this widgetpublic void hideComponentMask(boolean suppressFocusReset)
component level clickMask
for this widgetsuppressFocusReset
- By default when the component-level mask is hidden it will attempt to reset focus to whatever had focus before the
mask was shown. Pass this parameter to suppress this behavior.public void hideContextMenu()
public com.google.gwt.event.shared.HandlerRegistration addHoverHandler(HoverHandler handler)
If canHover
is true for this widget, the hover
string method will be fired when the user
hovers over this canvas. If this method returns false, it will suppress the default behavior of showing a hover canvas
if this.showHover
is true.
addHoverHandler
in interface HasHoverHandlers
handler
- the hover handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addHoverHiddenHandler(HoverHiddenHandler handler)
If showHover
is true for this canvas, this notification method
will be fired whenever the hover shown in response to handleHover()
is hidden.
addHoverHiddenHandler
in interface HasHoverHiddenHandlers
handler
- the hoverHidden handlerHandlerRegistration
used to remove this handlerpublic void initComplete()
initWidget()
, when canvas
initialization is complete. This is a notification method only and has no default implementation
public java.lang.Boolean intersects(Canvas other)
other
- other canvas to test for intersectionPositioning overview and related methods
public java.lang.Boolean isDirty()
markForRedraw()
has been called, but this canvas has not yet been
redrawn.Drawing overview and related methods
public java.lang.Boolean isDisabled()
Enabling and Disabling
public java.lang.Boolean isFocused()
synchronousFocusNotifications
).
In this case, canvas.isFocused()
method can correctly
return false when, intuitively, you would expect it to return true:
someCanvas.focus(); if (someCanvas.isFocused()) { // In most browsers we would get here, but not in Internet Explorer with // EventHandler.synchronousFocusNotifications disabled. }
containsFocus()
public com.google.gwt.event.shared.HandlerRegistration addKeyDownHandler(KeyDownHandler handler)
Executed when a key is pressed on a focusable widget (Canvas.canFocus
: true).
Use EventHandler.getKey()
to find out
the String of the key that was pressed, and use EventHandler.shiftKeyDown()
and related functions to determine whether modifier keys were down.
addKeyDownHandler
in interface HasKeyDownHandlers
handler
- the keyDown handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addKeyPressHandler(KeyPressHandler handler)
Executed when a key is pressed and released on a focusable widget (Canvas.canFocus
: true).
Use EventHandler.getKey()
to find out
the String of the key that was pressed, and use EventHandler.shiftKeyDown()
and related functions to determine whether modifier keys were down.
addKeyPressHandler
in interface HasKeyPressHandlers
handler
- the keyPress handlerHandlerRegistration
used to remove this handlerpublic java.lang.Boolean keyUp()
canFocus
:
true). Use EventHandler.getKey()
to find out the String of the
key that was pressed, and use EventHandler.shiftKeyDown()
and
related functions to determine whether modifier keys were down.
getCanFocus()
public void layoutChildren(java.lang.String reason)
layoutChildren()
is where a Canvas should implement a sizing policy for it's Canvas children. Since
layoutChildren
calls parentResized() on its children, parentResized()
is a good place for a child to implement a layout
policy that can be used within any parent. Recommended practice for a Canvas that manages Canvas children is to create those children without any initial coordinate or size settings and do all sizing when layoutChildren() is called.
layoutChildren() is always called at least once before children are drawn, and is called automatically whenever the viewport size changes (which includes both resizing and introduction/removal of scrolling). layoutChildren() can also be manually invoked in any other component-specific situation which changes the layout.
NOTE: layoutChildren() may be called before draw() if a widget is resized before draw(), so be sure to avoid errors such as assuming that any children you automatically create have already been created.
NOTE: auto-sizing: layoutChildren() is also called once during the initial draw(), before children are drawn, with a "reason" of "initial draw". During this invocation of layoutChildren() it is legal to directly draw children (call child.draw()), which is otherwise never allowed. This allows a Canvas to implement an auto-sizing layout policy by drawing some children before deciding on the sizes of remaining children, which is far more efficient than drawing all children and resizing some of them after they are drawn.
reason
- reason why layoutChildren() is being called, passed when framework code invokes layoutChildren()Sizing overview and related methods
public java.lang.String linkHTML(java.lang.String href)
href
- URL for the link to point toHTMLString
public java.lang.String linkHTML(java.lang.String href, java.lang.String text)
linkHTML(java.lang.String)
public java.lang.String linkHTML(java.lang.String href, java.lang.String text, java.lang.String target)
linkHTML(java.lang.String)
public java.lang.String linkHTML(java.lang.String href, java.lang.String text, java.lang.String target, java.lang.String ID)
linkHTML(java.lang.String)
public java.lang.String linkHTML(java.lang.String href, java.lang.String text, java.lang.String target, java.lang.String ID, java.lang.Integer tabIndex)
linkHTML(java.lang.String)
public java.lang.String linkHTML(java.lang.String href, java.lang.String text, java.lang.String target, java.lang.String ID, java.lang.Integer tabIndex, java.lang.String accessKey)
href
- URL for the link to point totext
- HTML to display in the link element (defaults to the href).
See HTMLString
target
- Target window for the link (defaults to opening in a new, unnamed window)ID
- optional ID for the link element to be written outtabIndex
- optional tabIndex for the linkaccessKey
- optional accessKey for the linkHTMLString
public void markForDestroy()
destroy()
this canvas on a timeout. This method should be used
instead of calling canvas.destroy()
directly unless there's a reason a the canvas needs to be destroyed
synchronously. By using a timeout, this method ensures the destroy()
will occur after the current thread of
execution completes. This allows you to easily mark canvases for destruction while they're handling events, which must
complete before the canvas can be destroyed. Notes:
markForDestroy()
performs some immediate
cleanup and puts a component into a "pending destroy" state. As far as application code is concerned, once a component
has been is in this state it should be considered invalid to invoke methods on the component.destroy()
or markForDestroy()
a component while it is in the middle of an asynchronous
operation. For example, if you need to submit and then destroy a single-use dynamic form, the call to
markForDestroy()
should be invoked from the callback to DynamicForm.saveData()
, rather than being invoked synchronously
after the call to saveData()
BaseWidget.destroy()
public void markForRedraw()
markForRedraw()
instead of calling redraw()
directly. Since this method queues the redraw, multiple calls to markForRedraw() within a single thread of
execution will only lead to a single DOM manipulation which greatly improves application performance.Drawing overview and related methods
public void markForRedraw(java.lang.String reason)
markForRedraw()
instead of calling redraw()
directly. Since this method queues the redraw, multiple calls to markForRedraw() within a single thread of
execution will only lead to a single DOM manipulation which greatly improves application performance.reason
- reason for performing the redrawDrawing overview and related methods
public com.google.gwt.event.shared.HandlerRegistration addMouseDownHandler(MouseDownHandler handler)
Executed when the left mouse button is pressed on this widget. No default implementation.
addMouseDownHandler
in interface HasMouseDownHandlers
handler
- the mouseDown handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler)
Executed when the mouse moves within this widget. No default implementation.
addMouseMoveHandler
in interface HasMouseMoveHandlers
handler
- the mouseMove handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addMouseOutHandler(MouseOutHandler handler)
Executed when the mouse leaves this widget. No default implementation.
Note that if the mouse goes over a child of
this canvas, the mouseOut event will fire as it would if the user rolled entirely off the canvas. Developers may
determine whether the mouse is still over a descendant of this component via Canvas.containsEventTarget()
.
addMouseOutHandler
in interface HasMouseOutHandlers
handler
- the mouseOut handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addMouseOverHandler(MouseOverHandler handler)
Executed when mouse enters this widget. No default implementation.
addMouseOverHandler
in interface HasMouseOverHandlers
handler
- the mouseOver handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addMouseStillDownHandler(MouseStillDownHandler handler)
Repeating notification method for the user holding the left mouse button down over this canvas.
The
mouseStillDown
event is fired immediately when the mouse goes down. If the user holds the mouse down, after
a pause of Canvas.mouseStillDownInitialDelay
,
it will begin to fire repeatedly every Canvas.mouseStillDownDelay
milliseconds.
This provides developers with a simple way to handle the common "repeated
action" use case where a user can click a UI element to perform an action once, or click and hold to perform the
action repeatedly.
Examples of this include standard scrollbar button behavior and buttons to increase or decrease
the value in a spinner type input element.
This event is not native to JavaScript, but is provided by the ISC system.
addMouseStillDownHandler
in interface HasMouseStillDownHandlers
handler
- the mouseStillDown handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addMouseUpHandler(MouseUpHandler handler)
Executed when the left mouse is released on this widget. No default implementation.
addMouseUpHandler
in interface HasMouseUpHandlers
handler
- the mouseUp handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler)
Executed when the mouse wheel is actuated.
addMouseWheelHandler
in interface HasMouseWheelHandlers
handler
- the mouseWheel handlerHandlerRegistration
used to remove this handlerpublic void moveAbove(Canvas canvas)
canvas
- canvas to move aboveZIndex overview and related methods
,
Layer Examplepublic void moveBelow(Canvas canvas)
canvas
- canvas to move belowZIndex overview and related methods
,
Layer Examplepublic java.lang.Boolean moveBy(int deltaX, int deltaY)
deltaX
- amount to move horizontally (may be negative)deltaY
- amount to move vertically (may be negative)Positioning overview and related methods
,
Move Examplepublic com.google.gwt.event.shared.HandlerRegistration addMovedHandler(MovedHandler handler)
Notification method fired when this component is explicitly moved. Note that a component's position on the screen may
also changed due to an ancestor being moved. The Canvas.parentMoved()
method provides a notification entry point to catch that case as well.
addMovedHandler
in interface HasMovedHandlers
handler
- the moved handlerHandlerRegistration
used to remove this handlerpublic boolean moveTo(int left, int top)
This method will also accept a single parameter as an object array with left and top given as properties.
left
- x-coordinate to move to in LOCAL coordinates or Object with left and top
properties.top
- y-coordinate to move to in LOCAL coordinatesPositioning overview and related methods
,
Move Examplepublic com.google.gwt.event.shared.HandlerRegistration addClearHandler(ClearHandler handler)
Notification method fired when the canvas is removed from the DOM via a call to Canvas.clear()
. Canvases are cleared recursively, so if a parent is
clear()'d, all of its descendants will also be cleared. This notification is fired before the canvas has been
removed from the DOM, and Canvas.isDrawn()
will return
true
if called while the notification is running.
addClearHandler
in interface HasClearHandlers
handler
- the clear handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addDropHandler(DropHandler handler)
Notification method fired when the user drops another canvas onto this one. Returning false
from this
method will prevent any default drop behavior from occurring
addDropHandler
in interface HasDropHandlers
handler
- the drop handlerHandlerRegistration
used to remove this handlerpublic void pageScrollDown()
public void pageScrollUp()
public com.google.gwt.event.shared.HandlerRegistration addParentMovedHandler(ParentMovedHandler handler)
Notification method fired when an ancestor of this component's position changes.
addParentMovedHandler
in interface HasParentMovedHandlers
handler
- the parentMoved handlerHandlerRegistration
used to remove this handlerpublic void placeNear()
Positioning overview and related methods
public void placeNear(int left)
placeNear()
public void placeNear(int left, int top)
left
- Left coordinate (defaults to mouse position)top
- Top coordinate (defaults to mouse position)Positioning overview and related methods
public void print()
PrintWindow
containing a PrintCanvas
showing a printable view of this component.public void print(PrintProperties printProperties)
print()
public void print(PrintProperties printProperties, PrintWindow printWindowProperties)
print()
public void print(PrintProperties printProperties, PrintWindow printWindowProperties, java.lang.String callback)
PrintWindow
containing a PrintCanvas
showing a printable view of this component.printProperties
- PrintProperties object for customizing the print HTML outputprintWindowProperties
- Properties to apply to the generated print window.callback
- callback to fire when the print preview canvas has been populated with the printable HTML. This callback takes 2
parameters: printPreview
- a pointer to the generated print canvas shown in the body of the print
window. printWindow
- a pointer to the generated print window and.
See Callback
showPrintPreview(com.smartgwt.client.widgets.Canvas)
,
Printing
public void redraw()
Drawing overview and related methods
public void redraw(java.lang.String reason)
reason
- reason for performing the redrawDrawing overview and related methods
public void removeChild(Canvas child)
child
- Child canvas to remove from this parent.Component Containment and Hierarchy
public void removeChild(Canvas child, java.lang.String name)
child
- Child canvas to remove from this parent.name
- If the child canvas was assigned a name when added via addChild(), it should be passed in here to
ensure no reference is kept to the childComponent Containment and Hierarchy
public void removePeer(Canvas peer)
peer
- Peer to be removed from this canvasComponent Containment and Hierarchy
public void removePeer(Canvas peer, java.lang.String name)
peer
- Peer to be removed from this canvasname
- If this peer was assigned a name when added via addPeer(), it should be passed in here to ensure
no reference is kept to the peerComponent Containment and Hierarchy
public void removeRuleContext(java.lang.String path)
path
along with any user-provided schema. Normally
data is removed from the ruleContext by passing null
to data
in provideRuleContext()
, however, this call will do the same but
also removes the schema as explicitly provided to provideRuleContext.
Data automatically provided to the
ruleContext, as described by ruleScope
, along with the
associated schema is automatically removed when the contributing DataBoundComponent is destroyed. Therefore there is no
need to clean up those ruleContext paths manually.
path
- path where data and schema should be removedpublic void removeSnapAlignCandidate(Canvas candidate)
snapAlignCandidates
. If the
passed widget was not actually a candidate, nothing happens and no warning is logged.candidate
- SnapGridDragging overview and related methods
public java.lang.Boolean resizeBy(int deltaX, int deltaY)
deltaX
- amount to resize horizontally (may be negative)deltaY
- amount to resize vertically (may be negative)Sizing overview and related methods
,
Resize Examplepublic com.google.gwt.event.shared.HandlerRegistration addResizedHandler(ResizedHandler handler)
Method called whenever a Canvas changes size. Note that if this canvas is overflow:"visible"
, and is waiting for a queued redraw (see Canvas.isDirty()
), the value for Canvas.getVisibleWidth()
and Canvas.getVisibleHeight()
will be unreliable until
redraw()
fires.
In this case, if the delayed redraw does change the drawn size of the component, this
notification will be fired a second time when it completes.
addResizedHandler
in interface HasResizedHandlers
handler
- the resized handlerHandlerRegistration
used to remove this handlerpublic java.lang.Boolean resizeTo(int width, int height)
width
or height
for more on canvas sizing.width
- new width for canvas.height
- new height for canvasSizing overview and related methods
,
Resize Examplepublic com.google.gwt.event.shared.HandlerRegistration addRightMouseDownHandler(RightMouseDownHandler handler)
Executed when the right mouse button is pressed on this widget. No default implementation.
addRightMouseDownHandler
in interface HasRightMouseDownHandlers
handler
- the rightMouseDown handlerHandlerRegistration
used to remove this handlerpublic com.google.gwt.event.shared.HandlerRegistration addRuleContextChangedHandler(RuleContextChangedHandler handler)
Notification that the rule context gathered by the Canvas.ruleScope
has changed.
This notification fires only on the component designated as the Canvas.ruleScope
; components that are merely contributing data to the
rule context do not fire ruleContextChanged
.
addRuleContextChangedHandler
in interface HasRuleContextChangedHandlers
handler
- the ruleContextChanged handlerHandlerRegistration
used to remove this handlerpublic void scrollBy(int dX, int dY)
Note: If you attempt to call this API before the widget is drawn, the call will be ignored.
dX
- Number of pixels to scroll horizontallydY
- Number of pixels to scroll verticallyScrolling overview and related methods
public void scrollByPercent(int dX, int dY)
dX
- Percentage to scroll horizontally. Will accept either a numeric percent value, or a
string like "10%".dY
- Percentage to scroll horizontally. Will accept either a numeric percent value, or a
string like "10%".Scrolling overview and related methods
public com.google.gwt.event.shared.HandlerRegistration addScrolledHandler(ScrolledHandler handler)
Notification that this component has just scrolled.
Fires for both CSS and "synthetic" scrollbars
.
addScrolledHandler
in interface HasScrolledHandlers
handler
- the scrolled handlerHandlerRegistration
used to remove this handlerpublic void scrollTo()
This is guaranteed to be called whenever this Canvas is scrolled, whether scrolling is initiated programmatically, by custom scrollbars, or a by a native scrollbar.
Note: If you attempt to call this API before the widget is drawn, the call will be ignored.
Scrolling overview and related methods
public void scrollTo(java.lang.Integer left)
scrollTo()
public void scrollTo(java.lang.Integer left, java.lang.Integer top)
This is guaranteed to be called whenever this Canvas is scrolled, whether scrolling is initiated programmatically, by custom scrollbars, or a by a native scrollbar.
Note: If you attempt to call this API before the widget is drawn, the call will be ignored.
left
- the left coordinatetop
- the top coordinateScrolling overview and related methods
public void scrollToBottom()
Scrolling overview and related methods
public void scrollToLeft()
Scrolling overview and related methods
public void scrollToPercent(int left, int top)
left
- Left Percentage position to scroll to Will accept either a numeric percent value,
or a string like "10%".top
- Top Percentage position to scroll to Will accept either a numeric percent value,
or a string like "10%".Scrolling overview and related methods
public void scrollToRight()
Scrolling overview and related methods
public void scrollToTop()
Scrolling overview and related methods
public void sendToBack()
ZIndex overview and related methods
,
Layer Examplepublic void setBottom(int bottom)
NOTE: if you're setting multiple coordinates, use setRect(), moveTo() or resizeTo() instead
bottom
- new bottom coordinateSizing overview and related methods
public void setEditMode(boolean editingOn)
EditNode
within an EditContext
. Components with
editMode enabled support certain editing interactions which vary depending on the componentType and settings on the
editProxy
.
To disable edit mode just pass
editingOn
as false. The other parameters are not needed.
To enable edit mode on this component all
three parameters are required. The editNode
is the edit node for this component as it exists within the
editContext
.
An alternative method, EditContext.enableEditing()
, can be used when only an editContext and editNode are available.
Placing a component
into editMode
causes the component's editProxy
to
be created.
editingOn
- true to enable editMode; false to disableEditTree
,
EditContext
public void setEditMode(boolean editingOn, EditContext editContext)
setEditMode(boolean)
public void setEditMode(boolean editingOn, EditContext editContext, EditNode editNode)
EditNode
within an EditContext
. Components with
editMode enabled support certain editing interactions which vary depending on the componentType and settings on the
editProxy
.
To disable edit mode just pass
editingOn
as false. The other parameters are not needed.
To enable edit mode on this component all
three parameters are required. The editNode
is the edit node for this component as it exists within the
editContext
.
An alternative method, EditContext.enableEditing()
, can be used when only an editContext and editNode are available.
Placing a component
into editMode
causes the component's editProxy
to
be created.
editingOn
- true to enable editMode; false to disableeditContext
- the EditContexteditNode
- the EditNodeEditTree
,
EditContext
public void setImage(java.lang.String identifier, java.lang.String URL)
The element must have been created from HTML generated by
calling canvas.imgHTML()
on this particular Canvas.
identifier
- name of the image to change, as originally passed to imgHTML
URL
- URL for the image.
See SCImgURL
Images overview and related methods
public void setImage(java.lang.String identifier, java.lang.String URL, java.lang.String imgDir)
The element must have been created from HTML generated by
calling canvas.imgHTML()
on this particular Canvas.
identifier
- name of the image to change, as originally passed to imgHTML
URL
- URL for the image.
See SCImgURL
imgDir
- optional image directory, overrides the default for this CanvasImages overview and related methods
public boolean setLocatorParent(Canvas locatorParent, java.lang.String childName)
locators
that reference this canvas will
use the childName
to navigate from the specified parent to this component, exactly how named autoChildren
are referenced in locators. Note that, as with Smart GWT autoChildren, the locator parent does not need to be the direct parent of this component, or even a true ancestor, in the widget hierarchy. However, you should never set the locatorParent to a descendant of this widget as that would lead to infinite loops when attempting to create or resolve locators.
This method will also set
locatorParent.attributeName
, (or locatorParent.childName
if no explicit attributeName was
specified) to refer to this canvas, if this is not already the case.
If the attribute is already set to refer to some other object, this method will return false without taking any further action.
locatorParent
- New locator parent for this canvaschildName
- Name to refer from the locator parent to this canvas in the locatorpublic boolean setLocatorParent(Canvas locatorParent, java.lang.String childName, java.lang.String attributeName)
locators
that reference this canvas will
use the childName
to navigate from the specified parent to this component, exactly how named autoChildren
are referenced in locators. Note that, as with Smart GWT autoChildren, the locator parent does not need to be the direct parent of this component, or even a true ancestor, in the widget hierarchy. However, you should never set the locatorParent to a descendant of this widget as that would lead to infinite loops when attempting to create or resolve locators.
This method will also set
locatorParent.attributeName
, (or locatorParent.childName
if no explicit attributeName was
specified) to refer to this canvas, if this is not already the case.
If the attribute is already set to refer to some other object, this method will return false without taking any further action.
locatorParent
- New locator parent for this canvaschildName
- Name to refer from the locator parent to this canvas in the locatorattributeName
- Optional attribute to refer from the parent to this canvas. If unset the childName will be used instead.public void setPageLeft(int left)
left
- new left coordinate in pixelsPositioning overview and related methods
public void setPageTop(int top)
top
- new top coordinate in pixelsPositioning overview and related methods
public void setPanelContainer(Canvas container)
TabSet
or SectionStack
. Smart GWT uses this
method internally when child panels are added to panel container widgets; if you need to create a panel container widget
that does not extend one of the built-in ones (these are TabSet
, SectionStack
and Window
), your code should do the same thing.container
- The container widget for this canvaspublic void setRelativeTabPosition(java.lang.Integer position)
For canvases with no specified parent canvas
, (or where updateTabPositionOnReparent
is false), this method will and move the canvas to the appropriate tab-position among other
top level canvases. It will also disable updateTabPositionOnDraw
so if this method is called before draw, drawing this canvas will not cause its tab position to
change.
For canvases embedded in a getParentCanvas()
,
this method will move the canvas to the appropriate tab position among the other children of the parent.
Implementation note: This is achieved by setting an internal property to indicate the new tab position which will
be respected by the default getChildTabPosition()
implementation, and calling updateChildTabPositions()
to implement a reflow. Therefore if getChildTabPosition()
has been overridden, this method may have
no effect.
As with other APIs related to tab index management
,
tab indices are treated as a hierarchy by default. By setting the relative tab position of a canvas which is not itself
focusable but has focusable descendents, these descendents' tab position will be updated.
Note that after this method has been called, the tab position can be modified by subsequent code to shift another sibling in front of this one, or reparent this canvas.
position
- new relative tab positionpublic void setRight(int right)
NOTE: if you're setting multiple coordinates, use setRect(), moveTo() or resizeTo() instead
right
- new right coordinateSizing overview and related methods
public void shouldDragScroll()
Drag and Drop
public void show()
If the widget has not yet been drawn (and doesn't have a parent or master), this method calls the draw method as well.
public void showComponentMask()
unmaskedChildren
parameter. Children will remain blocked until hideComponentMask()
is called. This method will show the
componentMask
canvas to block mouse interaction with
children, and temporarily remove masked children from the page's tab-order.
This behavior differs from the standard
click mask
in that the modal mask shown by showClickMask()
will cover the entire screen and typically only allow
"unmasking" of top level components.
Use hideComponentMask()
to hide the component level mask.
public void showComponentMask(Canvas... unmaskedChildren)
unmaskedChildren
parameter. Children will remain blocked until hideComponentMask()
is called. This method will show the
componentMask
canvas to block mouse interaction with
children, and temporarily remove masked children from the page's tab-order.
This behavior differs from the standard
click mask
in that the modal mask shown by showClickMask()
will cover the entire screen and typically only allow
"unmasking" of top level components.
Use hideComponentMask()
to hide the component level mask.
unmaskedChildren
- Children passed into this parameter will continue to be interactive while other children are blocked. They will be
moved above the componentMask in the page's z-order and remain accessible via keyboard navigation. Note that this
array should contain direct children of this widget only.public com.google.gwt.event.shared.HandlerRegistration addShowContextMenuHandler(ShowContextMenuHandler handler)
Executed when the right mouse button is clicked. The default implementation of this method auto-creates a Menu
from the Canvas.contextMenu
property on this component and then calls Menu.showContextMenu()
on it to show it.
If you want to show a standard context menu, you can simply define your Menu and set it as the contextMenu property on your component - you do not need to override this method.
If you want to do some other processing before showing a menu or do something else entirely, then you should override this method. Note that the return value from this method controls whether or not the native browser context menu is shown.
addShowContextMenuHandler
in interface HasShowContextMenuHandlers
handler
- the showContextMenu handlerHandlerRegistration
used to remove this handlerpublic void showNextTo(Canvas otherWidget)
Note that this method simply sets the coordinates of the widget and displays it (using a animateShow()
by default). It will not change the parentElement
of either component.
An example use case might be showing a menu next to a menu-button.
otherWidget
- Canvas to show next topublic void showNextTo(Canvas otherWidget, java.lang.String side)
public void showNextTo(Canvas otherWidget, java.lang.String side, boolean canOcclude)
public void showNextTo(Canvas otherWidget, java.lang.String side, boolean canOcclude, boolean skipAnimation)
Note that this method simply sets the coordinates of the widget and displays it (using a animateShow()
by default). It will not change the parentElement
of either component.
An example use case might be showing a menu next to a menu-button.
otherWidget
- Canvas to show next toside
- Which side of the other canvas should we put. Options are "top", "bottom", "left",
"right". (Defaults to "right")canOcclude
- This argument controls whether this canvas can be positioned on top of the other widget if there isn't room to put it
next to the other widget extending out of the browser viewportskipAnimation
- If false
do not use an animation to show the component.public void showPendingMarker()
pendingMarker style
, or the Pending suffix in stateful
components). This is used for components that don't automatically track whether there are unsaved changes, such as
tabs. Other components (such as ListGrid
and DynamicForm
) show the "pending" visual state
automatically based on whether the
end user has edited particular field values.
public void showRecursively()
If the widget has not yet been drawn, this method calls the draw method as well.
Visibility overview and related methods
public void updateChildTabPosition(Canvas child)
updateTabPositionOnReparent
is true, ensure the
child canvas shows up in the TabIndexManager
tree under the entry for this widget
(the parent), in the position returned by getChildTabPosition()
. This method is called automatically in cases where a single child's tab position may need to be updated - such as if a child is added to a drawn parent.
See also updateChildTabPositions()
child
- child to have tab position updated.public void updateChildTabPositions()
TabIndexManager
, in the order defined by getChildTabPosition()
. This method will skip any children where
updateTabPositionOnReparent
is false. This method is called automatically on canvas draw(). It may be overridden by subclasses for custom tab-order behavior.
public void updateHover()
handleHover()
),
this method can be called to update the HTML contents of the hover. Has no effect if this widget is showing hover-components instead of simple HTML
, or if the hover
canvas is not showing for this widget.public void updateHover(java.lang.String hoverHTML)
handleHover()
),
this method can be called to update the HTML contents of the hover. Has no effect if this widget is showing hover-components instead of simple HTML
, or if the hover
canvas is not showing for this widget.hoverHTML
- Option to specify new HTML for the hover. If not passed, the result of this.getHoverHTML()
will be used instead. Note that if the hover
HTML is empty the hover will be hidden.public void updateTabPositionForDraw()
Has no effect if this canvas is embedded in a parent
.
public com.google.gwt.event.shared.HandlerRegistration addVisibilityChangedHandler(VisibilityChangedHandler handler)
Notification fired when this canvas becomes visible or hidden to the user. Note - this method is fired when the Canvas.isVisible()
state of this component changes. It may be fired in
response an explicit call to Canvas.show()
or Canvas.hide()
, or in response to a parent component being shown or hidden when
this widgets Canvas.visibility
is set to "inherit".
Note
that a call to Canvas.show()
or Canvas.hide()
will not always fire this notification. If this widget has
a hidden parent, show or hide would change this components Canvas.visibility
property, and may update the CSS visibility attribute of the drawn handle in the DOM, but would not
actually hide or reveal the component to the user and as such the notification would not fire.
Note also that this
notification will only be fired for components which have been drawn
.
addVisibilityChangedHandler
in interface HasVisibilityChangedHandlers
handler
- the visibilityChanged handlerHandlerRegistration
used to remove this handlerpublic static EdgeName getEventEdge()
getResizeFrom()
public static EdgeName getEventEdge(EdgeName... edgeMask)
edgeMask
- Array of legal edges. Default is all the edges that allow resizing (see resizeFrom
)getResizeFrom()
public static Point getSnapPosition(Canvas target, java.lang.String snapTo, Canvas snapper)
snapper
to be placed in order to "snap to" an edge or corner of
target
, in the same sense as snapTo
. Default for
snapEdge
is the opposite edge or corner from snapTo
. For example, snapTo
of "T" (top) means snapEdge
will default to "B" (bottom), so the returned coordinates would place
snapper
centered along the top edge of target
. A snapTo
of "TL" (top left)
means snapEdge
will default to "BR" (bottom right), so the returned coordinates would place the bottom
right of snapper
at the top left corner of target
.
target
can be passed as
either a Canvas or 4-element Array giving the top, left, width and height of the target.
target
- canvas to snap tosnapTo
- edge against which to snapsnapper
- canvas being snappedsnapper
to be placed in order to "snap to" an edge or corner of target
public static Point getSnapPosition(Canvas target, java.lang.String snapTo, Canvas snapper, java.lang.String snapEdge)
snapper
to be placed in order to "snap to" an edge or corner of
target
, in the same sense as snapTo
. Default for
snapEdge
is the opposite edge or corner from snapTo
. For example, snapTo
of "T" (top) means snapEdge
will default to "B" (bottom), so the returned coordinates would place
snapper
centered along the top edge of target
. A snapTo
of "TL" (top left)
means snapEdge
will default to "BR" (bottom right), so the returned coordinates would place the bottom
right of snapper
at the top left corner of target
.
target
can be passed as
either a Canvas or 4-element Array giving the top, left, width and height of the target.
target
- canvas to snap tosnapTo
- edge against which to snapsnapper
- canvas being snappedsnapEdge
- optional edge to snapTo. Default is the opposite edge or corner from snapTo
snapper
to be placed in order to "snap to" an edge or corner of target
public static void registerFontScaledPaddingStyles(java.lang.String[] scaledStyles, java.lang.String[] baselineStyles, int targetSizeChange)
padding size change
applied to the page. Each
class
to be registered is provided along with a corresponding baseline class, and a single
targetSizeChange
is specified for all the classes. The padding in each
registered class is adjusted downward towards the baseline as the padding size change
approaches 0 (no resizing), and upward as it increases, so that it exactly equals the
declared style's padding at a padding size change of targetSizeChange
.
Note that each call to this method replaces the registration of the previous call (if any),
and will have no effect until resizePadding()
is called.
For example:
isc.Canvas.registerFontScaledPaddingStyles( [ "tabButtonTop", "tabButtonBottom"], ["iconOnlyTabButtonTop", "iconOnlyTabButtonBottom"], 3 );In this case, the CSS style "tabButtonTop" will have its padding adjusted downward to the padding from the baseline CSS style "iconOnlyTabButtonTop" style at a
sizeChange
of 0, and be left unchanged at a sizeChange
of 3.scaledStyles
- styles whose padding should be adjustedbaselineStyles
- corresponding baseline reference stylestargetSizeChange
- sizeChange at which scaledStyles are unchangedresizeFonts(int)
,
resizePadding(int)
,
resizeControls(int)
,
com.smartgwt.client.widgets.Canvas#registerIconSizingAttributes
public static void resizeAutoChildAttributes(java.lang.String policy, int delta)
registerAutoChildSizingAttributes()
by some number
of pixels. This method may be invoked automatically from resizeControls()
or resizeFonts()
Must be called after the skin has been loaded, but before any components are created.
policy
- Which set of attributes should be resized? This should correspond to the sizing policy argument applied when
registering the icon sizing attributes
.delta
- number of pixels to increase or decrease from current sizepublic static void resizeControls(int delta)
In general, this method changes the height of various controls, except for certain controls that appear in alternate orientations (such as resizeBars and tabs), in which case thickness properties (resizeBarThickness, tabBarThickness) are adjusted.
The height of a text input control implies the height of most other controls:
Window headers
, TabBar and SectionHeaders Because of this necessary uniformity, just specifying a single pixel value is enough for the framework to resize all core controls, with several caveats:
resizeControls()
is only officially supported in CSS3 Mode
, which includes any of the skins in our Flat series
(Tahoe, Stratus, Obsidian and Twilight) or Enterprise series
(Enterprise/Blue and Graphite), or a
custom skin based on one of those - including any skin generated by the Skin Editor
. tree connector lines
vertically stretch, becoming obviously blurry and misshapen with an increase of 4-5px. To avoid this, replace the
tree connector media (see TreeGrid.connectorImage
).
FormItemIcon
s are not resized by default, because stretched icons
generally look worse than non-scaled icons that are a bit smaller than the input field spriting
will not be stretched because the sizes for these controls are embedded
in CSS. In most cases, this is desirable; for example, the downward chevron shape used for SelectItem controls
doesn't stretch, and looks better that way. delta
- number of pixels to increase or decrease from current sizepublic static void resizeControlsTo(int targetDelta)
resizeControls()
, but takes a
final target size instead of a delta representing the change from a current size. Note that all the same limitations
apply.targetDelta
- the final size, expressed as a differential from the defaultpublic static void resizeFonts(int sizeChange)
This method can be used to dynamically
increase or decrease font size for all of the fonts in your application, or just fonts defined in your chosen Smart GWT
skin (the latter can be achieved by passing styleSheets
as "skin_styles.css" - the default name for the CSS
file used in each Smart GWT skin).
resizeFonts()
must be called after the skin has been loaded, and
before any components have been created. Calling resizeFonts()
at a later time is not supported (you will
notice that font sizes still increase, however, this approach is not supported).
Some browsers will disallow access
or modification of styleSheets if they are loaded from a domain that is different from the loading page. In this case
resizeFonts()
cannot be used.
This method has a small performance penalty which depends on the browser, number of stylesheets being modified, and age of your machine. With modern browsers on modern machines resizing just skin fonts, the impact is basically negligible (<5ms).
Certain controls such as icons are resized when fonts are
resized (see setAutoResizeIcons()
and setAutoResizeAutoChildAttributes()
) so you might
want to set resizeRelatedControls
to false
where you are just trying to make fonts in a
dynamically loaded stylesheet match previously loaded fonts, but controls such as icons should not be resized upwards
again.
sizeChange
- size to change fonts by. Can be negative to shrink fontspublic static void resizeFonts(int sizeChange, java.lang.String styleSheets)
resizeFonts(int)
public static void resizeFonts(int sizeChange, java.lang.String styleSheets, java.lang.Boolean resizeRelatedControls)
This method can be used to dynamically
increase or decrease font size for all of the fonts in your application, or just fonts defined in your chosen Smart GWT
skin (the latter can be achieved by passing styleSheets
as "skin_styles.css" - the default name for the CSS
file used in each Smart GWT skin).
resizeFonts()
must be called after the skin has been loaded, and
before any components have been created. Calling resizeFonts()
at a later time is not supported (you will
notice that font sizes still increase, however, this approach is not supported).
Some browsers will disallow access
or modification of styleSheets if they are loaded from a domain that is different from the loading page. In this case
resizeFonts()
cannot be used.
This method has a small performance penalty which depends on the browser, number of stylesheets being modified, and age of your machine. With modern browsers on modern machines resizing just skin fonts, the impact is basically negligible (<5ms).
Certain controls such as icons are resized when fonts are
resized (see setAutoResizeIcons()
and setAutoResizeAutoChildAttributes()
) so you might
want to set resizeRelatedControls
to false
where you are just trying to make fonts in a
dynamically loaded stylesheet match previously loaded fonts, but controls such as icons should not be resized upwards
again.
sizeChange
- size to change fonts by. Can be negative to shrink fontsstyleSheets
- optional regular expression pattern for matching stylesheetsresizeRelatedControls
- resize icons and autoChild attributes? Set to false to suppress default behavior.public static void resizeFontsTo(int targetDelta)
resizeFonts()
, but takes a final
target size instead of a delta representing the change from a current size. Note that all the same limitations apply.targetDelta
- the final size, expressed as a differential from the defaultpublic static void resizeIcons(java.lang.String policy, int delta)
resizeControls()
. Must be called after the skin has been loaded, but before any components are created.
policy
- Which set of icons should be resized? This should correspond to the iconSizingPolicy argument applied when registering the icon sizing attributes
.delta
- number of pixels to increase or decrease from current sizepublic static void resizePadding(int fontSizeChange)
registerFontScaledPaddingStyles()
are modified.
resizePadding()
must be called after the skin has been loaded, and before any components have been created.
Calling resizePadding()
at a later time is not supported (you will notice that padding is modified,
however, this approach is not supported).
This method has similar browser security limitations as resizeFonts()
.
The intent is that the same font size change be
passed to this method as is passed to resizeFonts()
, so that the
targetSizeChange
in the call to registerFontScaledPaddingStyles()
represents the right font size for the unadjusted styles being registered.
fontSizeChange
- size change to apply to the padding of registered styles, so that they aren't changed at all
at the size change passed to registerFontScaledPaddingStyles()
, and the padding
is reduced to baseline style levels at a zero size change.resizeFonts(int)
,
resizeControls(int)
public static void resizePadding(int fontSizeChange, java.lang.String styleSheets)
registerFontScaledPaddingStyles()
are modified.
resizePadding()
must be called after the skin has been loaded, and before any components have been created.
Calling resizePadding()
at a later time is not supported (you will notice that padding is modified,
however, this approach is not supported).
This method has similar browser security limitations as resizeFonts()
.
The intent is that the same font size change be
passed to this method as is passed to resizeFonts()
, so that the
targetSizeChange
in the call to registerFontScaledPaddingStyles()
represents the right font size for the unadjusted styles being registered.
fontSizeChange
- size change to apply to the padding of registered styles, so that they aren't changed at all
at the size change passed to registerFontScaledPaddingStyles()
, and the padding
is reduced to baseline style levels at a zero size change.styleSheets
- optional regular expression pattern for matching stylesheetsresizeFonts(int)
,
resizeControls(int)
public static void setAllowExternalFilters(boolean allExternalFilters)
allowExternalFilters
setting.allExternalFilters
- new settingpublic static void setAutoResizeAutoChildAttributes(boolean autoResize)
controls
and text
? If true, attributes registered for resize with policy "controls"
will be resized when
resizeControls()
runs, and icons registered with policy "fonts"
will resize when
resizeFonts()
runs.
To resize autoChild attributes with other policies, developers should call resizeAutoChildAttributes()
directly
autoResize
- true if attributes should be auto-resizedpublic static void setAutoResizeIcons(boolean autoResizeIcons)
controls
and text
? If true, icon attributes registered for resize with policy
"controls"
will be resized when resizeControls()
runs, and icons registered with policy
"fonts"
will resize when resizeFonts()
runs.
To resize icons with other policies,
developers should call resizeIcons()
directly
autoResizeIcons
- true if icons should be auto-resizedpublic static void setDefaultPageSpace(int newDefaultPageSpace)
defaultPageSpace
.newDefaultPageSpace
- the new value for defaultPageSpace
.public static void setNeverUseFilters(boolean neverUseFilters)
neverUseFilters
setting.neverUseFilters
- new settingpublic static void startDebuggingOverflow(DebugOverflowSettings settings)
settings
- stopDebuggingOverflow()
public static void stopDebuggingOverflow()
public static void setDefaultProperties(Canvas canvasProperties)
Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.
canvasProperties
- properties that should be used as new defaults when instances of this class are createdSGWTProperties
protected Canvas getTestInstance()
public static Canvas getById(java.lang.String ID)
ID
.ID
- global ID of the Canvaspublic static Canvas getByJSObject(com.google.gwt.core.client.JavaScriptObject jsObj)
JavaScriptObject
.jsObj
- SmartClient object associated with Canvasprotected void setElement(com.google.gwt.user.client.Element elem)
getOuterElement()
and
getContentElement()
. See the javadoc for
those methods for more information. Note particularly that these elements should not be
directly manipulated in the DOM - instead standard SmartGWT APIs such as draw(),
clear(), setContents(), addChild(), redraw() should be used.
See also setHtmlElement(Element)
for how to embed
a SmartGWT component into an existing DOM element.
getElement() and setEleent() exist solely to support adding SmartGWT widgets to a core GWT layout manager. This usage has limitations and caveats - see this list of Frequently Asked Questions.
The mechanism that getElement() uses to integrate with core GWT is the same as that described for
com.smartgwt.client.widgets.Canvas#setHTMLElement(Element)
and has the same caveats
setElement
in class com.google.gwt.user.client.ui.UIObject
public com.google.gwt.user.client.Element getElement()
getOuterElement()
and
getContentElement()
. See the javadoc for
those methods for more information. Note particularly that these elements should not be
directly manipulated in the DOM - instead standard SmartGWT APIs such as draw(),
clear(), setContents(), addChild(), redraw() should be used.
See also setHtmlElement(Element)
for how to embed
a SmartGWT component into an existing DOM element.
getElement() and setEleent() exist solely to support adding SmartGWT widgets to a core GWT layout manager. This usage has limitations and caveats - see this list of Frequently Asked Questions.
The mechanism that getElement() uses to integrate with core GWT is the same as that described for
com.smartgwt.client.widgets.Canvas#setHTMLElement(Element)
and has the same caveats
getElement
in class com.google.gwt.user.client.ui.UIObject
public com.google.gwt.user.client.Element getElement(boolean allowPreRender)
allowPreRender
- UIObject.getElement()
public static <T extends Canvas> T asSGWTComponent(com.google.gwt.core.client.JavaScriptObject jsObj)
JavaScriptObject
. If
the supplied object is not a SmartClient Canvas, a warning will be logged and null
returned; otherwise the widget will be returned as the appropriate subtype of SGWT
Canvas.jsObj
- SmartClient Canvas whose wrapper is wantedpublic Canvas getByLocalId(java.lang.String ID)
A "local ID" is name for a child widget which is unique only for this parent, and not globally
unique as is required for ID
.
Widgets receive local IDs when loaded via
com.smartgwt.client.client.rpc.RPCManager#loadScreen()
or com.smartgwt.client.rpc.RPCManager#cacheScreens()
and
com.smartgwt.client.rpc.RPCManager#createScreen()
.
ID
- global ID of the Canvaspublic java.lang.String getClassName()
getClassName
in class BaseWidget
public void setInitHandler(CanvasInitHandler initHandler)
initHandler
- protected void onInit()
onInit
in class BaseWidget
protected void onDetach()
onDetach
in class com.google.gwt.user.client.ui.Widget
protected void onAttach()
onAttach
in class com.google.gwt.user.client.ui.Widget
public void addStyleName(java.lang.String style)
setStyleName(String)
addStyleName
in class com.google.gwt.user.client.ui.UIObject
style
- the style namesetStyleName(String)
public void setVisible(boolean visible)
setVisible
in interface com.google.gwt.user.client.ui.HasVisibility
setVisible
in class com.google.gwt.user.client.ui.UIObject
public Canvas setHeight(int height)
setHeight(Integer)
public Canvas setHeight100()
public java.lang.String getHeightAsString()
public void setTitle(java.lang.String title)
setPrompt(String)
setTitle
in class BaseWidget
title
- the titlepublic java.lang.String getTitle()
getPrompt()
getTitle
in class BaseWidget
public Canvas setTooltip(java.lang.String tooltip)
setPrompt(String)
tooltip
- the tooltipCanvas
instance, for chaining setter
callspublic java.lang.String getTooltip()
getPrompt()
public Canvas setWidth(int width)
setWidth(Integer)
public Canvas setWidth100()
public java.lang.String getWidthAsString()
public java.lang.String getLeftAsString()
position
property). Can also be set as a percentage, specified as a
String ending in '%', eg, "50%". In this case the top coordinate is considered as a percentage of the specified width
of the 'parent'
.
public java.lang.String getFacetId()
CubeGrid
, and it has a facetId
property specified then the Cube treats this as adding that facetId at the drop location.public Canvas setFacetId(java.lang.String facetId)
CubeGrid
, and it has a facetId property specified then
the Cube treats this as adding that facetId at the drop location.facetId
- the facet idCanvas
instance, for chaining setter
callspublic java.lang.String getTopAsString()
position
property). Can also be set as a percentage, specified as a String ending in '%', eg, "50%". In this case
the top coordinate is considered as a percentage of the specified height of the 'parent'
.
public int getAbsoluteLeft()
getPageLeft()
.getAbsoluteLeft
in class com.google.gwt.user.client.ui.UIObject
public int getAbsoluteTop()
getPageTop()
.getAbsoluteTop
in class com.google.gwt.user.client.ui.UIObject
public Canvas setAnimateShowEffect(AnimationEffect animateShowEffect)
animateShow()
is called without an explicit effect parameter.animateShowEffect
- the animate show effect. Default is "wipe"Canvas
instance, for chaining setter
callspublic AnimationEffect getAnimateShowEffect()
animateShow()
is called without an explicit effect parameter.public AnimationEffect getAnimateHideEffect()
animateHide()
is called without an explicit effect parameter.public Canvas setAnimateHideEffect(AnimationEffect animateHideEffect)
animateHide()
is called without an explicit effect parameter.animateHideEffect
- the animate show effect. Default is "wipe"Canvas
instance, for chaining setter
callspublic Canvas setDisabled(boolean disabled)
Note : This is an advanced setting
disabled
- new disabled state of this object - pass true
to disable the widget. Default value is falseCanvas
instance, for chaining setter
callspublic boolean getDisabled()
public java.lang.Boolean willAcceptDrop()
dragType
of the
dragTarget
(the component being dragged from) with the list of dropTypes
on this Canvas. If the dropTypes
list contains the dragType
value, then this method returns true. Otherwise it returns
false.
No matter what you return, the
onDropOver
and
onDropMove
handlers
will still be called, and their return value will control whether those events are bubbled to parent elements.
However, what you return from willAcceptDrop()
does determine whether the
onDrop
handler will be called.
onDrop()
will be called, and
its return value will determine whether the event is bubbled to parent
elements.
onDrop()
will not be called,
and the event will not be bubbled.
onDrop()
will not be called,
but the event will be bubbled to parent elements (giving them a chance
to handle the drop).
So, you should return false to definitively deny a drop, and return null if it could make sense to allow a parent
element (such as a Layout
) to handle the drop.
Note: This is an override point
protected void parentResized()
This method allows a child to implement a layout policy that can be used within any parent, such as a Resizer component
that always snaps to the parent's bottom-right corner. The default implementation of this method applies a child's
percent sizes, if any, or implements layout based on the snapTo
property.
Make sure you call super.parentResized() if you'd like the default behavior to apply.
Note: This is an override point
public Canvas getHoverComponent()
showHoverComponents
is true, this method is
called to get the component to show as a hover for this Canvas. There is no default implementation of this method, so
you need to override it with an implementation that returns a Canvas that suits your needs. By default, components
returned by getHoverComponent()
will not be automatically destroyed when the hover is hidden. To enforce
this, set hoverAutoDestroy
to true on the returned
component.
Note: this is an override point
public Canvas setSmoothFade(java.lang.Boolean smoothFade) throws java.lang.IllegalStateException
java.lang.IllegalStateException
public Canvas setPrefix(java.lang.String prefix)
public java.lang.String getPrefix()
public Canvas setResizeFrom(java.lang.String... resizeFrom)
#setResizeFrom(EdgeName)
instead.resizeFrom
- resizeFrom valuesCanvas
instance, for chaining setter
callspublic java.lang.Boolean resizeTo(java.lang.String width, java.lang.String height)
width
- new width for canvasheight
- new height for canvaspublic Canvas setProportionalResizeModifiers(java.lang.String... proportionalResizeModifiers) throws java.lang.IllegalStateException
proportionalResizing
is set to
ProportionalResizeMode.MODIFIER
or
ProportionalResizeMode.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.
The keys allowed in this set are: "Alt", "Ctrl", and "Shift". If this set of keys is empty then proportional
resizing is always used if proportionalResizing
is MODIFIER
and is never used if
proportionalResizing
is MODIFIER_OFF
.
proportionalResizeModifiers
- Default value is ["Shift"]Canvas
instance, for chaining setter
callsjava.lang.IllegalStateException
- this property cannot be changed after the underlying component has been createdpublic java.lang.String[] getProportionalResizeModifiers()
proportionalResizing
is set to
ProportionalResizeMode.MODIFIER
or
ProportionalResizeMode.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.
The keys allowed in this set are: "Alt", "Ctrl", and "Shift". If this set of keys is empty then proportional
resizing is always used if proportionalResizing
is MODIFIER
and is never used if
proportionalResizing
is MODIFIER_OFF
.
public boolean isVisible()
NOTE: Undrawn widgets will report themselves as visible if they would be visible if drawn.
isVisible
in interface com.google.gwt.user.client.ui.HasVisibility
isVisible
in class com.google.gwt.user.client.ui.UIObject
public void animateScroll(int scrollLeft, int scrollTop, AnimationCallback callback)
scrollLeft
- desired final left scroll postionscrollTop
- desired final top scroll postioncallback
- When the scroll completes this callback will be fired. Single
'earlyFinish' parameter will be passed if the animation was cut
short by a call to finishAnimationpublic void animateScroll(int scrollLeft, int scrollTop, AnimationCallback callback, int duration)
scrollLeft
- desired final left scroll postionscrollTop
- desired final top scroll postioncallback
- When the scroll completes this callback will be fired. Single
'earlyFinish' parameter will be passed if the animation was cut
short by a call to finishAnimationduration
- Duration in ms of the animated scrollpublic void animateFade(int opacity)
opacity
- desired final opacitypublic void animateFade(int opacity, AnimationCallback callback)
opacity
- desired final opacitycallback
- When the fade completes this callback will be fired. Single
'earlyFinish' parameter will be passed if the animation was cut
short by a call to finishAnimationpublic void animateFade(int opacity, AnimationCallback callback, int duration)
opacity
- desired final opacitycallback
- When the fade completes this callback will be fired. Single
'earlyFinish' parameter will be passed if the animation was cut
short by a call to finishAnimationduration
- Duration in ms of the animated fadepublic void animateFade(int opacity, AnimationCallback callback, int duration, AnimationAcceleration acceleration)
opacity
- desired final opacitycallback
- When the fade completes this callback will be fired. Single
'earlyFinish' parameter will be passed if the animation was cut
short by a call to finishAnimationduration
- Duration in ms of the animated fadeacceleration
- Animation acceleration to bias the ratiospublic void animateHide()
animateHideEffect
. This method will not fire if the
widget is already drawn and visible, or has overflow other than "visible"
or "hidden"
.public void animateHide(AnimationEffect effect)
"visible"
or "hidden"
.effect
- How should the content of the window be hidden during the hide? If omitted, default behavior can
be configured via animateHideEffect
public void animateHide(AnimateShowEffect effect)
"visible"
or "hidden"
.effect
- How should the content of the window be hidden during the hide? If omitted, default behavior can
be configured via animateHideEffect
public void animateHide(AnimationEffect effect, AnimationCallback callback)
"visible"
or "hidden"
.effect
- How should the content of the window be hidden during the hide? If omitted, default behavior
can be configured via animateHideEffect
callback
- When the hide completes this callback will be fired. Single
'earlyFinish' parameter will be passed if the animation was cut
short by a call to finishAnimation.public void animateHide(AnimateShowEffect effect, AnimationCallback callback)
"visible"
or "hidden"
.effect
- How should the content of the window be hidden during the hide? If omitted, default behavior
can be configured via animateHideEffect
callback
- When the hide completes this callback will be fired. Single
'earlyFinish' parameter will be passed if the animation was cut
short by a call to finishAnimation.public void animateHide(AnimationEffect effect, AnimationCallback callback, int duration)
"visible"
or "hidden"
.effect
- How should the content of the window be hidden during the hide? If omitted, default behavior
can be configured via animateHideEffect
callback
- When the hide completes this callback will be fired. Single
'earlyFinish' parameter will be passed if the animation was cut
short by a call to finishAnimation.duration
- Duration in ms of the animated hide. If unset, duration will be picked up from animateHideTime
public void animateHide(AnimateShowEffect effect, AnimationCallback callback, int duration)
"visible"
or "hidden"
.effect
- How should the content of the window be hidden during the hide? If omitted, default behavior
can be configured via animateHideEffect
callback
- When the hide completes this callback will be fired. Single
'earlyFinish' parameter will be passed if the animation was cut
short by a call to finishAnimation.duration
- Duration in ms of the animated hide. If unset, duration will be picked up from animateHideTime
public void animateShow()
animateShowEffect
. This method will not fire if the
widget is already drawn and visible, or has overflow other than "visible"
or "hidden"
.public void animateShow(AnimationEffect effect)
"visible"
or
"hidden"
.effect
- Animation effect to use when revealing the widget. If omitted, default behavior can be
configured via animateShowEffect
public void animateShow(AnimateShowEffect effect)
"visible"
or
"hidden"
.effect
- AnimateShowEffect effect to use when revealing the widget. If omitted, default behavior can be
configured via animateShowEffect
public void animateShow(AnimationEffect effect, AnimationCallback callback)
"visible"
or
"hidden"
.effect
- Animation effect to use when revealing the widget. If omitted, default behavior can be
configured via animateShowEffect
callback
- When the show completes this callback will be fired. Single
'earlyFinish' parameter will be passed if the animation was cut
short by a call to finishAnimation.public void animateShow(AnimateShowEffect effect, AnimationCallback callback)
"visible"
or
"hidden"
.effect
- AnimateShowEffect effect to use when revealing the widget. If omitted, default behavior can be
configured via animateShowEffect
callback
- When the show completes this callback will be fired. Single
'earlyFinish' parameter will be passed if the animation was cut short by a call to finishAnimation.public void animateShow(AnimationEffect effect, AnimationCallback callback, int duration)
"visible"
or
"hidden"
.effect
- Animation effect to use when revealing the widget. If omitted, default behavior can be
configured via animateShowEffect
callback
- When the show completes this callback will be fired. Single
'earlyFinish' parameter will be passed if the animation was cut
short by a call to finishAnimation.duration
- Duration in ms of the animated show. If unset, duration will be picked up from animateShowTime
public void animateShow(AnimateShowEffect effect, AnimationCallback callback, int duration)
"visible"
or
"hidden"
.effect
- AnimateShowEffect effect to use when revealing the widget. If omitted, default behavior can be
configured via animateShowEffect
callback
- When the show completes this callback will be fired. Single
'earlyFinish' parameter will be passed if the animation was cut
short by a call to finishAnimation.duration
- Duration in ms of the animated show. If unset, duration will be picked up from animateShowTime
public void updateShadow()
public int getZIndex()
public int getNextZIndex()
public Canvas setZIndex(int newIndex)
newIndex
- the new zIndex to set toCanvas
instance, for chaining setter
callspublic Rectangle getPageRect()
public Canvas setRect(Rectangle rectangle)
Moves the widget so that its top-left corner is at the specified top-left coordinates, then resizes it to the specified width and height.
rectangle
- new coordinatesCanvas
instance, for chaining setter
callspublic Canvas setRect(int left, int top, int width, int height)
Moves the widget so that its top-left corner is at the specified top-left coordinates, then resizes it to the specified width and height.
left
- new left coordinatetop
- new top coordinatewidth
- new widthheight
- new heightCanvas
instance, for chaining setter
callspublic Rectangle getRect()
public static java.lang.String getImgURL(java.lang.String URL)
If the passed URL begins with the special prefix "[SKIN]", it will have the widget.skinImgDir and Page.skinImgDir prepended. Otherwise the image is assumed to be application-specific, and will have the widget.appImgDir and Page.appImgDir automatically prepended.
Note that if passed an absolute path (starting with "/" or "http://" for example), no extra image directory information will be prepended to the generated URL.//
URL
- URL local to skin or application image directorypublic static java.lang.String getImgURL(java.lang.String URL, java.lang.String imgDir)
If the passed URL begins with the special prefix "[SKIN]", it will have the widget.skinImgDir and Page.skinImgDir prepended. Otherwise the image is assumed to be application-specific, and will have the widget.appImgDir and Page.appImgDir automatically prepended.
Note that if passed an absolute path (starting with "/" or "http://" for example), no extra image directory information will be prepended to the generated URL.//
URL
- URL local to skin or application image directoryimgDir
- optional image directory to override the default for this Canvaspublic static java.lang.String imgHTML(java.lang.String src)
The full URL for the image will be formed
according to the rules documented for
. getImgURL(java.lang.String)
The created image will have an identifier unique to this Canvas, and subsequent calls to
and getImage(java.lang.String)
with the name passed to this function will act on the image object produced by the HTML returned from this
call.setImage(java.lang.String, java.lang.String)
src
- URL local to the skin or application directory.public static java.lang.String imgHTML(java.lang.String src, int width, int height, java.lang.String name, java.lang.String extraStuff, java.lang.String imgDir)
The full URL for the image will be formed
according to the rules documented for
. getImgURL(java.lang.String)
The created image will have an identifier unique to this Canvas, and subsequent calls to
and getImage(java.lang.String)
with the name passed to this function will act on the image object produced by the HTML returned from this
call.setImage(java.lang.String, java.lang.String)
src
- URL local to the skin or application directory.width
- width of the imageheight
- height of the imagename
- name for the imageextraStuff
- additional attributes to write in the tagimgDir
- image-specific image directory to override the default for
this Canvaspublic static java.lang.String imgHTML(java.lang.String src, int width, int height)
public static void showPrintPreview(Canvas component)
component
- to get printable HTML for.public static void showPrintPreview(java.lang.Object[] components)
components
- components to get the print HTML for. May also include raw HTML strings which will be folded into the generated print
outputpublic static void showPrintPreview(java.lang.Object[] components, PrintProperties printProperties, java.lang.String title, PrintPreviewCallback callback)
components
- components to get the print HTML for. May also include raw HTML strings which will be folded into the generated print
outputprintProperties
- for customizing the print HTML output. If this parameter is passed as null, it will be ignored.title
- for the print windowcallback
- to fire when the print preview window has been created and shownpublic static void showPrintPreview(java.lang.Object[] components, PrintProperties printProperties, java.lang.String title, PrintPreviewCallback callback, Window printWindowProperties, java.lang.String printButtonTitle)
components
- components to get the print HTML for. May also include raw HTML strings which will be folded into the generated print
outputprintProperties
- for customizing the print HTML output. If this parameter is passed as null, it will be ignored.title
- for the print windowcallback
- to fire when the print preview window has been created and shownprintWindowProperties
- the print window propertiesprintButtonTitle
- the brint button titlepublic static void getPrintHTML(java.lang.Object[] components, PrintProperties printProperties, PrintHTMLCallback callback)
components
- Components to get the print HTML for. Strings of raw HTML may also be included in this array, and will be integrated
into the final HTML at the appropriate point.
HTML
.printProperties
- for customizing the print HTML output. If this parameter is passed as null, it will be ignored.callback
- to fire when the HTML has been generatedgetPrintHTML(PrintProperties, PrintHTMLCallback)
public java.lang.String getPrintHTML(PrintProperties printProperties, PrintHTMLCallback callback)
By default any Canvas with children will simply collect the printable HTML of its
children by calling getPrintHTML() on each child that is considered
printable
. If a callback is
provided, then null is always returned and the callback is fired asynchronously.
If overriding this method for a custom component, you should either return a String of printable HTML directly or return null and fire the provided callback using Class.fireCallback().
To return an empty print representation, return an empty string ("") rather than null.
The printProperties
argument, if passed,
must be passed to any subcomponents on which getPrintHTML()
is called.
Default implementation will set
flag to
true
to indicate printing is in* progress, and clear this flag when the
printing has completed (possibly via an asynchronous callback).
NOTE: Expecting a direct return value from the default implementation is deprecated usage. This is because small changes to an application (such as adding a few more data points to a chart or adding another button) or using certain browsers can make it necessary to generate the HTML asynchronously. Thus, application code should not rely on the return value and always pass a callback.
NOTE: CubeGrid does not support a WYSIWYG print view by default (also used when
exporting to pdf
). Instead we recommend
exporting to excel or csv format
.
printProperties
- properties to configure printing behavior - may be null.callback
- optional callback. This is required to handle cases where HTML generation
is asynchronous - if a method generates HTML asynchronously, it should return null, and
fire the specified callback on completion of HTML generation. The first parameter
HTML
should contain the generated print HTML. The callback is only called
if null is returned. Furthermore, the default getPrintHTML() implementation always
returns null and fires the callback when a callback is provided. See
Callback
.Printing overview and related methods
public static void printComponents(java.lang.Object[] components)
components
- components to get the print HTML for. May also include raw HTML strings which will be folded into the generated
print outputpublic Canvas setAutoChildConstructor(java.lang.String autoChildName, java.lang.String className)
autoChildName
.autoChildName
- the name of the AutoChildclassName
- the SmartClient class name to use when constructing the AutoChild.Canvas
instance, for chaining setter
callsAutoChildUsage
public Canvas setAutoChildProperties(java.lang.String autoChildName, Canvas properties) throws java.lang.IllegalStateException
Canvas
AutoChild named autoChildName
.
properties
must not have already been created
(properties.isCreated()
must be false
).
NOTE: Overrides at override points are not applied to AutoChildren created from
properties
; that is, if the Java Class
of properties
overrides a Smart GWT override point, the custom method implementation will not be called.
autoChildName
- the name of the AutoChildproperties
- AutoChild configurationCanvas
instance, for chaining setter
callsjava.lang.IllegalStateException
- if properties
has been created.AutoChildUsage
public Canvas setAutoChildProperties(java.lang.String autoChildName, FormItem properties) throws java.lang.IllegalStateException
FormItem
AutoChild named autoChildName
.
properties
must not have already been created
(properties.isCreated()
must be false
).
NOTE: Overrides at override points are not applied to AutoChildren created from
properties
; that is, if the Java Class
of properties
overrides a Smart GWT override point, the custom method implementation will not be called.
autoChildName
- the name of the AutoChildproperties
- AutoChild configurationCanvas
instance, for chaining setter
callsjava.lang.IllegalStateException
- if properties
has been created.AutoChildUsage
public Canvas setAutoChildProperties(java.lang.String autoChildName, EditProxy properties) throws java.lang.IllegalStateException
autoChildName
.
properties
must not have already been created
(properties.isCreated()
must be false
).
autoChildName
- the name of the AutoChildproperties
- AutoChild configurationCanvas
instance, for chaining setter
callsjava.lang.IllegalStateException
- if properties
has been created.AutoChildUsage
public Canvas setAutoChildProperties(java.lang.String autoChildName, EditContext properties) throws java.lang.IllegalStateException
autoChildName
.
properties
must not have already been created
(properties.isCreated()
must be false
).
autoChildName
- the name of the AutoChildproperties
- AutoChild configurationCanvas
instance, for chaining setter
callsjava.lang.IllegalStateException
- if properties
has been created.AutoChildUsage
public Canvas setAutoChildVisibility(java.lang.String autoChildName, boolean visible)
autoChildName
.
NOTE: This API is not valid for all AutoChildren because some AutoChildren cannot be hidden without destroying the main functions of the component.
autoChildName
- name of an AutoChildvisible
- whether to show the AutoChildCanvas
instance, for chaining setter
callspublic final Canvas getCanvasAutoChild(java.lang.String autoChildName)
Canvas
AutoChild named autoChildName
if already created.autoChildName
- name of an AutoChild to return.java.lang.RuntimeException
- if the AutoChild is not a SmartClient Canvas
object.AutoChildUsage
public final FormItem getFormItemAutoChild(java.lang.String autoChildName)
FormItem
AutoChild named autoChildName
if already created.autoChildName
- name of an AutoChild to return.java.lang.RuntimeException
- if the AutoChild is not a SmartClient FormItem
object.AutoChildUsage
public void addChild(com.google.gwt.user.client.ui.Widget widget)
If newChild has a parent it will be removed from it. If it has a master, it will be detached from it if the master is a child of a different parent. If newChild has peers, they'll be added to this widget as children as well.
newChild
- new child canvas to addpublic Canvas addChild(Canvas newChild, java.lang.String name, boolean autoDraw)
If newChild has a parent it will be removed from it. If it has a master, it will be detached from it if the master is a child of a different parent. If newChild has peers, they'll be added to this widget as children as well.
newChild
- new child canvas to addname
- name to assign to child (eg: this[name] == child)autoDraw
- if false, child will not automatically be drawn (only for advanced use)Containment overview and related methods
public Canvas setChildren(Canvas... children)
Note : This is an advanced setting
children
- children Default value is nullCanvas
instance, for chaining setter
callspublic int getOffsetHeight()
getOffsetHeight
in class com.google.gwt.user.client.ui.UIObject
public int getOffsetWidth()
getOffsetWidth
in class com.google.gwt.user.client.ui.UIObject
public Canvas setAutoHeight()
For use with setOverflow(Overflow.VISIBLE), where widgets render only as large as their contents and/or children, and height and width settings act as a minimum size.
Canvas
instance, for chaining setter
callspublic Canvas setAutoWidth()
For use with setOverflow(Overflow.VISIBLE), where widgets render only as large as their contents and/or children, and height and width settings act as a minimum size.
Canvas
instance, for chaining setter
callspublic java.lang.String showClickMask(Function clickActionCallback, ClickMaskMode mode, Canvas[] unmaskedTargets)
clickActionCallback
- action to fire when the user clicks on the maskmode
- whether to automatically hide the clickMask on mouseDown and suppress the mouseDown
event from reaching the target under the mouseunmaskedTargets
- initially unmasked targets for this clickMask. Note that if this is a "hard"
mask, unmasked children of
masked parents are not supported so any non-top-level widgets passed in will have their parents unmasked. Children of
masked parents can never be masked.public java.lang.Boolean visibleAtPoint(int x, int y, boolean withinViewport, Canvas ignoreWidgets, Canvas upToParent)
x
- GLOBAL x-coordinatey
- GLOBAL y-coordinatewithinViewport
- point lies within our viewport rather than just our drawn areaignoreWidgets
- If passed ignore widget(s), do not check whether those widgets occludes this oneupToParent
- If passed, only check for siblings occluding the component up as far as the specified parent widgetPositioning overview and related methods
public Canvas setAriaState(java.lang.String stateName, java.lang.Object stateValue) throws java.lang.IllegalStateException
com.smartgwt.docs.Accessibility
.stateName
- stateValue
- Canvas
instance, for chaining setter
callsjava.lang.IllegalStateException
- ARIA state cannot be changed after the component has been created.public void updateEditNode(EditContext editContext, EditNode editNode)
liveObject
by EditContext
when the EditContext is being serialized. The liveObject may make any updates
needed to the EditNode
(or the EditContext
as a
whole) in order to be able to later recreate the objects.
editContext
- the EditContexteditNode
- the EditNodeEditContext.serializeAllEditNodes()
,
EditContext.serializeEditNodes(com.smartgwt.client.tools.EditNode[])
public Canvas setAdaptWidthByCustomizer(AdaptWidthByCustomizer customizer)
adaptWidthBy
.AdaptWidthByCustomizer
- customizerCanvas
instance, for chaining setter
callsAdaptWidthByCustomizer
,
setCanAdaptWidth(java.lang.Boolean)
public Canvas setAdaptHeightByCustomizer(AdaptHeightByCustomizer customizer)
adaptHeightBy
.AdaptHeightByCustomizer
- customizerCanvas
instance, for chaining setter
callsAdaptHeightByCustomizer
,
setCanAdaptHeight(java.lang.Boolean)
public void provideRuleContext(java.lang.String dataPath, java.lang.Object data)
com.smartgwt.client.widgets.Canvas#ruleScope
component,
to be made available in the rule context at the specified path
.
path
must be one or more valid identifiers with either dot (.) or slash (/) used
as a separator.
data
can be any value, including both atomic values like a Boolean or String, or a
nested data structure. Pass data
as null
to remove data from the
context at the specified path
dbc
is the DataBoundComponent to be identified as the owner of the rule context
contribution. This component is used to handle any conflicts between multiple components
contributing to the same base path (i.e. first segment of path). For any collision an editable
display (such as a form or editable grid) wins over a static display (such as a non-editable
grid with a selection). Hidden components have lowest priority even if editable. For two
editable components the first becomes the owner.
path
- path where data should be made availabledata
- data to contribute to rule contextpublic void provideRuleContext(java.lang.String dataPath, java.lang.Object data, DataBoundComponent dbc)
com.smartgwt.client.widgets.Canvas#ruleScope
component,
to be made available in the rule context at the specified path
.
path
must be one or more valid identifiers with either dot (.) or slash (/) used
as a separator.
data
can be any value, including both atomic values like a Boolean or String, or a
nested data structure. Pass data
as null
to remove data from the
context at the specified path
dbc
is the DataBoundComponent to be identified as the owner of the rule context
contribution. This component is used to handle any conflicts between multiple components
contributing to the same base path (i.e. first segment of path). For any collision an editable
display (such as a form or editable grid) wins over a static display (such as a non-editable
grid with a selection). Hidden components have lowest priority even if editable. For two
editable components the first becomes the owner.
path
- path where data should be made availabledata
- data to contribute to rule contextdbc
- the DataBoundComponent contributing to ruleContextpublic void revealChild(java.lang.String childID)
TabSet
have more useful implementations)
NOTE: This is an override point.childID
- the global ID of the child Canvas to revealpublic void revealChild(Canvas child)
TabSet
have more useful implementations)
NOTE: This is an override point.child
- the child Canvas to revealpublic static Canvas setDefaultShowCustomScrollbars(boolean showCS)
This method changes the default value of com.smartgwt.client.widgets.Canvas#showCustomScrollbars
.
showCS
- whether to show custom (SmartGWT-based) scrollbars rather than css-scrollbars by default.Canvas
instance, for chaining setter
callspublic com.smartgwt.logicalstructure.core.LogicalStructureObject setLogicalStructure(com.smartgwt.logicalstructure.widgets.CanvasLogicalStructure s)
LogicalStructure
interface,
which supports Eclipse's logical structure debugging facility.public com.smartgwt.logicalstructure.core.LogicalStructureObject getLogicalStructure()
LogicalStructure
interface,
which supports Eclipse's logical structure debugging facility.getLogicalStructure
in interface LogicalStructure
getLogicalStructure
in class BaseWidget