com.tensegrity.skeleton.swt.launch
Class SwtCommandLaunchTask

java.lang.Object
  extended bycom.tensegrity.gui.launch.LaunchTask
      extended bycom.tensegrity.skeleton.swing.launch.AbstractLaunchTask
          extended bycom.tensegrity.skeleton.swt.launch.SwtCommandLaunchTask

public class SwtCommandLaunchTask
extends AbstractLaunchTask

A LaunchTask which creates all the Command instances required for a given application based on the SWT windowing toolkit.

The run() method uses the Template Method Design Pattern in order to make customization of this class easier. It delegates the Commands creation to the following methods: Simply provide an empty implementation of these methods if you do not require the corresponding command..

Version:
$Id: SwtCommandLaunchTask.java,v 1.27 2005/08/08 16:36:36 BurkhardWick Exp $
Author:
S�bastien Guyon

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
SwtCommandLaunchTask(ApplicationFrame applicationFrame)
          Constructs a new SwtCommandLaunchTask which creates all the Command of a SWT-based application.
 
Method Summary
protected  boolean contains(java.lang.String lnfName)
          This method checks whether a LookAndFeel has already been installed.
protected  void doAboutCommand()
          Creates the default AboutCommand Command.
protected  void doAlignCommands()
          Creates alignment commands.
protected  void doCancelCommand()
          This generic command should not be replaced
protected  void doCloneDocumentCommand()
          Creates the default CloneDocumentCommand Command.
protected  void doCloseAllCommand()
          Creates the default CloseAllCommand Command.
protected  void doCloseCommand()
          Creates the default CloseCommand Command.
protected  void doCopyCommand()
          Creates the default CopyCommand Command.
protected  void doCutCommand()
          Creates the default CutCommand Command.
protected  void doDebugCommands()
          Creates various commands useful for debug purpose.
protected  void doDeleteCommand()
          Creates the default DeleteCommand Command.
protected  void doEnglishSwitchLanguageCommand()
          Creates the default SwitchLanguageCommand (English) Command.
protected  void doFindCommand()
          Creates the find command which is used to find elements and select them depending on some user defined information
protected  void doFitToViewportCommand()
          Creates the default FitToViewportCommand Command.
protected  void doFloatCommand()
          Creates the default doFloatCommand.
protected  void doGermanSwitchLanguageCommand()
          Creates the default SwitchLanguageCommand (German) Command.
protected  void doGroupSelectionCommand()
          Creates the default GroupSelectionCommand Command.
protected  void doHelpCommand()
          Creates the default doHelpCommand Command.
protected  void doLayoutCommands()
           Initializes all the LayoutCommand instances.
protected  void doLoadStylesCommand()
          Creates the default LoadStyles Command.
protected  void doNewDocumentCommand()
          Creates the default NewDocumentCommand Command.
protected  void doOpenCommand()
          Creates the default OpenCommand Command.
protected  void doPageSetupCommand()
          Creates the default PageSetupCommand Command.
protected  void doPasteCommand()
          Creates the default PasteCommand Command.
protected  void doPreferencesCommand()
          Creates the default PreferencesCommand Command.
protected  void doPrintCommand()
          Creates the default PrintCommand Command.
protected  void doPrintPreviewCommand()
          Creates the default PrintPreviewCommand Command.
protected  void doQuitCommand()
          Creates the default QuitCommand Command.
protected  void doRedoCommand()
          Creates the default RedoCommand Command.
protected  void doSaveAsCommand()
          Creates the default SaveAsCommand Command.
protected  void doSaveCommand()
          Creates the default SwtSaveCommand Command.
protected  void doSaveStylesCommand()
          Creates the default SaveStyles Command.
protected  void doSelectAllCommand()
          Creates the default SelectAllCommand Command.
protected  void doShapeFormatCommand()
          Creates the default ShapeFormatCommand Command.
protected  void doStyleDialogCommand()
          Creates the default StyleDialog Command.
protected  void doToBackCommand()
          Creates the ToBackCommand command.
protected  void doToFrontCommand()
          Creates the ToFrontCommand command.
protected  void doToggleAutomaticLayoutCommand()
          Creates the ToggleAutomaticLayoutCommand.
protected  void doToggleConnectModeCommand()
          Creates the ToggleConnectModeCommand command.
protected  void doToggleFullscreenCommand()
          Creates the ToggleFullscreenCommand command.
protected  void doToggleLeftColumnCommand()
          Creates the default ToggleLeftColumnCommand Command.
