com.smartgwt.client.widgets
Class Canvas

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.smartgwt.client.widgets.BaseWidget
              extended by com.smartgwt.client.widgets.Canvas
All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, HasClickHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers
Direct Known Subclasses:
BatchUploader, BrowserPlugin, Calendar, DetailViewer, DrawPane, DynamicForm, EdgedCanvas, EditPane, GridRenderer, HTMLFlow, Layout, LayoutSpacer, PrintCanvas, RangeSlider, Slider, StatefulCanvas, TabSet, TileLayout, WidgetCanvas

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, HasDropHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers

Base class for all Smart GWT visual components (except FormItems).

Canvas provides:


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.smartgwt.client.widgets.BaseWidget
config, configOnly, id, nativeObject, scClassName
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
Canvas()
           
Canvas(JavaScriptObject jsObj)
           
Canvas(String id)
           
 
Method Summary
 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, String name)
           
 Canvas addChild(Canvas newChild, 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, 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.
 void addChild(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.
 HandlerRegistration addClickHandler(ClickHandler handler)
          Add a click handler.
 HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler)
          Add a doubleClick handler.
 HandlerRegistration addDragMoveHandler(DragMoveHandler handler)
          Add a dragMove handler.
 HandlerRegistration addDragRepositionMoveHandler(DragRepositionMoveHandler handler)
          Add a dragRepositionMove handler.
 HandlerRegistration addDragRepositionStartHandler(DragRepositionStartHandler handler)
          Add a dragRepositionStart handler.
 HandlerRegistration addDragRepositionStopHandler(DragRepositionStopHandler handler)
          Add a dragRepositionStop handler.
 HandlerRegistration addDragResizeMoveHandler(DragResizeMoveHandler handler)
          Add a dragResizeMove handler.
 HandlerRegistration addDragResizeStartHandler(DragResizeStartHandler handler)
          Add a dragResizeStart handler.
 HandlerRegistration addDragResizeStopHandler(DragResizeStopHandler handler)
          Add a dragResizeStop handler.
 HandlerRegistration addDragStartHandler(DragStartHandler handler)
          Add a dragStart handler.
 HandlerRegistration addDragStopHandler(DragStopHandler handler)
          Add a dragStop handler.
 HandlerRegistration addDropHandler(DropHandler handler)
          Add a drop handler.
 HandlerRegistration addDropMoveHandler(DropMoveHandler handler)
          Add a dropMove handler.
 HandlerRegistration addDropOutHandler(DropOutHandler handler)
          Add a dropOut handler.
 HandlerRegistration addDropOverHandler(DropOverHandler handler)
          Add a dropOver handler.
 HandlerRegistration addFocusChangedHandler(FocusChangedHandler handler)
          Add a focusChanged handler.
 HandlerRegistration addHoverHandler(HoverHandler handler)
          Add a hover handler.
 HandlerRegistration addHoverHiddenHandler(HoverHiddenHandler handler)
          Add a hoverHidden handler.
 HandlerRegistration addKeyDownHandler(KeyDownHandler handler)
          Add a keyDown handler.
 HandlerRegistration addKeyPressHandler(KeyPressHandler handler)
          Add a keyPress handler.
 HandlerRegistration addMouseDownHandler(MouseDownHandler handler)
          Add a mouseDown handler.
 HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler)
          Add a mouseMove handler.
 HandlerRegistration addMouseOutHandler(MouseOutHandler handler)
          Add a mouseOut handler.
 HandlerRegistration addMouseOverHandler(MouseOverHandler handler)
          Add a mouseOver handler.
 HandlerRegistration addMouseStillDownHandler(MouseStillDownHandler handler)
          Add a mouseStillDown handler.
 HandlerRegistration addMouseUpHandler(MouseUpHandler handler)
          Add a mouseUp handler.
 HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler)
          Add a mouseWheel handler.
 HandlerRegistration addMovedHandler(MovedHandler handler)
          Add a moved handler.
 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, String name)
           
 Canvas addPeer(Canvas newPeer, String name, Boolean autoDraw)
           
 Canvas addPeer(Canvas newPeer, String name, Boolean autoDraw, 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.
 HandlerRegistration addResizedHandler(ResizedHandler handler)
          Add a resized handler.
 HandlerRegistration addRightMouseDownHandler(RightMouseDownHandler handler)
          Add a rightMouseDown handler.
 HandlerRegistration addScrolledHandler(ScrolledHandler handler)
          Add a scrolled handler.
 HandlerRegistration addShowContextMenuHandler(ShowContextMenuHandler handler)
          Add a showContextMenu handler.
 void addStyleName(String style)
          Multiple styles are currently not supported.
 HandlerRegistration addVisibilityChangedHandler(VisibilityChangedHandler handler)
          Add a visibilityChanged handler.
 void adjustForContent(boolean immediate)
          This method tells a component to adjust for size changes made to content by external code.
 void animateFade(int opacity)
          Animate a change in opacity from the widget's current opacity to the specified opacity.
 void animateFade(int opacity, AnimationCallback callback)
          Animate a change in opacity from the widget's current opacity to the specified opacity.
 void animateFade(int opacity, AnimationCallback callback, int duration)
          Animate a change in opacity from the widget's current opacity to the specified opacity.
 void animateFade(int opacity, AnimationCallback callback, int duration, AnimationAcceleration acceleration)
          Animate a change in opacity from the widget's current opacity to the specified opacity.
 void animateFade(Integer opacity)
          Animate a change in opacity from the widget's current opacity to the specified opacity.
 void animateFade(Integer opacity, AnimationCallback callback)
           
 void animateFade(Integer opacity, AnimationCallback callback, Integer duration)
           
 void animateFade(Integer opacity, AnimationCallback callback, Integer duration, AnimationAcceleration acceleration)
          Animate a change in opacity from the widget's current opacity to the specified opacity.
 void 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(Integer left, Integer top)
          Animate a reposition of this canvas from its current position to the specified position
 void animateMove(Integer left, Integer top, AnimationCallback callback)
           
 void animateMove(Integer left, Integer top, AnimationCallback callback, Integer duration)
           
 void animateMove(Integer left, Integer top, AnimationCallback callback, Integer duration, AnimationAcceleration acceleration)
          Animate a reposition of this canvas from its current position to the specified position
 void animateRect(Integer left, Integer top, Integer width, Integer height)
          Animate a reposition / resize of this canvas from its current size and position.
 void animateRect(Integer left, Integer top, Integer width, Integer height, AnimationCallback callback)
           
 void animateRect(Integer left, Integer top, Integer width, Integer height, AnimationCallback callback, Integer duration)
           
 void animateRect(Integer left, Integer top, Integer width, Integer height, AnimationCallback callback, Integer duration, AnimationAcceleration acceleration)
          Animate a reposition / resize of this canvas from its current size and position.
 void animateResize(Integer width, Integer height)
          Animate a resize of this canvas from its current size to the specified size
 void animateResize(Integer width, Integer height, AnimationCallback callback)
           
 void animateResize(Integer width, Integer height, AnimationCallback callback, Integer duration)
           
 void animateResize(Integer width, Integer height, AnimationCallback callback, Integer duration, AnimationAcceleration acceleration)
          Animate a resize of this canvas from its current size to the specified size
 void animateScroll(Integer scrollLeft, Integer scrollTop)
          Animate a scroll from the current scroll position to the specified position.
 void animateScroll(Integer scrollLeft, Integer scrollTop, AnimationCallback callback)
           
 void animateScroll(Integer scrollLeft, Integer scrollTop, AnimationCallback callback, Integer duration)
           
 void animateScroll(Integer scrollLeft, Integer scrollTop, AnimationCallback callback, Integer duration, AnimationAcceleration acceleration)
          Animate a scroll from the current scroll position to the specified position.
 void 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(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>
T
asSGWTComponent(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(String autoChildName, Canvas defaults)
          Changes the defaults for Canvas AutoChildren named autoChildName.
static void changeAutoChildDefaults(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.
 Boolean clickMaskUp()
          Determines whether a clickmask is showing
 Boolean clickMaskUp(String ID)
          Determines whether a clickmask is showing
 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.
 Boolean contains(Canvas canvas, 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.
 Boolean containsEvent()
          Return true if the last event's mouse coordinates are within the bounds of this component.
 Boolean containsFocus()
          Returns true if the keyboard focus is in this Canvas or any child of this Canvas.
 Boolean containsPoint(int x, int y)
          Return whether or not this object contains the specified global (x,y) coordinates.
 Boolean containsPoint(int x, int y, Boolean withinViewport)
          Return whether or not this object contains the specified global (x,y) coordinates.
protected  JavaScriptObject create()
           
 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.
 void focus()
          If this canvas can accept focus, give it keyboard focus.
 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()
           
 int getAbsoluteTop()
           
 String getAccessKey()
          If specified this governs the HTML accessKey for the widget.
 AnimationAcceleration getAnimateAcceleration()
          Default acceleration effect to apply to all animations on this Canvas.
 Integer getAnimateFadeTime()
          Default time for performing an animated fade.
 AnimationAcceleration getAnimateHideAcceleration()
          Default acceleration function for performing an animated hide.
 Integer getAnimateHideTime()
          Default time for performing an animated hide.
 AnimationAcceleration getAnimateMoveAcceleration()
          Default acceleration effect for performing an animated move.
 Integer getAnimateMoveTime()
          Default time for performing an animated move.
 AnimationAcceleration getAnimateRectAcceleration()
          Default acceleration function for performing an animated move and resize.
 Integer getAnimateRectTime()
          Default time for performing an animated setRect.
 AnimationAcceleration getAnimateResizeAcceleration()
          Default acceleration function for performing an animated resize.
 Integer getAnimateResizeTime()
          Default time for performing an animated resize.
 AnimationAcceleration getAnimateScrollAcceleration()
          Default acceleration function for performing an animated scroll.
 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 Canvas#animateShow() is called without an explicit effect parameter.
 Integer getAnimateShowTime()
          Default time for performing an animated show.
 int getAnimateTime()
          Default total duration of animations.
 String getAppImgDir()
          Default directory for app-specific images, relative to the Page-wide appImgDir.
 String getAriaRole()
          ARIA role of this component.
 Boolean getAutoDraw()
          If true, this canvas will draw itself immediately after it is created.
 Boolean getAutoShowParent()
          If set to true, the widget's parent (if any) will automatically be shown whenever the widget is shown.
 String getBackgroundColor()
          The background color for this widget.
 String getBackgroundImage()
          URL for a background image for this widget (corresponding to the CSS "background-image" attribute).
 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.
 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").
 int getBottom()
          Return the bottom coordinate of this object as rendered, relative to its enclosing context, in pixels.
static Canvas getById(String ID)
          Retrieve a Canvas by its global ID.
static Canvas getByJSObject(JavaScriptObject jsObj)
          Retrieve a Canvas from its JavaScriptObject.
 Canvas getByLocalId(String ID)
          Retrieve a child of this Canvas by it's local ID.
 Boolean getCanAcceptDrop()
          Indicates that this object can receive dropped widgets (i.e.
 Boolean getCanDrag()
          Indicates whether this widget can initiate custom drag-and-drop operations (other than reposition or resize).
 Boolean getCanDragReposition()
          Indicates whether this widget can be moved by a user of your application by simply dragging with the mouse.
 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.
 Boolean getCanDrop()
          Indicates that this object can be dropped on top of other widgets.
 Boolean getCanDropBefore()
          When explicitly set to false, disallows drop before this member in the Layout.
 Boolean getCanFocus()
          Can this widget be allowed to become the target of keyboard events?
 Boolean getCanHover()
          Will this Canvas fire hover events when the user hovers over it, or one of its children?
 Boolean getCanSelectText()
          Whether native drag selection of contained text is allowed within this Canvas.
 Canvas getCanvasAutoChild(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.
 Boolean getChildrenSnapResizeToGrid()
          If true, causes this canvas's children to snap to its grid when resizing.
 Boolean getChildrenSnapToGrid()
          If true, causes this canvas's children to snap to its grid when dragging.
 String getClassName()
          Returns the javascript class name.
 Element getContentElement()
          Returns the DOM element for this Canvas which contains the contents, or for parent components, the DOM elements for any drawn children.
 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.
 Cursor getCursor()
          Specifies the cursor image to display when the mouse pointer is over this widget.
 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.
 Boolean getDestroyed()
          If this property is set to true, the destroy() method has been called on this canvas.
 Boolean getDestroying()
          This property is set to true when the Canvas.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.
 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.
 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 attributes 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 attributes 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.
 String getDragType()
          Sets a dragType for this widget used, to be compared to dropTypes on possible drop target widgets.
 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.
 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.
 Boolean getDynamicContents()
          Dynamic contents allows the contents string to be treated as a simple, but powerful template.
 String getEdgeBackgroundColor()
          Background color for the EdgedCanvas created to decorate this component.
 String getEdgeCenterBackgroundColor()
          Background color for the center section only.
 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?
 Integer getEdgeOffset()
          Amount the contained Canvas should be offset.
 Integer getEdgeOpacity()
          Opacity of the edges.
 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
 Element getElement()
          Normal usage of SmartGWT is to call draw() on SmartGWT widgets, not to use use RootPanel.add().
 Element getElement(boolean allowPreRender)
           
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.
 String getFacetId()
          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.
 FormItem getFormItemAutoChild(String autoChildName)
          Returns the FormItem AutoChild named autoChildName if already created.
 String getFullDataPath()
          Returns a fully qualified DataPath for this canvas.
 String getGroupBorderCSS()
          Sets the style for the grouping frame around the canvas.
 String getGroupLabelBackgroundColor()
          If set, the background color of the grouping label.
 String getGroupLabelStyleName()
          Sets the style for the grouping label.
 String getGroupTitle()
          The title/label for the grouping.
 Integer getHeight()
          Size for this component's vertical dimension.
 String getHeightAsString()
           
 boolean getHideUsingDisplayNone()
          When this widget is hidden (see visibility and Canvas.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.
 Boolean getHoverAutoDestroy()
          If this.showHover is true and Canvas.getHoverComponent is implemented, should the hoverCanvas returned from it be automatically destroyed when it is hidden?
 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
 Integer getHoverHeight()
          If this.showHover is true, this property can be used to customize the height of the hover canvas shown.
 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.
 Boolean getHoverMoveWithMouse()
          If this.showHover is true, should this widget's hover canvas be moved with the mouse while visible?
 Integer getHoverOpacity()
          If this.showHover is true, should the hover canvas be shown with opacity other than 100?
 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.
 Integer getHoverWidth()
          If this.showHover is true, this property can be used to customize the width of the hover canvas shown.
 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 getHSnapOrigin()
          Get an offset to be used when calculating snap positioning.
 int getHSnapOrigin(Canvas snapChild)
          Get an offset to be used when calculating snap positioning.
 int getHSnapPosition(int coordinate)
          Override this method to provide a custom snap-to grid.
 int getHSnapPosition(int coordinate, String direction)
          Override this method to provide a custom snap-to grid.
 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().
 DrawPosition getHtmlPosition()
          If htmlElement is specified, this attribute specifies the position where the canvas should be inserted relative to the htmlElement in the DOM.
 Element getImage(String identifier)
          Retrieve a native image element by name.
static String getImgURL(String URL)
          Return the full URL for an image to be drawn in this canvas.
static String getImgURL(String URL, 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.
 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 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.
 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).
 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).
 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.
 com.smartgwt.logicalstructure.core.LogicalStructureObject getLogicalStructure()
           
 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 Canvas.getMasterCanvas as of Smart GWT release 9.1
 Boolean getMatchElement()
          If htmlElement is specified, should this canvas initially be drawn at the same dimensions as the htmlElement?
Note: setting this property will not force the canvas to resize if the element subsequently resizes (for example due to page reflow).
 int getMaxHeight()
          Maximum height that this Canvas can be resized to.
 int getMaxWidth()
          Maximum width that this Canvas can be resized to.
 String getMenuConstructor()
          Default class used to construct menus created by this component, including context menus.
 int getMinHeight()
          Minimum height that this Canvas can be resized to by a user.
 int getMinWidth()
          Minimum width that this Canvas can be resized to.
 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 'mouseStillDown' events for this object
 int getMouseStillDownInitialDelay()
          Amount of time (in milliseconds) before mouseStillDown events start to be fired for this object.
 int getNextZIndex()
          get the next zIndex for the next item to be drawn.
 Boolean getNoDoubleClicks()
          If true, this canvas will receive all mouse-clicks as single click events rather than as doubleClick events.
 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()
 Integer getOpacity()
          Renders the widget to be partly transparent.
static Canvas getOrCreateRef(JavaScriptObject jsObj)
           
 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.
 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
 Canvas getParentCanvas()
          This Canvas's immediate parent, if any.
 Canvas getParentElement()
          Deprecated. As of Smartclient version 9.1, deprecated in favor of parentCanvas and Canvas.getParentCanvas
 Canvas[] getPeers()
          Array of all Canvii that are peers of 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.
 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.
 String getPrefix()
           
 Boolean getPrintChildrenAbsolutelyPositioned()
          Should this canvas print its children absolutely positioned when generating printable HTML.
static void getPrintHTML(Object[] components, PrintProperties printProperties, PrintHTMLCallback callback)
          Returns print-formatted HTML for the specified list of components.
 String getPrintHTML(PrintProperties printProperties, PrintHTMLCallback callback)
          Retrieves printable HTML for this component and all printable subcomponents.
 String getPrompt()
          Prompt displayed in hover canvas if showHover is true.
 Rectangle getRect()
          Get all four coordinates, relative to the enclosing context, at one.
 Boolean getRedrawOnResize()
          Should this element be redrawn in response to a resize?
 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.
 int getScrollbarSize()
          How thick should we make the scrollbars for this canvas.
NOTE: has no effect if showCustomScrollbars is false.
 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.
 int getShadowDepth()
          Depth of the shadow, or the virtual height above the page of the widget throwing the shadow.
 String getShadowImage()
          Base name of the series of images for the sides, corners, and center of the shadow.
 Integer getShadowOffset()
          Offset of the shadow.
 Integer getShadowSoftness()
          Softness, or degree of blurring, of the shadow.
 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.
 Boolean getShowDragShadow()
          When this widget is dragged, if its dragAppearance is "target", should we show a shadow behind the canvas during the drag.
 Boolean getShowEdges()
          Whether an EdgedCanvas should be used to show image-based edges around this component.
 Boolean getShowHover()
          If this.canHover is true, should we show the global hover canvas by default when the user hovers over this canvas?
 Boolean getShowHoverComponents()
          When set to true, shows a widget hovering at the mouse point instead of the builtin hover label.
 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.
 Boolean getShowShadow()
          Whether to show a drop shadow for this Canvas
 boolean getShrinkElementOnHide()
          This is an advanced setting.
 String getSkinImgDir()
          Default directory for skin images (those defined by the class), relative to the Page-wide skinDir.
 String getSnapAxis()
          Describes which axes to apply snap-to-grid to.
 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.
 String getSnapHDirection()
          The horizontal snap direction.
 int getSnapHGap()
          The horizontal grid size to use, in pixels, when snap-to-grid is enabled.
 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.
 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.
 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).
 Boolean getSnapResizeToGrid()
          Causes this canvas to snap to its parent's grid when resizing.
 String getSnapTo()
          Position this widget such that it is aligned with ("snapped to") an edge of its master (if specified), or its parent canvas.
 Boolean getSnapToGrid()
          Causes this canvas to snap to its parent's grid when dragging.
 String getSnapVDirection()
          The vertical snap direction.
 int getSnapVGap()
          The vertical grid size to use, in pixels, when snap-to-grid is enabled.
 String getStyleName()
          The CSS class applied to this widget as a whole.
 Integer getTabIndex()
          If specified this governs the tabIndex of the widget in the page's tab order.
protected  Canvas getTestInstance()
           
 String getTitle()
          Synonym for getPrompt()
 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).
 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.
 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 getUseDragMask()
          This flag controls whether we register the component as a maskable item with the EventHandler.
 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).
 Boolean getUseOpacityFilter()
          Configures where the Opacity filter is used for IE6-8.
 ValuesManager getValuesManager()
          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.
 int getVisibleWidth()
          Return the visible width of the Canvas.
 int getVSnapOrigin()
          Get an offset to be used when calculating snap positioning.
 int getVSnapOrigin(Canvas snapChild)
          Get an offset to be used when calculating snap positioning.
 int getVSnapPosition(int coordinate)
          Override this method to provide a custom snap-to grid.
 int getVSnapPosition(int coordinate, String direction)
          Override this method to provide a custom snap-to grid.
 Integer getWidth()
          Size for this component's horizontal dimension.
 String getWidthAsString()
           
 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(String ID)
          Hides the click mask associated with this canvas.
 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 String imgHTML(String src)
          Generates the HTML for an image unique to this Canvas.
static String imgHTML(String src, int width, int height)
           
static String imgHTML(String src, int width, int height, String name, String extraStuff, String imgDir)
          Generates the HTML for an image unique to this Canvas.
 Boolean intersects(Canvas other)
          Returns true if the rectangles of this widget and the specified widget overlap.
 Boolean isDirty()
          Returns whether a canvas is waiting to be redrawn.
 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.
 Boolean isDrawn()
          Returns the boolean true, if the widget has been completely drawn, and false otherwise.
 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.
 Boolean keyUp()
          Executed when a key is released on a focusable widget (canFocus: true).
 void layoutChildren(String reason)
          layoutChildren() is where a Canvas should implement a sizing policy for it's Canvas children.
 String linkHTML(String href)
          Generates the HTML for a standard link (anchor) element.
 String linkHTML(String href, String text)
           
 String linkHTML(String href, String text, String target)
           
 String linkHTML(String href, String text, String target, String ID)
           
 String linkHTML(String href, String text, String target, String ID, Integer tabIndex)
           
 String linkHTML(String href, String text, String target, String ID, Integer tabIndex, 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(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.
 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()
           
protected  void parentResized()
          Fires when the interior size of the parent changes, including parent resize and scrollbar introduction or removal.
static void printComponents(Object[] components)
          Generate printable HTML for the designated components and trigger the native print dialog, without ever showing the printable HTML to the user.
 void redraw()
          Redraws the widget immediately with its current property values.
 void redraw(String reason)
          Redraws the widget immediately with its current property values.
 void removeChild(Canvas child)
          Remove a child from this parent.
 void removeChild(Canvas child, String name)
          Remove a child from this parent.
 void removePeer(Canvas peer)
          Remove a peer from this Canvas
 void removePeer(Canvas peer, String name)
          Remove a peer from this Canvas
 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).
 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).
 Boolean resizeTo(String width, String height)
          Resizes the widget to the specified width and height (moves the right and/ or bottom sides of the widget).
 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(Integer left)
           
 void scrollTo(Integer left, 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.
 void setAccessKey(String accessKey)
          If specified this governs the HTML accessKey for the widget.
 void setAlign(Alignment align)
           
static void setAllowExternalFilters(boolean allExternalFilters)
          Changes the system-wide allowExternalFilters setting.
 void setAnimateAcceleration(AnimationAcceleration animateAcceleration)
          Default acceleration effect to apply to all animations on this Canvas.
 void setAnimateFadeTime(Integer animateFadeTime)
          Default time for performing an animated fade.
 void setAnimateHideAcceleration(AnimationAcceleration animateHideAcceleration)
          Default acceleration function for performing an animated hide.
 void setAnimateHideTime(Integer animateHideTime)
          Default time for performing an animated hide.
 void setAnimateMoveAcceleration(AnimationAcceleration animateMoveAcceleration)
          Default acceleration effect for performing an animated move.
 void setAnimateMoveTime(Integer animateMoveTime)
          Default time for performing an animated move.
 void setAnimateRectAcceleration(AnimationAcceleration animateRectAcceleration)
          Default acceleration function for performing an animated move and resize.
 void setAnimateRectTime(Integer animateRectTime)
          Default time for performing an animated setRect.
 void setAnimateResizeAcceleration(AnimationAcceleration animateResizeAcceleration)
          Default acceleration function for performing an animated resize.
 void setAnimateResizeTime(Integer animateResizeTime)
          Default time for performing an animated resize.
 void setAnimateScrollAcceleration(AnimationAcceleration animateScrollAcceleration)
          Default acceleration function for performing an animated scroll.
 void setAnimateScrollTime(Integer animateScrollTime)
          Default time for performing an animated scroll.
 void setAnimateShowAcceleration(AnimationAcceleration animateShowAcceleration)
          Default acceleration function for performing an animated show.
 void setAnimateShowEffect(AnimationEffect animateShowEffect)
          Default animation effect to use if Canvas#animateShow() is called without an explicit effect parameter.
 void setAnimateShowTime(Integer animateShowTime)
          Default time for performing an animated show.
 void setAnimateTime(int animateTime)
          Default total duration of animations.
 void setAppImgDir(String appImgDir)
          Default directory for app-specific images, relative to the Page-wide appImgDir.
 void setAriaRole(String ariaRole)
          ARIA role of this component.
 void setAriaState(String stateName, Object stateValue)
          Set a specific ARIA state mapping for this component.
 void setAutoChildConstructor(String autoChildName, String className)
          Sets the SmartClient constructor for the AutoChild named autoChildName.
 void setAutoChildProperties(String autoChildName, Canvas properties)
          Sets the properties for creating a Canvas AutoChild named autoChildName.
 void setAutoChildProperties(String autoChildName, FormItem properties)
          Sets the properties for creating a FormItem AutoChild named autoChildName.
 void setAutoChildVisibility(String autoChildName, boolean visible)
          Sets whether to create and show the AutoChild named autoChildName.
 void setAutoDraw(Boolean autoDraw)
          If true, this canvas will draw itself immediately after it is created.
 void setAutoHeight()
          Set the minimum value for height.
 void setAutoShowParent(Boolean autoShowParent)
          If set to true, the widget's parent (if any) will automatically be shown whenever the widget is shown.
 void setAutoWidth()
          Set the minimum value for width.
 void setBackgroundColor(String backgroundColor)
          The background color for this widget.
 void setBackgroundImage(String backgroundImage)
          URL for a background image for this widget (corresponding to the CSS "background-image" attribute).
 void setBackgroundPosition(String backgroundPosition)
          Specifies how the background image should be positioned on the widget.
 void setBackgroundRepeat(BackgroundRepeat backgroundRepeat)
          Specifies how the background image should be tiled if this widget is larger than the image.
 void setBorder(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").
 void setBottom(int bottom)
          Resizes the widget vertically to position its bottom edge at the specified coordinate.
 void setCanAcceptDrop(Boolean canAcceptDrop)
          Indicates that this object can receive dropped widgets (i.e.
 void setCanDrag(Boolean canDrag)
          Indicates whether this widget can initiate custom drag-and-drop operations (other than reposition or resize).
 void setCanDragReposition(Boolean canDragReposition)
          Indicates whether this widget can be moved by a user of your application by simply dragging with the mouse.
 void setCanDragResize(Boolean canDragResize)
          Indicates whether this widget can be resized by dragging on the edges and/or corners of the widget with the mouse.
 void 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.
 void setCanDrop(Boolean canDrop)
          Indicates that this object can be dropped on top of other widgets.
 void setCanDropBefore(Boolean canDropBefore)
          When explicitly set to false, disallows drop before this member in the Layout.
 void setCanFocus(Boolean canFocus)
          Can this widget be allowed to become the target of keyboard events?
 void setCanHover(Boolean canHover)
          Will this Canvas fire hover events when the user hovers over it, or one of its children?
 void setCanSelectText(Boolean canSelectText)
          Whether native drag selection of contained text is allowed within this Canvas.
 void setChildren(Canvas... children)
          Array of all Canvii that are immediate children of this Canvas.
 void setChildrenSnapResizeToGrid(Boolean childrenSnapResizeToGrid)
          If true, causes this canvas's children to snap to its grid when resizing.
 void setChildrenSnapToGrid(Boolean childrenSnapToGrid)
          If true, causes this canvas's children to snap to its grid when dragging.
 void setContents(String contents)
          The contents of a canvas or label widget.
 void setContextMenu(Menu contextMenu)
          Context menu to show for this object, an instance of the Menu widget.
 void setCursor(Cursor cursor)
          Specifies the cursor image to display when the mouse pointer is over this widget.
 void setDataPath(String dataPath)
          A dataPath may be specified on any canvas.
 void setDefaultHeight(int defaultHeight)
          For custom components, establishes a default height for the component.
static void setDefaultProperties(Canvas canvasProperties)
          Class level method to set the default properties of this class.
 void setDefaultWidth(int defaultWidth)
          For custom components, establishes a default width for the component.
 void setDisabled(boolean disabled)
          If set to true, the widget will be disabled.
 void setDisabledCursor(Cursor disabledCursor)
          Specifies the cursor image to display when the mouse pointer is over this widget if this widget is disabled.
 void setDoubleClickDelay(int doubleClickDelay)
          Amount of time (in milliseconds) between which two clicks are considered a single click
 void setDragAppearance(DragAppearance dragAppearance)
          Visual appearance to show when the object is being dragged.
 void 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.
 void setDragMaskType(DragMaskType dragMaskType)
          This property controls what kind of mask is used in case useDragMask is enabled.
 void setDragOpacity(Integer dragOpacity)
          If this widget has dragAppearance "target", this value specifies the opacity to render the target while it is being dragged.
 void setDragRepositionAppearance(DragAppearance dragRepositionAppearance)
          If canDragReposition is true, this attributes specifies the visual appearance to show during drag reposition.
 void setDragRepositionCursor(Cursor dragRepositionCursor)
          Cursor to switch to if the mouse is over a widget that is drag repositionable.
 void setDragResizeAppearance(DragAppearance dragResizeAppearance)
          If canDragResize is true, this attributes specifies the visual appearance to show during drag resize.
 void 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.
 void setDragStartDistance(int dragStartDistance)
          Number of pixels the cursor needs to move before the EventHandler starts a drag operation.
 void setDragTarget(Canvas dragTarget)
          A different widget that should be actually dragged when dragging initiates on this widget.
 void setDragType(String dragType)
          Sets a dragType for this widget used, to be compared to dropTypes on possible drop target widgets.
 void setDropTypes(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.
 void setDropTypes(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.
 void setDynamicContents(Boolean dynamicContents)
          Dynamic contents allows the contents string to be treated as a simple, but powerful template.
 void setEdgeBackgroundColor(String edgeBackgroundColor)
          Background color for the EdgedCanvas created to decorate this component.
 void setEdgeCenterBackgroundColor(String edgeCenterBackgroundColor)
          Background color for the center section only.
 void setEdgeImage(String edgeImage)
          Base name of images for edges.
 void setEdgeMarginSize(int edgeMarginSize)
          How far into the edge of an object do we consider the "edge" for drag resize purposes?
 void setEdgeOffset(Integer edgeOffset)
          Amount the contained Canvas should be offset.
 void setEdgeOpacity(Integer edgeOpacity)
          Opacity of the edges.
 void setEdgeShowCenter(Boolean edgeShowCenter)
          Whether to show media in the center section, that is, behind the decorated Canvas.
 void setEdgeSize(int edgeSize)
          Size in pixels for corners and edges
protected  void setElement(Element elem)
          Normal usage of SmartGWT is to call draw() on SmartGWT widgets, not to use use RootPanel.add().
 void 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.
 void setFacetId(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.
 void setGroupBorderCSS(String groupBorderCSS)
          Sets the style for the grouping frame around the canvas.
 void setGroupLabelBackgroundColor(String groupLabelBackgroundColor)
          If set, the background color of the grouping label.
 void setGroupLabelStyleName(String groupLabelStyleName)
          Sets the style for the grouping label.
 void setGroupTitle(String groupTitle)
          The title/label for the grouping.
 void setHeight(int height)
           
 void setHeight(Integer height)
          Size for this component's vertical dimension.
 void setHeight(String height)
          Size for this component's vertical dimension.
 void setHeight100()
          Convenience method that sets the height to 100%.
 void setHideUsingDisplayNone(boolean hideUsingDisplayNone)
          When this widget is hidden (see visibility and Canvas.hide), should display:none be applied to the outer element?
 void setHoverAlign(Alignment hoverAlign)
          If this.showHover is true, this property can be used to customize the alignment of content in the hover canvas.
 void setHoverAutoDestroy(Boolean hoverAutoDestroy)
          If this.showHover is true and Canvas.getHoverComponent is implemented, should the hoverCanvas returned from it be automatically destroyed when it is hidden?
 void setHoverDelay(int hoverDelay)
          If this.canHover is true, how long should the mouse be kept over this widget before the hover event is fired
 void setHoverHeight(Integer hoverHeight)
          If this.showHover is true, this property can be used to customize the height of the hover canvas shown.
 void setHoverMoveWithMouse(Boolean hoverMoveWithMouse)
          If this.showHover is true, should this widget's hover canvas be moved with the mouse while visible?
 void setHoverOpacity(Integer hoverOpacity)
          If this.showHover is true, should the hover canvas be shown with opacity other than 100?
 void setHoverStyle(String hoverStyle)
          If this.showHover is true, this property can be used to specify the css style to apply to the hover canvas.
 void setHoverVAlign(VerticalAlignment hoverVAlign)
          If this.showHover is true, this property can be used to customize the vertical alignment of content in the hover canvas.
 void setHoverWidth(Integer hoverWidth)
          If this.showHover is true, this property can be used to customize the width of the hover canvas shown.
 void setHoverWrap(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.
 void setHtmlElement(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().
 void 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(String identifier, String URL)
          Set the URL of an image element by name.
 void setImage(String identifier, String URL, String imgDir)
          Set the URL of an image element by name.
 void setInitHandler(CanvasInitHandler initHandler)
          Specify a notification method to fire when this Canvas is initialized in JavaScript.
 void setIsGroup(boolean isGroup)
          Should a grouping frame be shown around this canvas.
 void setKeepInParentRect(Boolean keepInParentRect)
          Constrains drag-resizing and drag-repositioning of this canvas to either the rect of its parent (if set to true) or an arbitrary rect based its parent (if set to a [Left,Top,Width,Height] rect array).
 void setKeepInParentRect(Integer... keepInParentRect)
          Constrains drag-resizing and drag-repositioning of this canvas to either the rect of its parent (if set to true) or an arbitrary rect based its parent (if set to a [Left,Top,Width,Height] rect array).
 void setKeepInParentRect(Rectangle rectangle)
           
 void setLayoutAlign(Alignment layoutAlign)
          When this Canvas is included as a member in a Layout, layoutAlign controls alignment on the breadth axis of the layout.
 void setLayoutAlign(VerticalAlignment layoutAlign)
          When this Canvas is included as a member in a Layout, layoutAlign controls alignment on the breadth axis of the layout.
 void 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).
 void setLeft(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).
 void setLocateChildrenBy(LocatorStrategy locateChildrenBy)
          Strategy to use when locating children in this canvas from an autoTest locator string.
 void setLocateChildrenType(LocatorTypeStrategy locateChildrenType)
          LocatorTypeStrategy to use when finding children within this canvas.
 void setLocatePeersBy(LocatorStrategy locatePeersBy)
          Strategy to use when locating peers of this canvas from an autoTest locator string.
 void setLocatePeersType(LocatorTypeStrategy locatePeersType)
          LocatorTypeStrategy to use when finding peers of this canvas.
 com.smartgwt.logicalstructure.core.LogicalStructureObject setLogicalStructure(com.smartgwt.logicalstructure.widgets.CanvasLogicalStructure s)
           
 void setMargin(Integer margin)
          Set the CSS Margin, in pixels, for this component.
 void setMatchElement(Boolean matchElement)
          If htmlElement is specified, should this canvas initially be drawn at the same dimensions as the htmlElement?
Note: setting this property will not force the canvas to resize if the element subsequently resizes (for example due to page reflow).
 void setMaxHeight(int maxHeight)
          Maximum height that this Canvas can be resized to.
 void setMaxWidth(int maxWidth)
          Maximum width that this Canvas can be resized to.
 void setMenuConstructor(String menuConstructor)
          Default class used to construct menus created by this component, including context menus.
 void setMinHeight(int minHeight)
          Minimum height that this Canvas can be resized to by a user.
 void setMinWidth(int minWidth)
          Minimum width that this Canvas can be resized to.
 void setMomentumScrollMinSpeed(double momentumScrollMinSpeed)
          The minimum speed in pixels per second that must be reached for momentum scrolling to kick in.
 void setMouseStillDownDelay(int mouseStillDownDelay)
          Amount of time (in milliseconds) between 'mouseStillDown' events for this object
 void setMouseStillDownInitialDelay(int mouseStillDownInitialDelay)
          Amount of time (in milliseconds) before mouseStillDown events start to be fired for this object.
static void setNeverUseFilters(boolean neverUseFilters)
          Changes the system-wide neverUseFilters setting.
 void setNoDoubleClicks(Boolean noDoubleClicks)
          If true, this canvas will receive all mouse-clicks as single click events rather than as doubleClick events.
 void setOpacity(Integer opacity)
          Renders the widget to be partly transparent.
 void 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.
 void setPadding(Integer padding)
          Set the CSS padding of this component, in pixels.
 void setPageLeft(int left)
          Set the page-relative left coordinate of this widget.
 void setPageTop(int top)
          Set the page-relative top coordinate of this widget.
 void setParentCanvas(Canvas parentCanvas)
          This Canvas's immediate parent, if any.
 void setParentElement(Canvas parentElement)
          Deprecated. As of Smartclient version 9.1, deprecated in favor of parentCanvas and Canvas.getParentCanvas
 void setPeers(Canvas... peers)
          Array of all Canvii that are peers of this Canvas.
 void setPercentBox(PercentBoxModel percentBox)
          Governs the model to be used when sizing canvases with percentage width or height, or positioning widgets with a specified snapTo.
 void 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.
 void 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.
 void setPrefix(String prefix)
           
 void setPrintChildrenAbsolutelyPositioned(Boolean printChildrenAbsolutelyPositioned)
          Should this canvas print its children absolutely positioned when generating printable HTML.
 void setPrompt(String prompt)
          Prompt displayed in hover canvas if showHover is true.
 void setRect(int left, int top, int width, int height)
          Set all four coordinates, relative to the enclosing context, at once.
 void setRect(Rectangle rectangle)
          Set all four coordinates, relative to the enclosing context, at once.
 void setRedrawOnResize(Boolean redrawOnResize)
          Should this element be redrawn in response to a resize?
 void setResizeBarTarget(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.
 void setResizeFrom(EdgeName... resizeFrom)
          When drag resizing is enabled via canDragResize, restricts resizes to only certain edges or corners.
 void setResizeFrom(String... resizeFrom)
          Deprecated. use #setResizeFrom(EdgeName) instead.
 void setRight(int right)
          Resizes the widget horizontally to position its right side at the specified coordinate.
 void setScrollbarConstructor(String scrollbarConstructor)
          The class that will be used to create custom scrollbars for this component.
 void setScrollbarSize(int scrollbarSize)
          How thick should we make the scrollbars for this canvas.
NOTE: has no effect if showCustomScrollbars is false.
 void setShadowDepth(int shadowDepth)
          Depth of the shadow, or the virtual height above the page of the widget throwing the shadow.
 void setShadowImage(String shadowImage)
          Base name of the series of images for the sides, corners, and center of the shadow.
 void setShadowOffset(Integer shadowOffset)
          Offset of the shadow.
 void setShadowSoftness(Integer shadowSoftness)
          Softness, or degree of blurring, of the shadow.
 void setShouldPrint(Boolean shouldPrint)
          Whether this canvas should be included in a printable view.
 void setShowCustomScrollbars(Boolean showCustomScrollbars)
          Whether to use the browser's native scrollbars or Smart GWT-based scrollbars.
 void setShowDragShadow(Boolean showDragShadow)
          When this widget is dragged, if its dragAppearance is "target", should we show a shadow behind the canvas during the drag.
 void setShowEdges(Boolean showEdges)
          Whether an EdgedCanvas should be used to show image-based edges around this component.
 void setShowHover(Boolean showHover)
          If this.canHover is true, should we show the global hover canvas by default when the user hovers over this canvas?
 void setShowHoverComponents(Boolean showHoverComponents)
          When set to true, shows a widget hovering at the mouse point instead of the builtin hover label.
 void setShowResizeBar(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.
 void setShowShadow(Boolean showShadow)
          Whether to show a drop shadow for this Canvas

If this method is called after the component has been drawn/initialized: Method to update showShadow.
 void setShrinkElementOnHide(boolean shrinkElementOnHide)
          This is an advanced setting.
 void setSkinImgDir(String skinImgDir)
          Default directory for skin images (those defined by the class), relative to the Page-wide skinDir.
 void setSmoothFade(Boolean smoothFade)
           
 void setSnapAxis(String snapAxis)
          Describes which axes to apply snap-to-grid to.
 void setSnapEdge(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.
 void setSnapHDirection(String snapHDirection)
          The horizontal snap direction.
 void setSnapHGap(int snapHGap)
          The horizontal grid size to use, in pixels, when snap-to-grid is enabled.
 void setSnapOffsetLeft(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.
 void setSnapOffsetTop(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.
 void setSnapOnDrop(Boolean snapOnDrop)
          When this canvas is dropped onto an object supporting snap-to-grid, should it snap to the grid (true, the default) or just drop wherever the mouse is (false).
 void setSnapResizeToGrid(Boolean snapResizeToGrid)
          Causes this canvas to snap to its parent's grid when resizing.
 void setSnapTo(String snapTo)
          Position this widget such that it is aligned with ("snapped to") an edge of its master (if specified), or its parent canvas.
 void setSnapToGrid(Boolean snapToGrid)
          Causes this canvas to snap to its parent's grid when dragging.
 void setSnapVDirection(String snapVDirection)
          The vertical snap direction.
 void setSnapVGap(int snapVGap)
          The vertical grid size to use, in pixels, when snap-to-grid is enabled.
 void setStyleName(String styleName)
          The CSS class applied to this widget as a whole.
 void setTabIndex(Integer tabIndex)
          If specified this governs the tabIndex of the widget in the page's tab order.
 void setTitle(String title)
          Synonym for setPrompt(String)
 void setTooltip(String tooltip)
          Synonym for setPrompt(String)
 void 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).
 void setTop(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).
 void setUseBackMask(Boolean useBackMask)
          In earlier versions of Internet Explorer (pre IE9), a native limitation exists whereby if HTML elements are overlapping on the page, certain elements can appear to "burn through" elements in the same position with a higher z-index.
 void setUseDragMask(boolean useDragMask)
          This flag controls whether we register the component as a maskable item with the EventHandler.
 void setUseNativeDrag(Boolean useNativeDrag)
          If set, native HTML5 drag and drop will be used for all drags initiated on this widget (on browsers where this is supported).
 void setUseOpacityFilter(Boolean useOpacityFilter)
          Configures where the Opacity filter is used for IE6-8.
 void setValuesManager(ValuesManager valuesManager)
          ValuesManager for managing values displayed in this component.
 void setVisibility(Visibility visibility)
          Controls widget visibility when the widget is initialized.
 void setVisible(boolean visible)
           
 void setWidth(int width)
           
 void setWidth(Integer width)
          Size for this component's horizontal dimension.
 void setWidth(String width)
          Size for this component's horizontal dimension.
 void setWidth100()
          Convenience method that sets the width to 100%.
 void 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 it's parents are visible or it has no parents.
 String showClickMask(Function clickActionCallback, ClickMaskMode mode, Canvas[] unmaskedTargets)
          Show a clickMask over the entire screen that intercepts mouse clicks and fires some action.
 void showNextTo(Canvas otherWidget)
          Show this widget next to another widget on the page, positioned such that it will not extend beyond the browser viewport.
 void showNextTo(Canvas otherWidget, String side)
           
 void showNextTo(Canvas otherWidget, String side, boolean canOcclude)
           
 void showNextTo(Canvas otherWidget, String side, boolean canOcclude, boolean skipAnimation)
          Show this widget next to another widget on the page, positioned such that it will not extend beyond the browser viewport.
static void showPrintPreview(Canvas component)
          Show a PrintWindow containing a printable view of the component passed in containing print HTML.
static void showPrintPreview(Object[] components)
          Show a Print containing a printable view of the components passed in.
static void showPrintPreview(Object[] components, PrintProperties printProperties, String title, PrintPreviewCallback callback)
          Show a Print containing a printable view of the components passed in.
static void showPrintPreview(Object[] components, PrintProperties printProperties, String title, PrintPreviewCallback callback, Window printWindowProperties, String printButtonTitle)
          Show a Print containing a printable view of the components passed in.
 void showRecursively()
          Recursively show the canvas and all it's parents so the canvas will be visible.
 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 Canvas.handleHover), this method can be called to update the contents of the hover.
 void updateHover(String hoverHTML)
          If this canvas is currently showing a hover (see Canvas.handleHover), this method can be called to update the contents of the hover.
 void updateShadow()
          Update the canvas shadow.
 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.
 Boolean willAcceptDrop()
          Returns true if the widget object being dragged can be dropped on this widget, and false otherwise.
 
Methods inherited from class com.smartgwt.client.widgets.BaseWidget
addDrawHandler, destroy, doAddHandler, doInit, doOnRender, draw, equals, error, errorIfNotCreated, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDateArray, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsFloatArray, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getConfig, getDOM, getHandlerCount, getID, getInnerHTML, getJsObj, getOrCreateJsObj, getRef, getScClassName, hasAutoAssignedID, hashCode, initNativeObject, internalSetID, internalSetID, isConfigOnly, isCreated, 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, setDragTracker, setID, setJavaScriptObject, setLogicalStructure, setNullProperty, setPosition, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setScClassName, toString
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

Canvas

public Canvas()

Canvas

public Canvas(JavaScriptObject jsObj)

Canvas

public Canvas(String id)
Method Detail

getOrCreateRef

public static Canvas getOrCreateRef(JavaScriptObject jsObj)

changeAutoChildDefaults

public static void changeAutoChildDefaults(String autoChildName,
                                           Canvas defaults)
Changes the defaults for Canvas AutoChildren named autoChildName.

Parameters:
autoChildName - name of an AutoChild to customize the defaults for.
defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties.
See Also:
AutoChildUsage

changeAutoChildDefaults

public static void changeAutoChildDefaults(String autoChildName,
                                           FormItem defaults)
Changes the defaults for FormItem AutoChildren named autoChildName.

Parameters:
autoChildName - name of an AutoChild to customize the defaults for.
defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties.
See Also:
AutoChildUsage

create

protected JavaScriptObject create()
Overrides:
create in class BaseWidget

setAccessKey

public void setAccessKey(String accessKey)
If specified this governs the HTML accessKey for the widget.

This should be set to a character - when a user hits the html accessKey modifier for the browser, plus this character, focus will be given to the widget in question. The accessKey modifier can vary by browser and platform.

The following list of default behavior is for reference only, developers should also consult browser documentation for additional information.



If this method is called after the component has been drawn/initialized: Set the accessKey for this canvas.

The accessKey can be set to any alphanumeric character (symbols not supported) Having set an accessKey, the canvas will be given focus when the user hits Alt+[accessKey], or in Mozilla Firefox 2.0 and above, Shift+Alt+[accessKey].

Note : This is an advanced setting

Parameters:
accessKey - Character to use as an accessKey for this widget. Case Insensitive.. Default value is null
See Also:
Focus overview and related methods

getAccessKey

public String getAccessKey()
If specified this governs the HTML accessKey for the widget.

This should be set to a character - when a user hits the html accessKey modifier for the browser, plus this character, focus will be given to the widget in question. The accessKey modifier can vary by browser and platform.

The following list of default behavior is for reference only, developers should also consult browser documentation for additional information.

Returns:
String
See Also:
Focus overview and related methods

setAnimateAcceleration

public void setAnimateAcceleration(AnimationAcceleration animateAcceleration)
Default acceleration effect to apply to all animations on this Canvas. Can be overridden by setting animationAcceleration for specific animations or by passing an acceleration function directly into the appropriate method.

Note : This is an advanced setting

Parameters:
animateAcceleration - Default value is "smoothEnd"

getAnimateAcceleration

public AnimationAcceleration getAnimateAcceleration()
Default acceleration effect to apply to all animations on this Canvas. Can be overridden by setting animationAcceleration for specific animations or by passing an acceleration function directly into the appropriate method.

Returns:
AnimationAcceleration

setAnimateFadeTime

public void setAnimateFadeTime(Integer animateFadeTime)
Default time for performing an animated fade. If unset, this.animateTime will be used by default instead

Note : This is an advanced setting

Parameters:
animateFadeTime - Default value is null

getAnimateFadeTime

public Integer getAnimateFadeTime()
Default time for performing an animated fade. If unset, this.animateTime will be used by default instead

Returns:
Integer

setAnimateHideAcceleration

public void setAnimateHideAcceleration(AnimationAcceleration animateHideAcceleration)
Default acceleration function for performing an animated hide. If unset, this.animateAcceleration will be used by default instead

Note : This is an advanced setting

Parameters:
animateHideAcceleration - Default value is null

getAnimateHideAcceleration

public AnimationAcceleration getAnimateHideAcceleration()
Default acceleration function for performing an animated hide. If unset, this.animateAcceleration will be used by default instead

Returns:
AnimationAcceleration

setAnimateHideTime

public void setAnimateHideTime(Integer animateHideTime)
Default time for performing an animated hide. If unset, this.animateTime will be used by default instead

Note : This is an advanced setting

Parameters:
animateHideTime - Default value is null

getAnimateHideTime

public Integer getAnimateHideTime()
Default time for performing an animated hide. If unset, this.animateTime will be used by default instead

Returns:
Integer

setAnimateMoveAcceleration

public void setAnimateMoveAcceleration(AnimationAcceleration animateMoveAcceleration)
Default acceleration effect for performing an animated move. If unset, this.animateAcceleration will be used by default instead

Note : This is an advanced setting

Parameters:
animateMoveAcceleration - Default value is null

getAnimateMoveAcceleration

public AnimationAcceleration getAnimateMoveAcceleration()
Default acceleration effect for performing an animated move. If unset, this.animateAcceleration will be used by default instead

Returns:
AnimationAcceleration

setAnimateMoveTime

public void setAnimateMoveTime(Integer animateMoveTime)
Default time for performing an animated move. If unset, this.animateTime will be used by default instead

Note : This is an advanced setting

Parameters:
animateMoveTime - Default value is null

getAnimateMoveTime

public Integer getAnimateMoveTime()
Default time for performing an animated move. If unset, this.animateTime will be used by default instead

Returns:
Integer

setAnimateRectAcceleration

public void setAnimateRectAcceleration(AnimationAcceleration animateRectAcceleration)
Default acceleration function for performing an animated move and resize. If unset, this.animateAcceleration will be used by default instead

Note : This is an advanced setting

Parameters:
animateRectAcceleration - Default value is null

getAnimateRectAcceleration

public AnimationAcceleration getAnimateRectAcceleration()
Default acceleration function for performing an animated move and resize. If unset, this.animateAcceleration will be used by default instead

Returns:
AnimationAcceleration

setAnimateRectTime

public void setAnimateRectTime(Integer animateRectTime)
Default time for performing an animated setRect. If unset, this.animateTime will be used by default instead

Note : This is an advanced setting

Parameters:
animateRectTime - Default value is null

getAnimateRectTime

public Integer getAnimateRectTime()
Default time for performing an animated setRect. If unset, this.animateTime will be used by default instead

Returns:
Integer

setAnimateResizeAcceleration

public void setAnimateResizeAcceleration(AnimationAcceleration animateResizeAcceleration)
Default acceleration function for performing an animated resize. If unset, this.animateAcceleration will be used by default instead

Note : This is an advanced setting

Parameters:
animateResizeAcceleration - Default value is null

getAnimateResizeAcceleration

public AnimationAcceleration getAnimateResizeAcceleration()
Default acceleration function for performing an animated resize. If unset, this.animateAcceleration will be used by default instead

Returns:
AnimationAcceleration

setAnimateResizeTime

public void setAnimateResizeTime(Integer animateResizeTime)
Default time for performing an animated resize. If unset, this.animateTime will be used by default instead

Note : This is an advanced setting

Parameters:
animateResizeTime - Default value is null

getAnimateResizeTime

public Integer getAnimateResizeTime()
Default time for performing an animated resize. If unset, this.animateTime will be used by default instead

Returns:
Integer

setAnimateScrollAcceleration

public void setAnimateScrollAcceleration(AnimationAcceleration animateScrollAcceleration)
Default acceleration function for performing an animated scroll. If unset, this.animateAcceleration will be used by default instead

Note : This is an advanced setting

Parameters:
animateScrollAcceleration - Default value is null

getAnimateScrollAcceleration

public AnimationAcceleration getAnimateScrollAcceleration()
Default acceleration function for performing an animated scroll. If unset, this.animateAcceleration will be used by default instead

Returns:
AnimationAcceleration

setAnimateScrollTime

public void setAnimateScrollTime(Integer animateScrollTime)
Default time for performing an animated scroll. If unset, this.animateTime will be used by default instead

Note : This is an advanced setting

Parameters:
animateScrollTime - Default value is null

getAnimateScrollTime

public Integer getAnimateScrollTime()
Default time for performing an animated scroll. If unset, this.animateTime will be used by default instead

Returns:
Integer

setAnimateShowAcceleration

public void setAnimateShowAcceleration(AnimationAcceleration animateShowAcceleration)
Default acceleration function for performing an animated show. If unset, this.animateAcceleration will be used by default instead

Note : This is an advanced setting

Parameters:
animateShowAcceleration - Default value is null

getAnimateShowAcceleration

public AnimationAcceleration getAnimateShowAcceleration()
Default acceleration function for performing an animated show. If unset, this.animateAcceleration will be used by default instead

Returns:
AnimationAcceleration

setAnimateShowTime

public void setAnimateShowTime(Integer animateShowTime)
Default time for performing an animated show. If unset, this.animateTime will be used by default instead

Note : This is an advanced setting

Parameters:
animateShowTime - Default value is null

getAnimateShowTime

public Integer getAnimateShowTime()
Default time for performing an animated show. If unset, this.animateTime will be used by default instead

Returns:
Integer

setAnimateTime

public void setAnimateTime(int animateTime)
Default total duration of animations. Can be overridden by setting animation times for specific animations, or by passing a duration parameter into the appropriate animate...() method.

Note : This is an advanced setting

Parameters:
animateTime - Default value is 300
See Also:
Fly Onscreen Example

getAnimateTime

public int getAnimateTime()
Default total duration of animations. Can be overridden by setting animation times for specific animations, or by passing a duration parameter into the appropriate animate...() method.

Returns:
int
See Also:
Fly Onscreen Example

setAppImgDir

public void setAppImgDir(String appImgDir)
Default directory for app-specific images, relative to the Page-wide appImgDir.

Note : This is an advanced setting

Parameters:
appImgDir - Default value is ""
See Also:
Images overview and related methods

getAppImgDir

public String getAppImgDir()
Default directory for app-specific images, relative to the Page-wide appImgDir.

Returns:
String
See Also:
Images overview and related methods

setAriaRole

public void setAriaRole(String ariaRole)
                 throws IllegalStateException
ARIA role of this component. Usually does not need to be manually set - see Accessibility.

Parameters:
ariaRole - Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Accessibility overview and related methods

getAriaRole

public String getAriaRole()
ARIA role of this component. Usually does not need to be manually set - see Accessibility.

Returns:
String
See Also:
Accessibility overview and related methods

setAutoDraw

public void setAutoDraw(Boolean autoDraw)
                 throws IllegalStateException
If true, this canvas will draw itself immediately after it is created.

Note that you should turn this OFF for any canvases that are provided as children of other canvases, or they will draw initially, then be clear()ed and drawn again when added as children, causing a large performance penalty.

For example, the following code is incorrect and will cause extra draw()s:

      isc.Layout.create({
          members : [
              isc.ListGrid.create()
          ]
      });
  
It should instead be:
      isc.Layout.create({
          members : [
              isc.ListGrid.create({ autoDraw: false })
          ]
      });
  
In order to avoid unwanted autoDrawing systematically, it is recommend that you call isc.setAutoDraw(false) immediately after Smart GWT is loaded and before any components are created, then set autoDraw:true or call draw() explicitly to draw components.

Otherwise, if the global setting for autoDraw remains true, you must set autoDraw:false, as shown above, on every component in your application that should not immediately draw: all Canvas children, Layout members, Window items, Tab panes, etc, however deeply nested. Forgetting to set autoDraw:false will result in one more clear()s - these are reported on the Results tab of the Developer Console, and can be tracked to individual components by using the "clears" log category in the Developer Console.

Parameters:
autoDraw - Default value is true
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Drawing overview and related methods

getAutoDraw

public Boolean getAutoDraw()
If true, this canvas will draw itself immediately after it is created.

Note that you should turn this OFF for any canvases that are provided as children of other canvases, or they will draw initially, then be clear()ed and drawn again when added as children, causing a large performance penalty.

For example, the following code is incorrect and will cause extra draw()s:

      isc.Layout.create({
          members : [
              isc.ListGrid.create()
          ]
      });
  
It should instead be:
      isc.Layout.create({
          members : [
              isc.ListGrid.create({ autoDraw: false })
          ]
      });
  
In order to avoid unwanted autoDrawing systematically, it is recommend that you call isc.setAutoDraw(false) immediately after Smart GWT is loaded and before any components are created, then set autoDraw:true or call draw() explicitly to draw components.

Otherwise, if the global setting for autoDraw remains true, you must set autoDraw:false, as shown above, on every component in your application that should not immediately draw: all Canvas children, Layout members, Window items, Tab panes, etc, however deeply nested. Forgetting to set autoDraw:false will result in one more clear()s - these are reported on the Results tab of the Developer Console, and can be tracked to individual components by using the "clears" log category in the Developer Console.

Returns:
Boolean
See Also:
Drawing overview and related methods

setAutoShowParent

public void setAutoShowParent(Boolean autoShowParent)
If set to true, the widget's parent (if any) will automatically be shown whenever the widget is shown.

Note : This is an advanced setting

Parameters:
autoShowParent - Default value is false
See Also:
Appearance overview and related methods

getAutoShowParent

public Boolean getAutoShowParent()
If set to true, the widget's parent (if any) will automatically be shown whenever the widget is shown.

Returns:
Boolean
See Also:
Appearance overview and related methods

setBackgroundColor

public void setBackgroundColor(String backgroundColor)
The background color for this widget. It corresponds to the CSS background-color attribute. You can set this property to an RGB value (e.g. #22AAFF) or a named color (e.g. red) from a list of browser supported color names.

If this method is called after the component has been drawn/initialized: Sets the background color of this widget to newColor.

Parameters:
backgroundColor - new color to set the widget's background to. Default value is null
See Also:
Appearance overview and related methods

getBackgroundColor

public String getBackgroundColor()
The background color for this widget. It corresponds to the CSS background-color attribute. You can set this property to an RGB value (e.g. #22AAFF) or a named color (e.g. red) from a list of browser supported color names.

Returns:
String
See Also:
Appearance overview and related methods

setBackgroundImage

public void setBackgroundImage(String backgroundImage)
URL for a background image for this widget (corresponding to the CSS "background-image" attribute).

If this method is called after the component has been drawn/initialized: Sets the background to an image file given by newImage. This URL should be given as a string relative to the image directory for the page (./images by default).

Parameters:
backgroundImage - new URL (local to Page image directory) for background image See SCImgURL . Default value is null
See Also:
Appearance overview and related methods

getBackgroundImage

public String getBackgroundImage()
URL for a background image for this widget (corresponding to the CSS "background-image" attribute).

Returns:
See SCImgURL
See Also:
Appearance overview and related methods

setBackgroundPosition

public void setBackgroundPosition(String backgroundPosition)
                           throws IllegalStateException
Specifies how the background image should be positioned on the widget. It corresponds to the CSS background-position attribute. If unset, no background-position attribute is specified if a background image is specified.

Parameters:
backgroundPosition - Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Appearance overview and related methods

getBackgroundPosition

public String getBackgroundPosition()
Specifies how the background image should be positioned on the widget. It corresponds to the CSS background-position attribute. If unset, no background-position attribute is specified if a background image is specified.

Returns:
String
See Also:
Appearance overview and related methods

setBackgroundRepeat

public void setBackgroundRepeat(BackgroundRepeat backgroundRepeat)
                         throws IllegalStateException
Specifies how the background image should be tiled if this widget is larger than the image. It corresponds to the CSS 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.

Parameters:
backgroundRepeat - Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Appearance overview and related methods

getBackgroundRepeat

public BackgroundRepeat getBackgroundRepeat()
Specifies how the background image should be tiled if this widget is larger than the image. It corresponds to the CSS 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.

Returns:
BackgroundRepeat
See Also:
Appearance overview and related methods

setBorder

public void setBorder(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").

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 isGroup is set to true 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.

Parameters:
border - new border to set to (eg: "2px solid black"). Default value is null
See Also:
Appearance overview and related methods

getBorder

public 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").

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 isGroup is set to true then border is derived from the groupBorderCSS attribute, not from the explicit border property.

Returns:
String
See Also:
Appearance overview and related methods

setCanAcceptDrop

public void setCanAcceptDrop(Boolean canAcceptDrop)
Indicates that this object can receive dropped widgets (i.e. other widgets can be dropped on top of it).

Note : This is an advanced setting

Parameters:
canAcceptDrop - Default value is false
See Also:
Dragdrop overview and related methods, Drag create Example

getCanAcceptDrop

public Boolean getCanAcceptDrop()
Indicates that this object can receive dropped widgets (i.e. other widgets can be dropped on top of it).

Returns:
Boolean
See Also:
Dragdrop overview and related methods, Drag create Example

setCanDrag

public void setCanDrag(Boolean canDrag)
Indicates whether this widget can initiate custom drag-and-drop operations (other than reposition or resize). Normally 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

Parameters:
canDrag - Default value is false
See Also:
Dragdrop overview and related methods, Drag create Example

getCanDrag

public Boolean getCanDrag()
Indicates whether this widget can initiate custom drag-and-drop operations (other than reposition or resize). Normally 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.

Returns:
Boolean
See Also:
Dragdrop overview and related methods, Drag create Example

setCanDragReposition

public void setCanDragReposition(Boolean canDragReposition)
Indicates whether this widget can be moved by a user of your application by simply dragging with the mouse.

Note : This is an advanced setting

Parameters:
canDragReposition - Default value is false
See Also:
Dragdrop overview and related methods, Drag effects Example

getCanDragReposition

public Boolean getCanDragReposition()
Indicates whether this widget can be moved by a user of your application by simply dragging with the mouse.

Returns:
Boolean
See Also:
Dragdrop overview and related methods, Drag effects Example

setCanDragResize

public void setCanDragResize(Boolean canDragResize)
Indicates whether this widget can be resized by dragging on the edges and/or corners of the widget with the mouse.

Note : This is an advanced setting

Parameters:
canDragResize - Default value is false
See Also:
Dragdrop overview and related methods, Drag resize Example

getCanDragResize

public Boolean getCanDragResize()
Indicates whether this widget can be resized by dragging on the edges and/or corners of the widget with the mouse.

Returns:
Boolean
See Also:
Dragdrop overview and related methods, Drag resize Example

setCanDragScroll

public void 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.

Note : This is an advanced setting

Parameters:
canDragScroll - Default value is true
See Also:
shouldDragScroll()

getCanDragScroll

public boolean getCanDragScroll()
If this Canvas is canAcceptDrop:true, when the user drags a droppable widget over an edge of the widget, should we scroll to show the rest of the widget's content? Returned from canvas.shouldDragScroll() if there are scrollbars.

Returns:
boolean
See Also:
shouldDragScroll()

setCanDrop

public void setCanDrop(Boolean canDrop)
Indicates that this object can be dropped on top of other widgets. Only valid if canDrag or canDragReposition is true.

Note : This is an advanced setting

Parameters:
canDrop - Default value is false
See Also:
Dragdrop overview and related methods, Drag create Example

getCanDrop

public Boolean getCanDrop()
Indicates that this object can be dropped on top of other widgets. Only valid if canDrag or canDragReposition is true.

Returns:
Boolean
See Also:
Dragdrop overview and related methods, Drag create Example

setCanDropBefore

public void setCanDropBefore(Boolean canDropBefore)
When explicitly set to false, disallows drop before this member in the Layout.

Note : This is an advanced setting

Parameters:
canDropBefore - Default value is null
See Also:
Layout, LayoutMember overview and related methods

getCanDropBefore

public Boolean getCanDropBefore()
When explicitly set to false, disallows drop before this member in the Layout.

Returns:
Boolean
See Also:
Layout, LayoutMember overview and related methods

setCanFocus

public void setCanFocus(Boolean canFocus)
Can this widget be allowed to become the target of keyboard events?

If canFocus is unset (the default), only scrollable widgets with visible scrollbars are focusable, to allow for keyboard scrolling.

A widget normally receives focus by being clicked on or tabbed to.

If this method is called after the component has been drawn/initialized: Change whether a widget can accept keyboard focus.

Note : This is an advanced setting

Parameters:
canFocus - whether the widget should now accept focus. Default value is null
See Also:
Focus overview and related methods, Focus & Tabbing Example

getCanFocus

public Boolean getCanFocus()
Can this widget be allowed to become the target of keyboard events?

If canFocus is unset (the default), only scrollable widgets with visible scrollbars are focusable, to allow for keyboard scrolling.

A widget normally receives focus by being clicked on or tabbed to.

Returns:
Boolean
See Also:
Focus overview and related methods, Focus & Tabbing Example

setCanHover

public void setCanHover(Boolean canHover)
Will this Canvas fire hover events when the user hovers over it, or one of its children?

Parameters:
canHover - Default value is null
See Also:
setShowHover(java.lang.Boolean), HoverEvent

getCanHover

public Boolean getCanHover()
Will this Canvas fire hover events when the user hovers over it, or one of its children?

Returns:
Boolean
See Also:
getShowHover(), HoverEvent

setCanSelectText

public void setCanSelectText(Boolean canSelectText)
Whether native drag selection of contained text is allowed within this Canvas.

Note that setting this property to false will not avoid text selection which is initiated outside this Canvas from continuing into this Canvas, even if text selection began in another Canvas.

Note : This is an advanced setting

Parameters:
canSelectText - Default value is false

getCanSelectText

public Boolean getCanSelectText()
Whether native drag selection of contained text is allowed within this Canvas.

Note that setting this property to false will not avoid text selection which is initiated outside this Canvas from continuing into this Canvas, even if text selection began in another Canvas.

Returns:
Boolean

getCanvasItem

public CanvasItem getCanvasItem()
                         throws IllegalStateException
If this canvas is being displayed in a 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.

Returns:
CanvasItem
Throws:
IllegalStateException - if this widget has not yet been rendered.

getChildren

public Canvas[] getChildren()
Array of all Canvii that are immediate children of this Canvas.

Use Canvas.addChild and Canvas.removeChild to add and remove children after a Canvas has been created/drawn.

Returns:
Canvas...
See Also:
Containment overview and related methods

setChildrenSnapResizeToGrid

public void setChildrenSnapResizeToGrid(Boolean childrenSnapResizeToGrid)
If true, causes this canvas's children to snap to its grid when resizing. This behavior can be overridden on a per-child basis by setting the snapToGrid or snapResizeToGrid value on the child.

Parameters:
childrenSnapResizeToGrid - Default value is null
See Also:
Dragdrop overview and related methods

getChildrenSnapResizeToGrid

public Boolean getChildrenSnapResizeToGrid()
If true, causes this canvas's children to snap to its grid when resizing. This behavior can be overridden on a per-child basis by setting the snapToGrid or snapResizeToGrid value on the child.

Returns:
Boolean
See Also:
Dragdrop overview and related methods

setChildrenSnapToGrid

public void setChildrenSnapToGrid(Boolean childrenSnapToGrid)
If true, causes this canvas's children to snap to its grid when dragging. This behavior can be overridden on a per-child basis by setting the snapToGrid value on the child.

Parameters:
childrenSnapToGrid - Default value is null
See Also:
Dragdrop overview and related methods

getChildrenSnapToGrid

public Boolean getChildrenSnapToGrid()
If true, causes this canvas's children to snap to its grid when dragging. This behavior can be overridden on a per-child basis by setting the snapToGrid value on the child.

Returns:
Boolean
See Also:
Dragdrop overview and related methods

setContents

public void setContents(String contents)
The contents of a canvas or label widget. Any HTML string is acceptable.

If this method is called after the component has been drawn/initialized: Changes the contents of a widget to newContents, an HTML string.

When dynamicContents is set, setContents() can also be called with no arguments to cause contents to be re-evaluated.

Note : This is an advanced setting

Parameters:
contents - an HTML string to be set as the contents of this widget See HTMLString . Default value is " "
See Also:
setDynamicContents(java.lang.Boolean)

getContents

public String getContents()
The contents of a canvas or label widget. Any HTML string is acceptable.

Returns:
Returns the contents of a Canvas. The contents are an HTML string. See HTMLString
See Also:
getDynamicContents()

setContextMenu

public void setContextMenu(Menu contextMenu)
Context menu to show for this object, an instance of the Menu widget.

Note: if Canvas.destroy is called on a canvas, any specified context menu is not automatically destroyed as well. This is in contrast to MenuButtons which automatically destroy their specified menu by default. The behavior is intentional as context menus are commonly reused across components.

Note : This is an advanced setting

Parameters:
contextMenu - Default value is null
See Also:
ShowContextMenuEvent, Cues overview and related methods, Context menus Example

getContextMenu

public Menu getContextMenu()
Context menu to show for this object, an instance of the Menu widget.

Note: if Canvas.destroy is called on a canvas, any specified context menu is not automatically destroyed as well. This is in contrast to MenuButtons which automatically destroy their specified menu by default. The behavior is intentional as context menus are commonly reused across components.

Returns:
Menu
See Also:
ShowContextMenuEvent, Cues overview and related methods, Context menus Example

setCursor

public void setCursor(Cursor cursor)
Specifies the cursor image to display when the mouse pointer is over this widget. It corresponds to the CSS cursor attribute. See Cursor type for different cursors.

If this method is called after the component has been drawn/initialized: Sets the cursor for this widget to cursor. See the cursor property for possible values.

Note : This is an advanced setting

Parameters:
cursor - new cursor. Default value is Canvas.DEFAULT
See Also:
Cues overview and related methods, Drag create Example, Cursors Example

getCursor

public Cursor getCursor()
Specifies the cursor image to display when the mouse pointer is over this widget. It corresponds to the CSS cursor attribute. See Cursor type for different cursors.

Returns:
Cursor
See Also:
Cues overview and related methods, Drag create Example, Cursors Example

setDataPath

public void setDataPath(String dataPath)
A dataPath may be specified on any canvas. This provides a straightforward way to display or edit complex nested data.

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:

  { companyName:"Some Company",
    address:{    street:"123 Main Street", city:"New York", state:"NY"  }
  }
  
a developer could specify a DynamicForm instance with 'dataPath' set to "address" to edit the nested address object:
  isc.ValuesManager.create({
       ID:'vm',
       values: { companyName:"Some Company",
               address:{    street:"123 Main Street", city:"New York", state:"NY"  }
       }
  });
 
  isc.DynamicForm.create({
       valuesManager:"vm",
       dataPath:"address",
       items:[{name:"street"}, {name:"city"}, {name:"state"}]
  });
  
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:
  isc.ValuesManager.create({
       ID:'vm',
       values: { companyName:"Some Company",
               address:{    street:"123 Main Street", city:"New York", state:"NY"  }
       }
  });
 
  isc.Layout.create({
       valuesManager:"vm",
       members:[
           isc.DynamicForm.create({
               dataPath:"/",
               items:[{name:"companyName"}]
           }),
           isc.DynamicForm.create({
               dataPath:"address",
               items:[{name:"street"}, {name:"city"}, {name:"state"}]
           })
       ]
  });
  
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:

  isc.ValuesManager.create({
       ID:'vm',
       values: { companyName:"Some Company",
               address:{    street:"123 Main Street", city:"New York", state:"NY"  }
               parentCompany:{
                   companyName:"Some Corporation",
                   address:{   street:"1 High Street", city:"New York", state:"NY" }
               }
       }
  });
 
  isc.Layout.create({
       valuesManager:"vm",
       members:[
           isc.DynamicForm.create({
               dataPath:"/",
               items:[{name:"companyName"}]
           }),
           isc.DynamicForm.create({
               dataPath:"address",
               items:[{name:"street"}, {name:"city"}, {name:"state"}]
           }),
           isc.Layout.create({
               dataPath:"parentCompany",
               members:[
                   isc.DynamicForm.create({
                       dataPath:"/",
                       items:[{name:"companyName", type:"staticText"}]
                   }),
                   isc.DetailViewer.create({
                       dataPath:"address",
                       fields:[{name:"street", name:"city", name:"state"}]
                   })
               ]
           })
       ]
  });
  
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 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

Parameters:
dataPath - new dataPath See DataPath . Default value is null

getDataPath

public String getDataPath()
A dataPath may be specified on any canvas. This provides a straightforward way to display or edit complex nested data.

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:

  { companyName:"Some Company",
    address:{    street:"123 Main Street", city:"New York", state:"NY"  }
  }
  
a developer could specify a DynamicForm instance with 'dataPath' set to "address" to edit the nested address object:
  isc.ValuesManager.create({
       ID:'vm',
       values: { companyName:"Some Company",
               address:{    street:"123 Main Street", city:"New York", state:"NY"  }
       }
  });
 
  isc.DynamicForm.create({
       valuesManager:"vm",
       dataPath:"address",
       items:[{name:"street"}, {name:"city"}, {name:"state"}]
  });
  
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:
  isc.ValuesManager.create({
       ID:'vm',
       values: { companyName:"Some Company",
               address:{    street:"123 Main Street", city:"New York", state:"NY"  }
       }
  });
 
  isc.Layout.create({
       valuesManager:"vm",
       members:[
           isc.DynamicForm.create({
               dataPath:"/",
               items:[{name:"companyName"}]
           }),
           isc.DynamicForm.create({
               dataPath:"address",
               items:[{name:"street"}, {name:"city"}, {name:"state"}]
           })
       ]
  });
  
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:

  isc.ValuesManager.create({
       ID:'vm',
       values: { companyName:"Some Company",
               address:{    street:"123 Main Street", city:"New York", state:"NY"  }
               parentCompany:{
                   companyName:"Some Corporation",
                   address:{   street:"1 High Street", city:"New York", state:"NY" }
               }
       }
  });
 
  isc.Layout.create({
       valuesManager:"vm",
       members:[
           isc.DynamicForm.create({
               dataPath:"/",
               items:[{name:"companyName"}]
           }),
           isc.DynamicForm.create({
               dataPath:"address",
               items:[{name:"street"}, {name:"city"}, {name:"state"}]
           }),
           isc.Layout.create({
               dataPath:"parentCompany",
               members:[
                   isc.DynamicForm.create({
                       dataPath:"/",
                       items:[{name:"companyName", type:"staticText"}]
                   }),
                   isc.DetailViewer.create({
                       dataPath:"address",
                       fields:[{name:"street", name:"city", name:"state"}]
                   })
               ]
           })
       ]
  });
  
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).

Returns:
See DataPath

setDefaultHeight

public void setDefaultHeight(int defaultHeight)
For custom components, establishes a default height for the component.

For a component that should potentially be sized automatically by a Layout, set this property rather than height directly, because Layouts regard a height setting as an explicit size that shouldn't be changed.

Note : This is an advanced setting

Parameters:
defaultHeight - Default value is 100
See Also:
Sizing overview and related methods

getDefaultHeight

public int getDefaultHeight()
For custom components, establishes a default height for the component.

For a component that should potentially be sized automatically by a Layout, set this property rather than height directly, because Layouts regard a height setting as an explicit size that shouldn't be changed.

Returns:
int
See Also:
Sizing overview and related methods

setDefaultWidth

public void setDefaultWidth(int defaultWidth)
For custom components, establishes a default width for the component.

For a component that should potentially be sized automatically by a Layout, set this property rather than width directly, because Layouts regard a width setting as an explicit size that shouldn't be changed.

Note : This is an advanced setting

Parameters:
defaultWidth - Default value is 100
See Also:
Sizing overview and related methods

getDefaultWidth

public int getDefaultWidth()
For custom components, establishes a default width for the component.

For a component that should potentially be sized automatically by a Layout, set this property rather than width directly, because Layouts regard a width setting as an explicit size that shouldn't be changed.

Returns:
int
See Also:
Sizing overview and related methods

getDestroyed

public Boolean getDestroyed()
                     throws IllegalStateException
If this property is set to 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.

Returns:
Boolean
Throws:
IllegalStateException - if this widget has not yet been rendered.
See Also:
BaseWidget.destroy()

getDestroying

public Boolean getDestroying()
                      throws IllegalStateException
This property is set to true when the Canvas.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.

Returns:
Boolean
Throws:
IllegalStateException - if this widget has not yet been rendered.
See Also:
BaseWidget.destroy()

setDisabledCursor

public void setDisabledCursor(Cursor disabledCursor)
Specifies the cursor image to display when the mouse pointer is over this widget if this widget is disabled. It corresponds to the CSS cursor attribute. See Cursor type for different cursors.

Note : This is an advanced setting

Parameters:
disabledCursor - Default value is Canvas.DEFAULT
See Also:
Cues overview and related methods

getDisabledCursor

public Cursor getDisabledCursor()
Specifies the cursor image to display when the mouse pointer is over this widget if this widget is disabled. It corresponds to the CSS cursor attribute. See Cursor type for different cursors.

Returns:
Cursor
See Also:
Cues overview and related methods

setDoubleClickDelay

public void setDoubleClickDelay(int doubleClickDelay)
Amount of time (in milliseconds) between which two clicks are considered a single click

Note : This is an advanced setting

Parameters:
doubleClickDelay - Default value is 250

getDoubleClickDelay

public int getDoubleClickDelay()
Amount of time (in milliseconds) between which two clicks are considered a single click

Returns:
int

setDragAppearance

public void setDragAppearance(DragAppearance dragAppearance)
Visual appearance to show when the object is being dragged. May be overridden for dragResize or dragReposition events via dragResizeAppearance and dragRepositionAppearance.

Note : This is an advanced setting

Parameters:
dragAppearance - Default value is EventHandler.OUTLINE
See Also:
Dragdrop overview and related methods

getDragAppearance

public DragAppearance getDragAppearance()
Visual appearance to show when the object is being dragged. May be overridden for dragResize or dragReposition events via dragResizeAppearance and dragRepositionAppearance.

Returns:
DragAppearance
See Also:
Dragdrop overview and related methods

setDragIntersectStyle

public void 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.

Note : This is an advanced setting

Parameters:
dragIntersectStyle - Default value is "mouse"
See Also:
Dragdrop overview and related methods

getDragIntersectStyle

public 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.

Returns:
DragIntersectStyle
See Also:
Dragdrop overview and related methods

setDragMaskType

public void setDragMaskType(DragMaskType dragMaskType)
This property controls what kind of mask is used in case useDragMask is enabled.

Parameters:
dragMaskType - Default value is "div"
See Also:
Dragdrop overview and related methods

getDragMaskType

public DragMaskType getDragMaskType()
This property controls what kind of mask is used in case useDragMask is enabled.

Returns:
DragMaskType
See Also:
Dragdrop overview and related methods

setDragOpacity

public void setDragOpacity(Integer dragOpacity)
If this widget has dragAppearance "target", this value specifies the opacity to render the target while it is being dragged. A null value implies we do not modify the opacity.

Note : This is an advanced setting

Parameters:
dragOpacity - Default value is null
See Also:
Dragdrop overview and related methods, Drag effects Example

getDragOpacity

public Integer getDragOpacity()
If this widget has dragAppearance "target", this value specifies the opacity to render the target while it is being dragged. A null value implies we do not modify the opacity.

Returns:
Integer
See Also:
Dragdrop overview and related methods, Drag effects Example

setDragRepositionAppearance

public void setDragRepositionAppearance(DragAppearance dragRepositionAppearance)
If canDragReposition is true, this attributes specifies the visual appearance to show during drag reposition. If unset dragAppearance will be used.

Note : This is an advanced setting

Parameters:
dragRepositionAppearance - Default value is null
See Also:
Dragdrop overview and related methods

getDragRepositionAppearance

public DragAppearance getDragRepositionAppearance()
If canDragReposition is true, this attributes specifies the visual appearance to show during drag reposition. If unset dragAppearance will be used.

Returns:
DragAppearance
See Also:
Dragdrop overview and related methods

setDragRepositionCursor

public void setDragRepositionCursor(Cursor dragRepositionCursor)
Cursor to switch to if the mouse is over a widget that is drag repositionable.

Note : This is an advanced setting

Parameters:
dragRepositionCursor - Default value is Canvas.MOVE
See Also:
Dragdrop overview and related methods

getDragRepositionCursor

public Cursor getDragRepositionCursor()
Cursor to switch to if the mouse is over a widget that is drag repositionable.

Returns:
Cursor
See Also:
Dragdrop overview and related methods

setDragResizeAppearance

public void setDragResizeAppearance(DragAppearance dragResizeAppearance)
If canDragResize is true, this attributes specifies the visual appearance to show during drag resize. If unset dragAppearance will be used.

Note : This is an advanced setting

Parameters:
dragResizeAppearance - Default value is null
See Also:
Dragdrop overview and related methods

getDragResizeAppearance

public DragAppearance getDragResizeAppearance()
If canDragResize is true, this attributes specifies the visual appearance to show during drag resize. If unset dragAppearance will be used.

Returns:
DragAppearance
See Also:
Dragdrop overview and related methods

setDragScrollDelay

public void 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.

Note : This is an advanced setting

Parameters:
dragScrollDelay - Default value is 100

getDragScrollDelay

public int getDragScrollDelay()
If this widget supports drag-scrolling, This property specifies how many ms the user must hover over the drag-scroll threshold before scrolling begins.

Returns:
int

setDragStartDistance

public void setDragStartDistance(int dragStartDistance)
Number of pixels the cursor needs to move before the EventHandler starts a drag operation.

Note : This is an advanced setting

Parameters:
dragStartDistance - Default value is 5
See Also:
Dragdrop overview and related methods

getDragStartDistance

public int getDragStartDistance()
Number of pixels the cursor needs to move before the EventHandler starts a drag operation.

Returns:
int
See Also:
Dragdrop overview and related methods

setDragType

public void setDragType(String dragType)
Sets a 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

Parameters:
dragType - Default value is null
See Also:
Dragdrop overview and related methods

getDragType

public String getDragType()
Sets a dragType for this widget used, to be compared to dropTypes on possible drop target widgets. See dropTypes for a full explanation.

Returns:
String
See Also:
Dragdrop overview and related methods

setDropTypes

public void setDropTypes(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.

The default setting means any dragType is eligible for dropping on this widget, including no dragType setting.

See also Canvas.willAcceptDrop for dynamic determination of drop eligibility.

Note : This is an advanced setting

Parameters:
dropTypes - Default value is Canvas.ANYTHING
See Also:
Dragdrop overview and related methods

getDropTypes

public 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.

The default setting means any dragType is eligible for dropping on this widget, including no dragType setting.

See also Canvas.willAcceptDrop for dynamic determination of drop eligibility.

Returns:
String...
See Also:
Dragdrop overview and related methods

setDropTypes

public void setDropTypes(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.

The default setting means any dragType is eligible for dropping on this widget, including no dragType setting.

See also Canvas.willAcceptDrop for dynamic determination of drop eligibility.

Note : This is an advanced setting

Parameters:
dropTypes - Default value is Canvas.ANYTHING
See Also:
Dragdrop overview and related methods

getDropTypesAsString

public 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.

The default setting means any dragType is eligible for dropping on this widget, including no dragType setting.

See also Canvas.willAcceptDrop for dynamic determination of drop eligibility.

Returns:
String
See Also:
Dragdrop overview and related methods

setDynamicContents

public void setDynamicContents(Boolean dynamicContents)
Dynamic contents allows the contents string to be treated as a simple, but powerful template. When this attribute is set to true, expressions of the form \${arbitrary JS here} are replaced by the result of the evaluation of the JS code inside the curly brackets. This evaluation happens at draw time. If you want to trigger a re-evaluation of the expressions in the contents string you can call markForRedraw() on the canvas.

You can use this feature to build some simple custom components. For example, let's say you want to show the value of a Slider in a Canvas somewhere on the screen. You can do this by observing the valueChanged() method on the slider and calling setContents() on your canvas with the new string or you can set the contents of the canvas to something like:

"The slider value is \${sliderInstance.getValue()}."

Next you set dynamicContents: true on the canvas, observe valueChanged() on the slider and call canvas.markForRedraw() in that observation. This approach is cleaner than setContents() when the Canvas is aggregating several values or dynamic expressions. Like so:

  Slider.create({
      ID: "mySlider"
  });
 
  Canvas.create({
      ID: "myCanvas",
      dynamicContents: true,
      contents: "The slider value is \${mySlider.getValue()}."
  });
 
  myCanvas.observe(mySlider, "valueChanged",
                   "observer.markForRedraw()");
  
You can embed an arbitrary number of dynamic expressions in the contents string. The search and replace is optimized for speed.

If an error occurs during the evaluation of one of the expressions, a warning is logged to the ISC Developer Console and the error string is embedded in place of the expected value in the Canvas.

The value of a function is its return value. The value of any variable is the same as that returned by its toString() representation.

Inside the evaluation contentext, this points to the canvas instance that has the dynamicContents string as its contents - in other words the canvas instance on which the template is declared.

Note : This is an advanced setting

Parameters:
dynamicContents - Default value is false
See Also:
setContents(java.lang.String), com.smartgwt.client.widgets.Canvas#setDynamicContentsVars

getDynamicContents

public Boolean getDynamicContents()
Dynamic contents allows the contents string to be treated as a simple, but powerful template. When this attribute is set to true, expressions of the form \${arbitrary JS here} are replaced by the result of the evaluation of the JS code inside the curly brackets. This evaluation happens at draw time. If you want to trigger a re-evaluation of the expressions in the contents string you can call markForRedraw() on the canvas.

You can use this feature to build some simple custom components. For example, let's say you want to show the value of a Slider in a Canvas somewhere on the screen. You can do this by observing the valueChanged() method on the slider and calling setContents() on your canvas with the new string or you can set the contents of the canvas to something like:

"The slider value is \${sliderInstance.getValue()}."

Next you set dynamicContents: true on the canvas, observe valueChanged() on the slider and call canvas.markForRedraw() in that observation. This approach is cleaner than setContents() when the Canvas is aggregating several values or dynamic expressions. Like so:

  Slider.create({
      ID: "mySlider"
  });
 
  Canvas.create({
      ID: "myCanvas",
      dynamicContents: true,
      contents: "The slider value is \${mySlider.getValue()}."
  });
 
  myCanvas.observe(mySlider, "valueChanged",
                   "observer.markForRedraw()");
  
You can embed an arbitrary number of dynamic expressions in the contents string. The search and replace is optimized for speed.

If an error occurs during the evaluation of one of the expressions, a warning is logged to the ISC Developer Console and the error string is embedded in place of the expected value in the Canvas.

The value of a function is its return value. The value of any variable is the same as that returned by its toString() representation.

Inside the evaluation contentext, this points to the canvas instance that has the dynamicContents string as its contents - in other words the canvas instance on which the template is declared.

Returns:
Boolean
See Also:
getContents(), com.smartgwt.client.widgets.Canvas#getDynamicContentsVars

setEdgeBackgroundColor

public void setEdgeBackgroundColor(String edgeBackgroundColor)
                            throws IllegalStateException
Background color for the EdgedCanvas created to decorate this component. This can be used to provide an underlying "tint" color for translucent edge media

Parameters:
edgeBackgroundColor - See Color . Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getEdgeBackgroundColor

public String getEdgeBackgroundColor()
Background color for the EdgedCanvas created to decorate this component. This can be used to provide an underlying "tint" color for translucent edge media

Returns:
See Color

setEdgeCenterBackgroundColor

public void setEdgeCenterBackgroundColor(String edgeCenterBackgroundColor)
                                  throws IllegalStateException
Background color for the center section only. Can be used as a surrogate background color for the decorated Canvas, if the Canvas is set to partially overlap the edges and hence can't show a background color itself without occluding media.

Parameters:
edgeCenterBackgroundColor - See Color . Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getEdgeCenterBackgroundColor

public String getEdgeCenterBackgroundColor()
Background color for the center section only. Can be used as a surrogate background color for the decorated Canvas, if the Canvas is set to partially overlap the edges and hence can't show a background color itself without occluding media.

Returns:
See Color

setEdgeImage

public void setEdgeImage(String edgeImage)
                  throws IllegalStateException
Base name of images for edges. Extensions for each corner or edge piece will be added to this image URL, before the extension. For example, with the default base name of "edge.gif", the top-left corner image will be "edge_TL.gif".

The full list of extensions is: "_TL", "_TR", "_BL", "_BR", "_T", "_L", "_B", "_R", "_center".

Parameters:
edgeImage - See SCImgURL . Default value is "[SKIN]edge.gif"
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Edges Example

getEdgeImage

public String getEdgeImage()
Base name of images for edges. Extensions for each corner or edge piece will be added to this image URL, before the extension. For example, with the default base name of "edge.gif", the top-left corner image will be "edge_TL.gif".

The full list of extensions is: "_TL", "_TR", "_BL", "_BR", "_T", "_L", "_B", "_R", "_center".

Returns:
See SCImgURL
See Also:
Edges Example

setEdgeMarginSize

public void setEdgeMarginSize(int edgeMarginSize)
How far into the edge of an object do we consider the "edge" for drag resize purposes?

Note : This is an advanced setting

Parameters:
edgeMarginSize - Default value is 5
See Also:
Dragdrop overview and related methods, Drag resize Example

getEdgeMarginSize

public int getEdgeMarginSize()
How far into the edge of an object do we consider the "edge" for drag resize purposes?

Returns:
int
See Also:
Dragdrop overview and related methods, Drag resize Example

setEdgeOffset

public void setEdgeOffset(Integer edgeOffset)
                   throws IllegalStateException
Amount the contained Canvas should be offset. Defaults to edgeSize; set to less than edgeSize to allow the contained Canvas to overlap the edge and corner media.

Parameters:
edgeOffset - Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Corners Example

getEdgeOffset

public Integer getEdgeOffset()
Amount the contained Canvas should be offset. Defaults to edgeSize; set to less than edgeSize to allow the contained Canvas to overlap the edge and corner media.

Returns:
Integer
See Also:
Corners Example

setEdgeOpacity

public void setEdgeOpacity(Integer edgeOpacity)
                    throws IllegalStateException
Opacity of the edges. Defaults to matching this.opacity. if Canvas.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)

If this method is called after the component has been drawn/initialized: Set the edgeOpacity and mark the canvas for redraw

Parameters:
edgeOpacity - new edge-opacity level. Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Edges Example

getEdgeOpacity

public Integer getEdgeOpacity()
Opacity of the edges. Defaults to matching this.opacity. if Canvas.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)

Returns:
Integer
See Also:
Edges Example

setEdgeShowCenter

public void setEdgeShowCenter(Boolean edgeShowCenter)
                       throws IllegalStateException
Whether to show media in the center section, that is, behind the decorated Canvas.

Parameters:
edgeShowCenter - Default value is false
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Corners Example

getEdgeShowCenter

public Boolean getEdgeShowCenter()
Whether to show media in the center section, that is, behind the decorated Canvas.

Returns:
Boolean
See Also:
Corners Example

setEdgeSize

public void setEdgeSize(int edgeSize)
                 throws IllegalStateException
Size in pixels for corners and edges

Parameters:
edgeSize - Default value is 10
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Edges Example

getEdgeSize

public int getEdgeSize()
Size in pixels for corners and edges

Returns:
int
See Also:
Edges Example

setExtraSpace

public void setExtraSpace(int extraSpace)
                   throws IllegalStateException
When this Canvas is included as a member in a Layout, extra blank space that should be left after this member in a Layout.

Parameters:
extraSpace - Default value is 0
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
LayoutSpacer, LayoutMember overview and related methods

getExtraSpace

public 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.

Returns:
int
See Also:
LayoutSpacer, LayoutMember overview and related methods

setGroupBorderCSS

public void setGroupBorderCSS(String groupBorderCSS)
                       throws IllegalStateException
Sets the style for the grouping frame around the canvas. Only necessary when isGroup is set to true.

Parameters:
groupBorderCSS - Default value is "2px solid black"
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Appearance overview and related methods

getGroupBorderCSS

public String getGroupBorderCSS()
Sets the style for the grouping frame around the canvas. Only necessary when isGroup is set to true.

Returns:
String
See Also:
Appearance overview and related methods

setGroupLabelBackgroundColor

public void setGroupLabelBackgroundColor(String groupLabelBackgroundColor)
If set, the background color of the grouping label. Only applicable when isGroup is set to true.

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.

Parameters:
groupLabelBackgroundColor - the new grouping label background color. See CSSColor . Default value is null
See Also:
Appearance overview and related methods

getGroupLabelBackgroundColor

public String getGroupLabelBackgroundColor()
If set, the background color of the grouping label. Only applicable when isGroup is set to true.

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.

Returns:
See CSSColor
See Also:
Appearance overview and related methods

setGroupLabelStyleName

public void setGroupLabelStyleName(String groupLabelStyleName)
                            throws IllegalStateException
Sets the style for the grouping label. Only necessary when isGroup is set to true.

Note that groupLabelBackgroundColor overrides any background-color of this style.

Parameters:
groupLabelStyleName - See CSSStyleName . Default value is "groupLabel"
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Appearance overview and related methods

getGroupLabelStyleName

public String getGroupLabelStyleName()
Sets the style for the grouping label. Only necessary when isGroup is set to true.

Note that groupLabelBackgroundColor overrides any background-color of this style.

Returns:
See CSSStyleName
See Also:
Appearance overview and related methods

setGroupTitle

public void setGroupTitle(String groupTitle)
The title/label for the grouping. Only applicable when isGroup is set to true.

If this method is called after the component has been drawn/initialized: Setter for groupTitle.

Parameters:
groupTitle - The new title for the grouping. See HTMLString . Default value is null
See Also:
Appearance overview and related methods

getGroupTitle

public String getGroupTitle()
The title/label for the grouping. Only applicable when isGroup is set to true.

Returns:
See HTMLString
See Also:
Appearance overview and related methods

setHeight

public void setHeight(Integer height)
Size for this component's vertical dimension.

Can be a number of pixels, or a percentage like "50%". See documentation for width for details on how percentage values are resolved actual size.

Note that if overflow is set to "visible", this size is a minimum, and the component may overflow to show all content and/or children.

If trying to establish a default height for a custom component, set defaultHeight instead.

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

Parameters:
height - new height. Default value is null
See Also:
Sizing overview and related methods

getHeight

public Integer getHeight()
Size for this component's vertical dimension.

Can be a number of pixels, or a percentage like "50%". See documentation for width for details on how percentage values are resolved actual size.

Note that if overflow is set to "visible", this size is a minimum, and the component may overflow to show all content and/or children.

If trying to establish a default height for a custom component, set defaultHeight instead.

Returns:
Return the height of this object, in pixels.
See Also:
Sizing overview and related methods

setHeight

public void setHeight(String height)
Size for this component's vertical dimension.

Can be a number of pixels, or a percentage like "50%". See documentation for width for details on how percentage values are resolved actual size.

Note that if overflow is set to "visible", this size is a minimum, and the component may overflow to show all content and/or children.

If trying to establish a default height for a custom component, set defaultHeight instead.

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

Overrides:
setHeight in class UIObject
Parameters:
height - new height. Default value is null
See Also:
Sizing overview and related methods

setHideUsingDisplayNone

public void setHideUsingDisplayNone(boolean hideUsingDisplayNone)
                             throws IllegalStateException
When this widget is hidden (see visibility and Canvas.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

Parameters:
hideUsingDisplayNone - Default value is false
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Appearance overview and related methods

getHideUsingDisplayNone

public boolean getHideUsingDisplayNone()
When this widget is hidden (see visibility and Canvas.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.

Returns:
boolean
See Also:
Appearance overview and related methods

setHoverAlign

public void setHoverAlign(Alignment hoverAlign)
If this.showHover is true, this property can be used to customize the alignment of content in the hover canvas.

Parameters:
hoverAlign - Default value is null
See Also:
setShowHover(java.lang.Boolean)

getHoverAlign

public Alignment getHoverAlign()
If this.showHover is true, this property can be used to customize the alignment of content in the hover canvas.

Returns:
Alignment
See Also:
getShowHover()

setHoverAutoDestroy

public void setHoverAutoDestroy(Boolean hoverAutoDestroy)
If this.showHover is true and Canvas.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.

Parameters:
hoverAutoDestroy - Default value is null
See Also:
setShowHover(java.lang.Boolean)

getHoverAutoDestroy

public Boolean getHoverAutoDestroy()
If this.showHover is true and Canvas.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.

Returns:
Boolean
See Also:
getShowHover()

setHoverDelay

public void setHoverDelay(int hoverDelay)
If this.canHover is true, how long should the mouse be kept over this widget before the hover event is fired

Parameters:
hoverDelay - Default value is 300
See Also:
setCanHover(java.lang.Boolean), HoverEvent

getHoverDelay

public int getHoverDelay()
If this.canHover is true, how long should the mouse be kept over this widget before the hover event is fired

Returns:
int
See Also:
getCanHover(), HoverEvent

setHoverHeight

public void setHoverHeight(Integer hoverHeight)
If this.showHover is true, this property can be used to customize the height of the hover canvas shown.

Parameters:
hoverHeight - Default value is null
See Also:
setShowHover(java.lang.Boolean)

getHoverHeight

public Integer getHoverHeight()
If this.showHover is true, this property can be used to customize the height of the hover canvas shown.

Returns:
Integer
See Also:
getShowHover()

setHoverMoveWithMouse

public void setHoverMoveWithMouse(Boolean hoverMoveWithMouse)
If this.showHover is true, should this widget's hover canvas be moved with the mouse while visible?

Parameters:
hoverMoveWithMouse - Default value is null
See Also:
setShowHover(java.lang.Boolean)

getHoverMoveWithMouse

public Boolean getHoverMoveWithMouse()
If this.showHover is true, should this widget's hover canvas be moved with the mouse while visible?

Returns:
Boolean
See Also:
getShowHover()

setHoverOpacity

public void setHoverOpacity(Integer hoverOpacity)
If this.showHover is true, should the hover canvas be shown with opacity other than 100?

Parameters:
hoverOpacity - Default value is null
See Also:
setShowHover(java.lang.Boolean), Hovers / Tooltips Example

getHoverOpacity

public Integer getHoverOpacity()
If this.showHover is true, should the hover canvas be shown with opacity other than 100?

Returns:
Integer
See Also:
getShowHover(), Hovers / Tooltips Example

setHoverStyle

public void setHoverStyle(String hoverStyle)
If this.showHover is true, this property can be used to specify the css style to apply to the hover canvas.

Parameters:
hoverStyle - See CSSStyleName . Default value is null
See Also:
setShowHover(java.lang.Boolean), Hovers / Tooltips Example

getHoverStyle

public String getHoverStyle()
If this.showHover is true, this property can be used to specify the css style to apply to the hover canvas.

Returns:
See CSSStyleName
See Also:
getShowHover(), Hovers / Tooltips Example

setHoverVAlign

public void setHoverVAlign(VerticalAlignment hoverVAlign)
If this.showHover is true, this property can be used to customize the vertical alignment of content in the hover canvas.

Parameters:
hoverVAlign - Default value is null
See Also:
setShowHover(java.lang.Boolean)

getHoverVAlign

public VerticalAlignment getHoverVAlign()
If this.showHover is true, this property can be used to customize the vertical alignment of content in the hover canvas.

Returns:
VerticalAlignment
See Also:
getShowHover()

setHoverWidth

public void setHoverWidth(Integer hoverWidth)
If this.showHover is true, this property can be used to customize the width of the hover canvas shown.

Parameters:
hoverWidth - Default value is null
See Also:
setShowHover(java.lang.Boolean), Hovers / Tooltips Example

getHoverWidth

public Integer getHoverWidth()
If this.showHover is true, this property can be used to customize the width of the hover canvas shown.

Returns:
Integer
See Also:
getShowHover(), Hovers / Tooltips Example

setHoverWrap

public void setHoverWrap(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.

Parameters:
hoverWrap - Default value is null
See Also:
setShowHover(java.lang.Boolean)

getHoverWrap

public 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.

Returns:
Boolean
See Also:
getShowHover()

setHtmlElement

public void setHtmlElement(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().

NOTES:
This feature is intended for temporary integration with 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.

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

Overrides:
setHtmlElement in class BaseWidget
Parameters:
htmlElement - New htmlElement for this canvas, or Null to clear the existing htmlElement. Default value is null
See Also:
Positioning overview and related methods

getHtmlElement

public 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().

NOTES:
This feature is intended for temporary integration with 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.

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.

Returns:
Element
See Also:
Positioning overview and related methods

setHtmlPosition

public void 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.

If this method is called after the component has been drawn/initialized: Setter for the htmlPosition.

Note : This is an advanced setting

Parameters:
htmlPosition - New htmlPosition for this canvas. Default value is "afterBegin"
See Also:
Positioning overview and related methods

getHtmlPosition

public DrawPosition getHtmlPosition()
If htmlElement is specified, this attribute specifies the position where the canvas should be inserted relative to the htmlElement in the DOM.

Returns:
DrawPosition
See Also:
Positioning overview and related methods

setIsGroup

public void setIsGroup(boolean isGroup)
                throws IllegalStateException
Should a grouping frame be shown around this canvas.

Parameters:
isGroup - Default value is false
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
setGroupBorderCSS(java.lang.String), setGroupLabelStyleName(java.lang.String), setGroupLabelBackgroundColor(java.lang.String)

getIsGroup

public boolean getIsGroup()
Should a grouping frame be shown around this canvas.

Returns:
boolean
See Also:
getGroupBorderCSS(), getGroupLabelStyleName(), getGroupLabelBackgroundColor()

setKeepInParentRect

public void setKeepInParentRect(Boolean keepInParentRect)
Constrains drag-resizing and drag-repositioning of this canvas to either the rect of its parent (if set to true) or an arbitrary rect based its parent (if set to a [Left,Top,Width,Height] rect array). In the latter mode you may use negative offsets for left/top and a width/height greater than the visible or scroll width of the parent to allow positioning beyond the confines of the parent.

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 oveflow: "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

Parameters:
keepInParentRect - Default value is null
See Also:
Dragdrop overview and related methods, Drag create Example

getKeepInParentRect

public 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 its parent (if set to a [Left,Top,Width,Height] rect array). In the latter mode you may use negative offsets for left/top and a width/height greater than the visible or scroll width of the parent to allow positioning beyond the confines of the parent.

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 oveflow: "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).

Returns:
Boolean
See Also:
Dragdrop overview and related methods, Drag create Example

setKeepInParentRect

public void setKeepInParentRect(Integer... keepInParentRect)
Constrains drag-resizing and drag-repositioning of this canvas to either the rect of its parent (if set to true) or an arbitrary rect based its parent (if set to a [Left,Top,Width,Height] rect array). In the latter mode you may use negative offsets for left/top and a width/height greater than the visible or scroll width of the parent to allow positioning beyond the confines of the parent.

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 oveflow: "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

Parameters:
keepInParentRect - Default value is null
See Also:
Dragdrop overview and related methods, Drag create Example

setLayoutAlign

public void setLayoutAlign(Alignment layoutAlign)
When this Canvas is included as a member in a Layout, layoutAlign controls alignment on the breadth axis of the layout. Default is "left" for a VLayout, "top" for an HLayout.

Parameters:
layoutAlign - Default value is null
See Also:
LayoutMember overview and related methods

getLayoutAlign

public Alignment getLayoutAlign()
When this Canvas is included as a member in a Layout, layoutAlign controls alignment on the breadth axis of the layout. Default is "left" for a VLayout, "top" for an HLayout.

Returns:
Alignment
See Also:
LayoutMember overview and related methods

setLayoutAlign

public void setLayoutAlign(VerticalAlignment layoutAlign)
When this Canvas is included as a member in a Layout, layoutAlign controls alignment on the breadth axis of the layout. Default is "left" for a VLayout, "top" for an HLayout.

Parameters:
layoutAlign - Default value is null
See Also:
LayoutMember overview and related methods

setLeft

public void 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).

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

Parameters:
left - new left coordinate. Default value is 0
See Also:
Positioning overview and related methods

getLeft

public 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).

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.

Returns:
Return the left coordinate of this object, relative to its enclosing context, in pixels.
See Also:
Positioning overview and related methods

setLeft

public void setLeft(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).

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

Parameters:
left - new left coordinate. Default value is 0
See Also:
Positioning overview and related methods

setLocateChildrenBy

public void setLocateChildrenBy(LocatorStrategy locateChildrenBy)
Strategy to use when locating children in this canvas from an autoTest locator string.

Note : This is an advanced setting

Parameters:
locateChildrenBy - Default value is null

getLocateChildrenBy

public LocatorStrategy getLocateChildrenBy()
Strategy to use when locating children in this canvas from an autoTest locator string.

Returns:
LocatorStrategy

setLocateChildrenType

public void setLocateChildrenType(LocatorTypeStrategy locateChildrenType)
LocatorTypeStrategy to use when finding children within this canvas.

Note : This is an advanced setting

Parameters:
locateChildrenType - Default value is null

getLocateChildrenType

public LocatorTypeStrategy getLocateChildrenType()
LocatorTypeStrategy to use when finding children within this canvas.

Returns:
LocatorTypeStrategy

setLocatePeersBy

public void setLocatePeersBy(LocatorStrategy locatePeersBy)
Strategy to use when locating peers of this canvas from an autoTest locator string.

Note : This is an advanced setting

Parameters:
locatePeersBy - Default value is null

getLocatePeersBy

public LocatorStrategy getLocatePeersBy()
Strategy to use when locating peers of this canvas from an autoTest locator string.

Returns:
LocatorStrategy

setLocatePeersType

public void setLocatePeersType(LocatorTypeStrategy locatePeersType)
LocatorTypeStrategy to use when finding peers of this canvas.

Note : This is an advanced setting

Parameters:
locatePeersType - Default value is null

getLocatePeersType

public LocatorTypeStrategy getLocatePeersType()
LocatorTypeStrategy to use when finding peers of this canvas.

Returns:
LocatorTypeStrategy

setMargin

public void setMargin(Integer margin)
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.

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.

Parameters:
margin - new margin in pixels. Default value is null
See Also:
Appearance overview and related methods

getMargin

public Integer getMargin()
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.

Returns:
Integer
See Also:
Appearance overview and related methods

getMasterElement

public Canvas getMasterElement()
                        throws IllegalStateException
Deprecated. In favor or Canvas.getMasterCanvas as of Smart GWT release 9.1

This Canvas's "master" (the Canvas to which it was added as a peer), if any.

Note : This method should be called only after the widget has been rendered.

Returns:
Canvas
Throws:
IllegalStateException - if this widget has not yet been rendered.
See Also:
Containment overview and related methods

setMatchElement

public void setMatchElement(Boolean matchElement)
If htmlElement is specified, should this canvas initially be drawn at the same dimensions as the htmlElement?
Note: setting this property will not force the canvas to resize if the element subsequently resizes (for example due to page reflow).

Note : This is an advanced setting

Parameters:
matchElement - Default value is null

getMatchElement

public Boolean getMatchElement()
If htmlElement is specified, should this canvas initially be drawn at the same dimensions as the htmlElement?
Note: setting this property will not force the canvas to resize if the element subsequently resizes (for example due to page reflow).

Returns:
Boolean

setMaxHeight

public void setMaxHeight(int maxHeight)
Maximum height that this Canvas can be resized to.

Note : This is an advanced setting

Parameters:
maxHeight - Default value is 10000
See Also:
Sizing overview and related methods

getMaxHeight

public int getMaxHeight()
Maximum height that this Canvas can be resized to.

Returns:
int
See Also:
Sizing overview and related methods

setMaxWidth

public void setMaxWidth(int maxWidth)
Maximum width that this Canvas can be resized to.

Note : This is an advanced setting

Parameters:
maxWidth - Default value is 10000
See Also:
Sizing overview and related methods

getMaxWidth

public int getMaxWidth()
Maximum width that this Canvas can be resized to.

Returns:
int
See Also:
Sizing overview and related methods

setMenuConstructor

public void setMenuConstructor(String menuConstructor)
                        throws IllegalStateException
Default class used to construct menus created by this component, including context menus.

Parameters:
menuConstructor - See SCClassName . Default value is "Menu"
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
ShowContextMenuEvent, Cues overview and related methods

getMenuConstructor

public String getMenuConstructor()
Default class used to construct menus created by this component, including context menus.

Returns:
See SCClassName
See Also:
ShowContextMenuEvent, Cues overview and related methods

setMinHeight

public void setMinHeight(int minHeight)
Minimum height that this Canvas can be resized to by a user.

Note that a Canvas with overflow:"visible" has an implicit minimum size based on it's contents.

Note that minHeight affects only user-initiated drag resizes. To set the minimum height of a Canvas embedded in a Layout, you can set minMemberSize to affect the minimum height of all members of the Layout.

Note : This is an advanced setting

Parameters:
minHeight - Default value is 10
See Also:
Sizing overview and related methods

getMinHeight

public int getMinHeight()
Minimum height that this Canvas can be resized to by a user.

Note that a Canvas with overflow:"visible" has an implicit minimum size based on it's contents.

Note that minHeight affects only user-initiated drag resizes. To set the minimum height of a Canvas embedded in a Layout, you can set minMemberSize to affect the minimum height of all members of the Layout.

Returns:
int
See Also:
Sizing overview and related methods

setMinWidth

public void setMinWidth(int minWidth)
Minimum width that this Canvas can be resized to.

Note that a Canvas with overflow:"visible" has an implicit minimize size based on it's contents.

Note that minWidth affects only user-initiated drag resizes. To set the minimum width of a Canvas embedded in a Layout, you can set minMemberSize to affect the minimum width of all members of the Layout.

Note : This is an advanced setting

Parameters:
minWidth - Default value is 10
See Also:
Sizing overview and related methods

getMinWidth

public int getMinWidth()
Minimum width that this Canvas can be resized to.

Note that a Canvas with overflow:"visible" has an implicit minimize size based on it's contents.

Note that minWidth affects only user-initiated drag resizes. To set the minimum width of a Canvas embedded in a Layout, you can set minMemberSize to affect the minimum width of all members of the Layout.

Returns:
int
See Also:
Sizing overview and related methods

setMomentumScrollMinSpeed

public void setMomentumScrollMinSpeed(double momentumScrollMinSpeed)
The minimum speed in pixels per second that must be reached for momentum scrolling to kick in. This setting only applies to touch-enabled devices.

Note : This is an advanced setting

Parameters:
momentumScrollMinSpeed - Default value is 200

getMomentumScrollMinSpeed

public double getMomentumScrollMinSpeed()
The minimum speed in pixels per second that must be reached for momentum scrolling to kick in. This setting only applies to touch-enabled devices.

Returns:
double

setMouseStillDownDelay

public void setMouseStillDownDelay(int mouseStillDownDelay)
Amount of time (in milliseconds) between 'mouseStillDown' events for this object

Note : This is an advanced setting

Parameters:
mouseStillDownDelay - Default value is 100

getMouseStillDownDelay

public int getMouseStillDownDelay()
Amount of time (in milliseconds) between 'mouseStillDown' events for this object

Returns:
int

setMouseStillDownInitialDelay

public void setMouseStillDownInitialDelay(int mouseStillDownInitialDelay)
Amount of time (in milliseconds) before mouseStillDown events start to be fired for this object.

Note : This is an advanced setting

Parameters:
mouseStillDownInitialDelay - Default value is 400

getMouseStillDownInitialDelay

public int getMouseStillDownInitialDelay()
Amount of time (in milliseconds) before mouseStillDown events start to be fired for this object.

Returns:
int

setNoDoubleClicks

public void setNoDoubleClicks(Boolean noDoubleClicks)
If true, this canvas will receive all mouse-clicks as single click events rather than as doubleClick events.

Note : This is an advanced setting

Parameters:
noDoubleClicks - Default value is null

getNoDoubleClicks

public Boolean getNoDoubleClicks()
If true, this canvas will receive all mouse-clicks as single click events rather than as doubleClick events.

Returns:
Boolean

setOpacity

public void setOpacity(Integer opacity)
Renders the widget to be partly transparent. A widget's opacity property may be set to any number between 0 (transparent) to 100 (opaque). Null means don't specify opacity directly, 100 is fully opaque. 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.

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

Parameters:
opacity - new opacity level. Default value is null
See Also:
Cues overview and related methods

getOpacity

public Integer getOpacity()
Renders the widget to be partly transparent. A widget's opacity property may be set to any number between 0 (transparent) to 100 (opaque). Null means don't specify opacity directly, 100 is fully opaque. 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.

Returns:
Integer
See Also:
Cues overview and related methods

setOverflow

public void 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. Similar to the CSS property overflow, but consistent across browsers. See Overflow type for details.

If this method is called after the component has been drawn/initialized: Update the overflow of a Canvas after it has been created.

Parameters:
overflow - New overflow value.. Default value is Canvas.VISIBLE
See Also:
Sizing overview and related methods

getOverflow

public 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. Similar to the CSS property overflow, but consistent across browsers. See Overflow type for details.

Returns:
Overflow
See Also:
Sizing overview and related methods

setPadding

public void setPadding(Integer padding)
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.

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 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.

Parameters:
padding - new padding in pixels. Default value is null
See Also:
Appearance overview and related methods

getPadding

public Integer getPadding()
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.

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 layoutMargin to create blank space.

Returns:
Integer
See Also:
Appearance overview and related methods

setParentCanvas

public void setParentCanvas(Canvas parentCanvas)
                     throws IllegalStateException
This Canvas's immediate parent, if any.
Can be initialized, but any subsequent manipulation should be via addChild() and removeChild() calls on the parent. The parent Canvas should be fetched using getParentCanvas().

Parameters:
parentCanvas - Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Containment overview and related methods

getParentCanvas

public Canvas getParentCanvas()
This Canvas's immediate parent, if any.
Can be initialized, but any subsequent manipulation should be via addChild() and removeChild() calls on the parent. The parent Canvas should be fetched using getParentCanvas().

Returns:
Returns the parent of this canvas, if any.
See Also:
Containment overview and related methods

setParentElement

public void setParentElement(Canvas parentElement)
                      throws IllegalStateException
Deprecated. As of Smartclient version 9.1, deprecated in favor of parentCanvas and Canvas.getParentCanvas

This Canvas's immediate parent, if any.
Can be initialized, but any subsequent manipulation should be via addChild() and removeChild() calls on the parent.

Note : This is an advanced setting

Parameters:
parentElement - Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Containment overview and related methods

getParentElement

public Canvas getParentElement()
Deprecated. As of Smartclient version 9.1, deprecated in favor of parentCanvas and Canvas.getParentCanvas

This Canvas's immediate parent, if any.
Can be initialized, but any subsequent manipulation should be via addChild() and removeChild() calls on the parent.

Returns:
Canvas
See Also:
Containment overview and related methods

setPeers

public void setPeers(Canvas... peers)
              throws IllegalStateException
Array of all Canvii that are peers of this Canvas.

Use Canvas.addPeer and Canvas.removePeer to add and remove peers after a Canvas has been created/drawn.

Note : This is an advanced setting

Parameters:
peers - Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Containment overview and related methods

getPeers

public Canvas[] getPeers()
Array of all Canvii that are peers of this Canvas.

Use Canvas.addPeer and Canvas.removePeer to add and remove peers after a Canvas has been created/drawn.

Returns:
Canvas...
See Also:
Containment overview and related methods

setPercentBox

public void setPercentBox(PercentBoxModel percentBox)
                   throws IllegalStateException
Governs the model to be used when sizing canvases with percentage width or height, or positioning widgets with a specified 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

Parameters:
percentBox - Default value is "visible"
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Sizing overview and related methods

getPercentBox

public PercentBoxModel getPercentBox()
Governs the model to be used when sizing canvases with percentage width or height, or positioning widgets with a specified 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.

Returns:
PercentBoxModel
See Also:
Sizing overview and related methods

setPercentSource

public void 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.

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

Parameters:
percentSource - eterNew percent source (if omitted existing percentSource will just be cleared).. Default value is null
See Also:
setPercentBox(com.smartgwt.client.types.PercentBoxModel), Sizing overview and related methods

getPercentSource

public 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.

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.

Returns:
Canvas
See Also:
getPercentBox(), Sizing overview and related methods

setPosition

public void 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.

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 Canvas.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 : This is an advanced setting

Parameters:
position - Default value is null
See Also:
Positioning overview and related methods

getPosition

public 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.

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 Canvas.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".

Returns:
Positioning
See Also:
Positioning overview and related methods

setPrintChildrenAbsolutelyPositioned

public void setPrintChildrenAbsolutelyPositioned(Boolean printChildrenAbsolutelyPositioned)
Should this canvas print its children absolutely positioned when generating 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

Parameters:
printChildrenAbsolutelyPositioned - Default value is false
See Also:
Printing overview and related methods

getPrintChildrenAbsolutelyPositioned

public Boolean getPrintChildrenAbsolutelyPositioned()
Should this canvas print its children absolutely positioned when generating 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.

Returns:
Boolean
See Also:
Printing overview and related methods

setPrompt

public void setPrompt(String prompt)
Prompt displayed in hover canvas if showHover is true.

Parameters:
prompt - See HTMLString . Default value is null
See Also:
Hovers / Tooltips Example

getPrompt

public String getPrompt()
Prompt displayed in hover canvas if showHover is true.

Returns:
See HTMLString
See Also:
Hovers / Tooltips Example

setRedrawOnResize

public void setRedrawOnResize(Boolean redrawOnResize)
Should this element be redrawn in response to a resize?

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

Parameters:
redrawOnResize - Default value is true
See Also:
Drawing overview and related methods

getRedrawOnResize

public Boolean getRedrawOnResize()
Should this element be redrawn in response to a resize?

Should be set to true for components whose inner HTML will not automatically reflow to fit the component's new size.

Returns:
Boolean
See Also:
Drawing overview and related methods

setResizeBarTarget

public void setResizeBarTarget(String resizeBarTarget)
                        throws IllegalStateException
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. 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.

Parameters:
resizeBarTarget - Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
setShowResizeBar(java.lang.Boolean), LayoutMember overview and related methods

getResizeBarTarget

public 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. 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.

Returns:
String
See Also:
getShowResizeBar(), LayoutMember overview and related methods

setResizeFrom

public void setResizeFrom(EdgeName... resizeFrom)
When drag resizing is enabled via 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 EdgeNames.

Note : This is an advanced setting

Parameters:
resizeFrom - Default value is null
See Also:
Dragdrop overview and related methods, Drag resize Example

getResizeFrom

public EdgeName[] getResizeFrom()
When drag resizing is enabled via 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 EdgeNames.

Returns:
EdgeName...
See Also:
Dragdrop overview and related methods, Drag resize Example

setScrollbarConstructor

public void setScrollbarConstructor(String scrollbarConstructor)
                             throws IllegalStateException
The class that will be used to create custom scrollbars for this component. Set this attribute to a Scrollbar subclass with e.g. a different skinImgDir, to customize scrollbar appearance for this component only.

Note : This is an advanced setting

Parameters:
scrollbarConstructor - Default value is "Scrollbar"
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Scrolling overview and related methods

setScrollbarSize

public void setScrollbarSize(int scrollbarSize)
How thick should we make the scrollbars for this canvas.
NOTE: has no effect if showCustomScrollbars is false.

Note : This is an advanced setting

Parameters:
scrollbarSize - Default value is 16
See Also:
getScrollbarSize(), Scrolling overview and related methods

getScrollbarSize

public int getScrollbarSize()
How thick should we make the scrollbars for this canvas.
NOTE: has no effect if showCustomScrollbars is false.

Returns:
Returns the thickness of this widget's scrollbars.
For canvases showing custom scrollbars this is determined from this.scrollbarSize
See Also:
getScrollbarSize(), Scrolling overview and related methods

setShadowDepth

public void setShadowDepth(int shadowDepth)
                    throws IllegalStateException
Depth of the shadow, or the virtual height above the page of the widget throwing the shadow.

This is a single parameter that can be used to control both shadowSoftness and shadowOffset.

Parameters:
shadowDepth - Default value is 4
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShadowDepth

public int getShadowDepth()
Depth of the shadow, or the virtual height above the page of the widget throwing the shadow.

This is a single parameter that can be used to control both shadowSoftness and shadowOffset.

Returns:
int

setShadowImage

public void setShadowImage(String shadowImage)
                    throws IllegalStateException
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

Parameters:
shadowImage - See SCImgURL . Default value is "[SKIN]ds.png"
Throws:
IllegalStateException - this property cannot be changed after the component has been created

getShadowImage

public String getShadowImage()
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".

Returns:
See SCImgURL

setShadowOffset

public void setShadowOffset(Integer shadowOffset)
Offset of the shadow. Defaults to half of 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.

Note : This is an advanced setting

Parameters:
shadowOffset - Default value is null
See Also:
Shadows Example

getShadowOffset

public Integer getShadowOffset()
Offset of the shadow. Defaults to half of 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.

Returns:
Integer
See Also:
Shadows Example

setShadowSoftness

public void setShadowSoftness(Integer shadowSoftness)
Softness, or degree of blurring, of the shadow.

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

Parameters:
shadowSoftness - Default value is null
See Also:
Shadows Example

getShadowSoftness

public Integer getShadowSoftness()
Softness, or degree of blurring, of the shadow.

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.

Returns:
Integer
See Also:
Shadows Example

setShouldPrint

public void setShouldPrint(Boolean shouldPrint)
Whether this canvas should be included in a printable view.

Default is to:

Parameters:
shouldPrint - Default value is null
See Also:
Printing overview and related methods

getShouldPrint

public Boolean getShouldPrint()
Whether this canvas should be included in a printable view.

Default is to:

Returns:
Boolean
See Also:
Printing overview and related methods

setShowCustomScrollbars

public void setShowCustomScrollbars(Boolean showCustomScrollbars)
Whether to use the browser's native scrollbars or Smart GWT-based scrollbars.

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 Canvas.setShowCustomScrollbars method or via a simple addProperties block, like so:

      isc.Canvas.addProperties({ showCustomScrollbars:false });
  

Note : This is an advanced setting

Parameters:
showCustomScrollbars - Default value is true
See Also:
Scrolling overview and related methods

getShowCustomScrollbars

public Boolean getShowCustomScrollbars()
Whether to use the browser's native scrollbars or Smart GWT-based scrollbars.

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 Canvas.setShowCustomScrollbars method or via a simple addProperties block, like so:

      isc.Canvas.addProperties({ showCustomScrollbars:false });
  

Returns:
Boolean
See Also:
Scrolling overview and related methods

setShowDragShadow

public void setShowDragShadow(Boolean showDragShadow)
When this widget is dragged, if its dragAppearance is "target", should we show a shadow behind the canvas during the drag.

Note : This is an advanced setting

Parameters:
showDragShadow - Default value is null
See Also:
Dragdrop overview and related methods, Drag effects Example

getShowDragShadow

public Boolean getShowDragShadow()
When this widget is dragged, if its dragAppearance is "target", should we show a shadow behind the canvas during the drag.

Returns:
Boolean
See Also:
Dragdrop overview and related methods, Drag effects Example

setShowEdges

public void setShowEdges(Boolean showEdges)
                  throws IllegalStateException
Whether an EdgedCanvas should be used to show image-based edges around this component.

Parameters:
showEdges - Default value is false
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Edges Example

getShowEdges

public Boolean getShowEdges()
Whether an EdgedCanvas should be used to show image-based edges around this component.

Returns:
Boolean
See Also:
Edges Example

setShowHover

public void setShowHover(Boolean showHover)
If this.canHover is true, should we show the global hover canvas by default when the user hovers over this canvas?

Parameters:
showHover - Default value is true
See Also:
getHoverHTML()

getShowHover

public Boolean getShowHover()
If this.canHover is true, should we show the global hover canvas by default when the user hovers over this canvas?

Returns:
Boolean
See Also:
getHoverHTML()

setShowHoverComponents

public void setShowHoverComponents(Boolean showHoverComponents)
When set to true, shows a widget hovering at the mouse point instead of the builtin hover label. Override getHoverComponent to provide the Canvas to show as the hoverComponent.

Note : This is an advanced setting

Parameters:
showHoverComponents - Default value is false

getShowHoverComponents

public Boolean getShowHoverComponents()
When set to true, shows a widget hovering at the mouse point instead of the builtin hover label. Override getHoverComponent to provide the Canvas to show as the hoverComponent.

Returns:
Boolean

setShowResizeBar

public void setShowResizeBar(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.

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.

Parameters:
showResizeBar - setting for this.showResizeBar. Default value is false
See Also:
setResizeBarTarget(java.lang.String), Layout.setDefaultResizeBars(com.smartgwt.client.types.LayoutResizeBarPolicy), LayoutMember overview and related methods, Nesting Example

getShowResizeBar

public 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.

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.

Returns:
Boolean
See Also:
getResizeBarTarget(), Layout.getDefaultResizeBars(), LayoutMember overview and related methods, Nesting Example

setShowShadow

public void setShowShadow(Boolean showShadow)
Whether to show a drop shadow for this Canvas

If this method is called after the component has been drawn/initialized: Method to update showShadow.

Parameters:
showShadow - true if the shadow should be visible false if not. Default value is false
See Also:
Shadows Example

getShowShadow

public Boolean getShowShadow()
Whether to show a drop shadow for this Canvas

Returns:
Boolean
See Also:
Shadows Example

setShrinkElementOnHide

public void setShrinkElementOnHide(boolean shrinkElementOnHide)
This is an advanced setting. If set to 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

Parameters:
shrinkElementOnHide - Default value is false
See Also:
Visibility overview and related methods

getShrinkElementOnHide

public boolean getShrinkElementOnHide()
This is an advanced setting. If set to 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".

Returns:
boolean
See Also:
Visibility overview and related methods

setSkinImgDir

public void setSkinImgDir(String skinImgDir)
Default directory for skin images (those defined by the class), relative to the Page-wide skinDir.

Note : This is an advanced setting

Parameters:
skinImgDir - Default value is "images/"
See Also:
Images overview and related methods

getSkinImgDir

public String getSkinImgDir()
Default directory for skin images (those defined by the class), relative to the Page-wide skinDir.

Returns:
String
See Also:
Images overview and related methods

setSnapAxis

public void setSnapAxis(String snapAxis)
Describes which axes to apply snap-to-grid to. Valid values are "horizontal", "vertical" or "both".

Parameters:
snapAxis - Default value is "both"
See Also:
setSnapToGrid(java.lang.Boolean), setSnapResizeToGrid(java.lang.Boolean), setChildrenSnapToGrid(java.lang.Boolean), setChildrenSnapResizeToGrid(java.lang.Boolean), Dragdrop overview and related methods

getSnapAxis

public String getSnapAxis()
Describes which axes to apply snap-to-grid to. Valid values are "horizontal", "vertical" or "both".

Returns:
String
See Also:
getSnapToGrid(), getSnapResizeToGrid(), getChildrenSnapToGrid(), getChildrenSnapResizeToGrid(), Dragdrop overview and related methods

setSnapEdge

public void setSnapEdge(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.

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.

Parameters:
snapEdge - new snapEdge value. Default value is null
See Also:
setSnapTo(java.lang.String), Sizing overview and related methods

getSnapEdge

public 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.

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.

Returns:
Return the snapEdge value of this object
See Also:
getSnapTo(), Sizing overview and related methods

setSnapHDirection

public void setSnapHDirection(String snapHDirection)
The horizontal snap direction. Set this value to "before" to snap to the nearest gridpoint to the left; set it to "after" to snap to the nearest gridpoint to the right; and set it to "nearest" to snap to the nearest gridpoint in either direction.

Parameters:
snapHDirection - Default value is "after"
See Also:
setSnapToGrid(java.lang.Boolean), setSnapResizeToGrid(java.lang.Boolean), setChildrenSnapToGrid(java.lang.Boolean), setChildrenSnapResizeToGrid(java.lang.Boolean), Dragdrop overview and related methods

getSnapHDirection

public String getSnapHDirection()
The horizontal snap direction. Set this value to "before" to snap to the nearest gridpoint to the left; set it to "after" to snap to the nearest gridpoint to the right; and set it to "nearest" to snap to the nearest gridpoint in either direction.

Returns:
String
See Also:
getSnapToGrid(), getSnapResizeToGrid(), getChildrenSnapToGrid(), getChildrenSnapResizeToGrid(), Dragdrop overview and related methods

setSnapHGap

public void setSnapHGap(int snapHGap)
The horizontal grid size to use, in pixels, when snap-to-grid is enabled.

Parameters:
snapHGap - Default value is 20
See Also:
setSnapToGrid(java.lang.Boolean), setSnapResizeToGrid(java.lang.Boolean), setChildrenSnapToGrid(java.lang.Boolean), setChildrenSnapResizeToGrid(java.lang.Boolean), Dragdrop overview and related methods

getSnapHGap

public int getSnapHGap()
The horizontal grid size to use, in pixels, when snap-to-grid is enabled.

Returns:
int
See Also:
getSnapToGrid(), getSnapResizeToGrid(), getChildrenSnapToGrid(), getChildrenSnapResizeToGrid(), Dragdrop overview and related methods

setSnapOffsetLeft

public void setSnapOffsetLeft(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.

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.

Parameters:
snapOffsetLeft - Default value is null
See Also:
setSnapTo(java.lang.String), Sizing overview and related methods

getSnapOffsetLeft

public 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.

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.

Returns:
Integer
See Also:
getSnapTo(), Sizing overview and related methods

setSnapOffsetTop

public void setSnapOffsetTop(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.

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.

Parameters:
snapOffsetTop - Default value is null
See Also:
setSnapTo(java.lang.String), Sizing overview and related methods

getSnapOffsetTop

public 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.

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.

Returns:
Integer
See Also:
getSnapTo(), Sizing overview and related methods

setSnapOnDrop

public void setSnapOnDrop(Boolean snapOnDrop)
When this canvas is dropped onto an object supporting snap-to-grid, should it snap to the grid (true, the default) or just drop wherever the mouse is (false).

Note : This is an advanced setting

Parameters:
snapOnDrop - Default value is true
See Also:
setSnapToGrid(java.lang.Boolean), com.smartgwt.client.widgets.Canvas#shouldSnapOnDrop, Dragdrop overview and related methods

getSnapOnDrop

public 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).

Returns:
Boolean
See Also:
getSnapToGrid(), com.smartgwt.client.widgets.Canvas#shouldSnapOnDrop, Dragdrop overview and related methods

setSnapResizeToGrid

public void setSnapResizeToGrid(Boolean snapResizeToGrid)
Causes this canvas to snap to its parent's grid when resizing. Note that this value defaults to the Canvas's snapToGrid value if undefined.

Parameters:
snapResizeToGrid - Default value is null
See Also:
Dragdrop overview and related methods

getSnapResizeToGrid

public Boolean getSnapResizeToGrid()
Causes this canvas to snap to its parent's grid when resizing. Note that this value defaults to the Canvas's snapToGrid value if undefined.

Returns:
Boolean
See Also:
Dragdrop overview and related methods

setSnapTo

public void setSnapTo(String snapTo)
Position this widget such that it is aligned with ("snapped to") an edge of its 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.

Parameters:
snapTo - new snapTo value. Default value is null
See Also:
setSnapEdge(java.lang.String), setPercentBox(com.smartgwt.client.types.PercentBoxModel), Sizing overview and related methods

getSnapTo

public String getSnapTo()
Position this widget such that it is aligned with ("snapped to") an edge of its 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.

Returns:
Return the snapTo value of this object
See Also:
getSnapEdge(), getPercentBox(), Sizing overview and related methods

setSnapToGrid

public void setSnapToGrid(Boolean snapToGrid)
Causes this canvas to snap to its parent's grid when dragging.

Parameters:
snapToGrid - Default value is null
See Also:
setChildrenSnapToGrid(java.lang.Boolean), Dragdrop overview and related methods

getSnapToGrid

public Boolean getSnapToGrid()
Causes this canvas to snap to its parent's grid when dragging.

Returns:
Boolean
See Also:
getChildrenSnapToGrid(), Dragdrop overview and related methods

setSnapVDirection

public void setSnapVDirection(String snapVDirection)
The vertical snap direction. Set this value to "before" to snap to the nearest gridpoint above; set it to "after" to snap to the nearest gridpoint below; and set it to "nearest" to snap to the nearest gridpoint in either direction.

Parameters:
snapVDirection - Default value is "after"
See Also:
setSnapToGrid(java.lang.Boolean), setSnapResizeToGrid(java.lang.Boolean), setChildrenSnapToGrid(java.lang.Boolean), setChildrenSnapResizeToGrid(java.lang.Boolean), Dragdrop overview and related methods

getSnapVDirection

public String getSnapVDirection()
The vertical snap direction. Set this value to "before" to snap to the nearest gridpoint above; set it to "after" to snap to the nearest gridpoint below; and set it to "nearest" to snap to the nearest gridpoint in either direction.

Returns:
String
See Also:
getSnapToGrid(), getSnapResizeToGrid(), getChildrenSnapToGrid(), getChildrenSnapResizeToGrid(), Dragdrop overview and related methods

setSnapVGap

public void setSnapVGap(int snapVGap)
The vertical grid size to use, in pixels, when snap-to-grid is enabled.

Parameters:
snapVGap - Default value is 20
See Also:
setSnapToGrid(java.lang.Boolean), setSnapResizeToGrid(java.lang.Boolean), setChildrenSnapToGrid(java.lang.Boolean), setChildrenSnapResizeToGrid(java.lang.Boolean), Dragdrop overview and related methods

getSnapVGap

public int getSnapVGap()
The vertical grid size to use, in pixels, when snap-to-grid is enabled.

Returns:
int
See Also:
getSnapToGrid(), getSnapResizeToGrid(), getChildrenSnapToGrid(), getChildrenSnapResizeToGrid(), Dragdrop overview and related methods

setStyleName

public void setStyleName(String styleName)
The CSS class applied to this widget as a whole.

If this method is called after the component has been drawn/initialized: Sets the CSS class for this widget

Overrides:
setStyleName in class UIObject
Parameters:
styleName - new CSS style name See CSSStyleName . Default value is "normal"
See Also:
Appearance overview and related methods, CSS styles Example

getStyleName

public String getStyleName()
The CSS class applied to this widget as a whole.

Overrides:
getStyleName in class UIObject
Returns:
See CSSStyleName
See Also:
Appearance overview and related methods, CSS styles Example

setTabIndex

public void setTabIndex(Integer tabIndex)
If specified this governs the tabIndex of the widget in the page's tab order. Note that by default Smart GWT auto-assigns tab-indices, ensuring focusable widgets are reachable by tabbing in the order in which they are drawn on the page. 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.

Note : This is an advanced setting

Parameters:
tabIndex - New tabIndex for this widget. Must be less than TAB_INDEX_FLOOR to avoid interfering with auto-assigned tab indices on the page.. Default value is null
See Also:
Focus overview and related methods

getTabIndex

public Integer getTabIndex()
If specified this governs the tabIndex of the widget in the page's tab order. Note that by default Smart GWT auto-assigns tab-indices, ensuring focusable widgets are reachable by tabbing in the order in which they are drawn on the page. canvas.tabIndex cannot be set to greater than TAB_INDEX_FLOOR - as we reserve the values above this range for auto-assigned tab-indices.

Returns:
Integer
See Also:
Focus overview and related methods

setTop

public void 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).

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

Parameters:
top - new top coordinate. Default value is 0
See Also:
Positioning overview and related methods

getTop

public 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).

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.

Returns:
Return the top coordinate of this object, relative to its enclosing context, in pixels.
See Also:
Positioning overview and related methods

setTop

public void setTop(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).

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

Parameters:
top - new top coordinate. Default value is 0
See Also:
Positioning overview and related methods

getTopElement

public Canvas getTopElement()
                     throws IllegalStateException
The top-most Canvas (i.e., not a child of any other Canvas), if any, in this widget's containment hierarchy.

Note : This method should be called only after the widget has been rendered.

Returns:
Canvas
Throws:
IllegalStateException - if this widget has not yet been rendered.
See Also:
Containment overview and related methods

setUseBackMask

public void setUseBackMask(Boolean useBackMask)
In earlier versions of Internet Explorer (pre IE9), a native limitation exists whereby if HTML elements are overlapping on the page, certain elements can appear to "burn through" elements in the same position with a higher z-index. Specific cases in which this have been observed include Applets, <IFRAME> elements, and for older versions of IE, native <SELECT> items.

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

Parameters:
useBackMask - Default value is false

getUseBackMask

public 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. Specific cases in which this have been observed include Applets, <IFRAME> elements, and for older versions of IE, native <SELECT> items.

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.

Returns:
Boolean

setUseDragMask

public void setUseDragMask(boolean useDragMask)
This flag controls whether we register the component as a maskable item with the EventHandler. If enabled, a backmask will be automatically created for the dragMoveTarget on the fly to avoid burnthrough e.g. by plugins or frames.

Parameters:
useDragMask - Default value is false
See Also:
Dragdrop overview and related methods

getUseDragMask

public boolean getUseDragMask()
This flag controls whether we register the component as a maskable item with the EventHandler. If enabled, a backmask will be automatically created for the dragMoveTarget on the fly to avoid burnthrough e.g. by plugins or frames.

Returns:
boolean
See Also:
Dragdrop overview and related methods

setUseNativeDrag

public void setUseNativeDrag(Boolean useNativeDrag)
                      throws IllegalStateException
If set, native HTML5 drag and drop will be used for all drags initiated on this widget (on browsers where this is supported).

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 because cross-window drags—the primary purpose of this API—are not possible.

Parameters:
useNativeDrag - Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
Dragdrop overview and related methods, Native Drag Create Example

getUseNativeDrag

public 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).

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 because cross-window drags—the primary purpose of this API—are not possible.

Returns:
Boolean
See Also:
Dragdrop overview and related methods, Native Drag Create Example

setUseOpacityFilter

public void setUseOpacityFilter(Boolean useOpacityFilter)
                         throws IllegalStateException
Configures where the Opacity filter is used for IE6-8.

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.

Parameters:
useOpacityFilter - Default value is null
Throws:
IllegalStateException - this property cannot be changed after the component has been created
See Also:
IEFilters overview and related methods

getUseOpacityFilter

public Boolean getUseOpacityFilter()
Configures where the Opacity filter is used for IE6-8.

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.

Returns:
Boolean
See Also:
IEFilters overview and related methods

setValuesManager

public void 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

Parameters:
valuesManager - new dataPath. Default value is null

getValuesManager

public 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

Returns:
ValuesManager

setVisibility

public void setVisibility(Visibility visibility)
Controls widget visibility when the widget is initialized. See Visibility type for details.

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 it's 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.

Parameters:
visibility - Default value is Canvas.INHERIT
See Also:
Appearance overview and related methods

getVisibility

public Visibility getVisibility()
Controls widget visibility when the widget is initialized. See Visibility type for details.

Returns:
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.

NOTE: Undrawn widgets will report themselves as visible if they would be visible if drawn.

See Also:
Appearance overview and related methods

setWidth

public void setWidth(Integer width)
Size for this component's horizontal dimension.

Can be a number of pixels, or a percentage like "50%". Percentage sizes are resolved to pixel values as follows:

Layouts may specially interpret percentage sizes on their children, and also allow "*" as a size.

Note that if overflow is set to "visible", this size is a minimum, and the component may overflow to show all content and/or children.

If trying to establish a default width for a custom component, set defaultWidth instead.

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

Parameters:
width - new width. Default value is null
See Also:
Sizing overview and related methods

getWidth

public Integer getWidth()
Size for this component's horizontal dimension.

Can be a number of pixels, or a percentage like "50%". Percentage sizes are resolved to pixel values as follows:

Layouts may specially interpret percentage sizes on their children, and also allow "*" as a size.

Note that if overflow is set to "visible", this size is a minimum, and the component may overflow to show all content and/or children.

If trying to establish a default width for a custom component, set defaultWidth instead.

Returns:
Return the width of this object, in pixels.
See Also:
Sizing overview and related methods

setWidth

public void setWidth(String width)
Size for this component's horizontal dimension.

Can be a number of pixels, or a percentage like "50%". Percentage sizes are resolved to pixel values as follows:

Layouts may specially interpret percentage sizes on their children, and also allow "*" as a size.

Note that if overflow is set to "visible", this size is a minimum, and the component may overflow to show all content and/or children.

If trying to establish a default width for a custom component, set defaultWidth instead.

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

Overrides:
setWidth in class UIObject
Parameters:
width - new width. Default value is null
See Also:
Sizing overview and related methods

addChild

public 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.

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.

Parameters:
newChild - new child canvas to add
Returns:
the new child, or null if it couldn't be added
See Also:
Containment overview and related methods

addChild

public Canvas addChild(Canvas newChild,
                       String name)
See Also:
Canvas#addChild()}

addChild

public Canvas addChild(Canvas newChild,
                       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.

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.

Parameters:
newChild - new child canvas to add
name - name to assign to child (eg: this[name] == child)
autoDraw - if false, child will not automatically be drawn (only for advanced use)
Returns:
the new child, or null if it couldn't be added
See Also:
Containment overview and related methods

addPeer

public 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.

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)

Parameters:
newPeer - new peer widget to add
Returns:
the new peer, or null if it couldn't be added
See Also:
Containment overview and related methods

addPeer

public Canvas addPeer(Canvas newPeer,
                      String name)
See Also:
Canvas#addPeer()}

addPeer

public Canvas addPeer(Canvas newPeer,
                      String name,
                      Boolean autoDraw)
See Also:
Canvas#addPeer()}

addPeer

public Canvas addPeer(Canvas newPeer,
                      String name,
                      Boolean autoDraw,
                      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.

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)

Parameters:
newPeer - new peer widget to add
name - name to assign to peer (eg: this[peer] == child)
autoDraw - if true, 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 master
Returns:
the new peer, or null if it couldn't be added
See Also:
Containment overview and related methods

adjustForContent

public void adjustForContent(boolean immediate)
This method tells a component to adjust for size changes made to content by external code.

This is for very advanced use in which the contents of a Canvas are being directly updated by Ajax techniques, which is required for integration with some third-party libraries. Calling this method is required because browsers do not provide consistent events by which Smart GWT can be notified of external content changes.

Only contents supplied to a widget via contents or via an override of Canvas.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.

Parameters:
immediate - By default the adjustment will occur on a small delay for performance reasons. Pass in this parameter to force immediate adjustment.
See Also:
Sizing overview and related methods

animateFade

public void animateFade(Integer opacity)
Animate a change in opacity from the widget's current opacity to the specified opacity.

Parameters:
opacity - desired final opacity
See Also:
Fade Show & Hide Example

animateFade

public void animateFade(Integer opacity,
                        AnimationCallback callback)
See Also:
Canvas#animateFade()}

animateFade

public void animateFade(Integer opacity,
                        AnimationCallback callback,
                        Integer duration)
See Also:
Canvas#animateFade()}

animateFade

public void animateFade(Integer opacity,
                        AnimationCallback callback,
                        Integer duration,
                        AnimationAcceleration acceleration)
Animate a change in opacity from the widget's current opacity to the specified opacity.

Parameters:
opacity - desired final opacity
callback - 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 finishAnimation
duration - Duration in ms of the animated fade
acceleration - Optional animation acceleration to bias the ratios
See Also:
Fade Show & Hide Example

animateMove

public void animateMove(Integer left,
                        Integer top)
Animate a reposition of this canvas from its current position to the specified position

Parameters:
left - new left position (or null for unchanged)
top - new top position (or null for unchanged)
See Also:
Fly Onscreen Example

animateMove

public void animateMove(Integer left,
                        Integer top,
                        AnimationCallback callback)
See Also:
Canvas#animateMove()}

animateMove

public void animateMove(Integer left,
                        Integer top,
                        AnimationCallback callback,
                        Integer duration)
See Also:
Canvas#animateMove()}

animateMove

public void animateMove(Integer left,
                        Integer top,
                        AnimationCallback callback,
                        Integer duration,
                        AnimationAcceleration acceleration)
Animate a reposition of this canvas from its current position to the specified position

Parameters:
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 by a call to finishAnimation
duration - Duration in ms of the animated move
acceleration - Optional acceleration effect to bias the ratios
See Also:
Fly Onscreen Example

animateRect

public void animateRect(Integer left,
                        Integer top,
                        Integer width,
                        Integer height)
Animate a reposition / resize of this canvas from its current size and position.

Parameters:
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)
See Also:
Zoom & Shrink Example

animateRect

public void animateRect(Integer left,
                        Integer top,
                        Integer width,
                        Integer height,
                        AnimationCallback callback)
See Also:
Canvas#animateRect()}

animateRect

public void animateRect(Integer left,
                        Integer top,
                        Integer width,
                        Integer height,
                        AnimationCallback callback,
                        Integer duration)
See Also:
Canvas#animateRect()}

animateRect

public void animateRect(Integer left,
                        Integer top,
                        Integer width,
                        Integer height,
                        AnimationCallback callback,
                        Integer duration,
                        AnimationAcceleration acceleration)
Animate a reposition / resize of this canvas from its current size and position.

Parameters:
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 by a call to finishAnimation
duration - Duration in ms of the animated setRect
acceleration - Optional acceleration effect to apply to the animation
See Also:
Zoom & Shrink Example

animateResize

public void animateResize(Integer width,
                          Integer height)
Animate a resize of this canvas from its current size to the specified size

Parameters:
width - new width (or null for unchanged)
height - new height (or null for unchanged)
See Also:
Resize Example

animateResize

public void animateResize(Integer width,
                          Integer height,
                          AnimationCallback callback)
See Also:
Canvas#animateResize()}

animateResize

public void animateResize(Integer width,
                          Integer height,
                          AnimationCallback callback,
                          Integer duration)
See Also:
Canvas#animateResize()}

animateResize

public void animateResize(Integer width,
                          Integer height,
                          AnimationCallback callback,
                          Integer duration,
                          AnimationAcceleration acceleration)
Animate a resize of this canvas from its current size to the specified size

Parameters:
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 by a call to finishAnimation
duration - Duration in ms of the animated resize
acceleration - Optional acceleration effect to apply to the resize
See Also:
Resize Example

animateScroll

public void animateScroll(Integer scrollLeft,
                          Integer scrollTop)
Animate a scroll from the current scroll position to the specified position.

Parameters:
scrollLeft - desired final left scroll position
scrollTop - desired final top scroll position

animateScroll

public void animateScroll(Integer scrollLeft,
                          Integer scrollTop,
                          AnimationCallback callback)
See Also:
Canvas#animateScroll()}

animateScroll

public void animateScroll(Integer scrollLeft,
                          Integer scrollTop,
                          AnimationCallback callback,
                          Integer duration)
See Also:
Canvas#animateScroll()}

animateScroll

public void animateScroll(Integer scrollLeft,
                          Integer scrollTop,
                          AnimationCallback callback,
                          Integer duration,
                          AnimationAcceleration acceleration)
Animate a scroll from the current scroll position to the specified position.

Parameters:
scrollLeft - desired final left scroll position
scrollTop - desired final top scroll position
callback - 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 finishAnimation
duration - Duration in ms of the animated scroll
acceleration - Optional acceleration to bias the animation ratios

blur

public void blur()
If this canvas has keyboard focus, blur it. After this method, the canvas will no longer appear focused and will stop receiving keyboard events.

See Also:
Focus overview and related methods

bringToFront

public 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.

See Also:
ZIndex overview and related methods, Layer Example

clear

public 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.

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 Canvas.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 Canvas.addChild.


addClickHandler

public HandlerRegistration addClickHandler(ClickHandler handler)
Add a click handler.

Executed when the left mouse is clicked (pressed and then released) on this widget. No default implementation.

Specified by:
addClickHandler in interface HasClickHandlers
Parameters:
handler - the click handler
Returns:
HandlerRegistration used to remove this handler

clickMaskUp

public Boolean clickMaskUp()
Determines whether a clickmask is showing

Returns:
whether or not a clickmask is showing
See Also:
showClickMask(com.smartgwt.client.core.Function, com.smartgwt.client.types.ClickMaskMode, com.smartgwt.client.widgets.Canvas[])

clickMaskUp

public Boolean clickMaskUp(String ID)
Determines whether a clickmask is showing

Parameters:
ID - optional ID of specific clickMask to check. If not passed, checks for the click mask associated with this widget only.
Returns:
whether or not a clickmask is showing
See Also:
showClickMask(com.smartgwt.client.core.Function, com.smartgwt.client.types.ClickMaskMode, com.smartgwt.client.widgets.Canvas[])

contains

public 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.

Parameters:
canvas - the canvas to be tested
Returns:
true if specified element is a descendant of this canvas; false otherwise
See Also:
Containment overview and related methods

contains

public Boolean contains(Canvas canvas,
                        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.

Parameters:
canvas - the canvas to be tested
testSelf - If passed this method will return true if the the canvas parameter is a pointer to this widget.
Returns:
true if specified element is a descendant of this canvas; false otherwise
See Also:
Containment overview and related methods

containsEvent

public Boolean containsEvent()
Return true if the last event's mouse coordinates are within the bounds of this component. 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 of that component, this method will return true.

Returns:
true if the event occurred within the bounds of this component
See Also:
Positioning overview and related methods

containsFocus

public Boolean containsFocus()
Returns true if the keyboard focus is in this Canvas or any child of this Canvas.

Returns:
whether this Canvas contains the keyboard focus
See Also:
Focus overview and related methods

containsPoint

public Boolean containsPoint(int x,
                             int y)
Return whether or not this object contains the specified global (x,y) coordinates.

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)

Parameters:
x - GLOBAL x-coordinate
y - GLOBAL y-coordinate
Returns:
true if this object contains the specified point; false otherwise
See Also:
Positioning overview and related methods

containsPoint

public Boolean containsPoint(int x,
                             int y,
                             Boolean withinViewport)
Return whether or not this object contains the specified global (x,y) coordinates.

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)

Parameters:
x - GLOBAL x-coordinate
y - GLOBAL y-coordinate
withinViewport - point lies specifically within our viewport (drawn area excluding margins and scrollbars if present)
Returns:
true if this object contains the specified point; false otherwise
See Also:
Positioning overview and related methods

deparent

public void deparent()
Remove this canvas from its parent if it has one.

See Also:
Containment overview and related methods

depeer

public void depeer()
Make this Canvas no longer a peer of its master

See Also:
Containment overview and related methods

disable

public void disable()
Disables this widget and any children and peers of this widget.

See Also:
Enable overview and related methods

addDoubleClickHandler

public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler)
Add a doubleClick handler.

Executed when the left mouse button is clicked twice in rapid succession (within doubleClickDelay by default) in this object.

Specified by:
addDoubleClickHandler in interface HasDoubleClickHandlers
Parameters:
handler - the doubleClick handler
Returns:
HandlerRegistration used to remove this handler

addDragMoveHandler

public HandlerRegistration addDragMoveHandler(DragMoveHandler handler)
Add a dragMove handler.

Executed every time the mouse moves while dragging this canvas.

Specified by:
addDragMoveHandler in interface HasDragMoveHandlers
Parameters:
handler - the dragMove handler
Returns:
HandlerRegistration used to remove this handler

addDragRepositionMoveHandler

public HandlerRegistration addDragRepositionMoveHandler(DragRepositionMoveHandler handler)
Add a dragRepositionMove 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 dragTarget (or outline if dragAppearance is set to "outline") will automatically be moved as appropriate whenever the mouse moves.

Specified by:
addDragRepositionMoveHandler in interface HasDragRepositionMoveHandlers
Parameters:
handler - the dragRepositionMove handler
Returns:
HandlerRegistration used to remove this handler

addDragRepositionStartHandler

public HandlerRegistration addDragRepositionStartHandler(DragRepositionStartHandler handler)
Add a dragRepositionStart handler.

Executed when dragging first starts. No default implementation. Create this handler to set things up for the drag reposition.

Specified by:
addDragRepositionStartHandler in interface HasDragRepositionStartHandlers
Parameters:
handler - the dragRepositionStart handler
Returns:
HandlerRegistration used to remove this handler

addDragRepositionStopHandler

public HandlerRegistration addDragRepositionStopHandler(DragRepositionStopHandler handler)
Add a dragRepositionStop 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 dragTarget (or outline if 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.

Specified by:
addDragRepositionStopHandler in interface HasDragRepositionStopHandlers
Parameters:
handler - the dragRepositionStop handler
Returns:
HandlerRegistration used to remove this handler

addDragResizeMoveHandler

public HandlerRegistration addDragResizeMoveHandler(DragResizeMoveHandler handler)
Add a dragResizeMove 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 dragTarget (or outline if dragAppearance is set to "outline") will automatically be moved as appropriate whenever the mouse moves.

Specified by:
addDragResizeMoveHandler in interface HasDragResizeMoveHandlers
Parameters:
handler - the dragResizeMove handler
Returns:
HandlerRegistration used to remove this handler

addDragResizeStartHandler

public HandlerRegistration addDragResizeStartHandler(DragResizeStartHandler handler)
Add a dragResizeStart handler.

Executed when resize dragging first starts. No default implementation. Create this handler to set things up for the drag resize.

Specified by:
addDragResizeStartHandler in interface HasDragResizeStartHandlers
Parameters:
handler - the dragResizeStart handler
Returns:
HandlerRegistration used to remove this handler

addDragResizeStopHandler

public HandlerRegistration addDragResizeStopHandler(DragResizeStopHandler handler)
Add a dragResizeStop 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 dragTarget (or outline if 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

Specified by:
addDragResizeStopHandler in interface HasDragResizeStopHandlers
Parameters:
handler - the dragResizeStop handler
Returns:
HandlerRegistration used to remove this handler

addDragStartHandler

public HandlerRegistration addDragStartHandler(DragStartHandler handler)
Add a dragStart 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 dragStartDistance with the left mouse down.

Specified by:
addDragStartHandler in interface HasDragStartHandlers
Parameters:
handler - the dragStart handler
Returns:
HandlerRegistration used to remove this handler

addDragStopHandler

public HandlerRegistration addDragStopHandler(DragStopHandler handler)
Add a dragStop 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.

Specified by:
addDragStopHandler in interface HasDragStopHandlers
Parameters:
handler - the dragStop handler
Returns:
HandlerRegistration used to remove this handler

addDropMoveHandler

public HandlerRegistration addDropMoveHandler(DropMoveHandler handler)
Add a dropMove 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.

Specified by:
addDropMoveHandler in interface HasDropMoveHandlers
Parameters:
handler - the dropMove handler
Returns:
HandlerRegistration used to remove this handler

addDropOutHandler

public HandlerRegistration addDropOutHandler(DropOutHandler handler)
Add a dropOut handler.

Executed when the dragged object is moved out of the rectangle of this drop target. If you have set a visual indication in dropOver or dropMove, you should reset it to its normal state in dropOut.

Specified by:
addDropOutHandler in interface HasDropOutHandlers
Parameters:
handler - the dropOut handler
Returns:
HandlerRegistration used to remove this handler

addDropOverHandler

public HandlerRegistration addDropOverHandler(DropOverHandler handler)
Add a dropOver 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.

Specified by:
addDropOverHandler in interface HasDropOverHandlers
Parameters:
handler - the dropOver handler
Returns:
HandlerRegistration used to remove this handler

enable

public void enable()
Enables this widget and any children / peers of this widget.

See Also:
Enable overview and related methods

focus

public void focus()
If this canvas can accept focus, give it keyboard focus. After this method, the canvas will appear focused and will receive keyboard events.

See Also:
Focus overview and related methods

addFocusChangedHandler

public HandlerRegistration addFocusChangedHandler(FocusChangedHandler handler)
Add a focusChanged handler.

Notification function fired when this widget receives or loses keyboard focus.

Specified by:
addFocusChangedHandler in interface HasFocusChangedHandlers
Parameters:
handler - the focusChanged handler
Returns:
HandlerRegistration used to remove this handler

focusInNextTabElement

public void focusInNextTabElement()
Shifts focus to the next focusable element after this one. This is the programmatic equivalent of the user pressing the Tab key. A "focusable element" is a Canvas or FormItem that is focusable, and is not disabled or masked. Note that the movement of focus to a FormItem is managed by the containing DynamicForm; calling this method on a DynamicForm will move the focus to the next focusable FormItem in the form if there is one, and onto the next focusable Canvas if not.

NOTE: This method only considers Smart GWT elements. Native elements that you create directly - for example, with HTMLFlow.setContents or by creating a custom widget with Canvas.getInnerHTML that has focusable elements that are not child Canvases - will not be noticed by this method.

See Also:
getTabIndex(), focusInPreviousTabElement(), Focus overview and related methods

focusInPreviousTabElement

public void focusInPreviousTabElement()
Shifts focus to the previous focusable element before this one. This is the programmatic equivalent of the user pressing Shift-Tab. A "focusable element" is a Canvas or FormItem that is focusable, and is not disabled or masked. Note that the movement of focus to a FormItem is managed by the containing DynamicForm; calling this method on a DynamicForm will move the focus to the previous focusable FormItem in the form if there is one, and onto the previous focusable Canvas if not.

NOTE: This method only considers Smart GWT elements. Native elements that you create directly - for example, with HTMLFlow.setContents or by creating a custom widget with Canvas.getInnerHTML that has focusable elements that are not child Canvases - will not be noticed by this method.

See Also:
getTabIndex(), focusInNextTabElement(), Focus overview and related methods

getBottom

public int getBottom()
Return the bottom coordinate of this object as rendered, relative to its enclosing context, in pixels.

Returns:
bottom coordinate
See Also:
Sizing overview and related methods

getContentElement

public Element getContentElement()
Returns the DOM element for this Canvas which contains the 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 Canvas.draw, Canvas.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 Canvas.setContents, Canvas.addChild, Canvas.removeChild, Canvas.markForRedraw and Canvas.redraw should be used instead.

In some cases, the element returned may match the element returned by Canvas.getOuterElement, but this will not always be the case.

If the widget is undrawn, this method will return null.

Returns:
The outer DOM element for a drawn Canvas.

getFullDataPath

public String getFullDataPath()
Returns a fully qualified 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.

Returns:
fully qualified dataPath for this component

getHoverHTML

public 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. 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.

Returns:
the string to show in the hover
See Also:
getShowHover()

getHSnapOrigin

public int getHSnapOrigin()
Get an offset to be used when calculating snap positioning. Returns 0 by default.

Returns:
The offset to use when snapping
See Also:
getHSnapPosition(int), Positioning overview and related methods

getHSnapOrigin

public int getHSnapOrigin(Canvas snapChild)
Get an offset to be used when calculating snap positioning. Returns 0 by default.

Parameters:
snapChild - the child that is being snapped
Returns:
The offset to use when snapping
See Also:
getHSnapPosition(int), Positioning overview and related methods

getHSnapPosition

public int getHSnapPosition(int coordinate)
Override this method to provide a custom snap-to grid. Note that you do not need to do this if your grid is regular (ie, grid points are every x pixels); regular grids should be defined using snapHGap and snapVGap. You should only override this method if you want to provide support for a grid of irregularly-placed points

Parameters:
coordinate - x-coordinate of the drag event relative to the inside of this widget
Returns:
The horizontal coordinate to snap to
See Also:
Dragdrop overview and related methods

getHSnapPosition

public int getHSnapPosition(int coordinate,
                            String direction)
Override this method to provide a custom snap-to grid. Note that you do not need to do this if your grid is regular (ie, grid points are every x pixels); regular grids should be defined using snapHGap and snapVGap. You should only override this method if you want to provide support for a grid of irregularly-placed points

Parameters:
coordinate - x-coordinate of the drag event relative to the inside of this widget
direction - "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 default
Returns:
The horizontal coordinate to snap to
See Also:
Dragdrop overview and related methods

getImage

public Element getImage(String identifier)
Retrieve a native image element by name.

The image element must have been created from HTML generated by calling Canvas.imgHTML on this particular Canvas.

Parameters:
identifier - name of the image to get, as originally passed to imgHTML()
Returns:
DOM image element if found, else null
See Also:
Images overview and related methods

getInnerContentHeight

public 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.

Returns:
inner height of the widget in pixels
See Also:
getInnerContentWidth(), getInnerHeight(), getInnerWidth(), Sizing overview and related methods

getInnerContentWidth

public 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.

Returns:
inner height of the widget in pixels
See Also:
getInnerContentHeight(), getInnerHeight(), getInnerWidth(), Sizing overview and related methods

getInnerHeight

public 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.

This is the space within the viewport of the widget (including padding, but excluding margins, borders or scrollbars) rendered at its specified size.

Returns:
inner height of the widget in pixels
See Also:
getInnerWidth(), getInnerContentHeight(), getInnerContentWidth(), Sizing overview and related methods

getInnerWidth

public 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.

This is the space within the viewport of the widget (including padding, but excluding margins, borders or scrollbars) rendered at its specified size.

Returns:
inner width of the widget in pixels
See Also:
getInnerHeight(), getInnerContentHeight(), getInnerContentWidth(), Sizing overview and related methods

getMasterCanvas

public Canvas getMasterCanvas()
Returns this canvas's "master" (the canvas to which it was added as a peer), if any.

Returns:
the master canvas, null if none exists.
See Also:
Containment overview and related methods

getOffsetX

public 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()

Returns:
See Also:
Positioning overview and related methods

getOffsetY

public 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()

Returns:
See Also:
Positioning overview and related methods

getOuterElement

public Element getOuterElement()
Returns the outer DOM element of this Canvas. 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 Canvas.draw, Canvas.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 Canvas.setContents, Canvas.addChild, Canvas.removeChild, Canvas.markForRedraw and Canvas.redraw should be used instead.

In some cases, the element returned may match the element returned by Canvas.getContentElement, but this will not always be the case.

If the widget is undrawn, this method will return null.

Returns:
The outer DOM element for a drawn Canvas.

getPageBottom

public int getPageBottom()
Return the page-relative bottom coordinate of this object, in pixels.

Returns:
GLOBAL bottom coordinate
See Also:
Positioning overview and related methods

getPageLeft

public int getPageLeft()
Returns the page-relative left coordinate of the widget on the page, in pixels.

Returns:
global left coordinate
See Also:
Positioning overview and related methods

getPageRight

public int getPageRight()
Return the page-relative right coordinate of this object, in pixels.

Returns:
GLOBAL right coordinate
See Also:
Positioning overview and related methods

getPageTop

public int getPageTop()
Returns the page-relative top coordinate of the widget on the page, in pixels

Returns:
GLOBAL top coordinate
See Also:
Positioning overview and related methods

getRight

public int getRight()
Return the right coordinate of this object as rendered, relative to its enclosing context, in pixels.

Returns:
right coordinate
See Also:
Sizing overview and related methods

getScrollBottom

public int getScrollBottom()
Returns the scrollTop required to scroll vertically to the end of this widget's content.

Returns:
scroll bottom coordinate
See Also:
Scrolling overview and related methods

getScrollHeight

public int getScrollHeight()
Returns the scrollable height of the widget's contents, including children, ignoring clipping.

Returns:
height of the element that can scroll
See Also:
Sizing overview and related methods

getScrollLeft

public int getScrollLeft()
Get the number of pixels this Canvas is scrolled from its left edge.

Returns:
scrollLeft
See Also:
Positioning overview and related methods

getScrollRight

public int getScrollRight()
Returns the scrollLeft required to scroll horizontally to the end of this widget's content.

Returns:
scroll bottom coordinate
See Also:
Scrolling overview and related methods

getScrollTop

public int getScrollTop()
Get the number of pixels this Canvas is scrolled from its top edge.

Returns:
scrollTop
See Also:
Positioning overview and related methods

getScrollWidth

public int getScrollWidth()
Returns the scrollable width of the widget's contents, including children, ignoring clipping.

Returns:
the scrollable width of the widget's contents
See Also:
Sizing overview and related methods

getViewportHeight

public int getViewportHeight()
Returns the height of the viewport onto the scrollable content.

Returns:
height of the viewport, in pixels
See Also:
Sizing overview and related methods

getViewportWidth

public int getViewportWidth()
Returns the width of the viewport onto the scrollable content.

Returns:
width of the viewport, in pixels
See Also:
Sizing overview and related methods

getVisibleHeight

public int getVisibleHeight()
Return the visible height of the Canvas.

Returns:
visible height in pixels
See Also:
Sizing overview and related methods

getVisibleWidth

public int getVisibleWidth()
Return the visible width of the Canvas.

Returns:
visible width in pixels
See Also:
Sizing overview and related methods

getVSnapOrigin

public int getVSnapOrigin()
Get an offset to be used when calculating snap positioning. Returns 0 by default.

Returns:
The offset to use when snapping
See Also:
getVSnapPosition(int), Positioning overview and related methods

getVSnapOrigin

public int getVSnapOrigin(Canvas snapChild)
Get an offset to be used when calculating snap positioning. Returns 0 by default.

Parameters:
snapChild - the child that is being snapped
Returns:
The offset to use when snapping
See Also:
getVSnapPosition(int), Positioning overview and related methods

getVSnapPosition

public int getVSnapPosition(int coordinate)
Override this method to provide a custom snap-to grid. Note that you do not need to do this if your grid is regular (ie, grid points are every x pixels) - regular grids should be defined using snapHGap and snapVGap. You should only override this method if you want to provide support for a grid of irregularly-placed points

Parameters:
coordinate - y-coordinate of the drag event relative to the inside of this widget
Returns:
The vertical coordinate to snap to
See Also:
Dragdrop overview and related methods

getVSnapPosition

public int getVSnapPosition(int coordinate,
                            String direction)
Override this method to provide a custom snap-to grid. Note that you do not need to do this if your grid is regular (ie, grid points are every x pixels) - regular grids should be defined using snapHGap and snapVGap. You should only override this method if you want to provide support for a grid of irregularly-placed points

Parameters:
coordinate - y-coordinate of the drag event relative to the inside of this widget
direction - "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 default
Returns:
The vertical coordinate to snap to
See Also:
Dragdrop overview and related methods

getZIndex

public int getZIndex(boolean resolveToNumber)
Get the z-Index of this canvas.

Parameters:
resolveToNumber - If passed true, for undrawn widgets, resolve "auto" to the next available zIndex.
Returns:
See Also:
ZIndex overview and related methods

handleHover

public void handleHover()
Handler fired on a delay when the user hovers the mouse over this hover-target. Default implementation will fire this.hover() (if defined), and handle showing the hover canvas if this.showHover is true.

See Also:
getCanHover(), getShowHover(), HoverEvent

hide

public void hide()
Sets the widget's CSS visibility attribute to "hidden".

See Also:
Visibility overview and related methods, Show & Hide Example

hideClickMask

public void hideClickMask()
Hides the click mask associated with this canvas.

See Also:
showClickMask(com.smartgwt.client.core.Function, com.smartgwt.client.types.ClickMaskMode, com.smartgwt.client.widgets.Canvas[])

hideClickMask

public void hideClickMask(String ID)
Hides the click mask associated with this canvas.

Parameters:
ID - optional ID of specific clickMask to hide. If not passed, defaults to hiding the click mask associated with this widget only.
See Also:
showClickMask(com.smartgwt.client.core.Function, com.smartgwt.client.types.ClickMaskMode, com.smartgwt.client.widgets.Canvas[])

hideContextMenu

public 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). Override if you want some other behavior.

See Also:
ShowContextMenuEvent, Menu.hideContextMenu(), getOffsetX(), getOffsetY()

addHoverHandler

public HandlerRegistration addHoverHandler(HoverHandler handler)
Add a hover 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.

Specified by:
addHoverHandler in interface HasHoverHandlers
Parameters:
handler - the hover handler
Returns:
HandlerRegistration used to remove this handler

addHoverHiddenHandler

public HandlerRegistration addHoverHiddenHandler(HoverHiddenHandler handler)
Add a hoverHidden handler.

If showHover is true for this canvas, this notification method will be fired whenever the hover shown in response to handleHover() is hidden. This method may be observed or overridden.

Specified by:
addHoverHiddenHandler in interface HasHoverHiddenHandlers
Parameters:
handler - the hoverHidden handler
Returns:
HandlerRegistration used to remove this handler

intersects

public Boolean intersects(Canvas other)
Returns true if the rectangles of this widget and the specified widget overlap.

Parameters:
other - other canvas to test for intersection
Returns:
true if this canvas intersects other; false otherwise
See Also:
Positioning overview and related methods

isDirty

public Boolean isDirty()
Returns whether a canvas is waiting to be redrawn. Will return true if Canvas.markForRedraw has been called, but this canvas has not yet been redrawn.

Returns:
true is this canvas needs to be redrawn; false otherwise
See Also:
Drawing overview and related methods

isDisabled

public 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.

Returns:
true if the widget or any widget above it in the containment hierarchy are disabled.
See Also:
Enable overview and related methods

isDrawn

public Boolean isDrawn()
Returns the boolean true, if the widget has been completely drawn, and false otherwise.

Overrides:
isDrawn in class BaseWidget
Returns:
true if drawn, false if not drawn
See Also:
Drawing overview and related methods

addKeyDownHandler

public HandlerRegistration addKeyDownHandler(KeyDownHandler handler)
Add a keyDown handler.

Executed when a key is pressed on a focusable widget (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.

Specified by:
addKeyDownHandler in interface HasKeyDownHandlers
Parameters:
handler - the keyDown handler
Returns:
HandlerRegistration used to remove this handler

addKeyPressHandler

public HandlerRegistration addKeyPressHandler(KeyPressHandler handler)
Add a keyPress handler.

Executed when a key is pressed and released on a focusable widget (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.

Specified by:
addKeyPressHandler in interface HasKeyPressHandlers
Parameters:
handler - the keyPress handler
Returns:
HandlerRegistration used to remove this handler

keyUp

public Boolean keyUp()
Executed when a key is released on a focusable widget (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.

Returns:
false to prevent this event from bubbling to this widget's parent, true or undefined to bubble.
See Also:
getCanFocus()

layoutChildren

public void layoutChildren(String reason)
layoutChildren() is where a Canvas should implement a sizing policy for it's Canvas children. Since layoutChildren calls parentResized() on its children, Canvas.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.

Parameters:
reason - reason why layoutChildren() is being called, passed when framework code invokes layoutChildren()
See Also:
Sizing overview and related methods

linkHTML

public String linkHTML(String href)
Generates the HTML for a standard link (anchor) element.

Parameters:
href - URL for the link to point to
Returns:
HTML for the link

linkHTML

public String linkHTML(String href,
                       String text)
See Also:
Canvas#linkHTML()}

linkHTML

public String linkHTML(String href,
                       String text,
                       String target)
See Also:
Canvas#linkHTML()}

linkHTML

public String linkHTML(String href,
                       String text,
                       String target,
                       String ID)
See Also:
Canvas#linkHTML()}

linkHTML

public String linkHTML(String href,
                       String text,
                       String target,
                       String ID,
                       Integer tabIndex)
See Also:
Canvas#linkHTML()}

linkHTML

public String linkHTML(String href,
                       String text,
                       String target,
                       String ID,
                       Integer tabIndex,
                       String accessKey)
Generates the HTML for a standard link (anchor) element.

Parameters:
href - URL for the link to point to
text - 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 out
tabIndex - optional tabIndex for the link
accessKey - optional accessKey for the link
Returns:
HTML for the link

markForDestroy

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.

See Also:
BaseWidget.destroy()

markForRedraw

public void markForRedraw()
Marks the widget as "dirty" so that it will be added to a queue for redraw. Redraw of dirty components is handled by a looping timer and will after a very short delay (typically less than 100ms). In most cases it is recommended that developers use markForRedraw() instead of calling Canvas.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.

See Also:
Drawing overview and related methods

markForRedraw

public void markForRedraw(String reason)
Marks the widget as "dirty" so that it will be added to a queue for redraw. Redraw of dirty components is handled by a looping timer and will after a very short delay (typically less than 100ms). In most cases it is recommended that developers use markForRedraw() instead of calling Canvas.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.

Parameters:
reason - reason for performing the redraw
See Also:
Drawing overview and related methods

addMouseDownHandler

public HandlerRegistration addMouseDownHandler(MouseDownHandler handler)
Add a mouseDown handler.

Executed when the left mouse down is pressed on this widget. No default implementation.

Specified by:
addMouseDownHandler in interface HasMouseDownHandlers
Parameters:
handler - the mouseDown handler
Returns:
HandlerRegistration used to remove this handler

addMouseMoveHandler

public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler)
Add a mouseMove handler.

Executed when the mouse moves within this widget. No default implementation.

Specified by:
addMouseMoveHandler in interface HasMouseMoveHandlers
Parameters:
handler - the mouseMove handler
Returns:
HandlerRegistration used to remove this handler

addMouseOutHandler

public HandlerRegistration addMouseOutHandler(MouseOutHandler handler)
Add a mouseOut handler.

Executed when the mouse leaves this widget. No default implementation.

Specified by:
addMouseOutHandler in interface HasMouseOutHandlers
Parameters:
handler - the mouseOut handler
Returns:
HandlerRegistration used to remove this handler

addMouseOverHandler

public HandlerRegistration addMouseOverHandler(MouseOverHandler handler)
Add a mouseOver handler.

Executed when mouse enters this widget. No default implementation.

Specified by:
addMouseOverHandler in interface HasMouseOverHandlers
Parameters:
handler - the mouseOver handler
Returns:
HandlerRegistration used to remove this handler

addMouseStillDownHandler

public HandlerRegistration addMouseStillDownHandler(MouseStillDownHandler handler)
Add a mouseStillDown handler.

Executed repeatedly (every mouseStillDownDelay by default) when the system is idle - i.e. not busy running other scripts - and the left mouse button is held down after having been pressed in the object. This event is not native to JavaScript, but is provided by the ISC system.

Note: The event handling system waits mouseStillDownInitialDelay before calling mouseStillDown for the first time on the widget. Subsequently the method is called every mouseStillDownDelay. Both attributes are configurable per widget instance.

This method is called only when the left mouse is held down.

Specified by:
addMouseStillDownHandler in interface HasMouseStillDownHandlers
Parameters:
handler - the mouseStillDown handler
Returns:
HandlerRegistration used to remove this handler

addMouseUpHandler

public HandlerRegistration addMouseUpHandler(MouseUpHandler handler)
Add a mouseUp handler.

Executed when the left mouse is released on this widget. No default implementation.

Specified by:
addMouseUpHandler in interface HasMouseUpHandlers
Parameters:
handler - the mouseUp handler
Returns:
HandlerRegistration used to remove this handler

addMouseWheelHandler

public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler)
Add a mouseWheel handler.

Executed when the mouse wheel is actuated.

Specified by:
addMouseWheelHandler in interface HasMouseWheelHandlers
Parameters:
handler - the mouseWheel handler
Returns:
HandlerRegistration used to remove this handler

moveAbove

public 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.

Parameters:
canvas - canvas to move above
See Also:
ZIndex overview and related methods, Layer Example

moveBelow

public 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.

Parameters:
canvas - canvas to move below
See Also:
ZIndex overview and related methods, Layer Example

moveBy

public Boolean moveBy(int deltaX,
                      int deltaY)
Moves the widget deltaX pixels to the right and deltaY pixels down. Pass negative numbers to move up and/or to the left.

Parameters:
deltaX - amount to move horizontally (may be negative)
deltaY - amount to move vertically (may be negative)
Returns:
whether the component actually moved
See Also:
Positioning overview and related methods, Move Example

addMovedHandler

public HandlerRegistration addMovedHandler(MovedHandler handler)
Add a moved 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.

Specified by:
addMovedHandler in interface HasMovedHandlers
Parameters:
handler - the moved handler
Returns:
HandlerRegistration used to remove this handler

moveTo

public boolean moveTo(int left,
                      int top)
Moves the widget so that its top-left corner is at the specified coordinates.

This method will also accept a single parameter as an object array with left and top given as properties.

Parameters:
left - x-coordinate to move to in LOCAL coordinates or Object with left and top properties.
top - y-coordinate to move to in LOCAL coordinates
Returns:
whether the component actually moved
See Also:
Positioning overview and related methods, Move Example

addDropHandler

public HandlerRegistration addDropHandler(DropHandler handler)
Add a drop 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

Specified by:
addDropHandler in interface HasDropHandlers
Parameters:
handler - the drop handler
Returns:
HandlerRegistration used to remove this handler

addParentMovedHandler

public HandlerRegistration addParentMovedHandler(ParentMovedHandler handler)
Add a parentMoved handler.

Notification method fire when an ancestor of this component's position changes.

Specified by:
addParentMovedHandler in interface HasParentMovedHandlers
Parameters:
handler - the parentMoved handler
Returns:
HandlerRegistration used to remove this handler

redraw

public void redraw()
Redraws the widget immediately with its current property values. Generally, if you want a Canvas to redraw, call markForRedraw() - this will cause the Canvas to be redrawn when current processing ends, so that a series of modifications made to a Canvas will cause it to redraw only once. Only call redraw() directly if you need immediate responsiveness, for example you are redrawing in response to continuous mouse motion.

See Also:
Drawing overview and related methods

redraw

public void redraw(String reason)
Redraws the widget immediately with its current property values. Generally, if you want a Canvas to redraw, call markForRedraw() - this will cause the Canvas to be redrawn when current processing ends, so that a series of modifications made to a Canvas will cause it to redraw only once. Only call redraw() directly if you need immediate responsiveness, for example you are redrawing in response to continuous mouse motion.

Parameters:
reason - reason for performing the redraw
See Also:
Drawing overview and related methods

removeChild

public void removeChild(Canvas child)
Remove a child from this parent.

Parameters:
child - Child canvas to remove from this parent.
See Also:
Containment overview and related methods

removeChild

public void removeChild(Canvas child,
                        String name)
Remove a child from this parent.

Parameters:
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 child
See Also:
Containment overview and related methods

removePeer

public void removePeer(Canvas peer)
Remove a peer from this Canvas

Parameters:
peer - Peer to be removed from this canvas
See Also:
Containment overview and related methods

removePeer

public void removePeer(Canvas peer,
                       String name)
Remove a peer from this Canvas

Parameters:
peer - Peer to be removed from this canvas
name - 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 peer
See Also:
Containment overview and related methods

resizeBy

public 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).

Parameters:
deltaX - amount to resize horizontally (may be negative)
deltaY - amount to resize vertically (may be negative)
Returns:
whether the component actually changed size
See Also:
Sizing overview and related methods, Resize Example

addResizedHandler

public HandlerRegistration addResizedHandler(ResizedHandler handler)
Add a resized handler.

Observable 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.

Specified by:
addResizedHandler in interface HasResizedHandlers
Parameters:
handler - the resized handler
Returns:
HandlerRegistration used to remove this handler

resizeTo

public 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). The width and height parameters can be expressed as a percentage of viewport size or as the number of pixels.

Parameters:
width - new width for canvas.
height - new height for canvas
Returns:
whether the size actually changed
See Also:
Sizing overview and related methods, Resize Example

addRightMouseDownHandler

public HandlerRegistration addRightMouseDownHandler(RightMouseDownHandler handler)
Add a rightMouseDown handler.

Executed when the right mouse down is pressed on this widget. No default implementation.

Specified by:
addRightMouseDownHandler in interface HasRightMouseDownHandlers
Parameters:
handler - the rightMouseDown handler
Returns:
HandlerRegistration used to remove this handler

scrollBy

public void scrollBy(int dX,
                     int dY)
Scroll this widget by some pixel increment in either (or both) direction(s).

Parameters:
dX - Number of pixels to scroll horizontally
dY - Number of pixels to scroll vertically
See Also:
Scrolling overview and related methods

scrollByPercent

public void scrollByPercent(int dX,
                            int dY)
Scroll this widget by some percentage of scroll size in either (or both) direction(s).

Parameters:
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%".
See Also:
Scrolling overview and related methods

addScrolledHandler

public HandlerRegistration addScrolledHandler(ScrolledHandler handler)
Add a scrolled handler.

Notification that this component has just scrolled. Use with observation.

Fires for both CSS and "synthetic" scrollbars.

Specified by:
addScrolledHandler in interface HasScrolledHandlers
Parameters:
handler - the scrolled handler
Returns:
HandlerRegistration used to remove this handler

scrollTo

public 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).

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.

See Also:
Scrolling overview and related methods

scrollTo

public void scrollTo(Integer left)
See Also:
Canvas#scrollTo()}

scrollTo

public void scrollTo(Integer left,
                     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).

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.

Parameters:
left - the left coordinate
top - the top coordinate
See Also:
Scrolling overview and related methods

scrollToBottom

public void scrollToBottom()
Vertically scrolls the content of the widget to the end of its content

See Also:
Scrolling overview and related methods

scrollToLeft

public void scrollToLeft()
Horizontally scrolls the content of the widget to 0

See Also:
Scrolling overview and related methods

scrollToPercent

public 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).

Parameters:
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%".
See Also:
Scrolling overview and related methods

scrollToRight

public void scrollToRight()
Horizontally scrolls the content of the widget to the end of its content

See Also:
Scrolling overview and related methods

scrollToTop

public void scrollToTop()
Vertically scrolls the content of the widget to 0

See Also:
Scrolling overview and related methods

sendToBack

public void sendToBack()
Puts this widget at the bottom of the stacking order, so it appears behind all other widgets in the same parent.

See Also:
ZIndex overview and related methods, Layer Example

setBottom

public void setBottom(int bottom)
Resizes the widget vertically to position its bottom edge at the specified coordinate.

NOTE: if you're setting multiple coordinates, use setRect(), moveTo() or resizeTo() instead

Parameters:
bottom - new bottom coordinate
See Also:
Sizing overview and related methods

setImage

public void setImage(String identifier,
                     String URL)
Set the URL of an image element by name.

The image element must have been created from HTML generated by calling canvas.imgHTML() on this particular Canvas.

Parameters:
identifier - name of the image to change, as originally passed to imgHTML
URL - URL for the image. See SCImgURL
See Also:
Images overview and related methods

setImage

public void setImage(String identifier,
                     String URL,
                     String imgDir)
Set the URL of an image element by name.

The image element must have been created from HTML generated by calling canvas.imgHTML() on this particular Canvas.

Parameters:
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 Canvas
See Also:
Images overview and related methods

setPageLeft

public void setPageLeft(int left)
Set the page-relative left coordinate of this widget.

Parameters:
left - new left coordinate in pixels
See Also:
Positioning overview and related methods

setPageTop

public void setPageTop(int top)
Set the page-relative top coordinate of this widget.

Parameters:
top - new top coordinate in pixels
See Also:
Positioning overview and related methods

setRight

public void setRight(int right)
Resizes the widget horizontally to position its right side at the specified coordinate.

NOTE: if you're setting multiple coordinates, use setRect(), moveTo() or resizeTo() instead

Parameters:
right - new right coordinate
See Also:
Sizing overview and related methods

shouldDragScroll

public 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.

See Also:
Dragdrop overview and related methods

show

public void show()
Sets this widget's visibility to "inherit", so that it becomes visible if all it's 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.

See Also:
Visibility overview and related methods, Show & Hide Example

addShowContextMenuHandler

public HandlerRegistration addShowContextMenuHandler(ShowContextMenuHandler handler)
Add a showContextMenu handler.

Executed when the right mouse button is clicked. The default implementation of this method auto-creates a Menu from the 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.

Specified by:
addShowContextMenuHandler in interface HasShowContextMenuHandlers
Parameters:
handler - the showContextMenu handler
Returns:
HandlerRegistration used to remove this handler

showNextTo

public 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.

Note that this method simply sets the coordinates of the widget and displays it (using a Canvas.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.

Parameters:
otherWidget - Canvas to show next to

showNextTo

public void showNextTo(Canvas otherWidget,
                       String side)
See Also:
Canvas#showNextTo()}

showNextTo

public void showNextTo(Canvas otherWidget,
                       String side,
                       boolean canOcclude)
See Also:
Canvas#showNextTo()}

showNextTo

public void showNextTo(Canvas otherWidget,
                       String side,
                       boolean canOcclude,
                       boolean skipAnimation)
Show this widget next to another widget on the page, positioned such that it will not extend beyond the browser viewport.

Note that this method simply sets the coordinates of the widget and displays it (using a Canvas.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.

Parameters:
otherWidget - Canvas to show next to
side - which side to show on, 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 viewport
If 'canOcclude' is true, simply shift this widget over the other widget, so that it ends up onscreen. If 'canOcclude' is false, avoid extending offscreen by positioning this widget on the other side of the other widget.
skipAnimation - If false do not use an animation to show the component.

showRecursively

public void showRecursively()
Recursively show the canvas and all it's parents so the canvas will be visible.

If the widget has not yet been drawn, this method calls the draw method as well.

See Also:
Visibility overview and related methods

updateHover

public void updateHover()
If this canvas is currently showing a hover (see Canvas.handleHover), this method can be called to update the contents of the hover. Has no effect if the hover canvas is not showing for this widget.


updateHover

public void updateHover(String hoverHTML)
If this canvas is currently showing a hover (see Canvas.handleHover), this method can be called to update the contents of the hover. Has no effect if the hover canvas is not showing for this widget.

Parameters:
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.

addVisibilityChangedHandler

public HandlerRegistration addVisibilityChangedHandler(VisibilityChangedHandler handler)
Add a visibilityChanged 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 Canvas.setVisibility, or in response to a parent component being shown or hidden when this widgets 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 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.

Specified by:
addVisibilityChangedHandler in interface HasVisibilityChangedHandlers
Parameters:
handler - the visibilityChanged handler
Returns:
HandlerRegistration used to remove this handler

getEventEdge

public static EdgeName getEventEdge()
Check if an event is within an "edge" of this canvas.

Returns:
edge where the mouse is positioned, or null if not within a legal edge (including being in the center)
See Also:
getResizeFrom()

getEventEdge

public static EdgeName getEventEdge(EdgeName... edgeMask)
Check if an event is within an "edge" of this canvas.

Parameters:
edgeMask - Array of legal edges. Default is all the edges that allow resizing (see resizeFrom)
Returns:
edge where the mouse is positioned, or null if not within a legal edge (including being in the center)
See Also:
getResizeFrom()

setAllowExternalFilters

public static void setAllowExternalFilters(boolean allExternalFilters)
Changes the system-wide allowExternalFilters setting.

Parameters:
allExternalFilters - new setting

setNeverUseFilters

public static void setNeverUseFilters(boolean neverUseFilters)
Changes the system-wide neverUseFilters setting.

Parameters:
neverUseFilters - new setting

setDefaultProperties

public static void setDefaultProperties(Canvas canvasProperties)
Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties set on the SmartGWT class instance passed to this function before its underlying SmartClient JS object was created. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

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.

Parameters:
canvasProperties - properties that should be used as new defaults when instances of this class are created

getTestInstance

protected Canvas getTestInstance()

getById

public static Canvas getById(String ID)
Retrieve a Canvas by its global ID.

Parameters:
ID - global ID of the Canvas
Returns:
the Canvas, or null if not found

getByJSObject

public static Canvas getByJSObject(JavaScriptObject jsObj)
Retrieve a Canvas from its JavaScriptObject.

Parameters:
jsObj - SmartClient object associated with Canvas
Returns:
the Canvas, or null if not found

setElement

protected void setElement(Element elem)
Normal usage of SmartGWT is to call draw() on SmartGWT widgets, not to use use RootPanel.add(). Developers will not typically need to call getElement() or setElement() for SmartGWT canvas instances. If developers do need to access the DOM elements created by a drawn SmartGWT component, they should use 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

Overrides:
setElement in class UIObject

getElement

public Element getElement()
Normal usage of SmartGWT is to call draw() on SmartGWT widgets, not to use use RootPanel.add(). Developers will not typically need to call getElement() or setElement() for SmartGWT canvas instances. If developers do need to access the DOM elements created by a drawn SmartGWT component, they should use 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

Overrides:
getElement in class UIObject

getElement

public Element getElement(boolean allowPreRender)
Parameters:
allowPreRender -
Returns:
See Also:
UIObject.getElement()

asSGWTComponent

public static <T extends Canvas> T asSGWTComponent(JavaScriptObject jsObj)
Returns the existing SGWT widget, or creates and returns one if none exist, associated with the supplied 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.

Parameters:
jsObj - SmartClient Canvas whose wrapper is wanted
Returns:
wrapping SGWT Canvas, appropriately subtyped, or null

getByLocalId

public Canvas getByLocalId(String ID)
Retrieve a child of this Canvas by it's local 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().

Parameters:
ID - global ID of the Canvas
Returns:
the Canvas, or null if not found

getClassName

public String getClassName()
Returns the javascript class name.

Overrides:
getClassName in class BaseWidget
Returns:

setInitHandler

public void setInitHandler(CanvasInitHandler initHandler)
Specify a notification method to fire when this Canvas is initialized in JavaScript. This allows developers to set up form item state dynamically when the item is created.

Parameters:
initHandler -

onInit

protected void onInit()
Overrides:
onInit in class BaseWidget

onDetach

protected void onDetach()
Overrides:
onDetach in class Widget

onAttach

protected void onAttach()
Overrides:
onAttach in class Widget

addStyleName

public void addStyleName(String style)
Multiple styles are currently not supported. This method essentially calls setStyleName(String)

Overrides:
addStyleName in class UIObject
Parameters:
style - the style name
See Also:
setStyleName(String)

setVisible

public void setVisible(boolean visible)
Specified by:
setVisible in interface HasVisibility
Overrides:
setVisible in class UIObject

setHeight

public void setHeight(int height)
See Also:
setHeight(Integer)

setHeight100

public void setHeight100()
Convenience method that sets the height to 100%.


getHeightAsString

public String getHeightAsString()

setTitle

public void setTitle(String title)
Synonym for setPrompt(String)

Overrides:
setTitle in class BaseWidget
Parameters:
title - the title

getTitle

public String getTitle()
Synonym for getPrompt()

Overrides:
getTitle in class BaseWidget
Returns:
the title

setTooltip

public void setTooltip(String tooltip)
Synonym for setPrompt(String)

Parameters:
tooltip - the tooltip

getTooltip

public String getTooltip()
Synonym for getPrompt()

Returns:
the tooltip

setWidth

public void setWidth(int width)
See Also:
setWidth(Integer)

setWidth100

public void setWidth100()
Convenience method that sets the width to 100%.


getWidthAsString

public String getWidthAsString()

getLeftAsString

public 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).

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'.

Returns:
Return the left coordinate of this object, relative to its enclosing context, in pixels.

getFacetId

public String getFacetId()
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.

Returns:
the facet id

setFacetId

public void setFacetId(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.

Parameters:
facetId - the facet id

getTopAsString

public 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).

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'.

Returns:
Return the top coordinate of this object, relative to its enclosing context, in pixels.

setAlign

public void setAlign(Alignment align)

getAbsoluteLeft

public int getAbsoluteLeft()
Overrides:
getAbsoluteLeft in class UIObject

getAbsoluteTop

public int getAbsoluteTop()
Overrides:
getAbsoluteTop in class UIObject

setAnimateShowEffect

public void setAnimateShowEffect(AnimationEffect animateShowEffect)
Default animation effect to use if Canvas#animateShow() is called without an explicit effect parameter.

Parameters:
animateShowEffect - the animate show effect. Default is "wipe"

getAnimateShowEffect

public AnimationEffect getAnimateShowEffect()
Default animation effect to use if Canvas#animateShow() is called without an explicit effect parameter.

Returns:
animation effect. Default value is "wipe"

setDisabled

public void setDisabled(boolean disabled)
If set to true, the widget will be disabled. A widget is only considered enabled if it is individually enabled and all parents above it in the containment hierarchy are enabled. This allows you to enable or disable all components of a complex nested widget by enabling or disabling the top-level parent only. set the disabled state of this object

Note : This is an advanced setting

Parameters:
disabled - new disabled state of this object - pass true to disable the widget. Default value is false

getDisabled

public boolean getDisabled()
If set to true, the widget will be disabled. A widget is only considered enabled if it is individually enabled and all parents above it in the containment hierarchy are enabled. This allows you to enable or disable all components of a complex nested widget by enabling or disabling the top-level parent only.

Returns:
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.

setDragTarget

public void setDragTarget(Canvas dragTarget)
A different widget that should be actually dragged when dragging initiates on this widget. One example of this is to have a child widget that drags its parent, as with a drag box. Because the parent automatically repositions its children, setting the drag target of the child to the parent and then dragging the child will result in both widgets being moved.
Valid dragTarget values are:
- null (default) [this widget is its own drag target]
- Pointer to another widget, or widget ID
- "parent" drag target is this widget's parentCanvas
- "top" drag target is this widget's topElement

Note : This is an advanced setting

Parameters:
dragTarget - dragTarget Default value is null

getDragTarget

public Canvas getDragTarget()
A different widget that should be actually dragged when dragging initiates on this widget. One example of this is to have a child widget that drags its parent, as with a drag box. Because the parent automatically repositions its children, setting the drag target of the child to the parent and then dragging the child will result in both widgets being moved.
Valid dragTarget values are:
- null (default) [this widget is its own drag target]
- Pointer to another widget, or widget ID
- "parent" drag target is this widget's parentCanvas
- "top" drag target is this widget's topElement

Returns:
Canvas

willAcceptDrop

public Boolean willAcceptDrop()
Returns true if the widget object being dragged can be dropped on this widget, and false otherwise. The default implementation of this method simply compares the 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.
Note: This is an override point

Returns:
true if the widget object being dragged can be dropped on this widget, false otherwise

parentResized

protected void parentResized()
Fires when the interior size of the parent changes, including parent resize and scrollbar introduction or removal.

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


getHoverComponent

public Canvas getHoverComponent()
When 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

Returns:
the component to show as a hover

setSmoothFade

public void setSmoothFade(Boolean smoothFade)
                   throws IllegalStateException
Throws:
IllegalStateException

setKeepInParentRect

public void setKeepInParentRect(Rectangle rectangle)

setPrefix

public void setPrefix(String prefix)

getPrefix

public String getPrefix()

setResizeFrom

public void setResizeFrom(String... resizeFrom)
Deprecated. use #setResizeFrom(EdgeName) instead.

Allows resizing in certain edges or corners. The default value of null indicates that the widget is resizable from any corner or edge. To restrict resizing to only certain corners, set resizeFrom to an array of any of the values listed:
T top edge
B bottom edge
L left edge
R right edge
TL top-left corner
TR top-right corner
BL bottom-left corner
BR bottom-right corner

E.g. setting this property to a value of ["R","TR","BR"] would restrict resizing to the right edge, top-right corner and bottom-right corner only

Parameters:
resizeFrom - resizeFrom values

resizeTo

public Boolean resizeTo(String width,
                        String height)
Resizes the widget to the specified width and height (moves the right and/ or bottom sides of the widget). The width and height parameters can be expressed as a percentage of viewport size or as the number of pixels.

Parameters:
width - new width for canvas
height - new height for canvas
Returns:
whether the size actually changed

isVisible

public 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.

NOTE: Undrawn widgets will report themselves as visible if they would be visible if drawn.

Specified by:
isVisible in interface HasVisibility
Overrides:
isVisible in class UIObject
Returns:
true if the widget is visible, false otherwise

animateScroll

public void animateScroll(int scrollLeft,
                          int scrollTop,
                          AnimationCallback callback)
Animate a scroll from the current scroll position to the specified position.

Parameters:
scrollLeft - desired final left scroll postion
scrollTop - desired final top scroll postion
callback - 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 finishAnimation

animateScroll

public void animateScroll(int scrollLeft,
                          int scrollTop,
                          AnimationCallback callback,
                          int duration)
Animate a scroll from the current scroll position to the specified position.

Parameters:
scrollLeft - desired final left scroll postion
scrollTop - desired final top scroll postion
callback - 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 finishAnimation
duration - Duration in ms of the animated scroll

animateFade

public void animateFade(int opacity)
Animate a change in opacity from the widget's current opacity to the specified opacity.

Parameters:
opacity - desired final opacity

animateFade

public void animateFade(int opacity,
                        AnimationCallback callback)
Animate a change in opacity from the widget's current opacity to the specified opacity.

Parameters:
opacity - desired final opacity
callback - 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 finishAnimation

animateFade

public void animateFade(int opacity,
                        AnimationCallback callback,
                        int duration)
Animate a change in opacity from the widget's current opacity to the specified opacity.

Parameters:
opacity - desired final opacity
callback - 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 finishAnimation
duration - Duration in ms of the animated fade