|
Re: how to make an element undeletable [message #538545 is a reply to message #538534] |
Mon, 07 June 2010 22:17   |
Eclipse User |
|
|
|
Hi,
you can try to override the getDestroyElementCommand() method of the
ItemSemanticEditPolicy of the corresponding node edit parts.
protected Command getDestroyElementCommand(DestroyElementRequest req) {
return UnexecutableCommand.INSTANCE;
}
For links use getDestroyReferenceCommand() accordingly. Note that this
includes that the parent edit part can not be deleted, too.
Maybe you need to additionally install another policy to prevent deletion by
the del key also:
installEditPolicy(EditPolicy.COMPONENT_ROLE, new ComponentEditPolicy() {
protected Command getDeleteCommand(GroupRequest request) {
return null;
}
});
HTH
Axel
bachra04 wrote:
> For some reasons I want to make one element non deletable once created,
> Is there a way to do that ?
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.10644 seconds