protected  void doToggleRightColumnCommand()
          Creates the default ToggleRightColumnCommand Command.
protected  void doUndoCommand()
          Creates the default UndoCommand Command.
protected  void doUngroupSelectionCommand()
          Creates the default UngroupSelectionCommand Command.
protected  void doViewGridCommand()
          Creates the ViewGridCommand Command.
protected  void doViewRulerCommand()
          Creates the ViewRulerCommand Command.
protected  void doZoom1000GraphCommand()
          Creates the default Zoom1000GraphCommand Command.
protected  void doZoom100GraphCommand()
          Creates the default Zoom100GraphCommand Command.
protected  void doZoom150GraphCommand()
          Creates the default Zoom150GraphCommand Command.
protected  void doZoom1To1GraphCommand()
          Creates the default Zoom1To1GraphCommand Command.
protected  void doZoom200GraphCommand()
          Creates the default Zoom200GraphCommand Command.
protected  void doZoom400GraphCommand()
          Creates the default Zoom400GraphCommand Command.
protected  void doZoom50GraphCommand()
          Creates the default Zoom50GraphCommand Command.
protected  void doZoom75GraphCommand()
          Creates the default Zoom75GraphCommand Command.
protected  void doZoomDialogCommand()
          Creates the default ZoomDialogCommand Command.
protected  void doZoomInCommand()
          Creates the default ZoomInCommand Command.
protected  void doZoomOutCommand()
          Creates the default ZoomOutCommand Command.
protected  void doZoomRectangleCommand()
          Creates the default ZoomToRectangle command.
protected  void doZoomToFitCommand()
          Creates the default ZoomToFitCommand Command.
protected  void doZoomToSelectionCommand()
          Creates the doZoomToSelectionCommand command.
protected  void doZoomXGraphCommand()
          Creates the default ZoomGraphCommand Commands.
 void postCreate(java.lang.Object object)
          This method is invoked once all Command instances have been created and the run() method is about to return.
 int run()
          The run method of this launch task.
 
Methods inherited from class com.tensegrity.skeleton.swing.launch.AbstractLaunchTask
findResourceText, getApplicationFrame, getName, getStatusPrefix, getStatusPrefixResourceKey
 
Methods inherited from class com.tensegrity.gui.launch.LaunchTask
getError, getStatusDetails
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwtCommandLaunchTask

public SwtCommandLaunchTask(ApplicationFrame applicationFrame)
Constructs a new SwtCommandLaunchTask which creates all the Command of a SWT-based application. This commands can then later be retrieved using the CommandRegistry of the given ApplicationFrame.

Parameters:
applicationFrame - The SWT-based application context for this launch task.
Method Detail

run

public final int run()
              throws java.lang.Exception
Description copied from class: LaunchTask
The run method of this launch task. The returned status indicates what the invoker is supposed to do after the task executed.

Specified by:
run in class LaunchTask
Returns:
one of the LAUNCHTASKSTATUS_* constants defined in this interface.
Throws:
java.lang.Exception

doAlignCommands

protected void doAlignCommands()
Creates alignment commands.


doToBackCommand

protected void doToBackCommand()
Creates the ToBackCommand command.


doToFrontCommand

protected void doToFrontCommand()
Creates the ToFrontCommand command.


doToggleConnectModeCommand

protected void doToggleConnectModeCommand()
Creates the ToggleConnectModeCommand command.


doCancelCommand

protected final void doCancelCommand()
This generic command should not be replaced


doToggleFullscreenCommand

protected void doToggleFullscreenCommand()
Creates the ToggleFullscreenCommand command.


doZoomToSelectionCommand

protected void doZoomToSelectionCommand()
Creates the doZoomToSelectionCommand command.


doFindCommand

protected void doFindCommand()
Creates the find command which is used to find elements and select them depending on some user defined information


doNewDocumentCommand

protected void doNewDocumentCommand()
Creates the default NewDocumentCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a NewDocumentCommand Command or override if you require a custom NewDocumentCommand.


doOpenCommand

protected void doOpenCommand()
Creates the default OpenCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a OpenCommand Command or override if you require a custom OpenCommand.


doCloneDocumentCommand

protected void doCloneDocumentCommand()
Creates the default CloneDocumentCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a CloneDocumentCommand Command or override if you require a custom CloneDocumentCommand.


doCloseCommand

protected void doCloseCommand()
Creates the default CloseCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a CloseCommand Command or override if you require a custom CloseCommand.


doCloseAllCommand

