com.tensegrity.skeleton.swing.launch
Class AbstractToolBarLaunchTask

java.lang.Object
  extended bycom.tensegrity.gui.launch.LaunchTask
      extended bycom.tensegrity.skeleton.swing.launch.AbstractLaunchTask
          extended bycom.tensegrity.skeleton.swing.launch.AbstractToolBarLaunchTask
Direct Known Subclasses:
ToolBarLaunchTask

public abstract class AbstractToolBarLaunchTask
extends AbstractLaunchTask

An abstract ToolBar task as "must-extend" class for future ToolBar LaunchTask implementation. This class provides the methods to fill ToolBars.

Version:
$Id: AbstractToolBarLaunchTask.java,v 1.49 2005/11/18 16:07:50 BurkhardWick Exp $
Author:
GillesIachelini

Field Summary
 
Fields inherited from class com.tensegrity.gui.launch.LaunchTask
lasterror, LAUNCHTASKSTATUS_FATAL, LAUNCHTASKSTATUS_FATAL_RETRY, LAUNCHTASKSTATUS_SERIOUS, LAUNCHTASKSTATUS_SERIOUS_RETRY, LAUNCHTASKSTATUS_SHUTDOWN, LAUNCHTASKSTATUS_SUCCESS, LAUNCHTASKSTATUS_WARNING
 
Constructor Summary
AbstractToolBarLaunchTask(ApplicationFrame applicationFrame)
          Constructor
AbstractToolBarLaunchTask(ApplicationFrame applicationFrame, java.lang.String nameKey)
          Constructor
 
Method Summary
protected  void addSeparator(SwingToolBar toolbar)
          Adds a Separator the end of the given ToolBar.
protected  void addSeparator(SwingToolBar toolbar, int index)
          This method adds a Separator to the passed ToolBar at the specified index
protected  void addToToolBar(java.lang.String id, java.lang.Class resourceClass)
          Adds a new Button to the end of the ToolBar of the application.
protected  void addToToolBar(java.lang.String id, java.lang.String icon)
          Adds a new Button to the end of the default ToolBar of the application.
protected  void addToToolBar(java.lang.String id, java.lang.String icon, java.lang.Class resourceClass)
          Adds a new Button to the end of the ToolBar of the application.
protected  void addToToolBar(java.lang.String id, java.lang.String icon, int index)
          Inserts a command specified by the id and icon to the ToolBar at the given index.
protected  void addToToolBar(java.lang.String id, java.lang.String icon, int index, java.lang.String defaultIcon)
          Adds a new Button at position index of the default ToolBar of the application.
protected  void addToToolBar(java.lang.String id, java.lang.String icon, java.lang.String defaultIcon)
          Adds a new Button to the end of the default ToolBar of the application.
protected  void addToToolBar(java.lang.String id, java.lang.String icon, java.lang.String defaultIcon, java.lang.Class resourceClass)
          Adds a new Button to the end of the ToolBar of the application.
protected  void addToToolBar(java.lang.String id, java.lang.String icon, java.lang.String defaultIcon, int index, java.lang.Class resourceClass)
          Adds a new Button at position indexthe end of the ToolBar of the application.
protected  javax.swing.JButton addToToolBar(SwingToolBar toolbar, BaseCommand command, java.lang.String iconurl, java.lang.String defaultIcon)
          The method addToToolbar is a convience method to add new elements to the end of a given ToolBar.
protected  javax.swing.JButton addToToolBar(SwingToolBar toolbar, BaseCommand command, java.lang.String iconurl, java.lang.String defaultIcon, int index, java.lang.Class resourceClass)
          Adds a button to the specified ToolBar by calling the #addToToolBarToggleButton(SwingToolBar, Command, String, String, int, Class) method.
protected  void addToToolBar(SwingToolBar toolbar, java.lang.String id, java.lang.Class resourceClass)
          Adds a new Button to the end of the ToolBar of the application.
protected  javax.swing.AbstractButton addToToolBarToggleButton(SwingToolBar toolbar, java.lang.String commandId, java.lang.Class resourceClass)
          Adds a ToggleButton to the given ToolBar Loads the icons from the properties key Icon.Command.COMMANDID and IconToggled.Command.COMMANDID
