com.tensegrity.skeleton.commands
Class CloseCommand

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.CloseCommand
All Implemented Interfaces:
Command

public class CloseCommand
extends DocumentCommand

This Command closes the active document. If the document has been since modified, users may be asked to save it before it is closed.

This class uses the DocumentCommand.getDocument() to retrieve its document.

Version:
$Id: CloseCommand.java,v 1.31 2005/11/23 10:07:56 BurkhardWick Exp $
Author:
MichaelKegel, Gilles Iachelini, Stepan RUtz, Burkhard Wick

Constructor Summary
CloseCommand(ApplicationFrame applicationFrame, java.lang.String command)
          The CloseCommand for a ApplicationFrame.
 
Method Summary
 int closeDocument(Document document)
          Closes the given document.
protected  void doSaveConfirmedAction(Document document)
          This method is invoked when the user confirmed the save dialog upon closing a dirty document.
 boolean isCloseConfirmed()
          Returns true, if the close operation has been confirmed by the user
 boolean isEnabled()
          Returns true if this command is enabled.
 void perform(java.lang.Object args)
          Updates the StatusBar with this commands title string.
 void setEnabled(boolean b)
          Specifies whether this command is enabled or not.
 
Methods inherited from class com.tensegrity.skeleton.commands.DocumentCommand
getDocument, getGraphApplication, newGraphDocumentFromFactory
 
Methods inherited from class com.tensegrity.skeleton.commands.CommonBaseCommand
getApplicationFrame, getTitle
 
Methods inherited from class com.tensegrity.generic.command.BaseCommand
getDescription, getId, getPerformDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CloseCommand

public CloseCommand(ApplicationFrame applicationFrame,
                    java.lang.String command)
The CloseCommand for a ApplicationFrame.

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

perform

public void perform(java.lang.Object args)
Description copied from class: CommonBaseCommand
Updates the StatusBar with this commands title string. (non-Javadoc)

Specified by:
perform in interface Command
Overrides:
perform in class CommonBaseCommand
See Also:
Command.perform(java.lang.Object)

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

setEnabled

public void setEnabled(boolean b)
Description copied from interface: Command
Specifies whether this command is enabled or not.

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

closeDocument

public int closeDocument(Document document)
Closes the given document. This method only applies to instances of GraphDocument. If the document is modified users may save it before activating the close.

Parameters:
document - the document instance to close.
Returns:
users selected option.

doSaveConfirmedAction

protected void doSaveConfirmedAction(Document document)
This method is invoked when the user confirmed the save dialog upon closing a dirty document. Meant to be overriden by subclasses.

Parameters:
document - The document to save

isCloseConfirmed

public boolean isCloseConfirmed()
Returns true, if the close operation has been confirmed by the user

Returns:
true, if the close operation has been confirmed by the user


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