Class Progressbar

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, HasPercentChangedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers

public class Progressbar extends StretchImg implements HasPercentChangedHandlers
The Progressbar widget class extends the StretchImg class to implement image-based progress bars (graphical bars whose lengths represent percentages, typically of task completion).
  • Constructor Details

    • Progressbar

      public Progressbar()
    • Progressbar

      public Progressbar(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static Progressbar 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 StretchImg
    • setBaseStyle

      public Progressbar setBaseStyle(String baseStyle) throws IllegalStateException
      Base style for this Progressbar. Only used when useCssStyles is true.
      Overrides:
      setBaseStyle in class StatefulCanvas
      Parameters:
      baseStyle - New baseStyle value. Default value is "progressbar"
      Returns:
      Progressbar instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getBaseStyle

      public String getBaseStyle()
      Base style for this Progressbar. Only used when useCssStyles is true.
      Overrides:
      getBaseStyle in class StatefulCanvas
      Returns:
      Current baseStyle value. Default value is "progressbar"
      See Also:
    • setBreadth

      public Progressbar setBreadth(int breadth)
      Thickness of the progressbar in pixels. This is effectively width for a vertical progressbar, or height for a horizontal progressbar.

      This property must be set instead of setting width or height.

      If this method is called after the component has been drawn/initialized: Sets the breadth of the progressbar to newLength. This is the height of a horizontal progressbar, or the width of a vertical progressbar.

      Parameters:
      breadth - the new breadth of the progressbar. Default value is 20
      Returns:
      Progressbar instance, for chaining setter calls
      See Also:
    • getBreadth

      public int getBreadth()
      Thickness of the progressbar in pixels. This is effectively width for a vertical progressbar, or height for a horizontal progressbar.

      This property must be set instead of setting width or height.

      Returns:
      Returns the current height of a horizontal progressbar, or width of a vertical progressbar. Default value is 20
      See Also:
    • setEditProxyConstructor

      public Progressbar setEditProxyConstructor(String editProxyConstructor) throws IllegalStateException
      Default class used to construct the EditProxy for this component when the component is first placed into edit mode.
      Overrides:
      setEditProxyConstructor in class StatefulCanvas
      Parameters:
      editProxyConstructor - New editProxyConstructor value. Default value is "ProgressbarProxy"
      Returns:
      Progressbar instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getEditProxyConstructor

      public String getEditProxyConstructor()
      Default class used to construct the EditProxy for this component when the component is first placed into edit mode.
      Overrides:
      getEditProxyConstructor in class StatefulCanvas
      Returns:
      Current editProxyConstructor value. Default value is "ProgressbarProxy"
      See Also:
    • setLength

      public Progressbar setLength(int length)
      Length of the progressbar in pixels. This is effectively height for a vertical progressbar, or width for a horizontal progressbar.

      This property must be set instead of setting width or height.

      If this method is called after the component has been drawn/initialized: Sets the length of the progressbar to newLength. This is the width of a horizontal progressbar, or the height of a vertical progressbar.

      Parameters:
      length - the new length of the progressbar. Default value is 100
      Returns:
      Progressbar instance, for chaining setter calls
      See Also:
    • getLength

      public int getLength()
      Length of the progressbar in pixels. This is effectively height for a vertical progressbar, or width for a horizontal progressbar.

      This property must be set instead of setting width or height.

      Returns:
      Returns the current width of a horizontal progressbar, or height of a vertical progressbar. Default value is 100
      See Also:
    • setLength

      public Progressbar setLength(String length)
      Length of the progressbar in pixels. This is effectively height for a vertical progressbar, or width for a horizontal progressbar.

      This property must be set instead of setting width or height.

      If this method is called after the component has been drawn/initialized: Sets the length of the progressbar to newLength. This is the width of a horizontal progressbar, or the height of a vertical progressbar.

      Parameters:
      length - the new length of the progressbar. Default value is 100
      Returns:
      Progressbar instance, for chaining setter calls
      See Also:
    • setPercentDone

      public Progressbar setPercentDone(int percentDone)
      Number from 0 to 100, inclusive, for the percentage to be displayed graphically in this progressbar.

      If this method is called after the component has been drawn/initialized: Sets percentDone to newPercent.
      Parameters:
      percentDone - percent to show as done (0-100). Default value is 0
      Returns:
      Progressbar instance, for chaining setter calls
      See Also:
    • getPercentDone

      public int getPercentDone()
      Number from 0 to 100, inclusive, for the percentage to be displayed graphically in this progressbar.
      Returns:
      Current percentDone value. Default value is 0
      See Also:
    • setProgressStyle

      public Progressbar setProgressStyle(String progressStyle) throws IllegalStateException
      Base style used to style the percentage-done portion of this Progressbar. Only used when useCssStyles is true.
      Parameters:
      progressStyle - New progressStyle value. Default value is "progressbarProgress"
      Returns:
      Progressbar instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getProgressStyle

      public String getProgressStyle()
      Base style used to style the percentage-done portion of this Progressbar. Only used when useCssStyles is true.
      Returns:
      Current progressStyle value. Default value is "progressbarProgress"
      See Also:
    • setSrc

      public Progressbar setSrc(String src)
      The base file name for the progressbar image.
      Overrides:
      setSrc in class StretchImg
      Parameters:
      src - New src value. Default value is "[SKIN]progressbar.gif"
      Returns:
      Progressbar instance, for chaining setter calls
      See Also:
    • getSrc

      public String getSrc()
      The base file name for the progressbar image.
      Overrides:
      getSrc in class StretchImg
      Returns:
      Current src value. Default value is "[SKIN]progressbar.gif"
      See Also:
    • setUseCssStyles

      public Progressbar setUseCssStyles(boolean useCssStyles) throws IllegalStateException
      When set to true, styles the Progressbar via the base and progress CSS styles.
      Parameters:
      useCssStyles - New useCssStyles value. Default value is false
      Returns:
      Progressbar instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getUseCssStyles

      public boolean getUseCssStyles()
      When set to true, styles the Progressbar via the base and progress CSS styles.
      Returns:
      Current useCssStyles value. Default value is false
    • setVertical

      public Progressbar setVertical(Boolean vertical)
      Indicates whether this is a vertical or horizontal progressbar.
      Overrides:
      setVertical in class StretchImg
      Parameters:
      vertical - New vertical value. Default value is false
      Returns:
      Progressbar instance, for chaining setter calls
      See Also:
    • getVertical

      public Boolean getVertical()
      Indicates whether this is a vertical or horizontal progressbar.
      Overrides:
      getVertical in class StretchImg
      Returns:
      Current vertical value. Default value is false
      See Also:
    • getAriaStateDefaults

      public Map getAriaStateDefaults()
      Retrieves dynamically calculated default ARIA state mapping properties for this canvas. These will be combined with explicitly specified aria state as described in Canvas.getAriaState().

      Overridden by Progressbar to pick up aria-valuenow.

      Overrides:
      getAriaStateDefaults in class StatefulCanvas
      Returns:
      dynamically calculated default aria state properties
    • addPercentChangedHandler

      public HandlerRegistration addPercentChangedHandler(PercentChangedHandler handler)
      Add a percentChanged handler.

      This method is called when the percentDone value changes. Call this method to be notified upon a change to the percentDone value.

      Specified by:
      addPercentChangedHandler in interface HasPercentChangedHandlers
      Parameters:
      handler - the percentChanged handler
      Returns:
      HandlerRegistration used to remove this handler
    • setDefaultProperties

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

      public String getLengthAsString()
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(ProgressbarLogicalStructure 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 StretchImg