protected  javax.swing.AbstractButton addToToolBarToggleButton(SwingToolBar toolbar, java.lang.String commandId, java.lang.String iconUrl, java.lang.String iconToggledUrl, java.lang.String defaultIconUrl, java.lang.String defaultIconToggledUrl, java.lang.Class resourceClass)
          Adds a ToggleButton to the given toolbar by using the SwingCommandRegistry#addToToolBarToggleButton(SwingToolBar, Command, String, String, Class) -method.
protected  void addToToolBarToggleButton(SwingToolBar toolbar, java.lang.String commandId, java.lang.String iconUrl, java.lang.String iconToggledUrl, java.lang.String defaultIconUrl, java.lang.String defaultIconToggledUrl, int index, java.lang.Class resourceClass)
          Adds a ToggleButton to the given toolbar by using the #addToToolBarToggleButton(SwingToolBar, Command, String, String, Class) method.
protected  void addZoomCombo(SwingToolBar toolBar)
          Creates a new ZoomComboBox and adds it to the given ToolBar.
protected  ZoomComboBox createZoomCombo()
          Creates the ZoomComboBox.
protected  void fillZoomCombo(ZoomComboBox combo)
          Adds all zoom graph commands to the combo that should be selectable by the user
 int getIndexOf(java.lang.String id, SwingToolBar toolbar)
          Returns the index of the button with the given command id.
protected  ToolBar getToolBar(java.lang.String name)
          Returns the ToolBar with the given name or null, if there is no matching ToolBar
protected  java.awt.Component removeToolbarComponent(java.lang.String id, SwingToolBar toolbar)
          Utility method used in order to remove a specific component from the passed ToolBar.
 
Methods inherited from class com.tensegrity.skeleton.swing.launch.AbstractLaunchTask
findResourceText, getApplicationFrame, getName, getStatusPrefix, getStatusPrefixResourceKey, postCreate
 
Methods inherited from class com.tensegrity.gui.launch.LaunchTask
getError, getStatusDetails, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractToolBarLaunchTask

public AbstractToolBarLaunchTask(ApplicationFrame applicationFrame)
Constructor

Parameters:
applicationFrame - Application context for this LaunchTask.

AbstractToolBarLaunchTask

public AbstractToolBarLaunchTask(ApplicationFrame applicationFrame,
                                 java.lang.String nameKey)
Constructor

Parameters:
applicationFrame - Application context for this LaunchTask.
nameKey - The resource key for the name of this launchtask
Method Detail

addToToolBar

protected void addToToolBar(java.lang.String id,
                            java.lang.String icon,
                            java.lang.String defaultIcon)
Adds a new Button to the end of the default ToolBar of the application. The button will trigger the command associated with the given id and uses the given icon. The defaultIcon will be used when the LookAndFeel switches to the WindowsLookAndFeel.

Parameters:
id - the id of the command to add.
icon - name of the icon to use.
defaultIcon - name of the icon to use when being in windows LnF.

addToToolBar

protected void addToToolBar(java.lang.String id,
                            java.lang.String icon)
Adds a new Button to the end of the default ToolBar of the application. The button will trigger the command associated with the given id and uses the given icon.

Parameters:
id - the id of the command to add.
icon - name of the icon to use.

addToToolBar

protected void addToToolBar(java.lang.String id,
                            java.lang.String icon,
                            int index)
Inserts a command specified by the id and icon to the ToolBar at the given index.

Parameters:
id - the command id.
icon - icon to use.
index - position within the ToolBar.

addToToolBar

protected void addToToolBar(java.lang.String id,
                            java.lang.String icon,
                            int index,
                            java.lang.String defaultIcon)
Adds a new Button at position index of the default ToolBar of the application. The button will trigger the command associated with the given id and uses the given icon. The defaultIcon will be used when the LookAndFeel switches to the WindowsLookAndFeel.

Parameters:
id - the id of the command to add.
icon - name of the icon to use.
index - position where to add the new element.
defaultIcon - name of the icon to use when being in windows LnF.

addToToolBar

protected void addToToolBar(java.lang.String id,
                            java.lang.String icon,
                            java.lang.String defaultIcon,
                            java.lang.Class resourceClass)
Adds a new Button to the end of the ToolBar of the application. The button will trigger the command associated with the given id and uses the given icon. The defaultIcon will be used when the LookAndFeel switches to the WindowsLookAndFeel. The resourceClass will be used to load the icons.

Parameters:
id - the id of the command to add.
icon - name of the icon to use.
defaultIcon - name of the icon to use when being in windows LnF.
resourceClass - Class instance to use, to load files.

