contributing 'before' and 'after' commands without using inheritance [message #43214] |
Fri, 08 September 2006 12:47 |
Eclipse User |
|
|
|
Originally posted by: vcciubot.uwaterloo.ca
Is it possible to obtain the following behavior without using inheritance?
Basically, I need to wrap a command around two other commands. This is
needed because in some situations the default implementation in
GraphicalEditPart does not turn off the canonical mode of the correct
editPart.
class MyEditPart extends GraphicalEditPart {
public Command getCommand(Request req) {
if (req instanceof CreateConnectionRequest) {
Comand before = new ToggleCanonicalModeCommand( ..., true);
Comand after = new ToggleCanonicalModeCommand ( ...., false);
CompoundComand cc = ....
cc.add (before);
cc.add (super.getCommand(req));
cc.add (after);
}
}
}
thanks for looking
vlad
|
|
|
Powered by
FUDForum. Page generated in 0.03634 seconds