A Creation Tool for every model/figure? [message #657121] |
Tue, 01 March 2011 16:24 |
akoeck Messages: 62 Registered: December 2010 |
Member |
|
|
Do I need a Creation Tool for every model respectively figure?
I only want a creation tool for one figure. Because the other figure are depending on the values of the first figure and should be created with the first Figure.
I try to explain this via code:
protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
IAdaptable info) throws ExecutionException {
Element newElement = ModelFactory.eINSTANCE.createElement();
newElement.setValue(SOMEVALUE);
Diagram owner = (Diagram) getElementToEdit();
owner.getElements1().add(newElement);
// this is what I meant - createing the other element in here or is there something else needed?
// or can I just use my other creationtools here, but make the invisible in the editor?
Element2 newElement2 = ModelFactory.eINSTANCE.createElement2();
newElement2.setAttribute(newElement.getInformation());
owner.getElements2().add(newElement2);
doConfigure(newElement, monitor, info);
((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
[Updated on: Tue, 01 March 2011 16:27] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02639 seconds