Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Delete Connection of a Node Programmatically
Delete Connection of a Node Programmatically [message #1006664] Fri, 01 February 2013 06:13 Go to previous message
Daniel König is currently offline Daniel König
Messages: 24
Registered: November 2012
Junior Member
Hello!

I have a structure like this:
Node A ---(1)---> Node B ---(2)---> Node C

If I delete connection (1) I would like to also delete connection (2) between node B and C. The connections are of a different type.

Does anybody know a solution how to access and delete connection (2)?
Thank you very much!



Here is the remove of Connection (1) (after the confirmation of a dialog):
protected Command getDestroyElementCommand(DestroyElementRequest req) {
	DestroyElementCommand cmd = new DestroyElementCommand(req) {
		@Override
		protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
			Shell shell = new Shell(SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL);
			boolean result = MessageDialog.openQuestion(shell, Messages.StateTransitionDeleteQuestionTitle, Messages.StateTransitionDeleteQuestion);

			if (result) {
				// OK Button selected
				return super.doExecuteWithResult(monitor, info);
			} else {
				// Cancel Button selected
				return CommandResult.newCancelledCommandResult();
			}
		}
	};
	return getGEFWrapper(cmd);
}
 
Read Message
Read Message
Read Message
Previous Topic:Where is my editing domain set to null
Next Topic:Updating existing diagrams when model changes
Goto Forum:
  


Current Time: Wed May 22 20:41:58 EDT 2013

Powered by FUDForum. Page generated in 0.07726 seconds