Class SimpleTile

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, HasClearHandlers, HasClickHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers

public class SimpleTile extends StatefulCanvas
Default class used by a TileGrid to render each tile. See TileGrid.tile.

SimpleTiles should not be created directly, instead, use a TileGrid and provide data and SimpleTile instances are created for you.

  • Constructor Details

    • SimpleTile

      public SimpleTile()
    • SimpleTile

      public SimpleTile(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static SimpleTile 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. For usage tips on this param, see SGWTProperties.
      See Also:
    • 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. For usage tips on this param, see SGWTProperties.
      See Also:
    • create

      protected JavaScriptObject create()
      Overrides:
      create in class StatefulCanvas
    • setBaseStyle

      public SimpleTile setBaseStyle(String baseStyle) throws IllegalStateException
      CSS style for the tile as a whole. As with StatefulCanvas.baseStyle, suffixes are appended to this style to represent various states ("Over", "Selected", etc).
      Overrides:
      setBaseStyle in class StatefulCanvas
      Parameters:
      baseStyle - New baseStyle value. Default value is "simpleTile"
      Returns:
      SimpleTile instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getBaseStyle

      public String getBaseStyle()
      CSS style for the tile as a whole. As with StatefulCanvas.baseStyle, suffixes are appended to this style to represent various states ("Over", "Selected", etc).
      Overrides:
      getBaseStyle in class StatefulCanvas
      Returns:
      Current baseStyle value. Default value is "simpleTile"
      See Also:
    • setCreator

      public SimpleTile setCreator(TileGrid creator) throws IllegalStateException
      Deprecated.
      As of Smart GWT 10.0, use tileGrid.
      The TileGrid that created this SimpleTile. This property will be null if the tile was created by a user-provided TileGrid.createTile() method.
      Parameters:
      creator - New creator value. Default value is null
      Returns:
      SimpleTile instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getCreator

      public TileGrid getCreator()
      Deprecated.
      As of Smart GWT 10.0, use tileGrid.
      The TileGrid that created this SimpleTile. This property will be null if the tile was created by a user-provided TileGrid.createTile() method.
      Returns:
      Current creator value. Default value is null
      See Also:
    • setTileGrid

      public SimpleTile setTileGrid(TileGrid tileGrid) throws IllegalStateException
      The TileGrid that created this SimpleTile.
      Parameters:
      tileGrid - New tileGrid value. Default value is null
      Returns:
      SimpleTile instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getTileGrid

      public TileGrid getTileGrid()
      The TileGrid that created this SimpleTile.
      Returns:
      Current tileGrid value. Default value is null
    • getRecord

      public TileRecord getRecord()
      Return the record that this tile should render.

      NOTE: a TileGrid that is doing data paging may reuse tiles with different records, so a subclass of SimpleTile should not cache the record returned by getRecord().

      Returns:
      the TileRecord associated with this tile
    • setDefaultProperties

      public static void setDefaultProperties(SimpleTile simpleTileProperties)
      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:
      simpleTileProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(SimpleTileLogicalStructure s)
      Setter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
    • getLogicalStructure

      public LogicalStructureObject getLogicalStructure()
      Getter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
      Specified by:
      getLogicalStructure in interface LogicalStructure
      Overrides:
      getLogicalStructure in class StatefulCanvas