Package org.eclipse.ui.forms.widgets
Class ToggleHyperlink
- All Implemented Interfaces:
Drawable
A custom selectable control that can be used to control areas that can be
expanded or collapsed.
This is an abstract class. Subclasses are responsible for rendering the control using decoration and hover decoration color. Control should be rendered based on the current expansion state.
- Styles:
- None
- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intprotected intFields inherited from class org.eclipse.ui.forms.widgets.AbstractHyperlink
marginHeight, marginWidthFields inherited from class org.eclipse.swt.widgets.Widget
nativeZoom -
Constructor Summary
ConstructorsConstructorDescriptionToggleHyperlink(Composite parent, int style) Creates a control in a provided composite. -
Method Summary
Modifier and TypeMethodDescriptioncomputeSize(int wHint, int hHint, boolean changed) Computes the size of the control.Deprecated.Returns the color of the decoration.Returns the hover color of the decoration.booleanReturns the expansion state of the toggle control.voidsetDecorationColor(Color decorationColor) Sets the color of the decoration.voidsetExpanded(boolean expanded) Sets the expansion state of the twistie controlvoidsetHoverDecorationColor(Color hoverColor) Sets the hover color of decoration.Methods inherited from class org.eclipse.ui.forms.widgets.AbstractHyperlink
addHyperlinkListener, getHref, getSelection, getText, handleActivate, handleEnter, handleExit, paint, paintHyperlink, removeHyperlinkListener, setEnabled, setHrefMethods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIMEMethods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList, toStringMethods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar, setScrollbarsModeMethods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, updateMethods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, addTypedListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, getTypedListeners, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, removeListener, removeTypedListener, reskin, setData, setDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.swt.graphics.Drawable
isAutoScalable
-
Field Details
-
innerWidth
protected int innerWidth -
innerHeight
protected int innerHeight -
hover
protected boolean hover
-
-
Constructor Details
-
ToggleHyperlink
Creates a control in a provided composite.- Parameters:
parent- the parentstyle- the style
-
-
Method Details
-
setDecorationColor
Sets the color of the decoration.- Parameters:
decorationColor- color to set
-
getDecorationColor
Returns the color of the decoration.- Returns:
- decoration color
-
setHoverDecorationColor
Sets the hover color of decoration. Hover color will be used when mouse enters the decoration area.- Parameters:
hoverColor- the hover color to use
-
getHoverDecorationColor
Returns the hover color of the decoration.- Returns:
- the hover color of the decoration.
- Since:
- 3.1
-
geHoverDecorationColor
Deprecated.usegetHoverDecorationColorReturns the hover color of the decoration.- Returns:
- the hover color of the decoration.
- See Also:
-
computeSize
Computes the size of the control.- Overrides:
computeSizein classControl- Parameters:
wHint- width hinthHint- height hintchanged- if true, flush any saved layout state- Returns:
- the preferred size of the control.
- See Also:
-
isExpanded
public boolean isExpanded()Returns the expansion state of the toggle control. When toggle is in the normal (downward) state, the value is true . Collapsed control will return false .- Returns:
- false if collapsed, true otherwise.
-
setExpanded
public void setExpanded(boolean expanded) Sets the expansion state of the twistie control- Parameters:
expanded- the expansion state
-
getHoverDecorationColor