To change editparts position programmatically [message #197100] |
Tue, 15 July 2008 09:22  |
Eclipse User |
|
|
|
Hello all,
Can know what is the best way to reposition editparts programmatically.i.e
I have compartment "A" which has children "A1" "B1" in turn compartment
"A1" has children "A1_1" and "A1_2".I would like to move the
editpart(A1_1)progamatically and make it as child for A ,such that A as
now "A1,B1 and A1_1" as children
A
| --- A1 ----A1_1
| |
| |
| |-----A1_2
|
| --- B1
This change should reflect in the domain model and i would also like
retain the layout
I tried using MoveElementsCommand
//snippet
MoveRequest moveRequest = new
MoveRequest(selectedElement.getEditingDomain(), createdModelElement,
listOfContainedElements);
MoveElementsCommand moveCommand = new MoveElementsCommand(moveRequest);
IOperationHistory history =
OperationHistoryFactory.getOperationHistory();
try {
history.execute(moveCommand, new NullProgressMonitor(), null);
} catch (ExecutionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
This changes the model as expected but the existing layout gets altered
I also tried
Command getReparentCommand(ChangeBoundsRequest request,EditPart editPart)
but that also did't work as expected.
|
|
|
|
Powered by
FUDForum. Page generated in 0.09605 seconds