CompartmentChildCreateCommand & RepositionEObjectCommand [message #233077] |
Tue, 09 June 2009 12:42 |
Oelerink 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
|
|
|
Powered by
FUDForum. Page generated in 0.02970 seconds