svn commit: r13488 - trunk/src/model/src/org/argouml/model

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2007-09-03 17:21:01-0700
New Revision: 13488

Modified:
   trunk/src/model/src/org/argouml/model/DummyModelCommand.java
   trunk/src/model/src/org/argouml/model/ModelCommand.java

Log:
Provide isUndoable

Modified: trunk/src/model/src/org/argouml/model/DummyModelCommand.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model/src/org/argouml/model/DummyModelCommand.java?view=diff&rev=13488&p1=trunk/src/model/src/org/argouml/model/DummyModelCommand.java&p2=trunk/src/model/src/org/argouml/model/DummyModelCommand.java&r1=13487&r2=13488
==============================================================================
--- trunk/src/model/src/org/argouml/model/DummyModelCommand.java	(original)
+++ trunk/src/model/src/org/argouml/model/DummyModelCommand.java	2007-09-03 17:21:01-0700
@@ -44,4 +44,9 @@
     public void execute() {
         // Do nothing.
     }
+
+    @Override
+    public boolean isUndoable() {
+        return false;
+    }
 }

Modified: trunk/src/model/src/org/argouml/model/ModelCommand.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model/src/org/argouml/model/ModelCommand.java?view=diff&rev=13488&p1=trunk/src/model/src/org/argouml/model/ModelCommand.java&p2=trunk/src/model/src/org/argouml/model/ModelCommand.java&r1=13487&r2=13488
==============================================================================
--- trunk/src/model/src/org/argouml/model/ModelCommand.java	(original)
+++ trunk/src/model/src/org/argouml/model/ModelCommand.java	2007-09-03 17:21:01-0700
@@ -35,21 +35,18 @@
 public abstract class ModelCommand {
 
     /**
-     * The method to undo this memento.
+     * The method to execute this memento.
      */
-    public abstract void undo();
+    public abstract void execute();
 
     /**
-     * The method to execute this memento.
+     * Determine of the command can be undone
+     * @return true if the command can be undone
      */
-    public abstract void execute();
-    
+    public abstract boolean isUndoable();
+
     /**
-     * Dispose of any resources used by this memento before it is
-     * destroyed. A memento is destroyed when it is forced off the
-     * end of the undo or redo stack when that stack has reached
-     * its maximum size or when the stack is emptied.
+     * The method to undo this memento.
      */
-    public void dispose() {
-    }
+    public abstract void undo();
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.