Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Modify model when a connection is created
Modify model when a connection is created [message #662850] Fri, 01 April 2011 08:40
Hoang Tran is currently offline Hoang TranFriend
Messages: 3
Registered: January 2011
Junior Member
Hi guys,
I have 2 nodes : A, B and a connection A_B.
I want to initialize connection's properties when user connect node A -> node B.
I have try to install an EditPolicy in A_BConnectionEditPart but it is not successful.
Do I miss something ?
	/**
	 * @generated NOT
	 */
	protected void createDefaultEditPolicies() {
		installEditPolicy(ConnectionEditPolicy.CONNECTION_ROLE,new CreationEditPolicy(){
			protected Command getCreateCommand(CreateViewRequest request) {
			      return new ICommandProxy(new BindingCommand(getEditingDomain())
				      {
					  		protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException 
					  		{
					  			// Property source code to initialize connection's properties is in HERE
								return CommandResult.newOKCommandResult();
							}				    	  
				      }
			      );
			   }
		});
	}

	/**
	 * @generated NOT
	 */
	private static class BindingCommand extends AbstractTransactionalCommand {
		public BindingCommand(TransactionalEditingDomain editingDomain) {
			super(editingDomain, "Initialize BindingCommand", null);
		}

		protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
				IAdaptable info) throws ExecutionException {
			return CommandResult.newOKCommandResult();
		}
	}
Previous Topic:[Zest] Layer for a grid
Next Topic:Lock Lines in TextEditor
Goto Forum:
  


Current Time: Tue Apr 23 14:16:20 GMT 2024

Powered by FUDForum. Page generated in 0.02948 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top