Class ToggleButton

    • Constructor Detail

      • ToggleButton

        public ToggleButton()
        Constructor for ToggleButton.
      • ToggleButton

        public ToggleButton​(Image upImage)
        Constructor for ToggleButton. The supplied image is used to construct the default face.
        Parameters:
        upImage - image for the default face of the button
      • ToggleButton

        public ToggleButton​(Image upImage,
                            ClickHandler handler)
        Constructor for ToggleButton. The supplied image is used to construct the default face of the button.
        Parameters:
        upImage - image for the default (up) face of the button
        handler - the click handler
      • ToggleButton

        @Deprecated
        public ToggleButton​(Image upImage,
                            ClickListener listener)
        Deprecated.
        Constructor for ToggleButton. The supplied image is used to construct the default face of the button.
        Parameters:
        upImage - image for the default (up) face of the button
        listener - the click listener
      • ToggleButton

        public ToggleButton​(Image upImage,
                            Image downImage)
        Constructor for ToggleButton.
        Parameters:
        upImage - image for the default(up) face of the button
        downImage - image for the down face of the button
      • ToggleButton

        public ToggleButton​(Image upImage,
                            Image downImage,
                            ClickHandler handler)
        Constructor for ToggleButton.
        Parameters:
        upImage - image for the default(up) face of the button
        downImage - image for the down face of the button
        handler - the click handler
      • ToggleButton

        @Deprecated
        public ToggleButton​(Image upImage,
                            Image downImage,
                            ClickListener listener)
        Constructor for ToggleButton.
        Parameters:
        upImage - image for the default(up) face of the button
        downImage - image for the down face of the button
        listener - clickListener
      • ToggleButton

        public ToggleButton​(java.lang.String upText)
        Constructor for ToggleButton. The supplied text is used to construct the default face of the button.
        Parameters:
        upText - the text for the default (up) face of the button.
      • ToggleButton

        public ToggleButton​(java.lang.String upText,
                            ClickHandler handler)
        Constructor for ToggleButton. The supplied text is used to construct the default face of the button.
        Parameters:
        upText - the text for the default (up) face of the button
        handler - the click handler
      • ToggleButton

        @Deprecated
        public ToggleButton​(java.lang.String upText,
                            ClickListener listener)
        Deprecated.
        Constructor for ToggleButton. The supplied text is used to construct the default face of the button.
        Parameters:
        upText - the text for the default (up) face of the button
        listener - the click listener
      • ToggleButton

        public ToggleButton​(java.lang.String upText,
                            java.lang.String downText)
        Constructor for ToggleButton.
        Parameters:
        upText - the text for the default (up) face of the button
        downText - the text for down face of the button
      • ToggleButton

        public ToggleButton​(java.lang.String upText,
                            java.lang.String downText,
                            ClickHandler handler)
        Constructor for ToggleButton.
        Parameters:
        upText - the text for the default (up) face of the button
        downText - the text for down face of the button
        handler - the click handler
    • Method Detail

      • getValue

        public java.lang.Boolean getValue()
        Determines whether this button is currently down.
        Specified by:
        getValue in interface HasValue<java.lang.Boolean>
        Specified by:
        getValue in interface TakesValue<java.lang.Boolean>
        Returns:
        true if the button is pressed, false otherwise. Will not return null
        See Also:
        TakesValue.setValue(V)
      • isDown

        public boolean isDown()
        Description copied from class: CustomButton
        Is this button down?
        Overrides:
        isDown in class CustomButton
        Returns:
        true if the button is down
      • setValue

        public void setValue​(java.lang.Boolean value)
        Sets whether this button is down.
        Specified by:
        setValue in interface HasValue<java.lang.Boolean>
        Specified by:
        setValue in interface TakesValue<java.lang.Boolean>
        Parameters:
        value - true to press the button, false otherwise; null value implies false
        See Also:
        TakesValue.getValue()
      • setValue

        public void setValue​(java.lang.Boolean value,
                             boolean fireEvents)
        Sets whether this button is down, firing ValueChangeEvent if appropriate.
        Specified by:
        setValue in interface HasValue<java.lang.Boolean>
        Parameters:
        value - true to press the button, false otherwise; null value implies false
        fireEvents - If true, and value has changed, fire a ValueChangeEvent
      • onClick

        protected void onClick()
        Description copied from class: CustomButton
        Called when the user finishes clicking on this button. The default behavior is to fire the click event to listeners. Subclasses that override CustomButton.onClickStart() should override this method to restore the normal widget display.
        Overrides:
        onClick in class CustomButton