com.tensegrity.skeleton.commands
Class AbstractOpenCommand

java.lang.Object
  extended bycom.tensegrity.generic.command.BaseCommand
      extended bycom.tensegrity.skeleton.commands.CommonBaseCommand
          extended bycom.tensegrity.skeleton.commands.DocumentCommand
              extended bycom.tensegrity.skeleton.commands.AbstractOpenCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
OpenCommand, SwtOpenCommand

public abstract class AbstractOpenCommand
extends DocumentCommand

Designed as the base class for all Command classes that deal with the opening of documents. This class specifies a validation method that subclasses may override.

Version:
$Id: AbstractOpenCommand.java,v 1.3 2005/04/13 10:58:04 KevinCVS Exp $
Author:
GillesIachelini

Constructor Summary
AbstractOpenCommand(ApplicationFrame applicationFrame, java.lang.String command)
          Constructor specifying the ApplicationFrame, a name for this Command and the name of the HelpSet to use.
 
Method Summary
protected abstract  boolean doValidateDocument(GraphDocument document)
          Utility method which subclasses can overwrite in order to control the document creation.
 boolean isEnabled()
          Returns true if this command is enabled.
 
Methods inherited from class com.tensegrity.skeleton.commands.DocumentCommand
getDocument, 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

AbstractOpenCommand

public AbstractOpenCommand(ApplicationFrame applicationFrame,
                           java.lang.String command)
Constructor specifying the ApplicationFrame, a name for this Command and the name of the HelpSet to use.

Parameters:
applicationFrame - the ApplicationFrame.
command - a unique name for this Command.
Method Detail

doValidateDocument

protected abstract boolean doValidateDocument(GraphDocument document)
Utility method which subclasses can overwrite in order to control the document creation. This method is called as soon as the GraphDocument is created and before it is added to the MDI component.

Parameters:
document -
Returns:
true if the passed GraphDocument is considered as valid, false otherwise.

isEnabled

public boolean isEnabled()
Description copied from interface: Command
Returns true if this command is enabled.

Specified by:
isEnabled in interface Command
Overrides:
isEnabled in class BaseCommand


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