How do I handle my Model-Exceptions in GEF [message #213005] |
Sat, 01 April 2006 03:06  |
Eclipse User |
|
|
|
Hello,
is there an elegant way to handle exceptions thrown by the model in the
commands. Currently my commands inherit the
org.eclipse.gef.commands.Command which doesn't allow to throw excpetions
in the execute-method.
Greetings,
Alexander
|
|
|
|
Re: How do I handle my Model-Exceptions in GEF [message #213187 is a reply to message #213153] |
Mon, 03 April 2006 13:52  |
Eclipse User |
|
|
|
Actually, it is retrieved from the getAdapter, but more correctly you would
want to install your new CommandStack in the EditDomain which you would
associate with the viewer.
-Steve
"Steven Shaw" <steveshaw@ca.ibm.com> wrote in message
news:e0rjhd$gr2$1@utils.eclipse.org...
> If an exception occurs during command execution, it is handled by the
> CommandStack which will notify listeners that the command has been
executed.
> @see Command.execute. You could add a CommandStack listener before
> executing and then check the undo command to see if it matches the command
> you were executing to see if was successful.
>
> Otherwise, it is possible to override the CommandStack and provide your
own
> special handling. Simply override the getAdapter method in your
> GraphicalEditor to return your new CommandStack when adapting to
> CommandStack.class.
>
> -Steve
>
> "Alexander Dotor" <alexander.dotor@uni-bayreuth.de> wrote in message
> news:e0lcb5$9mq$1@utils.eclipse.org...
> > Hello,
> >
> > is there an elegant way to handle exceptions thrown by the model in the
> > commands. Currently my commands inherit the
> > org.eclipse.gef.commands.Command which doesn't allow to throw excpetions
> > in the execute-method.
> >
> > Greetings,
> > Alexander
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.32534 seconds