addToToolBar

protected void addToToolBar(java.lang.String id,
                            java.lang.String icon,
                            java.lang.Class resourceClass)
Adds a new Button to the end of the ToolBar of the application. The button will trigger the command associated with the given id and uses the given icon. The defaultIcon will be used when the LookAndFeel switches to the WindowsLookAndFeel. The resourceClass will be used to load the icons.

Parameters:
id - the id of the command to add.
icon - name of the icon to use.
resourceClass - Class instance to use, to load files.

addToToolBar

protected void addToToolBar(java.lang.String id,
                            java.lang.Class resourceClass)
Adds a new Button to the end of the ToolBar of the application. The button will trigger the command associated with the given id. It will use the icon that is stored in the properties under the key "Icon.Command." + COMMANDID. The resourceClass will be used to load the icons.

Parameters:
id - the id of the command to add.
resourceClass - Class instance to use, to load files.

addToToolBar

protected void addToToolBar(SwingToolBar toolbar,
                            java.lang.String id,
                            java.lang.Class resourceClass)
Adds a new Button to the end of the ToolBar of the application. The button will trigger the command associated with the given id. It will use the icon that is stored in the properties under the key "Icon.Command." + COMMANDID. The resourceClass will be used to load the icons.

Parameters:
toolbar - The ToolBar to add the button to
id - the id of the command to add.
resourceClass - Class instance to use, to load files.

addToToolBar

protected void addToToolBar(java.lang.String id,
                            java.lang.String icon,
                            java.lang.String defaultIcon,
                            int index,
                            java.lang.Class resourceClass)
Adds a new Button at position indexthe end of the ToolBar of the application. The button will trigger the command associated with the given id and uses the given icon. The defaultIcon will be used when the LookAndFeel switches to the WindowsLookAndFeel. The resourceClass will be used to load the icons.

Parameters:
id - the id of the command to add.
icon - name of the icon to use.
defaultIcon - name of the icon to use when being in windows LnF.
index - position where to add the new element.
resourceClass - Class instance to use, to load files.

addToToolBar

protected final javax.swing.JButton addToToolBar(SwingToolBar toolbar,
                                                 BaseCommand command,
                                                 java.lang.String iconurl,
                                                 java.lang.String defaultIcon)
The method addToToolbar is a convience method to add new elements to the end of a given ToolBar. This method basically uses the SwingUtil.addToToolBar to create the new entry in the ToolBar, but also adds the DEFAULT_ICON property.

Parameters:
toolbar - ToolBar instance to add to.
command - instance of
iconurl - url of the icon
defaultIcon - name of the icon to use when being in windows LnF.
Returns:
the JButton which was added to the ToolBar.

addToToolBar

protected final javax.swing.JButton addToToolBar(SwingToolBar toolbar,
                                                 BaseCommand command,
                                                 java.lang.String iconurl,
                                                 java.lang.String defaultIcon,
                                                 int index,
                                                 java.lang.Class resourceClass)
Adds a button to the specified ToolBar by calling the #addToToolBarToggleButton(SwingToolBar, Command, String, String, int, Class) method. Furthermore, the resulting button action will have an extra property called SwingUtil.TENSEGRITY_ICON that holds the icon displayed by the tensegrity Look and feel.
REVIEWJAVADOC: (AbstractToolBarLaunchTask.java) : Firstly, what is the tensegrity look and feel? Secondly why is only this method tagged for docbook?

Parameters:
toolbar - ToolBar instance to add to.
command - instance of BaseCommand to associate with the new element.
iconurl - url of the icon
defaultIcon - name of the icon to use when being in windows LnF.
index - position to add the new element to.
resourceClass - Class instance to use, to load files.
Returns:
the JButton which was added to the ToolBar.

Find more information in the class documentation


addToToolBarToggleButton

protected final javax.swing.AbstractButton addToToolBarToggleButton(SwingToolBar toolbar,
                                                                    java.lang.String commandId,
                                                                    java.lang.Class resourceClass)
Adds a ToggleButton to the given ToolBar Loads the icons from the properties key Icon.Command.COMMANDID and IconToggled.Command.COMMANDID

Parameters:
toolbar - ToolBar instance to add to.
commandId - instance of BaseCommand to associate with the new element.
resourceClass - Class instance to use, to load files.
Returns:
the created button

addToToolBarToggleButton

