com.tensegrity.skeleton.swt.commands
Class SwtDocumentCommand

java.lang.Object
  extended bycom.tensegrity.generic.command.BaseCommand
      extended bycom.tensegrity.skeleton.commands.CommonBaseCommand
          extended bycom.tensegrity.skeleton.swt.commands.SwtCommonBaseCommand
              extended bycom.tensegrity.skeleton.swt.commands.SwtDocumentCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
SwtCloseAllCommand, SwtCloseCommand, SwtGraphDocumentCommand

public abstract class SwtDocumentCommand
extends SwtCommonBaseCommand

This class, to be used within applications in a SWT context, is the base class for all Commands related to the currently selected Document.

Note that instances of SwtDocumentCommand are disabled when no Document is selected.

The getDocument() method is provided in order to retrieve the currently selected Document.

Version:
$Id: SwtDocumentCommand.java,v 1.8 2005/08/01 09:49:31 SebastienGuyon Exp $
Author:
S�bastien Guyon

Constructor Summary
SwtDocumentCommand(ApplicationFrame applicationFrame, java.lang.String command)
          Creates an instance of SwtDocumentCommand.
 
Method Summary
protected  Document getDocument()
          This method returns the currently active Document or null.
 boolean isEnabled()
          Returns false if getDocument() returns null, true otherwise.
 
Methods inherited from class com.tensegrity.skeleton.swt.commands.SwtCommonBaseCommand
getGraphApplication, newGraphDocumentFromFactory
 
Methods inherited from class com.tensegrity.skeleton.commands.CommonBaseCommand
getApplicationFrame, getTitle, perform
 
Methods inherited from class com.tensegrity.generic.command.BaseCommand
getDescription, getId, getPerformDescription, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwtDocumentCommand

public SwtDocumentCommand(ApplicationFrame applicationFrame,
                          java.lang.String command)
Creates an instance of SwtDocumentCommand.

Parameters:
applicationFrame - Application context of this command.
command - the ID of this command.
Method Detail

getDocument

protected Document getDocument()
This method returns the currently active Document or null.

Returns:
the currently active Document or null.

isEnabled

public boolean isEnabled()
Returns false if getDocument() returns null, true otherwise.

Specified by:
isEnabled in interface Command
Overrides:
isEnabled in class BaseCommand
Returns:
false if getDocument() returns null, true otherwise.
See Also:
Command.isEnabled()


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