diff options
author | Christian W. Damus | 2016-02-11 02:48:20 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2016-02-12 15:31:41 +0000 |
commit | ecd4928b327f5561364c5068c9ff5f1668e92d13 (patch) | |
tree | 7c34f46cf82a1d65ac753fa92c2a5d55371b8dba /plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus | |
parent | 751a204d74e15eb2db6b41c937691fc56dcc1252 (diff) | |
download | org.eclipse.papyrus-ecd4928b327f5561364c5068c9ff5f1668e92d13.tar.gz org.eclipse.papyrus-ecd4928b327f5561364c5068c9ff5f1668e92d13.tar.xz org.eclipse.papyrus-ecd4928b327f5561364c5068c9ff5f1668e92d13.zip |
Bug 485220: [Architecture] Provide a more modular architecture
https://bugs.eclipse.org/bugs/show_bug.cgi?id=485220
Factor UI dependencies out of the UML Element Types bundle. This includes
moving some advices that interact with the user into a new
org.eclipse.papyrus.uml.service.types.ui bundle.
Pull up the PasteCommandService and IPasteCommandProvider API into the
Infra Diagram layer where the extension point is defined. Deprecate the
old API in the UML layer.
Introduce a service for participation of languages in CSS styling:
* styling reset actions in the Reset Style command
* access to semantic model classes and properties to make available to CSS
Factor PapyrusObservableValue and cohorts out of the UML Tools bundle
into the Infra Layer for more general reuse and to relieve the
Diagram Infrastructure layer of UML dependencies. The old API remains as
deprecated.
Remove the Infra Diagram Layer dependency on UML Layer for property
testers governing deletion in the diagram. Includes introduction of
a new IGraphicalDeletionHelper OSGi service for delegation of the
determination of whether an element can be deleted from the diagram and
replacement of the XML expression properties
* org.eclipse.papyrus.uml.diagram.common.isSemanticDeletion
* org.eclipse.papyrus.uml.diagram.common.isReadOnly
by
* org.eclipse.papyrus.infra.gmfdiag.common.isSemanticDeletion
* org.eclipse.papyrus.infra.gmfdiag.common.canDelete
(where the latter is the negation of the property that it supersedes)
Extract UML dependencies from the Diagram Outline and CSS Editor bundles.
Remove unused MDTUtil APIs that referenced a UML-specific annotation.
Move the Diagram Infrastructure CSS Palette bundle into the UML layer because it
serves to provide extensions on the Palette Service, which is an overtly
UML-specific capability.
All client APIs for the Properties View are moved from
org.eclipse.papyrus.views.properties bundle to a new
org.eclipse.papyrus.infra.properties.ui bundle. This
includes renaming of:
* extension points
* label-provider contexts
* XWT namespaces
Add an "all UI tests" suite.
Define a componentized hierarchical build layout of the main plug-ins
Change-Id: I43f8f3644857a18b69715f5a2f1da9b1cf286d67
Diffstat (limited to 'plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus')
10 files changed, 242 insertions, 242 deletions
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/StyleSheetFactory.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/StyleSheetFactory.java index 708bc39b6a7..dcc8af32a7d 100644 --- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/StyleSheetFactory.java +++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/StyleSheetFactory.java @@ -1,75 +1,75 @@ -/*****************************************************************************
- * Copyright (c) 2012 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:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.infra.gmfdiag.css.properties.creation;
-
-import java.util.Collection;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
-import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage;
-import org.eclipse.papyrus.infra.widgets.creation.IAtomicOperationExecutor;
-import org.eclipse.papyrus.views.properties.creation.EcorePropertyEditorFactory;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * A Factory for creating StyleSheets directly in the resource. It is not
- * contained in an EObject.
- *
- * @author Camille Letavernier
- */
-public class StyleSheetFactory extends EcorePropertyEditorFactory {
-
- protected View context;
-
- public StyleSheetFactory(View context) {
- super(NotationPackage.eINSTANCE.getEObjectListValueStyle_EObjectListValue());
- this.type = StylesheetsPackage.eINSTANCE.getStyleSheet();
- this.context = context;
- }
-
- @Override
- protected EObject createObjectInDifferentContainer(Control widget) {
- // The EObject is simply created ; it isn't stored anywhere (yet)
- // @see #validateObjects(Collection)
- return simpleCreateObject(widget);
- }
-
- /**
- * @see org.eclipse.papyrus.views.properties.creation.PropertyEditorFactory#getOperationExecutor(java.lang.Object)
- *
- * @param context
- * @return
- */
- @Override
- public IAtomicOperationExecutor getOperationExecutor(Object context) {
- if (context instanceof StyleSheet) {
- StyleSheet stylesheet = (StyleSheet) context;
- if (stylesheet.eResource() == null) {
- // Bug 468345: Use the current Notation::view instead, since we're creating the stylesheet in this object's resource
- // Ensure that further edition occurs in a proper nested transaction
- return super.getOperationExecutor(this.context);
- }
- }
-
- return super.getOperationExecutor(context);
- }
-
- /**
- * Return the objects as-is. The factory is not responsible for storing them
- */
- @Override
- public Collection<Object> validateObjects(Collection<Object> objectsToValidate) {
- return objectsToValidate;
- }
-}
+/***************************************************************************** + * Copyright (c) 2012 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: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.infra.gmfdiag.css.properties.creation; + +import java.util.Collection; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.gmf.runtime.notation.NotationPackage; +import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet; +import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage; +import org.eclipse.papyrus.infra.properties.ui.creation.EcorePropertyEditorFactory; +import org.eclipse.papyrus.infra.widgets.creation.IAtomicOperationExecutor; +import org.eclipse.swt.widgets.Control; + +/** + * A Factory for creating StyleSheets directly in the resource. It is not + * contained in an EObject. + * + * @author Camille Letavernier + */ +public class StyleSheetFactory extends EcorePropertyEditorFactory { + + protected View context; + + public StyleSheetFactory(View context) { + super(NotationPackage.eINSTANCE.getEObjectListValueStyle_EObjectListValue()); + this.type = StylesheetsPackage.eINSTANCE.getStyleSheet(); + this.context = context; + } + + @Override + protected EObject createObjectInDifferentContainer(Control widget) { + // The EObject is simply created ; it isn't stored anywhere (yet) + // @see #validateObjects(Collection) + return simpleCreateObject(widget); + } + + /** + * @see org.eclipse.papyrus.infra.properties.ui.creation.PropertyEditorFactory#getOperationExecutor(java.lang.Object) + * + * @param context + * @return + */ + @Override + public IAtomicOperationExecutor getOperationExecutor(Object context) { + if (context instanceof StyleSheet) { + StyleSheet stylesheet = (StyleSheet) context; + if (stylesheet.eResource() == null) { + // Bug 468345: Use the current Notation::view instead, since we're creating the stylesheet in this object's resource + // Ensure that further edition occurs in a proper nested transaction + return super.getOperationExecutor(this.context); + } + } + + return super.getOperationExecutor(context); + } + + /** + * Return the objects as-is. The factory is not responsible for storing them + */ + @Override + public Collection<Object> validateObjects(Collection<Object> objectsToValidate) { + return objectsToValidate; + } +} diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/ThemePropertyEditorFactory.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/ThemePropertyEditorFactory.java index e1ac9e8cbc3..35187f16e46 100644 --- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/ThemePropertyEditorFactory.java +++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/creation/ThemePropertyEditorFactory.java @@ -15,7 +15,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.Theme; -import org.eclipse.papyrus.views.properties.creation.EcorePropertyEditorFactory; +import org.eclipse.papyrus.infra.properties.ui.creation.EcorePropertyEditorFactory; import org.eclipse.swt.widgets.Control; @@ -38,7 +38,7 @@ public class ThemePropertyEditorFactory extends EcorePropertyEditorFactory { /** - * @see org.eclipse.papyrus.views.properties.creation.EcorePropertyEditorFactory#simpleCreateObject(org.eclipse.swt.widgets.Control) + * @see org.eclipse.papyrus.infra.properties.ui.creation.EcorePropertyEditorFactory#simpleCreateObject(org.eclipse.swt.widgets.Control) * * @param widget * @return diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/dialog/CSSThemeEditionDialog.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/dialog/CSSThemeEditionDialog.java index 101605646f7..dca1f8f0cd0 100644 --- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/dialog/CSSThemeEditionDialog.java +++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/dialog/CSSThemeEditionDialog.java @@ -46,6 +46,7 @@ import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsFactory; import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage; import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.Theme; import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.WorkspaceThemes; +import org.eclipse.papyrus.infra.properties.ui.creation.EcorePropertyEditorFactory; import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService; import org.eclipse.papyrus.infra.services.labelprovider.service.impl.LabelProviderServiceImpl; import org.eclipse.papyrus.infra.ui.emf.providers.EMFContentProvider; @@ -57,7 +58,6 @@ import org.eclipse.papyrus.infra.widgets.providers.CollectionContentProvider; import org.eclipse.papyrus.infra.widgets.providers.WorkspaceContentProvider; import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector; import org.eclipse.papyrus.infra.widgets.util.FileUtil; -import org.eclipse.papyrus.views.properties.creation.EcorePropertyEditorFactory; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSPreferencesModelElement.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSPreferencesModelElement.java index 818b236c1db..d2920c44562 100644 --- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSPreferencesModelElement.java +++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSPreferencesModelElement.java @@ -1,35 +1,35 @@ -/*****************************************************************************
- * Copyright (c) 2012 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:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.infra.gmfdiag.css.properties.modelelement;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.papyrus.infra.gmfdiag.css.preferences.ThemePreferences;
-import org.eclipse.papyrus.infra.gmfdiag.css.properties.provider.CSSThemeLabelProvider;
-import org.eclipse.papyrus.infra.properties.contexts.DataContextElement;
-import org.eclipse.papyrus.views.properties.modelelement.PreferencesModelElement;
-
-
-public class CSSPreferencesModelElement extends PreferencesModelElement {
-
- public CSSPreferencesModelElement(DataContextElement context) {
- super(context);
- }
-
- @Override
- public ILabelProvider getLabelProvider(String propertyPath) {
- if (ThemePreferences.CURRENT_THEME.equals(propertyPath)) {
- return new CSSThemeLabelProvider();
- }
- return super.getLabelProvider(propertyPath);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012 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: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + *****************************************************************************/ +package org.eclipse.papyrus.infra.gmfdiag.css.properties.modelelement; + +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.papyrus.infra.gmfdiag.css.preferences.ThemePreferences; +import org.eclipse.papyrus.infra.gmfdiag.css.properties.provider.CSSThemeLabelProvider; +import org.eclipse.papyrus.infra.properties.contexts.DataContextElement; +import org.eclipse.papyrus.infra.properties.ui.modelelement.PreferencesModelElement; + + +public class CSSPreferencesModelElement extends PreferencesModelElement { + + public CSSPreferencesModelElement(DataContextElement context) { + super(context); + } + + @Override + public ILabelProvider getLabelProvider(String propertyPath) { + if (ThemePreferences.CURRENT_THEME.equals(propertyPath)) { + return new CSSThemeLabelProvider(); + } + return super.getLabelProvider(propertyPath); + } + +} diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSPreferencesModelElementFactory.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSPreferencesModelElementFactory.java index 76bf00b0eb6..ad77722d18b 100644 --- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSPreferencesModelElementFactory.java +++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSPreferencesModelElementFactory.java @@ -1,27 +1,27 @@ -/*****************************************************************************
- * Copyright (c) 2012, 2014 CEA LIST and others.
- *
- * 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:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- * Christian W. Damus (CEA) - bug 417409
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.gmfdiag.css.properties.modelelement;
-
-import org.eclipse.papyrus.infra.properties.contexts.DataContextElement;
-import org.eclipse.papyrus.views.properties.modelelement.PreferencesModelElement;
-import org.eclipse.papyrus.views.properties.modelelement.PreferencesModelElementFactory;
-
-
-public class CSSPreferencesModelElementFactory extends PreferencesModelElementFactory {
-
- @Override
- protected PreferencesModelElement doCreateFromSource(Object sourceElement, DataContextElement context) {
- return new CSSPreferencesModelElement(context);
- }
-}
+/***************************************************************************** + * Copyright (c) 2012, 2014 CEA LIST and others. + * + * 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: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + * Christian W. Damus (CEA) - bug 417409 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.gmfdiag.css.properties.modelelement; + +import org.eclipse.papyrus.infra.properties.contexts.DataContextElement; +import org.eclipse.papyrus.infra.properties.ui.modelelement.PreferencesModelElement; +import org.eclipse.papyrus.infra.properties.ui.modelelement.PreferencesModelElementFactory; + + +public class CSSPreferencesModelElementFactory extends PreferencesModelElementFactory { + + @Override + protected PreferencesModelElement doCreateFromSource(Object sourceElement, DataContextElement context) { + return new CSSPreferencesModelElement(context); + } +} diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSThemesModelElement.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSThemesModelElement.java index 7e64efad235..b9a164efc99 100644 --- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSThemesModelElement.java +++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSThemesModelElement.java @@ -18,7 +18,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.papyrus.infra.gmfdiag.css.properties.provider.CSSStyleSheetLabelProvider; -import org.eclipse.papyrus.views.properties.modelelement.EMFModelElement; +import org.eclipse.papyrus.infra.properties.ui.modelelement.EMFModelElement; /** @@ -44,7 +44,7 @@ public class CSSThemesModelElement extends EMFModelElement { } /** - * @see org.eclipse.papyrus.views.properties.modelelement.EMFModelElement#getLabelProvider(java.lang.String) + * @see org.eclipse.papyrus.infra.properties.ui.modelelement.EMFModelElement#getLabelProvider(java.lang.String) * * @param propertyPath * @return diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSThemesModelElementFactory.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSThemesModelElementFactory.java index 71d3c44b370..4bca7fc62d6 100644 --- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSThemesModelElementFactory.java +++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/modelelement/CSSThemesModelElementFactory.java @@ -17,9 +17,9 @@ package org.eclipse.papyrus.infra.gmfdiag.css.properties.modelelement; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.papyrus.infra.emf.utils.EMFHelper; +import org.eclipse.papyrus.infra.gmfdiag.css.properties.Activator; import org.eclipse.papyrus.infra.properties.contexts.DataContextElement; -import org.eclipse.papyrus.views.properties.Activator; -import org.eclipse.papyrus.views.properties.modelelement.AbstractEMFModelElementFactory; +import org.eclipse.papyrus.infra.properties.ui.modelelement.AbstractEMFModelElementFactory; /** diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/preferences/ThemePreferencesPage.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/preferences/ThemePreferencesPage.java index 2db99a62dcc..50d8ede6916 100644 --- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/preferences/ThemePreferencesPage.java +++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/preferences/ThemePreferencesPage.java @@ -51,6 +51,7 @@ import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference; import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage; import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.Theme; import org.eclipse.papyrus.infra.gmfdiag.css.theme.ThemeManager; +import org.eclipse.papyrus.infra.properties.ui.creation.EcorePropertyEditorFactory; import org.eclipse.papyrus.infra.services.labelprovider.service.LabelProviderService; import org.eclipse.papyrus.infra.services.labelprovider.service.impl.LabelProviderServiceImpl; import org.eclipse.papyrus.infra.ui.emf.providers.EMFContentProvider; @@ -61,7 +62,6 @@ import org.eclipse.papyrus.infra.widgets.providers.CollectionContentProvider; import org.eclipse.papyrus.infra.widgets.providers.WorkspaceContentProvider; import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector; import org.eclipse.papyrus.infra.widgets.util.FileUtil; -import org.eclipse.papyrus.views.properties.creation.EcorePropertyEditorFactory; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/property/StyleSheetsPropertyPage.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/property/StyleSheetsPropertyPage.java index a42b1b740f0..db4aa0f5131 100644 --- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/property/StyleSheetsPropertyPage.java +++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/property/StyleSheetsPropertyPage.java @@ -46,13 +46,13 @@ import org.eclipse.papyrus.infra.gmfdiag.css.properties.provider.CSSStyleSheetLa import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.ModelStyleSheets; import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet; import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsPackage; +import org.eclipse.papyrus.infra.properties.ui.creation.EcorePropertyEditorFactory; import org.eclipse.papyrus.infra.ui.emf.providers.EMFContentProvider; import org.eclipse.papyrus.infra.widgets.creation.ReferenceValueFactory; import org.eclipse.papyrus.infra.widgets.editors.MultipleValueSelectorDialog; import org.eclipse.papyrus.infra.widgets.providers.AbstractStaticContentProvider; import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider; import org.eclipse.papyrus.infra.widgets.selectors.ReferenceSelector; -import org.eclipse.papyrus.views.properties.creation.EcorePropertyEditorFactory; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/widgets/ResetStyleWidget.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/widgets/ResetStyleWidget.java index f8df14a2f4a..713253ad31b 100644 --- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/widgets/ResetStyleWidget.java +++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css.properties/src/org/eclipse/papyrus/infra/gmfdiag/css/properties/widgets/ResetStyleWidget.java @@ -1,96 +1,96 @@ -/*****************************************************************************
- * Copyright (c) 2012, 2014 CEA LIST and others.
- *
- * 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:
- * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
- * Christian W. Damus (CEA) - bug 323802
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.gmfdiag.css.properties.widgets;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.infra.gmfdiag.css.helper.ResetStyleHelper;
-import org.eclipse.papyrus.views.properties.modelelement.DataSource;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-
-public class ResetStyleWidget implements SelectionListener {
-
- private Button button;
-
- private DataSource input;
-
- private String propertyPath;
-
- public ResetStyleWidget(Composite parent, int style) {
- button = new Button(parent, SWT.PUSH);
- button.addSelectionListener(this);
- button.setText("Default style");
- button.setToolTipText("Resets the properties which have been customized outside of the Style support. The default style will be applied");
- }
-
- public void widgetSelected(SelectionEvent event) {
- if (event.widget != button || input == null) {
- return;
- }
-
- IStructuredSelection viewSelection = input.getSelection();
- ResetStyleHelper.resetStyle(viewSelection);
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // Nothing
- }
-
- public void setText(String text) {
- button.setText(text);
- }
-
- public String getText() {
- return button.getText();
- }
-
- public void setToolTipText(String tooltip) {
- button.setToolTipText(tooltip);
- }
-
- public String getToolTipText() {
- return button.getToolTipText();
- }
-
- public void setInput(DataSource input) {
- this.input = input;
- checkInput();
- }
-
- public DataSource getInput() {
- return input;
- }
-
- public String getProperty() {
- return propertyPath;
- }
-
- public void setProperty(String property) {
- this.propertyPath = property;
- checkInput();
- }
-
- protected void checkInput() {
- if ((propertyPath != null) && (input != null)) {
- button.setEnabled(input.isEditable(propertyPath));
- } else {
- button.setEnabled(true); // For compatibility with XWT models that don't specify the property
- }
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2012, 2014 CEA LIST and others. + * + * 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: + * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation + * Christian W. Damus (CEA) - bug 323802 + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.gmfdiag.css.properties.widgets; + +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.papyrus.infra.gmfdiag.css.helper.ResetStyleHelper; +import org.eclipse.papyrus.infra.properties.ui.modelelement.DataSource; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; + + +public class ResetStyleWidget implements SelectionListener { + + private Button button; + + private DataSource input; + + private String propertyPath; + + public ResetStyleWidget(Composite parent, int style) { + button = new Button(parent, SWT.PUSH); + button.addSelectionListener(this); + button.setText("Default style"); + button.setToolTipText("Resets the properties which have been customized outside of the Style support. The default style will be applied"); + } + + public void widgetSelected(SelectionEvent event) { + if (event.widget != button || input == null) { + return; + } + + IStructuredSelection viewSelection = input.getSelection(); + ResetStyleHelper.resetStyle(viewSelection); + } + + public void widgetDefaultSelected(SelectionEvent e) { + // Nothing + } + + public void setText(String text) { + button.setText(text); + } + + public String getText() { + return button.getText(); + } + + public void setToolTipText(String tooltip) { + button.setToolTipText(tooltip); + } + + public String getToolTipText() { + return button.getToolTipText(); + } + + public void setInput(DataSource input) { + this.input = input; + checkInput(); + } + + public DataSource getInput() { + return input; + } + + public String getProperty() { + return propertyPath; + } + + public void setProperty(String property) { + this.propertyPath = property; + checkInput(); + } + + protected void checkInput() { + if ((propertyPath != null) && (input != null)) { + button.setEnabled(input.isEditable(propertyPath)); + } else { + button.setEnabled(true); // For compatibility with XWT models that don't specify the property + } + } + +} |