Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard')
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/CreateFacetSetWizard.java240
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/WizardFactory.java40
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/CreateFacetSetWizardPage.java109
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/FacetSetPropertyWizardPage.java120
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedCreateFacetSetWizardPage.java70
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedFacetSetPropertyWizardPage.java80
6 files changed, 659 insertions, 0 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/CreateFacetSetWizard.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/CreateFacetSetWizard.java
new file mode 100644
index 00000000000..65ecfefb22c
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/CreateFacetSetWizard.java
@@ -0,0 +1,240 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.facet.efacet.core.IFacetActions;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.EFacetPackage;
+import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.FacetSet;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Activator;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.WorkbenchUtils;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.ICreateFacetSetWizardPage;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.IFacetSetPropertyWizardPage;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard.page.CreateFacetSetWizardPage;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard.page.FacetSetPropertyWizardPage;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard.page.SynchronizedCreateFacetSetWizardPage;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard.page.SynchronizedFacetSetPropertyWizardPage;
+import org.eclipse.emf.facet.util.core.Logger;
+import org.eclipse.emf.facet.util.ui.internal.exported.wizard.IExtendedWizard;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+/**
+ * Wizard for the creation of the "ecore" file with the main facetSet.
+ */
+public class CreateFacetSetWizard extends Wizard implements INewWizard,
+ IExtendedWizard {
+
+ private WizardDialog dialog;
+
+ private IStructuredSelection selection;
+ private IWorkbench workbench;
+ private final ICreateFacetSetWizardPage facetSetWizard;
+ private final IFacetSetPropertyWizardPage propertyWizard;
+
+ private boolean openFacetSet = true;
+
+ public CreateFacetSetWizard() {
+ this(PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+ .getSelectionService().getSelection());
+ }
+
+ public CreateFacetSetWizard(final ISelection selection,
+ final boolean openFacetSet) {
+ this(selection);
+ this.openFacetSet = openFacetSet;
+ }
+
+ public CreateFacetSetWizard(final ISelection selection) {
+ super();
+ if (selection instanceof IStructuredSelection) {
+ this.selection = (IStructuredSelection) selection;
+ }
+ setWindowTitle(Messages.Create_FacetSet_Model);
+
+ this.facetSetWizard = new CreateFacetSetWizardPage(
+ "Whatever", this.selection); //$NON-NLS-1$
+ this.propertyWizard = new FacetSetPropertyWizardPage("Whatever"); //$NON-NLS-1$
+
+ }
+
+ @Override
+ public void addPages() {
+ addPage(this.facetSetWizard);
+ addPage(this.propertyWizard);
+ }
+
+ public int open() {
+ this.dialog = new WizardDialog(Display.getDefault().getShells()[0],
+ this);
+ int result = Window.CANCEL;
+
+ if (this.dialog != null) {
+ result = this.dialog.open();
+ }
+ return result;
+ }
+
+ @Override
+ public boolean performFinish() {
+ boolean result = false;
+
+ if (this.propertyWizard.isPageComplete()) {
+ try {
+ // Remember the file.
+ final IFile modelFile = getModelFile();
+
+ // Do the work within an operation.
+ final WorkspaceModifyOperation operation = createOperation(modelFile);
+
+ getContainer().run(false, false, operation);
+
+ if (this.openFacetSet) {
+ // Select the new file resource in the current view.
+ final IWorkbenchWindow workbenchWindow = selectWorkbenchWindow();
+ final IWorkbenchPage page = WorkbenchUtils.selectNewFile(
+ modelFile,
+ workbenchWindow);
+
+ WorkbenchUtils.openNewFile(modelFile, this.workbench,
+ workbenchWindow,
+ page);
+ }
+
+ result = true;
+ } catch (final Exception exception) {
+ Logger.logError(exception, Activator.getDefault());
+ }
+ }
+
+ return result;
+ }
+
+ protected IWorkbenchWindow selectWorkbenchWindow() {
+ if (this.workbench == null) {
+ this.workbench = PlatformUI.getWorkbench();
+ }
+ final IWorkbenchWindow workbenchWindow = this.workbench
+ .getActiveWorkbenchWindow();
+ return workbenchWindow;
+ }
+
+ protected WorkspaceModifyOperation createOperation(final IFile modelFile) {
+ final WorkspaceModifyOperation operation = new WorkspaceModifyOperation() {
+ @Override
+ protected void execute(final IProgressMonitor progressMonitor) {
+ try {
+ final FacetSet facetSet = createInitialFacet();
+ IFacetActions.INSTANCE.saveFacetSet(facetSet, modelFile);
+ } catch (final Exception exception) {
+ Logger.logError(exception, Activator.getDefault());
+ } finally {
+ progressMonitor.done();
+ }
+ }
+ };
+ return operation;
+ }
+
+
+
+ @Override
+ public boolean canFinish() {
+ return (getContainer().getCurrentPage() == this.propertyWizard)
+ && this.propertyWizard.isPageComplete();
+ }
+
+ public void init(final IWorkbench newWorkbench,
+ final IStructuredSelection newSelection) {
+ this.workbench = newWorkbench;
+ this.selection = newSelection;
+ }
+
+ protected FacetSet createInitialFacet() {
+ final FacetSet facetSet = EFacetPackage.eINSTANCE.getEFacetFactory()
+ .createFacetSet();
+ final String modelFacetSetName = getModelFile().getName().replaceAll(
+ ".efacet", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ facetSet.setName(modelFacetSetName);
+ facetSet.setNsURI(this.propertyWizard.getNsUri());
+ facetSet.setNsPrefix(this.propertyWizard.getPrefix());
+ return facetSet;
+ }
+
+ public IFile getModelFile() {
+ return this.facetSetWizard.getModelFile();
+ }
+
+ public IFacetSetPropertyWizardPage getPropertyWizard() {
+ return this.propertyWizard;
+ }
+
+ public IWizardPage next() {
+ final IWizardPage nextPage = getNextPage(getContainer()
+ .getCurrentPage());
+ this.dialog.showPage(nextPage);
+ return getSynchronizedPage(nextPage);
+
+ }
+
+ public IWizardPage previous() {
+ final IWizardPage previousPage = getPreviousPage(getContainer()
+ .getCurrentPage());
+ this.dialog.showPage(previousPage);
+ return getSynchronizedPage(previousPage);
+ }
+
+ public boolean finish() {
+ final boolean result = performFinish();
+ dispose();
+ setContainer(null);
+ getDialog().close();
+ return result;
+ }
+
+ public ICreateFacetSetWizardPage getFacetSetWizard() {
+ return this.facetSetWizard;
+ }
+
+ public WizardDialog getDialog() {
+ return this.dialog;
+ }
+
+ public IWizardPage getCurrentPage() {
+ return getSynchronizedPage(getContainer().getCurrentPage());
+ }
+
+ private static IWizardPage getSynchronizedPage(final IWizardPage page) {
+ IWizardPage result = null;
+ if (page instanceof ICreateFacetSetWizardPage) {
+ result = new SynchronizedCreateFacetSetWizardPage(
+ (ICreateFacetSetWizardPage) page, Display.getDefault());
+ } else if (page instanceof IFacetSetPropertyWizardPage) {
+ result = new SynchronizedFacetSetPropertyWizardPage(
+ (IFacetSetPropertyWizardPage) page, Display.getDefault());
+ }
+ return result;
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/WizardFactory.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/WizardFactory.java
new file mode 100644
index 00000000000..a45f6a4e574
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/WizardFactory.java
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.wizard.IWizardFactory;
+import org.eclipse.emf.facet.util.ui.internal.exported.util.wizard.SynchronizedWizard;
+import org.eclipse.emf.facet.util.ui.internal.exported.wizard.IExtendedWizard;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Concrete implementation of {@link IWizardFactory}.
+ *
+ * @see IWizardFactory
+ */
+public class WizardFactory implements IWizardFactory {
+
+ public IExtendedWizard createCreateFacetSetWizard(
+ final ISelection selection) {
+ final CreateFacetSetWizard wizard = new CreateFacetSetWizard(
+ selection);
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ wizard.open();
+ }
+ });
+ return new SynchronizedWizard<IExtendedWizard>(wizard,
+ Display.getDefault());
+ }
+
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/CreateFacetSetWizardPage.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/CreateFacetSetWizardPage.java
new file mode 100644
index 00000000000..2871d22fade
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/CreateFacetSetWizardPage.java
@@ -0,0 +1,109 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * 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:
+ * Nicolas Guyomar (Mia-Software) - Bug 349546 - EMF Facet facetSet editor
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard.page;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Activator;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.ICreateFacetSetWizardPage;
+import org.eclipse.emf.facet.util.core.Logger;
+//import org.eclipse.emf.facet.util.core.internal.exported.PluginUtils;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
+
+public class CreateFacetSetWizardPage extends WizardNewFileCreationPage
+ implements ICreateFacetSetWizardPage {
+
+ private static final String FILE_EXTENSION = "efacet"; //$NON-NLS-1$
+ private static final String MODEL_BASE = "My"; //$NON-NLS-1$
+
+ public CreateFacetSetWizardPage(final String pageId,
+ final IStructuredSelection selection) {
+ super(pageId, selection);
+ setTitle(Messages.CreateFacetSetWizardImpl_FacetModel);
+ setDescription(Messages.CreateFacetSetWizardImpl_Create_new_facet_Set);
+ setFileName(MODEL_BASE + "." + CreateFacetSetWizardPage.FILE_EXTENSION); //$NON-NLS-1$
+ // Try and get the resource selection to determine a current directory
+ // for the file dialog.
+ if ((selection != null) && !selection.isEmpty()) {
+ // Get the resource...
+ getResource(selection);
+ }
+ }
+
+ private void getResource(final IStructuredSelection selection) {
+ final Object selectedElement = selection.iterator().next();
+ if (selectedElement instanceof IResource) {
+ // Get the resource parent, if its a file.
+ IResource selectedResource = (IResource) selectedElement;
+ if (selectedResource.getType() == IResource.FILE) {
+ selectedResource = selectedResource.getParent();
+ }
+ // This gives us a directory...
+ if ((selectedResource instanceof IFolder)
+ || (selectedResource instanceof IProject)) {
+ // Set this for the container.
+ setContainerFullPath(selectedResource.getFullPath());
+ // Make up a unique new name here.
+ final String modelFileExt = CreateFacetSetWizardPage.FILE_EXTENSION;
+ String modelFilename = MODEL_BASE + "." + modelFileExt; //$NON-NLS-1$
+ for (int i = 1; ((IContainer) selectedResource)
+ .findMember(modelFilename) != null; ++i) {
+ modelFilename = MODEL_BASE + i + "." + modelFileExt; //$NON-NLS-1$
+ }
+ setFileName(modelFilename);
+ }
+ }
+ }
+
+ @Override
+ protected boolean validatePage() {
+ boolean valid = super.validatePage();
+
+ if (valid) {
+ final String extension = new Path(getFileName()).getFileExtension();
+ if ((extension == null)
+ || !CreateFacetSetWizardPage.FILE_EXTENSION
+ .equalsIgnoreCase(extension)) {
+ setErrorMessage(Messages.CreateFacetSetWizardImpl_File_extension_restriction);
+ valid = false;
+ }
+ final IPath containerFullPath = getContainerFullPath();
+// try {
+// if (!PluginUtils.isInPluginProject(containerFullPath)) {
+// setMessage(
+// Messages.CreateFacetSetWizardPage_Not_a_Plugin_project,
+// IMessageProvider.WARNING);
+// }
+// } catch (final CoreException e) {
+// Logger.logError(e, Activator.getDefault());
+// }
+ }
+
+ return valid;
+ }
+
+ public IFile getModelFile() {
+ return ResourcesPlugin.getWorkspace().getRoot()
+ .getFile(getContainerFullPath().append(getFileName()));
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/FacetSetPropertyWizardPage.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/FacetSetPropertyWizardPage.java
new file mode 100644
index 00000000000..03a320e5b79
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/FacetSetPropertyWizardPage.java
@@ -0,0 +1,120 @@
+/**
+ * Copyright (c) 2011 Mia-Software.
+ *
+ * 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:
+ * Nicolas Guyomar (Mia-Software) - Bug 349546 - EMF Facet facetSet editor
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard.page;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.Messages;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.IFacetSetPropertyWizardPage;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Wizard page to enter a NsURI, a prefix and an extended EPackage to a facetSet
+ */
+public class FacetSetPropertyWizardPage extends WizardPage
+ implements IFacetSetPropertyWizardPage {
+
+ private transient Text nsUriTextField;
+ private transient Text prefixTextField;
+
+ public FacetSetPropertyWizardPage(final String pageName) {
+ super(pageName);
+
+ setTitle(Messages.FacetSetPropertyWizardPage_facet_properties);
+ }
+
+ public void createControl(final Composite parent) {
+
+ final Composite nsURiContainer = new Composite(parent, SWT.NONE);
+ nsURiContainer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ nsURiContainer.setLayout(new GridLayout(2, false));
+
+ // NsURI
+ final Label nsUriLabel = new Label(nsURiContainer, SWT.NONE);
+ nsUriLabel.setText(Messages.Enter_a_nsUri);
+ this.nsUriTextField = new Text(nsURiContainer, SWT.BORDER | SWT.SINGLE);
+ this.nsUriTextField
+ .setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ this.nsUriTextField.addListener(SWT.Modify, new Listener() {
+ public void handleEvent(final Event event) {
+ updateButtons();
+ }
+ });
+
+ // PREFIX
+ final Label prefixLabel = new Label(nsURiContainer, SWT.NONE);
+ prefixLabel.setText(Messages.Enter_a_prefix);
+ this.prefixTextField = new Text(nsURiContainer, SWT.BORDER | SWT.SINGLE);
+ this.prefixTextField.setLayoutData(new GridData(
+ GridData.FILL_HORIZONTAL));
+ this.prefixTextField.addListener(SWT.Modify, new Listener() {
+ public void handleEvent(final Event event) {
+ updateButtons();
+ }
+ });
+
+ setControl(nsURiContainer);
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ boolean result = false;
+
+ if (this.nsUriTextField.getText().length() == 0) {
+ setErrorMessage(Messages.Please_enter_nsUri);
+ }
+
+ if (this.prefixTextField.getText().length() == 0) {
+ setErrorMessage(Messages.Please_enter_prefix);
+ }
+
+ if (super.isPageComplete()) {
+ setErrorMessage(null);
+ result = true;
+ } else {
+ setErrorMessage(Messages.Please_select_EPackage);
+ }
+
+ return result;
+ }
+
+ public void setIsPageComplete(final boolean complete) {
+ this.setPageComplete(complete);
+ }
+
+ protected void updateButtons() {
+ getContainer().updateButtons();
+ }
+
+ public void setNsUri(final String nsUri) {
+ this.nsUriTextField.setText(nsUri);
+ }
+
+ public void setPrefix(final String prefix) {
+ this.prefixTextField.setText(prefix);
+ }
+
+ public String getNsUri() {
+ return this.nsUriTextField.getText();
+ }
+
+ public String getPrefix() {
+ return this.prefixTextField.getText();
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedCreateFacetSetWizardPage.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedCreateFacetSetWizardPage.java
new file mode 100644
index 00000000000..814c074d29f
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedCreateFacetSetWizardPage.java
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard.page;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.ICreateFacetSetWizardPage;
+import org.eclipse.emf.facet.util.emf.ui.internal.exported.util.wizard.page.SynchronizedWizardPage;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractVoidExceptionFreeRunnable;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Synchronized class for safe run.
+ */
+public class SynchronizedCreateFacetSetWizardPage extends
+ SynchronizedWizardPage<ICreateFacetSetWizardPage> implements
+ ICreateFacetSetWizardPage {
+
+ /**
+ * Constructor.
+ *
+ * @param object
+ * the to synchronized.
+ * @param display
+ * the display.
+ */
+ public SynchronizedCreateFacetSetWizardPage(
+ final ICreateFacetSetWizardPage object, final Display display) {
+ super(object, display);
+ }
+
+ public IFile getModelFile() {
+ return this.safeSyncExec(new AbstractExceptionFreeRunnable<IFile>() {
+ @Override
+ public IFile safeRun() {
+ return SynchronizedCreateFacetSetWizardPage.this
+ .getSynchronizedObject().getModelFile();
+ }
+ });
+ }
+
+ public String getFileName() {
+ return this.safeSyncExec(new AbstractExceptionFreeRunnable<String>() {
+ @Override
+ public String safeRun() {
+ return SynchronizedCreateFacetSetWizardPage.this
+ .getSynchronizedObject().getFileName();
+ }
+ });
+ }
+
+ public void setFileName(final String fileName) {
+ this.voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedCreateFacetSetWizardPage.this
+ .getSynchronizedObject().setFileName(fileName);
+ }
+ });
+ }
+}
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedFacetSetPropertyWizardPage.java b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedFacetSetPropertyWizardPage.java
new file mode 100644
index 00000000000..76652db4bcc
--- /dev/null
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.efacet.sdk.ui/src/org/eclipse/papyrus/emf/facet/efacet/sdk/ui/internal/wizard/page/SynchronizedFacetSetPropertyWizardPage.java
@@ -0,0 +1,80 @@
+/**
+ * Copyright (c) 2012 Mia-Software.
+ *
+ * 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:
+ * Alban Ménager (Soft-Maint) - Bug 387470 - [EFacet][Custom] Editors
+ */
+package org.eclipse.emf.facet.efacet.sdk.ui.internal.wizard.page;
+
+import org.eclipse.emf.facet.efacet.sdk.ui.internal.exported.wizard.page.IFacetSetPropertyWizardPage;
+import org.eclipse.emf.facet.util.emf.ui.internal.exported.util.wizard.page.SynchronizedWizardPage;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractExceptionFreeRunnable;
+import org.eclipse.emf.facet.util.ui.internal.exported.displaysync.AbstractVoidExceptionFreeRunnable;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Synchronized class for safe run.
+ */
+public class SynchronizedFacetSetPropertyWizardPage extends
+ SynchronizedWizardPage<IFacetSetPropertyWizardPage> implements
+ IFacetSetPropertyWizardPage {
+
+ /**
+ * Constructor.
+ *
+ * @param object
+ * the to synchronized.
+ * @param display
+ * the display.
+ */
+ public SynchronizedFacetSetPropertyWizardPage(
+ final IFacetSetPropertyWizardPage object, final Display display) {
+ super(object, display);
+ }
+
+ public String getNsUri() {
+ return this.safeSyncExec(new AbstractExceptionFreeRunnable<String>() {
+ @Override
+ public String safeRun() {
+ return SynchronizedFacetSetPropertyWizardPage.this
+ .getSynchronizedObject().getNsUri();
+ }
+ });
+ }
+
+ public void setNsUri(final String nsUri) {
+ this.voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedFacetSetPropertyWizardPage.this
+ .getSynchronizedObject().setNsUri(nsUri);
+ }
+ });
+ }
+
+ public String getPrefix() {
+ return this.safeSyncExec(new AbstractExceptionFreeRunnable<String>() {
+ @Override
+ public String safeRun() {
+ return SynchronizedFacetSetPropertyWizardPage.this
+ .getSynchronizedObject().getPrefix();
+ }
+ });
+ }
+
+ public void setPrefix(final String prefix) {
+ this.voidExceptionFreeRunnable(new AbstractVoidExceptionFreeRunnable() {
+ @Override
+ public void voidSafeRun() {
+ SynchronizedFacetSetPropertyWizardPage.this
+ .getSynchronizedObject().setPrefix(prefix);
+ }
+ });
+ }
+
+}

Back to the top