|
Re: Adjust New Diagram Wizard [message #485148 is a reply to message #485063] |
Thu, 10 September 2009 15:42 |
Peter Lang Messages: 153 Registered: July 2009 |
Senior Member |
|
|
Hi Peter,
I did almost the some, only the other way round (define model file, diagram is created automatically).
You should be able to adapt my solution (I tried to change as little as possible, so I use both pages but only display one).
You need to edit your generated part/XxxCreationWizard.java
Unfortunately there is no constant for the file-extensions, so I had to hardcode them.
/**
* @generated NOT
* do not use diagramModelFilePage since we use the same filename for model and diagram (different file extension)
*/
public void addPages() {
domainModelFilePage = new WorkflowCreationWizardPage(
"DomainModelFile", getSelection(), "xxx"); //$NON-NLS-1$ //$NON-NLS-2$
domainModelFilePage
.setTitle(Messages.WorkflowCreationWizard_DomainModelFilePageTitle);
domainModelFilePage
.setDescription(Messages.WorkflowCreationWizard_DomainModelFilePageDescription);
addPage(domainModelFilePage);
}
/**
* @generated NOT
*/
public boolean performFinish() {
IRunnableWithProgress op = new WorkspaceModifyOperation(null) {
protected void execute(IProgressMonitor monitor)
throws CoreException, InterruptedException {
// CUSTOM: do not use diagramModelFilePage since we use the
// same filename for model and diagram (different file extension)
URI domainModelFilePageURI = domainModelFilePage.getURI();
URI diagramModelFilePageURI = domainModelFilePageURI
.trimFileExtension().appendFileExtension("xxx_diagram");
diagram = WorkflowDiagramEditorUtil.createDiagram(
diagramModelFilePageURI, domainModelFilePageURI, monitor);
// end CUSTOM
if (isOpenNewlyCreatedDiagramEditor() && diagram != null) {
[...]
|
|
|
Re: Adjust New Diagram Wizard [message #485824 is a reply to message #485148] |
Tue, 15 September 2009 08:28 |
Peter Thijs Messages: 17 Registered: July 2009 |
Junior Member |
|
|
Hi Peter,
Thank you for your solution. This is exactly what I was looking for.
Peter Lang wrote:
> Hi Peter,
>
> I did almost the some, only the other way round (define model file,
> diagram is created automatically).
>
> You should be able to adapt my solution (I tried to change as little as
> possible, so I use both pages but only display one).
>
> You need to edit your generated part/XxxCreationWizard.java
> Unfortunately there is no constant for the file-extensions, so I had to
> hardcode them.
>
>
> /**
> * @generated NOT
> * do not use diagramModelFilePage since we use the same filename for
> model and diagram (different file extension)
> */
> public void addPages() {
> domainModelFilePage = new WorkflowCreationWizardPage(
> "DomainModelFile", getSelection(), "xxx"); //$NON-NLS-1$
> //$NON-NLS-2$
> domainModelFilePage
>
> .setTitle(Messages.WorkflowCreationWizard_DomainModelFilePag eTitle);
> domainModelFilePage
>
> .setDescription(Messages.WorkflowCreationWizard_DomainModelF ilePageDescription);
>
> addPage(domainModelFilePage);
> }
>
> /**
> * @generated NOT
> */
> public boolean performFinish() {
> IRunnableWithProgress op = new WorkspaceModifyOperation(null) {
>
> protected void execute(IProgressMonitor monitor)
> throws CoreException, InterruptedException {
> // CUSTOM: do not use diagramModelFilePage since we use the
> // same filename for model and diagram (different file
> extension)
> URI domainModelFilePageURI = domainModelFilePage.getURI();
> URI diagramModelFilePageURI = domainModelFilePageURI
> .trimFileExtension().appendFileExtension("xxx_diagram");
> diagram = WorkflowDiagramEditorUtil.createDiagram(
> diagramModelFilePageURI, domainModelFilePageURI,
> monitor);
> // end CUSTOM
> if (isOpenNewlyCreatedDiagramEditor() && diagram != null) {
> [...]
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03563 seconds