org.gudy.azureus2.ui.swt.twistie
Class TwistieLabel

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.gudy.azureus2.ui.swt.twistie.TwistieLabel
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable, ITwistieConstants

public class TwistieLabel
extends org.eclipse.swt.widgets.Composite
implements ITwistieConstants

A Label with a twistie graphic at the beginning; every time this label is clicked the twistie graphic toggles between pointing to the right and pointing down.

Author:
knguyen

Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
view
 
Fields inherited from interface org.gudy.azureus2.ui.swt.twistie.ITwistieConstants
NONE, SHOW_DESCRIPTION, SHOW_EXPANDED, SHOW_SEPARATOR
 
Constructor Summary
TwistieLabel(org.eclipse.swt.widgets.Composite parent, int style)
          Create a twistie Label with the given style bit.
 
Method Summary
 void addMouseListener(org.eclipse.swt.events.MouseListener listener)
          Add a mouse listener to the control and also the titleLabel
 void addTwistieListener(ITwistieListener listener)
          Add a listener to be notified whenever this control is collapsed or expanded; listeners can check the collapsed/expanded state on the control and perform layout changes if need be.
 boolean isCollapsed()
          Returns whether this control is in a collapsed state
 void removeMouseListener(org.eclipse.swt.events.MouseListener listener)
          Remove the mouse listener from the control and also the titleLabel
 void removeTwistieListener(ITwistieListener listener)
           
 void setBackground(org.eclipse.swt.graphics.Color color)
          Sets the background color for the control and also all the text-base children
 void setCollapsed(boolean c)
           
 void setDescription(java.lang.String string)
          Sets the text to display as the description; this is not in effect unless the ITwistieConstants.SHOW_DESCRIPTION flag is also set
 void setEnabled(boolean enabled)
          Sets the enablement for the control and also all the text-base children
 void setForeground(org.eclipse.swt.graphics.Color color)
          Sets the foreground color for the control and also all the text-base children
 void setTitle(java.lang.String string)
          Sets the text to display as the title
 void setToolTipText(java.lang.String string)
          Sets the tooltip for the control and also all the text-base children
 void setTwistieForeground(org.eclipse.swt.graphics.Color color)
          Sets the color to be used for drawing the twistie graphic
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, 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, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setFont, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TwistieLabel

public TwistieLabel(org.eclipse.swt.widgets.Composite parent,
                    int style)
Create a twistie Label with the given style bit.

Style bit can be one or more of:

Parameters:
parent -
style -
Method Detail

addMouseListener

public void addMouseListener(org.eclipse.swt.events.MouseListener listener)
Add a mouse listener to the control and also the titleLabel

Overrides:
addMouseListener in class org.eclipse.swt.widgets.Control

removeMouseListener

public void removeMouseListener(org.eclipse.swt.events.MouseListener listener)
Remove the mouse listener from the control and also the titleLabel

Overrides:
removeMouseListener in class org.eclipse.swt.widgets.Control

setTwistieForeground

public void setTwistieForeground(org.eclipse.swt.graphics.Color color)
Sets the color to be used for drawing the twistie graphic

Parameters:
color -

setForeground

public void setForeground(org.eclipse.swt.graphics.Color color)
Sets the foreground color for the control and also all the text-base children

Overrides:
setForeground in class org.eclipse.swt.widgets.Control

setBackground

public void setBackground(org.eclipse.swt.graphics.Color color)
Sets the background color for the control and also all the text-base children

Overrides:
setBackground in class org.eclipse.swt.widgets.Control

setTitle

public void setTitle(java.lang.String string)
Sets the text to display as the title

Parameters:
string -

setDescription

public void setDescription(java.lang.String string)
Sets the text to display as the description; this is not in effect unless the ITwistieConstants.SHOW_DESCRIPTION flag is also set

Parameters:
string -

setToolTipText

public void setToolTipText(java.lang.String string)
Sets the tooltip for the control and also all the text-base children

Overrides:
setToolTipText in class org.eclipse.swt.widgets.Control

setEnabled

public void setEnabled(boolean enabled)
Sets the enablement for the control and also all the text-base children

Overrides:
setEnabled in class org.eclipse.swt.widgets.Control

isCollapsed

public boolean isCollapsed()
Returns whether this control is in a collapsed state

Returns:

setCollapsed

public void setCollapsed(boolean c)

addTwistieListener

public void addTwistieListener(ITwistieListener listener)
Add a listener to be notified whenever this control is collapsed or expanded; listeners can check the collapsed/expanded state on the control and perform layout changes if need be.

Parameters:
listener -

removeTwistieListener

public void removeTwistieListener(ITwistieListener listener)