protected final javax.swing.AbstractButton addToToolBarToggleButton(SwingToolBar toolbar,
                                                                    java.lang.String commandId,
                                                                    java.lang.String iconUrl,
                                                                    java.lang.String iconToggledUrl,
                                                                    java.lang.String defaultIconUrl,
                                                                    java.lang.String defaultIconToggledUrl,
                                                                    java.lang.Class resourceClass)
Adds a ToggleButton to the given toolbar by using the SwingCommandRegistry#addToToolBarToggleButton(SwingToolBar, Command, String, String, Class) -method. Furthermore the resulting action of the ToggleButton will get an extra property called SwingUtil.TENSEGRITY_ICON which holds the icon to be used in the tensegrity Look and feel. Icons corresponding to the passed iconToggledUrl and defaultToggledUrl are displayed when the button is toggled.

Parameters:
toolbar - ToolBar instance to add to.
commandId - instance of BaseCommand to associate with the new element.
iconUrl - url of the icon
iconToggledUrl - url of the toggled icon
defaultIconUrl - name of the icon to use when being in windows LnF.
defaultIconToggledUrl - name of the toggle icon to use when being in windows LnF.
resourceClass - Class instance to use, to load files.
Returns:
The created button

addToToolBarToggleButton

protected final void addToToolBarToggleButton(SwingToolBar toolbar,
                                              java.lang.String commandId,
                                              java.lang.String iconUrl,
                                              java.lang.String iconToggledUrl,
                                              java.lang.String defaultIconUrl,
                                              java.lang.String defaultIconToggledUrl,
                                              int index,
                                              java.lang.Class resourceClass)
Adds a ToggleButton to the given toolbar by using the #addToToolBarToggleButton(SwingToolBar, Command, String, String, Class) method. Furthermore the resulting action of the ToggleButton will get an extra property called SwingUtil.TENSEGRITY_ICON which holds the icon to be used in the tensegrity look and feel. Icons corresponding to the passed iconToggledUrl and defaultToggledUrl are displayed when the button is toggled. The given index specifies the position on the ToolBar where the ToggleButton should be inserted.

Parameters:
toolbar - ToolBar instance to add to.
commandId - instance of BaseCommand to associate with the new element.
iconUrl - url of the icon
iconToggledUrl - url of the toggled icon
defaultIconUrl - name of the icon to use when being in windows LnF.
defaultIconToggledUrl - name of the toggle icon to use when being in windows LnF.
index - position where to add the element to.
resourceClass - Class instance to use, to load files.

addSeparator

protected final void addSeparator(SwingToolBar toolbar)
Adds a Separator the end of the given ToolBar.

Parameters:
toolbar - the ToolBar instance to add the separator to.

addSeparator

protected final void addSeparator(SwingToolBar toolbar,
                                  int index)

This method adds a Separator to the passed ToolBar at the specified index

Parameters:
toolbar - The ToolBar to add the separator to.
index - the position where to add the separator.
See Also:
JToolBar.Separator

removeToolbarComponent

protected java.awt.Component removeToolbarComponent(java.lang.String id,
                                                    SwingToolBar toolbar)
Utility method used in order to remove a specific component from the passed ToolBar. The removed component is returned. If the component is not found this method returns null.

Parameters:
id - the id of the command to remove from the ToolBar.
toolbar - the target ToolBar to operate on.
Returns:
The removed component

getIndexOf

public int getIndexOf(java.lang.String id,
                      SwingToolBar toolbar)
Returns the index of the button with the given command id.

Parameters:
id - The command id to look for
toolbar - The tookbar to examine
Returns:
The index of the button or -1

getToolBar

protected final ToolBar getToolBar(java.lang.String name)
Returns the ToolBar with the given name or null, if there is no matching ToolBar

Parameters:
name - The name of the ToolBar to look for
Returns:
The ToolBar that has been found or null

addZoomCombo

protected void addZoomCombo(SwingToolBar toolBar)
Creates a new ZoomComboBox and adds it to the given ToolBar.

Parameters:
toolBar - the ToolBar instance to add the combo to.

fillZoomCombo

protected void fillZoomCombo(ZoomComboBox combo)
Adds all zoom graph commands to the combo that should be selectable by the user

Parameters:
combo - The combo to add the commands to

createZoomCombo

protected ZoomComboBox createZoomCombo()
Creates the ZoomComboBox. This method should be called only once per application lifetime.

Returns:
an instance of class ZoomActionComboBox.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.