Get notified of executed command [message #831958] |
Thu, 29 March 2012 15:18 |
Ralph Gerbig 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 |
Ed Merks 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/
|
|
|
Powered by
FUDForum. Page generated in 0.02880 seconds