|
|
|
Re: Diagram properties [message #714464 is a reply to message #714393] |
Wed, 10 August 2011 15:01 |
Hernan Gonzalez Messages: 188 Registered: October 2010 Location: Buenos Aires, Argentina |
Senior Member |
|
|
Ok, I see, changes to the diagram must be transactional (EMF-wise), so something like this works :
final TransactionalEditingDomain ed = TransactionUtil.getEditingDomain(diagram);
ed.getCommandStack().execute(new RecordingCommand(ed) {
protected void doExecute() {
diagram.setGridUnit(myGridUnit);
}
});
This could be used to change the gridsize from some menu (in a Handler). But I don't think this should go inside a DiagramTypeProvider.init() : it would set the property each time a diagram was opened, which is not one would normally want (and besides, it would cause the editor to open always dirty).
To set a diagram property at creation time, i.e., where/how to invoke Graphiti.getPeCreateService().createDiagram(), seems to fit into a bigger task: customize a diagram creation (including, perhaps, a creation Wizard). I have not seen docs about this (perhaps it's not very much Graphiti specific?). I'll take a look into BPMN2DiagramCreator.
|
|
|
|
Re: Diagram properties [message #714783 is a reply to message #714687] |
Thu, 11 August 2011 13:49 |
Hernan Gonzalez Messages: 188 Registered: October 2010 Location: Buenos Aires, Argentina |
Senior Member |
|
|
Tim Kaiser wrote on Thu, 11 August 2011 06:24Hi Hernan,
maybe it is best to do the basic configuration for the diagram
in a place analogous to CreateDiagramWizard#performFinish
in the example.common plugin.
Yes, this seems to be the way. I had totally missed this class...
Thanks!
I'not sure about the example.common plugin : I had assumed that it simply had some "support" classes for the tutorial, but (as far as I see) this CreateDiagramWizard is not used. Is this plugin just a collection of example-utility code, to read-copy-paste? Is one supposed to learn about its contents by just browsing them, or are they used in some other (i.e., apart from the tutorial) Graphiti examples? The plugin is not supposed to be included in a final product, right?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04261 seconds