/** * 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.<br>
 Valid dragTarget values are:<br>
 - <code>null</code> (default) [this widget is its own drag target]<br>
 - Pointer to another widget, or widget ID<br>
 - <code>"parent"</code> drag target is this widget's 
 {@link com.smartgwt.client.widgets.Canvas#getParentElement parentElement}<br>
 - <code>"top"</code> drag target is this widget's 
 {@link com.smartgwt.client.widgets.Canvas#getTopElement topElement}<br> * * * @return Canvas * */ public Canvas getDragTarget() { return Canvas.getOrCreateRef(getAttributeAsJavaScriptObject("dragTarget")); }
/** * If this canvas is being displayed in a {@link com.smartgwt.client.widgets.form.fields.CanvasItem}, this property will be * set to point at the item. Otherwise this property will be null. * * * @return CanvasItem */ public CanvasItem getCanvasItem() { return CanvasItem.getOrCreateRef(getAttributeAsJavaScriptObject("canvasItem")); }
/** * Array of all Canvii that are immediate children of this Canvas. <p><b>Note : </b> This is an advanced * setting</p> */ public Canvas[] getChildren() { return convertToCanvasArray(getAttributeAsJavaScriptObject("children")); }
/** * Context menu to show for this object, an instance of the Menu widget. <P> Note: if {@link * com.smartgwt.client.widgets.Canvas#destroy Canvas.destroy} is called on a canvas, any specified context menu is not * automatically destroyed as well. This is in contrast to {@link com.smartgwt.client.widgets.menu.MenuButton}s which * automatically destroy their specified {@link com.smartgwt.client.widgets.menu.MenuButton#getMenu menu} by default. The * behavior is intentional as context menus are commonly reused across components. * * * @return Menu * @see com.smartgwt.client.widgets.events.ShowContextMenuEvent * @see com.smartgwt.client.docs.Cues Cues overview and related methods * @see <a href="http://www.smartclient.com/smartgwt/showcase/#basics_interaction_contextmenu" target="examples">Context menus Example</a> */ public Menu getContextMenu() { return Menu.getOrCreateRef(getAttributeAsJavaScriptObject("contextMenu")); }
/** * {@link com.smartgwt.client.widgets.form.ValuesManager} for managing values displayed in this component. If specified at * initialization time, this component will be added to the valuesManager via {@link * com.smartgwt.client.widgets.form.ValuesManager#addMember ValuesManager.addMember}. <P> 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. <P> 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 {@link * com.smartgwt.client.widgets.Canvas#getDataPath dataPath}. <P> Note that components may be automatically bound to an * existing valuesManager attached to a parent component if dataPath is specified. See {@link * com.smartgwt.client.widgets.Canvas#getDataPath 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 * * * @return ValuesManager */ public ValuesManager getValuesManager() { return ValuesManager.getOrCreateRef(getAttributeAsJavaScriptObject("valuesManager")); }
/** * This Canvas's immediate parent, if any. <BR> Can be initialized, but any subsequent manipulation should be via * {@link com.smartgwt.client.widgets.Canvas#addChild} and {@link com.smartgwt.client.widgets.Canvas#removeChild} * calls on the parent. * * @return Canvas */ public Canvas getParentElement() { JavaScriptObject parentJS = getAttributeAsJavaScriptObject("parentElement"); if(parentJS == null) return null; Canvas canvas = (Canvas) BaseWidget.getRef(parentJS); if (canvas == null) { canvas = new Canvas(parentJS); } return canvas; }