Hide/Unhide a node [message #630259] |
Fri, 01 October 2010 06:43  |
Eclipse User |
|
|
|
Hi All,
I am working on a GMF based RCP tool.
Now i have to hide a node and its child node when i double click on that node(can be triggered in any event)
I have installed a new edit policy as
installEditPolicy(EditPolicyRoles.OPEN_ROLE,
createOpenEditPolicy());
and inside the createOpenEditPolicy(), i have done the following,
private OpenEditPolicy createOpenEditPolicy() {
OpenEditPolicy policy = new OpenEditPolicy() {
@Override
protected Command getOpenCommand(Request request) {
IGraphicalEditPart ige = (IGraphicalEditPart) this
.getTargetEditPart(request);
View selectedView = ige.getPrimaryView();
selectedView.setVisible(false);
return null;
}
};
return policy;
}
But the node is hidden only if i refresh the diagram by adding a new node.
Kindly suggest where i went wrong, and let me know how to automatically refresh the diagram.
Regards,
Jeno J
|
|
|
|
|
Re: Hide/Unhide a node [message #630587 is a reply to message #630555] |
Mon, 04 October 2010 05:48  |
Eclipse User |
|
|
|
Now the node is hidden, but the changes are not getting persisted in the diagram file.
It will be helpful if the changes are stored in a file so that we can restore the changes while closing and opening the diagram again.
Regards,
Jeno J
|
|
|
Powered by
FUDForum. Page generated in 0.32357 seconds