Class VButton

java.lang.Object
org.eclipse.nebula.cwt.v.VControl
org.eclipse.nebula.cwt.v.VButton

public class VButton
extends VControl
Control to mimic a button.
  • Field Details

  • Constructor Details

    • VButton

      public VButton​(VPanel panel, int style)
      Constructor
      Parameters:
      panel - parent panel
      style - button style
  • Method Details

    • dispose

      public void dispose()
      Overrides:
      dispose in class VControl
    • getNativeBackground

      public boolean getNativeBackground()
      Returns:
      the paintNative flag
      See Also:
      setPaintNative(boolean)
    • getSelection

      public boolean getSelection()
      Returns:
      true if this button is currently selected.
    • getType

      public VControl.Type getType()
      Specified by:
      getType in class VControl
    • filterEvent

      protected void filterEvent​(org.eclipse.swt.widgets.Event event)
      Overrides:
      filterEvent in class VControl
    • setPaintInactive

      public void setPaintInactive​(boolean paintInactive)
      Parameters:
      paintInactive - true to paint the button in an inactive state.
    • setPaintNative

      public void setPaintNative​(boolean paintNative)
      Setting this value currently does nothing but subclasses can take advantage of this flag.

      Painting native is the act of letting the underlying OS take care of painting the background in some way or another.

      Parameters:
      paintNative - true to paint native
    • setSelection

      public void setSelection​(boolean select)
      Marks this button as being "selected" by the user.
      Parameters:
      select - true to make the button "selected".
    • setHoverBackgroundColor

      public void setHoverBackgroundColor​(org.eclipse.swt.graphics.Color hoverBackgroundColor)
      Set the background color when the mouse is hover the button
      Parameters:
      hoverBackgroundColor - new color
    • setHoverBorderColor

      public void setHoverBorderColor​(org.eclipse.swt.graphics.Color hoverBorderColor)
      border color when the mouse is hover the button
      Parameters:
      hoverBorderColor - new color
    • setSelectedBackgroundColor

      public void setSelectedBackgroundColor​(org.eclipse.swt.graphics.Color selectedBackgroundColor)
      background color when the button is selected
      Parameters:
      selectedBackgroundColor - new color
    • setSelectedBorderColor

      public void setSelectedBorderColor​(org.eclipse.swt.graphics.Color selectedBorderColor)
      background color when the button is selected
      Parameters:
      selectedBorderColor - new color