Package org.eclipse.nebula.cwt.v
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.
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description (package private) org.eclipse.swt.graphics.Color
defaultHoverBackgroundColor
(package private) org.eclipse.swt.graphics.Color
defaultHoverBorderColor
(package private) org.eclipse.swt.graphics.Color
defaultSelectedBackgroundColor
(package private) org.eclipse.swt.graphics.Color
defaultSelectedBorderColor
(package private) org.eclipse.swt.graphics.Color
hoverBackgroundColor
(package private) org.eclipse.swt.graphics.Color
hoverBorderColor
(package private) org.eclipse.swt.graphics.ImageData
oldImageData
(package private) boolean
paintInactive
(package private) boolean
paintNative
(package private) org.eclipse.swt.graphics.Color
selectedBackgroundColor
(package private) org.eclipse.swt.graphics.Color
selectedBorderColor
Fields inherited from class org.eclipse.nebula.cwt.v.VControl
background, bounds, carbon, composite, customToolTip, dataMap, disposed, fill, font, foreground, gtk, image, layoutData, listeners, marginBottom, marginLeft, marginRight, marginTop, menu, painter, parent, points, scaleImage, square, STATE_ACTIVE, STATE_ENABLED, STATE_MOUSE_DOWN, STATE_SELECTED, svg, text, tooltipText, visibility, win32, xAlign, yAlign
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description void
dispose()
protected void
filterEvent(org.eclipse.swt.widgets.Event event)
boolean
getNativeBackground()
boolean
getSelection()
VControl.Type
getType()
void
setHoverBackgroundColor(org.eclipse.swt.graphics.Color hoverBackgroundColor)
Set the background color when the mouse is hover the buttonvoid
setHoverBorderColor(org.eclipse.swt.graphics.Color hoverBorderColor)
border color when the mouse is hover the buttonvoid
setPaintInactive(boolean paintInactive)
void
setPaintNative(boolean paintNative)
Setting this value currently does nothing but subclasses can take advantage of this flag.void
setSelectedBackgroundColor(org.eclipse.swt.graphics.Color selectedBackgroundColor)
background color when the button is selectedvoid
setSelectedBorderColor(org.eclipse.swt.graphics.Color selectedBorderColor)
background color when the button is selectedvoid
setSelection(boolean select)
Marks this button as being "selected" by the user.Methods inherited from class org.eclipse.nebula.cwt.v.VControl
activate, addListener, addListener, attachListeners, computeSize, computeSize, containsControl, createMenu, deactivate, detachListeners, getBackground, getBounds, getClientArea, getClientSize, getComposite, getControl, getData, getData, getData, getData, getDisplay, getEnabled, getFont, getForeground, getImage, getLayoutData, getListeners, getLocation, getMargins, getMenu, getParent, getShell, getSize, getState, getStyle, getText, getToolTipText, getVisibility, getVisible, getWidget, handleEvent, hasState, hasStyle, isActivatable, isDisposed, isEnabled, isSameWidgetAs, isSameWidgetAs, isSquare, isVisible, moveAbove, moveBelow, notifyListeners, notifyListeners, paintControl, redraw, redrawOnActivate, redrawOnDeactivate, removeListener, removeListener, setActivatable, setActiveCursor, setAlignment, setAlpha, setAlpha, setBackground, setBounds, setBounds, setCursor, setData, setData, setEnabled, setFill, setFocus, setFocus, setFont, setForeground, setImage, setImage, setInactiveCursor, setLayoutData, setLocation, setLocation, setMargins, setMargins, setMargins, setOval, setOval, setPainter, setParent, setPolygon, setPolygon, setScaleImage, setSize, setSquare, setState, setStyle, setStyle, setText, setToolTipText, setVisibility, setVisible, setVisible, setVisible, toControl, toControl, toDisplay, toDisplay, toString, update
-
Field Details
-
oldImageData
org.eclipse.swt.graphics.ImageData oldImageData -
paintNative
boolean paintNative -
paintInactive
boolean paintInactive -
hoverBackgroundColor
org.eclipse.swt.graphics.Color hoverBackgroundColor -
defaultHoverBackgroundColor
org.eclipse.swt.graphics.Color defaultHoverBackgroundColor -
hoverBorderColor
org.eclipse.swt.graphics.Color hoverBorderColor -
defaultHoverBorderColor
org.eclipse.swt.graphics.Color defaultHoverBorderColor -
selectedBackgroundColor
org.eclipse.swt.graphics.Color selectedBackgroundColor -
defaultSelectedBackgroundColor
org.eclipse.swt.graphics.Color defaultSelectedBackgroundColor -
selectedBorderColor
org.eclipse.swt.graphics.Color selectedBorderColor -
defaultSelectedBorderColor
org.eclipse.swt.graphics.Color defaultSelectedBorderColor
-
-
Constructor Details
-
VButton
Constructor- Parameters:
panel
- parent panelstyle
- button style
-
-
Method Details
-
dispose
public void dispose() -
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
-
filterEvent
protected void filterEvent(org.eclipse.swt.widgets.Event event)- Overrides:
filterEvent
in classVControl
-
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
-