Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Get notified of executed command
Get notified of executed command [message #831958] Thu, 29 March 2012 15:18 Go to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
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 15:19]

Report message to a moderator

Re: Get notified of executed command [message #832161 is a reply to message #831958] Thu, 29 March 2012 21:12 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Reading a model instance produces a ClassNotFoundException
Next Topic:Binding Problem when using updateStrategy (@Tom)
Goto Forum:
  


Current Time: Fri Apr 26 07:20:32 GMT 2024

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

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

Back to the top