A Creation Tool for every model/figure? [message #657121] |
Tue, 01 March 2011 11:24  |
Eclipse User |
|
|
|
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 11:27] by Moderator
|
|
|
|
|
Re: A Creation Tool for every model/figure? [message #657843 is a reply to message #657837] |
Fri, 04 March 2011 05:21  |
Eclipse User |
|
|
|
Hello,
Quote: | So I don't need the Creation Tools for the other Elements?
|
Correct
Quote: | So when I delete the Creation Tools from my *.gmftool, will the Commands also be deleted, or will they be untouched?
|
The latter
You may ignore the existing command for Element2, modify command for Element1 as in your sample, and follow steps from my prev reply.
Regards,
Michael
|
|
|
Powered by
FUDForum. Page generated in 0.04060 seconds