|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
com.tensegrity.gui.swt.control.SwtToolBar
This is the SWT implementation of the
interface.
ToolBar
It is the caller's responsability to set a layout data to this .
Composite
Since the SWT recommendation is to NOT subclass ,
this class simply extends ToolBar
and internally manages an instance of Composite.
ToolBar
The internal instance
can be accessed through the ToolBar
method. It is required to use this method when adding getSwtToolBar()
s to the toolbar.
ToolItem
The and addItem(Command, String, Class)
methods can be used in order to add addItem(Command, String, Class, String)
s to the toolbar.
ToolItem
Use in order to insert separators to
the toolbar.
addSeparator()
Use the method in order to retrieve
the index of a particular ToolItem.
indexOf(String)
Note that although this class is a subclass of Composite, it
does not make sense to set a layout on it. The
method should therefore not be used.
setLayout(Layout)
| Nested Class Summary | |
class |
SwtToolBar.SwtToolbarToolTipGenerator
This is a implementation for the
SwtToolbar.
|
| Field Summary | |
static java.lang.String |
TOOLITEM_COMMAND_ID
Key used to store the command along with each ToolItem added to the ToolBar. |
static java.lang.String |
TOOLITEM_TOOLTIP_ID
Key used to store the tooltips id along with each ToolItem added to the ToolBar. |
| Fields inherited from class org.eclipse.swt.widgets.Control |
handle |
| Constructor Summary | |
protected |
SwtToolBar(org.eclipse.swt.widgets.Composite parent,
int style,
UIManager uiManager)
This constructor initializes the internal
instance with a style style. |
protected |
SwtToolBar(org.eclipse.swt.widgets.Composite parent,
int style,
UIManager uiManager,
int orientation)
This constructor initializes the internal
instance with a style style. |
|
SwtToolBar(org.eclipse.swt.widgets.Composite parent,
int style,
UIManager uiManager,
java.lang.String id)
This constructor initializes the internal
instance with a style style. |
|
SwtToolBar(org.eclipse.swt.widgets.Composite parent,
int style,
UIManager uiManager,
java.lang.String id,
int orientation)
This constructor initializes the internal
instance with a style style. |
| Method Summary | |
void |
acted(int actID)
Invoked after each interaction cycle. |
org.eclipse.swt.widgets.ToolItem |
addItem(Command command,
java.lang.String iconurl,
java.lang.Class resourceClass)
This method add a to the internal .
|
org.eclipse.swt.widgets.ToolItem |
addItem(Command command,
java.lang.String iconurl,
java.lang.Class resourceClass,
java.lang.String tooltipId)
This method add a to the internal .
|
void |
addSeparator()
This method simply adds a separator to the toolbar. |
void |
addSeparator(int index)
This method simply adds a separator to the toolbar. |
void |
applyEvList()
Refreshes the tooltip string associated to each
of the internal . |
void |
documentAdded(DocumentEvent documentevent)
Invoked after a document was added to the mdicomponent. |
void |
documentModelChanged(DocumentEvent documentevent)
Invoked after a document's model has changed. |
void |
documentPreAdd(DocumentEvent documentevent)
Invoked when a document is about to be added to a mdicomponent. |
void |
documentPreRemove(DocumentEvent documentevent)
Invoked when a document is about to be removed from a mdicomponent. |
void |
documentRemoved(DocumentEvent documentevent)
Invoked after a document was removed from the mdicomponent. |
void |
documentSelected(DocumentEvent documentevent)
Invoked after a document was selected in the mdicomponent. |
void |
documentUnselected(DocumentEvent documentevent)
Invoked after a document was unselected in the mdicomponent. |
int |
getHeight()
Returns the height of the component in pixels. |
java.lang.String |
getName()
A toolbar should provide a human readable name. |
BasicComponent |
getParentComponent()
Returns the parent Component of this instance. |
org.eclipse.swt.widgets.ToolBar |
getSwtToolBar()
Returns the wrapped instance. |
SwtToolTipGenerator |
getTooltipGenerator()
Returns the tooltipGenerator. |
int |
getWidth()
Returns the width of the component in pixels. |
int |
indexOf(java.lang.String id)
Note that the returned value validity is not guaranteed if the toolbar contains more than one ToolItem associated to the same command. |
void |
installEvList()
Tells the component to setup its internal state. |
void |
postAction()
Invoked when a user interaction has completed on a GraphPanel this instance of
GraphPanelListener is registered with.
|
void |
postDropBaseComposite(BaseComposite baseComposite)
Invoked when a BaseComposite was dragged and dropped onto
the GraphPanel this GraphPanelListener. |
void |
postMouseClick()
Invoked when a mouse click has completed on a GraphPanel this instance of
GraphPanelListener is registered with. |
void |
preAction()
Invoked when a user interaction is about to begin on a GraphPanel this instance of
GraphPanelListener is registered with.
|
void |
repaint()
Triggers a repaint. |
void |
setLayout(org.eclipse.swt.widgets.Layout layout)
This method is overwritten and throws a runtime exception if used. |
void |
setTooltipGenerator(SwtToolTipGenerator tooltipGenerator)
Set the SwtToolTipGenerator. |
void |
updateStatus()
This method is used to keep the state of the toolbar up-to-date. |
| Methods inherited from class org.eclipse.swt.widgets.Composite |
checkSubclass, computeSize, getChildren, getLayout, getTabList, layout, layout, setFocus, setTabList |
| Methods inherited from class org.eclipse.swt.widgets.Scrollable |
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
| Methods inherited from class org.eclipse.swt.widgets.Control |
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update |
| Methods inherited from class org.eclipse.swt.widgets.Widget |
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static java.lang.String TOOLITEM_TOOLTIP_ID
public static java.lang.String TOOLITEM_COMMAND_ID
| Constructor Detail |
protected SwtToolBar(org.eclipse.swt.widgets.Composite parent,
int style,
UIManager uiManager)
This constructor initializes the internal
instance with a ToolBarstyle style. The GridData style of the
internal is set
to ToolBarGridData.FILL_HORIZONTAL.
Do not use this constructor since it does not define the toolbar Id.
Subclasses might have a need for it so it is declared as protected.
parent - The toolbar parent containerstyle - The internal ToolBar
styleuiManager - The UIManager used for this toolbar
localized strings.
public SwtToolBar(org.eclipse.swt.widgets.Composite parent,
int style,
UIManager uiManager,
java.lang.String id)
This constructor initializes the internal
instance with a ToolBarstyle style. The GridData style of the
internal is set
to ToolBarGridData.FILL_HORIZONTAL.
parent - The toolbar parent containerstyle - The internal ToolBar
styleuiManager - The UIManager used for this toolbar
localized strings.id - Identifier of the GUI resource for the title of this ToolBar
protected SwtToolBar(org.eclipse.swt.widgets.Composite parent,
int style,
UIManager uiManager,
int orientation)
This constructor initializes the internal
instance with a ToolBarstyle style. The GridData style of the
internal is set
to ToolBarorientation.
Do not use this constructor since it does not define the toolbar Id.
Subclasses might have a need for it so it is declared as protected.
parent - The toolbar parent containerstyle - The internal ToolBar
styleuiManager - The UIManager used for this toolbar
localized strings.orientation - The GridData style of the internal ToolBar.
One of SWT.HORIZONTAL or SWT.VERTICAL.
public SwtToolBar(org.eclipse.swt.widgets.Composite parent,
int style,
UIManager uiManager,
java.lang.String id,
int orientation)
This constructor initializes the internal
instance with a ToolBarstyle style. The GridData style of the
internal is set
to ToolBarorientation.
parent - The toolbar parent containerstyle - The internal ToolBar
styleuiManager - The UIManager used for this toolbar
localized strings.id - Identifier of the GUI resource for the title of this ToolBarorientation - The GridData style of the internal ToolBar
.One of SWT.HORIZONTAL or SWT.VERTICAL.| Method Detail |
public void setLayout(org.eclipse.swt.widgets.Layout layout)
This method is overwritten and throws a runtime exception if used. The
SwtToolbar internally manages its layout.
Composite.setLayout(org.eclipse.swt.widgets.Layout)public void addSeparator()
This method simply adds a separator to the toolbar.
public void addSeparator(int index)
This method simply adds a separator to the toolbar.
index - the separator position
public org.eclipse.swt.widgets.ToolItem addItem(Command command,
java.lang.String iconurl,
java.lang.Class resourceClass)
This method add a to the internal ToolItem.
The passed ToolBar id is used as GUI
identifier for the item's tooltip.
Command
command - The command associated with the new ToolItemiconurl - location of the icon, relative to resourceClassresourceClass - the reference class used to retrieve the icon
public org.eclipse.swt.widgets.ToolItem addItem(Command command,
java.lang.String iconurl,
java.lang.Class resourceClass,
java.lang.String tooltipId)
This method add a to the internal ToolItem.
The passed ToolBar id is used as GUI
identifier for the item tooltip.
Command
command - The command associated with the new ToolItemiconurl - location of the icon, relative to resourceClassresourceClass - the reference class used to retrieve the icontooltipId - GUI identifier for the item's tooltip.
public int indexOf(java.lang.String id)
indexOf in interface ToolBarid - the id of command.
ToolBar.indexOf(java.lang.String)public void updateStatus()
ToolBar
updateStatus in interface ToolBarpublic void installEvList()
Evaluable
installEvList in interface Evaluablepublic void applyEvList()
ToolItem
of the internal ToolBar.
applyEvList in interface EvaluableEvaluable.applyEvList()public void documentAdded(DocumentEvent documentevent)
DocumentListener
documentAdded in interface DocumentListenerdocumentevent - the documentevent structure carrying information.public void documentModelChanged(DocumentEvent documentevent)
DocumentListener
documentModelChanged in interface DocumentListenerdocumentevent - the documentevent structure carrying information.
public void documentPreAdd(DocumentEvent documentevent)
throws DocumentEventVetoException
DocumentListener
documentPreAdd in interface DocumentListenerdocumentevent - the documentevent structure carrying information.
DocumentEventVetoException - indicates that the documentevent is
not desired.
public void documentPreRemove(DocumentEvent documentevent)
throws DocumentEventVetoException
DocumentListener
documentPreRemove in interface DocumentListenerdocumentevent - the documentevent structure carrying information.
DocumentEventVetoException - indicates that the documentevent is
not desired.public void documentRemoved(DocumentEvent documentevent)
DocumentListener
documentRemoved in interface DocumentListenerdocumentevent - the documentevent structure carrying information.public void documentSelected(DocumentEvent documentevent)
DocumentListener
documentSelected in interface DocumentListenerdocumentevent - the documentevent structure carrying information.public void documentUnselected(DocumentEvent documentevent)
DocumentListener
documentUnselected in interface DocumentListenerdocumentevent - the documentevent structure carrying information.public void postDropBaseComposite(BaseComposite baseComposite)
GraphPanelListenerBaseComposite was dragged and dropped onto
the GraphPanel this GraphPanelListener.
postDropBaseComposite in interface GraphPanelListenerbaseComposite - thepublic void preAction()
GraphPanelListenerGraphPanel this instance of
GraphPanelListener is registered with.
the GraphPanel this GraphPanelListener.
preAction in interface GraphPanelListenerpublic void acted(int actID)
GraphPanelListener
acted in interface GraphPanelListeneractID - integer id that holds one of the values
defined in InteractionConstants
that are prefixed with ACT*; The id gives additional
info about the type of interaction that actually occured (e.g.
whether a composite was manipulated or whether one or many composites
were moved.public void postAction()
GraphPanelListenerGraphPanel this instance of
GraphPanelListener is registered with.
the GraphPanel this GraphPanelListener.
postAction in interface GraphPanelListenerpublic void postMouseClick()
GraphPanelListenerGraphPanel this instance of
GraphPanelListener is registered with.
postMouseClick in interface GraphPanelListenerpublic BasicComponent getParentComponent()
BasicComponent
getParentComponent in interface BasicComponentnull if no parent exists.public java.lang.String getName()
ToolBar
getName in interface ToolBarpublic int getHeight()
BasicComponent
getHeight in interface BasicComponentpublic int getWidth()
BasicComponent
getWidth in interface BasicComponentpublic void repaint()
BasicComponent
repaint in interface BasicComponentpublic final org.eclipse.swt.widgets.ToolBar getSwtToolBar()
ToolBar instance.
ToolBar instancepublic SwtToolTipGenerator getTooltipGenerator()
public void setTooltipGenerator(SwtToolTipGenerator tooltipGenerator)
SwtToolTipManager.
tooltipGenerator - The tooltipGenerator to set.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||