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

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);
this.index = index;
this.editingDomain = editingDomain;

protected CommandResult doExecuteWithResult(IProgressMonitor
monitor, IAdaptable info)
throws ExecutionException {

View view =
Assert.isNotNull(view, "failed to create a view"); //$NON-NLS-1$

//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
Previous Topic:Change location on creation
Next Topic:Context Menu entry does not work when plug-in downloaded and installed
Goto Forum:

Current Time: Tue Mar 02 20:34:15 GMT 2021

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

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

Back to the top