|
|
|
Re: Adding an action to context menu [message #635514 is a reply to message #635265] |
Wed, 27 October 2010 03:33  |
Eclipse User |
|
|
|
Right, there is alread a bugzilla for hasDoneChanges not being called in
that scenario, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=327756 .
The action group approach is of course more flexible if you want to use it
outside of Graphiti. Onthe other hand you might also use the feature inside
Graphiti and wrap it for outside usage in an action and action group.
Michael
"Ashwani Kr Sharma" <ashw.kumar@gmail.com> wrote in message
news:ia6426$v3p$1@news.eclipse.org...
> Hi,
>
> It does not work because: internally graphiti creates a
> org.eclipse.graphiti.internal.command.CommandContainer and in
> GFCommandStack (line143), gefCommandWrapper.getCommand() does return a
> FeatureCommand and hence hasdoneChanges is never called.
>
> if (gefCommand instanceof GefCommandWrapper) {
> GefCommandWrapper gefCommandWrapper = (GefCommandWrapper) gefCommand;
> ICommand command = gefCommandWrapper.getCommand();
> if (command instanceof FeatureCommand) {
>
> Hence, editor still becomes dirty. Am i missing anything ?
>
> About the second approach i mentioned: One benefit there is if i create a
> Open,OpenWith action group, i can re-use it at many places like explorer,
> editor, views etc. But graphiti features will be restricted to grphiti
> modeler only.
>
> Regards.
> Ashwani Kr Sharma
|
|
|
Powered by
FUDForum. Page generated in 0.23246 seconds