protected void doCloseAllCommand()
Creates the default CloseAllCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a CloseCommand Command or override if you require a custom CloseCommand.


doSaveCommand

protected void doSaveCommand()
Creates the default SwtSaveCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a SaveCommand Command or override if you require a custom SaveCommand.


doSaveAsCommand

protected void doSaveAsCommand()
Creates the default SaveAsCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a SaveAsCommand Command or override if you require a custom SaveAsCommand.


doPageSetupCommand

protected void doPageSetupCommand()
Creates the default PageSetupCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a PageSetupCommand Command or override if you require a custom PageSetupCommand.


doPrintPreviewCommand

protected void doPrintPreviewCommand()
Creates the default PrintPreviewCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a PrintPreviewCommand Command or override if you require a custom PrintPreviewCommand.


doPrintCommand

protected void doPrintCommand()
Creates the default PrintCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a PrintCommand Command or override if you require a custom PrintCommand.


doQuitCommand

protected void doQuitCommand()
Creates the default QuitCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a QuitCommand Command or override if you require a custom QuitCommand.


doUndoCommand

protected void doUndoCommand()
Creates the default UndoCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a UndoCommand Command or override if you require a custom UndoCommand.


doRedoCommand

protected void doRedoCommand()
Creates the default RedoCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a RedoCommand Command or override if you require a custom RedoCommand.


doCutCommand

protected void doCutCommand()
Creates the default CutCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a CutCommand Command or override if you require a custom CutCommand.


doCopyCommand

protected void doCopyCommand()
Creates the default CopyCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a CopyCommand Command or override if you require a custom CopyCommand.


doPasteCommand

protected void doPasteCommand()
Creates the default PasteCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a PasteCommand Command or override if you require a custom PasteCommand.


doDeleteCommand

protected void doDeleteCommand()
Creates the default DeleteCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a DeleteCommand Command or override if you require a custom DeleteCommand.


doSelectAllCommand

protected void doSelectAllCommand()
Creates the default SelectAllCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a SelectAllCommand Command or override if you require a custom SelectAllCommand.


doZoomInCommand

protected void doZoomInCommand()
Creates the default ZoomInCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a ZoomInCommand Command or override if you require a custom ZoomInCommand.


doZoomOutCommand

protected void doZoomOutCommand()
Creates the default ZoomOutCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a ZoomOutCommand Command or override if you require a custom ZoomOutCommand.


doZoomToFitCommand

protected void doZoomToFitCommand()
Creates the default ZoomToFitCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a ZoomToFitCommand Command or override if you require a custom ZoomToFitCommand.


doZoomRectangleCommand

protected void doZoomRectangleCommand()
Creates the default ZoomToRectangle command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a ZoomToRectangle Command or override if you require a custom ZoomToRectangle.


doZoom1To1GraphCommand

protected void doZoom1To1GraphCommand()
Creates the default Zoom1To1GraphCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a Zoom1To1GraphCommand Command or override if you require a custom Zoom1To1GraphCommand.


doZoom50GraphCommand

protected void doZoom50GraphCommand()
Creates the default Zoom50GraphCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a Zoom50GraphCommand Command or override if you require a custom Zoom50GraphCommand.


doZoom75GraphCommand

protected void doZoom75GraphCommand()
Creates the default Zoom75GraphCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a Zoom75GraphCommand Command or override if you require a custom Zoom75GraphCommand.


doZoom100GraphCommand

protected void doZoom100GraphCommand()
Creates the default Zoom100GraphCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a Zoom100GraphCommand Command or override if you require a custom Zoom100GraphCommand.


doZoom150GraphCommand

protected void doZoom150GraphCommand()
Creates the default Zoom150GraphCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a Zoom150GraphCommand Command or override if you require a custom Zoom150GraphCommand.


doZoom200GraphCommand

protected void doZoom200GraphCommand()
Creates the default Zoom200GraphCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a Zoom200GraphCommand Command or override if you require a custom Zoom200GraphCommand.


doZoom400GraphCommand

protected void doZoom400GraphCommand()
Creates the default Zoom400GraphCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a Zoom400GraphCommand Command or override if you require a custom Zoom400GraphCommand.


doZoom1000GraphCommand

protected void doZoom1000GraphCommand()
Creates the default Zoom1000GraphCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a Zoom1000GraphCommand Command or override if you require a custom Zoom1000GraphCommand.


doZoomXGraphCommand

protected void doZoomXGraphCommand()
Creates the default ZoomGraphCommand Commands. It calls the following template methods: Refer to these methods documentation for more information. This method is internally called by the run() method. Simply provide an empty implementation if you do not require any ZoomGraphCommand Commands.


