diff options
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLCreationWizard.java')
-rw-r--r-- | plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLCreationWizard.java | 350 |
1 files changed, 175 insertions, 175 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLCreationWizard.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLCreationWizard.java index dd867e5baf7..d573c748d8c 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLCreationWizard.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.communication/src-gen/org/eclipse/papyrus/uml/diagram/communication/part/UMLCreationWizard.java @@ -1,175 +1,175 @@ -/** - * Copyright (c) 2014 CEA LIST. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - */ -package org.eclipse.papyrus.uml.diagram.communication.part; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.ui.INewWizard; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.actions.WorkspaceModifyOperation; - -/** - * @generated - */ -public class UMLCreationWizard extends Wizard implements INewWizard { - - /** - * @generated - */ - private IWorkbench workbench; - - /** - * @generated - */ - protected IStructuredSelection selection; - - /** - * @generated - */ - protected UMLCreationWizardPage diagramModelFilePage; - - /** - * @generated - */ - protected UMLCreationWizardPage domainModelFilePage; - - /** - * @generated - */ - protected Resource diagram; - - /** - * @generated - */ - private boolean openNewlyCreatedDiagramEditor = true; - - /** - * @generated - */ - public IWorkbench getWorkbench() { - return workbench; - } - - /** - * @generated - */ - public IStructuredSelection getSelection() { - return selection; - } - - /** - * @generated - */ - public final Resource getDiagram() { - return diagram; - } - - /** - * @generated - */ - public final boolean isOpenNewlyCreatedDiagramEditor() { - return openNewlyCreatedDiagramEditor; - } - - /** - * @generated - */ - public void setOpenNewlyCreatedDiagramEditor(boolean openNewlyCreatedDiagramEditor) { - this.openNewlyCreatedDiagramEditor = openNewlyCreatedDiagramEditor; - } - - /** - * @generated - */ - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.workbench = workbench; - this.selection = selection; - setWindowTitle(Messages.UMLCreationWizardTitle); - setDefaultPageImageDescriptor( - UMLDiagramEditorPlugin.getBundledImageDescriptor("icons/wizban/NewUMLWizard.gif")); //$NON-NLS-1$ - setNeedsProgressMonitor(true); - } - - /** - * @generated - */ - @Override - public void addPages() { - diagramModelFilePage = new UMLCreationWizardPage("DiagramModelFile", getSelection(), //$NON-NLS-1$ - "PapyrusUMLCommunication_diagram"); //$NON-NLS-1$ - diagramModelFilePage.setTitle(Messages.UMLCreationWizard_DiagramModelFilePageTitle); - diagramModelFilePage.setDescription(Messages.UMLCreationWizard_DiagramModelFilePageDescription); - addPage(diagramModelFilePage); - - domainModelFilePage = new UMLCreationWizardPage("DomainModelFile", getSelection(), "PapyrusUMLCommunication") { //$NON-NLS-1$ //$NON-NLS-2$ - - @Override - public void setVisible(boolean visible) { - if (visible) { - String fileName = diagramModelFilePage.getFileName(); - fileName = fileName.substring(0, fileName.length() - ".PapyrusUMLCommunication_diagram".length()); //$NON-NLS-1$ - setFileName(UMLDiagramEditorUtil.getUniqueFileName(getContainerFullPath(), fileName, - "PapyrusUMLCommunication")); //$NON-NLS-1$ - } - super.setVisible(visible); - } - }; - domainModelFilePage.setTitle(Messages.UMLCreationWizard_DomainModelFilePageTitle); - domainModelFilePage.setDescription(Messages.UMLCreationWizard_DomainModelFilePageDescription); - addPage(domainModelFilePage); - } - - /** - * @generated - */ - @Override - public boolean performFinish() { - IRunnableWithProgress op = new WorkspaceModifyOperation(null) { - - @Override - protected void execute(IProgressMonitor monitor) throws CoreException, InterruptedException { - diagram = UMLDiagramEditorUtil.createDiagram(diagramModelFilePage.getURI(), - domainModelFilePage.getURI(), monitor); - if (isOpenNewlyCreatedDiagramEditor() && diagram != null) { - try { - UMLDiagramEditorUtil.openDiagram(diagram); - } catch (PartInitException e) { - ErrorDialog.openError(getContainer().getShell(), Messages.UMLCreationWizardOpenEditorError, - null, e.getStatus()); - } - } - } - }; - try { - getContainer().run(false, true, op); - } catch (InterruptedException e) { - return false; - } catch (InvocationTargetException e) { - if (e.getTargetException() instanceof CoreException) { - ErrorDialog.openError(getContainer().getShell(), Messages.UMLCreationWizardCreationError, null, - ((CoreException) e.getTargetException()).getStatus()); - } else { - UMLDiagramEditorPlugin.getInstance().logError("Error creating diagram", e.getTargetException()); //$NON-NLS-1$ - } - return false; - } - return diagram != null; - } -} +/**
+ * Copyright (c) 2014 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.communication.part;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+/**
+ * @generated
+ */
+public class UMLCreationWizard extends Wizard implements INewWizard {
+
+ /**
+ * @generated
+ */
+ private IWorkbench workbench;
+
+ /**
+ * @generated
+ */
+ protected IStructuredSelection selection;
+
+ /**
+ * @generated
+ */
+ protected UMLCreationWizardPage diagramModelFilePage;
+
+ /**
+ * @generated
+ */
+ protected UMLCreationWizardPage domainModelFilePage;
+
+ /**
+ * @generated
+ */
+ protected Resource diagram;
+
+ /**
+ * @generated
+ */
+ private boolean openNewlyCreatedDiagramEditor = true;
+
+ /**
+ * @generated
+ */
+ public IWorkbench getWorkbench() {
+ return workbench;
+ }
+
+ /**
+ * @generated
+ */
+ public IStructuredSelection getSelection() {
+ return selection;
+ }
+
+ /**
+ * @generated
+ */
+ public final Resource getDiagram() {
+ return diagram;
+ }
+
+ /**
+ * @generated
+ */
+ public final boolean isOpenNewlyCreatedDiagramEditor() {
+ return openNewlyCreatedDiagramEditor;
+ }
+
+ /**
+ * @generated
+ */
+ public void setOpenNewlyCreatedDiagramEditor(boolean openNewlyCreatedDiagramEditor) {
+ this.openNewlyCreatedDiagramEditor = openNewlyCreatedDiagramEditor;
+ }
+
+ /**
+ * @generated
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ setWindowTitle(Messages.UMLCreationWizardTitle);
+ setDefaultPageImageDescriptor(
+ UMLDiagramEditorPlugin.getBundledImageDescriptor("icons/wizban/NewUMLWizard.gif")); //$NON-NLS-1$
+ setNeedsProgressMonitor(true);
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public void addPages() {
+ diagramModelFilePage = new UMLCreationWizardPage("DiagramModelFile", getSelection(), //$NON-NLS-1$
+ "PapyrusUMLCommunication_diagram"); //$NON-NLS-1$
+ diagramModelFilePage.setTitle(Messages.UMLCreationWizard_DiagramModelFilePageTitle);
+ diagramModelFilePage.setDescription(Messages.UMLCreationWizard_DiagramModelFilePageDescription);
+ addPage(diagramModelFilePage);
+
+ domainModelFilePage = new UMLCreationWizardPage("DomainModelFile", getSelection(), "PapyrusUMLCommunication") { //$NON-NLS-1$ //$NON-NLS-2$
+
+ @Override
+ public void setVisible(boolean visible) {
+ if (visible) {
+ String fileName = diagramModelFilePage.getFileName();
+ fileName = fileName.substring(0, fileName.length() - ".PapyrusUMLCommunication_diagram".length()); //$NON-NLS-1$
+ setFileName(UMLDiagramEditorUtil.getUniqueFileName(getContainerFullPath(), fileName,
+ "PapyrusUMLCommunication")); //$NON-NLS-1$
+ }
+ super.setVisible(visible);
+ }
+ };
+ domainModelFilePage.setTitle(Messages.UMLCreationWizard_DomainModelFilePageTitle);
+ domainModelFilePage.setDescription(Messages.UMLCreationWizard_DomainModelFilePageDescription);
+ addPage(domainModelFilePage);
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public boolean performFinish() {
+ IRunnableWithProgress op = new WorkspaceModifyOperation(null) {
+
+ @Override
+ protected void execute(IProgressMonitor monitor) throws CoreException, InterruptedException {
+ diagram = UMLDiagramEditorUtil.createDiagram(diagramModelFilePage.getURI(),
+ domainModelFilePage.getURI(), monitor);
+ if (isOpenNewlyCreatedDiagramEditor() && diagram != null) {
+ try {
+ UMLDiagramEditorUtil.openDiagram(diagram);
+ } catch (PartInitException e) {
+ ErrorDialog.openError(getContainer().getShell(), Messages.UMLCreationWizardOpenEditorError,
+ null, e.getStatus());
+ }
+ }
+ }
+ };
+ try {
+ getContainer().run(false, true, op);
+ } catch (InterruptedException e) {
+ return false;
+ } catch (InvocationTargetException e) {
+ if (e.getTargetException() instanceof CoreException) {
+ ErrorDialog.openError(getContainer().getShell(), Messages.UMLCreationWizardCreationError, null,
+ ((CoreException) e.getTargetException()).getStatus());
+ } else {
+ UMLDiagramEditorPlugin.getInstance().logError("Error creating diagram", e.getTargetException()); //$NON-NLS-1$
+ }
+ return false;
+ }
+ return diagram != null;
+ }
+}
|