Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » CompartmentChildCreateCommand & RepositionEObjectCommand
CompartmentChildCreateCommand & RepositionEObjectCommand [message #233077] Tue, 09 June 2009 12:42
Oelerink is currently offline OelerinkFriend
Messages: 129
Registered: July 2009
Senior Member
Hello,

i have a new CompartmentChildCreateCommand to create child in a
compartment whereever i want. In the gmf diagram its all right, but the
underlying model has another order than the view. So i want to execute a
RepositionEObjectCommand after the CompartmentChildCreateCommand, but i
didn't get the right elements to call new ICommandProxy(new
RepositionEObjectCommand(editingDomain, label, elements, element,
index)).execute(); , especially i cant get the elements and element
values. Can somebody help me?

Here is the code for the CompartmentChildCreateCommand:

public class CompartmentChildCreateCommand extends CreateCommand {

int index;
TransactionalEditingDomain editingDomain;

public CompartmentChildCreateCommand (TransactionalEditingDomain
editingDomain, ViewDescriptor viewDescriptor,
View containerView, int index) {
super(editingDomain, viewDescriptor, containerView);
System.out.println(index);
this.index = index;
this.editingDomain = editingDomain;
}

@SuppressWarnings("deprecation")
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor
monitor, IAdaptable info)
throws ExecutionException {

View view =
ViewService.getInstance().createView(
viewDescriptor.getViewKind(),
viewDescriptor.getElementAdapter(),
containerView,
viewDescriptor.getSemanticHint(),
index,
viewDescriptor.isPersisted(),
viewDescriptor.getPreferencesHint());
Assert.isNotNull(view, "failed to create a view"); //$NON-NLS-1$
viewDescriptor.setView(view);

//Here should the positioning command be called, i think
//new ICommandProxy(new RepositionEObjectCommand(editingDomain, label,
null, view, index)).execute();

return CommandResult.newOKCommandResult(viewDescriptor);
}

}


Can somebody help me?

Thanks in advance
Jörg
Previous Topic:Change location on creation
Next Topic:Context Menu entry does not work when plug-in downloaded and installed
Goto Forum:
  


Current Time: Fri Apr 03 10:47:59 GMT 2020

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

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

Back to the top