doZoomDialogCommand

protected void doZoomDialogCommand()
Creates the default ZoomDialogCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a ZoomDialogCommand Command or override if you require a custom ZoomDialogCommand.


doShapeFormatCommand

protected void doShapeFormatCommand()
Creates the default ShapeFormatCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a ShapeFormatCommand Command or override if you require a custom ShapeFormatCommand.


contains

protected boolean contains(java.lang.String lnfName)
This method checks whether a LookAndFeel has already been installed. Thus it takes the parameter String and compares it to all currently installed LNF's by using the UIManager#getInstalledLookAndFeels() method.

Parameters:
lnfName - the name of a LookAndFeel to look up.
Returns:
true, if the parameter String is found in the list of installed LNF's.

doGroupSelectionCommand

protected void doGroupSelectionCommand()
Creates the default GroupSelectionCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a GroupSelectionCommand or override if you require a custom GroupSelectionCommand.


doUngroupSelectionCommand

protected void doUngroupSelectionCommand()
Creates the default UngroupSelectionCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a UngroupSelectionCommand or override if you require a custom UngroupSelectionCommand.


doGermanSwitchLanguageCommand

protected void doGermanSwitchLanguageCommand()
Creates the default SwitchLanguageCommand (German) Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a SwitchLanguageCommand (German) Command or override if you require a custom SwitchLanguageCommand (German).


doEnglishSwitchLanguageCommand

protected void doEnglishSwitchLanguageCommand()
Creates the default SwitchLanguageCommand (English) Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a SwitchLanguageCommand (English) Command or override if you require a custom SwitchLanguageCommand (English).


doStyleDialogCommand

protected void doStyleDialogCommand()
Creates the default StyleDialog Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a PreferencesCommand Command or override if you require a custom PreferencesCommand.


doSaveStylesCommand

protected void doSaveStylesCommand()
Creates the default SaveStyles Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a PreferencesCommand Command or override if you require a custom PreferencesCommand.


doLoadStylesCommand

protected void doLoadStylesCommand()
Creates the default LoadStyles Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a PreferencesCommand Command or override if you require a custom PreferencesCommand.


doPreferencesCommand

protected void doPreferencesCommand()
Creates the default PreferencesCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a PreferencesCommand Command or override if you require a custom PreferencesCommand.


doAboutCommand

protected void doAboutCommand()
Creates the default AboutCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a AboutCommand Command or override if you require a custom AboutCommand.


doFitToViewportCommand

protected void doFitToViewportCommand()
Creates the default FitToViewportCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a FitToViewportCommand Command or override if you require a custom FitToViewportCommand.


doFloatCommand

protected void doFloatCommand()
Creates the default doFloatCommand. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a doFloatCommand or override if you require a custom doFloatCommand .


doHelpCommand

protected void doHelpCommand()
Creates the default doHelpCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a doHelpCommand Command or override if you require a custom doHelpCommand.


doDebugCommands

protected void doDebugCommands()
Creates various commands useful for debug purpose.

See Also:
DebugApplicationCommand, DebugGraphCommand

doToggleLeftColumnCommand

protected void doToggleLeftColumnCommand()
Creates the default ToggleLeftColumnCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a ToggleLeftColumnCommand Command or override if you require a custom ToggleLeftColumnCommand.


doToggleRightColumnCommand

protected void doToggleRightColumnCommand()
Creates the default ToggleRightColumnCommand Command. This method is internally called by the run() method. Simply provide an empty implementation if you do not require a ToggleRightColumnCommand Command or override if you require a custom ToggleRightColumnCommand.


doToggleAutomaticLayoutCommand

protected void doToggleAutomaticLayoutCommand()
Creates the ToggleAutomaticLayoutCommand.


doViewRulerCommand

protected void doViewRulerCommand()
Creates the ViewRulerCommand Command. This method is internally called by the run() method.


doViewGridCommand

protected void doViewGridCommand()
Creates the ViewGridCommand Command. This method is internally called by the run() method.


doLayoutCommands

protected void doLayoutCommands()

Initializes all the LayoutCommand instances.


postCreate

public void postCreate(java.lang.Object object)
This method is invoked once all Command instances have been created and the run() method is about to return. The parameter object is the CommandRegistry of the underlying application.

Specified by:
postCreate in class AbstractLaunchTask
Parameters:
object - the CommandRegistry of the underlying application.
See Also:
AbstractLaunchTask.postCreate(Object)


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