Skip to main content



      Home
Home » Modeling » EMF » Get notified of executed command
Get notified of executed command [message #831958] Thu, 29 March 2012 11:18 Go to next message
Eclipse UserFriend
Hi all,

I execute a command using:

xyz.getCommandStack().execute(refactoringCommand);


How can I get notified when the command is executed?

I tried:

xyz.getCommandStack().addCommandStackListener(new CommandStackListener() {
			
 @Override
 public void commandStackChanged(EventObject event) {
   //Execute code here								
 }
});


However, I cannot find a way to see if the command stack is empty. Any ideas on how to find out if everything has executed?


Ralph

[Updated on: Thu, 29 March 2012 11:19] by Moderator

Re: Get notified of executed command [message #832161 is a reply to message #831958] Thu, 29 March 2012 17:12 Go to previous message
Eclipse UserFriend
Ralph,

Typically you'd just call getMostRecentCommand. Or you'd look at
getUndoCommand and getRedoCommand to know the command that would be used
when calling undo/redo.

On 29/03/2012 11:18 AM, Ralph Gerbig wrote:
> Hi all,
>
> I execute a command using:
>
> xyz.getCommandStack().execute(refactoringCommand);
>
> How can I get notified when the command is executed?
>
> I tried:
>
> xyz.getCommandStack().addCommandStackListener(new
> CommandStackListener() {
>
> @Override
> public void commandStackChanged(EventObject event) {
> //Execute code here
> }
> });
>
> However, I cannot find a way to see if the command stack is empty. Any
> ideas on how to find out if everything has executed?
>
>
> Ralph
Previous Topic:Reading a model instance produces a ClassNotFoundException
Next Topic:Binding Problem when using updateStrategy (@Tom)
Goto Forum:
  


Current Time: Wed Sep 10 07:16:47 EDT 2025

Powered by FUDForum. Page generated in 0.03814 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top