diff options
author | Christian W. Damus | 2016-01-15 18:27:40 +0000 |
---|---|---|
committer | Christian W. Damus | 2016-01-22 15:57:12 +0000 |
commit | 929e9738301b35cef5cc1ab00f47047671940bd5 (patch) | |
tree | 3557a10c2577b834d83909689755a39b86162517 /plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf | |
parent | 652333238a0a1651c1b69a4563b72961250c5398 (diff) | |
download | org.eclipse.papyrus-929e9738301b35cef5cc1ab00f47047671940bd5.tar.gz org.eclipse.papyrus-929e9738301b35cef5cc1ab00f47047671940bd5.tar.xz org.eclipse.papyrus-929e9738301b35cef5cc1ab00f47047671940bd5.zip |
Bug 485220: [Architecture] Provide a more modular architecture
https://bugs.eclipse.org/bugs/show_bug.cgi?id=485220
Move UI-dependent APIs from the org.eclipse.papyrus.infra.constraints
bundle to a new org.eclipse.papyrus.infra.constraints.ui bundle.
Replace usage of ISelection and IStructuredSelection in Constraint and
ConstraintEngine API methods with Object and Collection<?>,
respectively.
Move the ElementTypesPreferences class from the
infra.elementtypesconfigurations bundle to a new
infra.elementtypesconfigurations.ui bundle. For compatibility, it still
persists its data via an `IMemento` in the preferences of the
core `infra.elementtypesconfigurations` bundle. It implements a new
provider extension interface that allows the core bundle's
element-type registry to call out to it to get user-defined element
types from the workspace.
Move the RuntimeValuesEditionAdviceEditHelperAdvice class and some of
its attendants from the infra.elementtypesconfigurations.emf bundle to
the new infra.elementtypesconfigurations.ui bundle because it needs to
open the EditionDialog to let the user edit objects.
Likewise the similar APIs in the infra.extendedtypes bundle, including
also the entire providers package for action-providers, with the
ExtendedElementTypeActionService class, the
IExtendedElementTypeActionProvider interface, and the corresponding
extension point namespace.
Move the ElementTypeValidator class from the infra.services.edit bundle
to a new infra.services.edit.ui bundle.
Other fixes for simple inessential UI dependencies and also conflicts in
bundle classpaths (such as in the Sequence Diagram particularly) that
cause deadlocks in class loading in a complete Papyrus environment, such
as the AllTests suite.
Factor the UI dependencies out of the infra.onefile bundle into a new
infra.onefile.ui bundle.
Tests all still pass (inasmuch as they do in the nightly master builds).
Change-Id: I43510c84f54c3e0e52cd7d2aa3ca6aca95b894a7
Diffstat (limited to 'plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf')
6 files changed, 5 insertions, 225 deletions
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/META-INF/MANIFEST.MF b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/META-INF/MANIFEST.MF index 7cd6b570368..c07b7da1f54 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/META-INF/MANIFEST.MF +++ b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/META-INF/MANIFEST.MF @@ -7,11 +7,9 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0", org.eclipse.emf.ecore.edit,
org.eclipse.uml2.uml.edit,
org.eclipse.papyrus.infra.core.log;bundle-version="1.2.0",
- org.eclipse.ui;bundle-version="3.7.0",
org.eclipse.papyrus.infra.services.edit;bundle-version="1.2.0",
org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
org.eclipse.core.databinding;bundle-version="1.4.1",
- org.eclipse.papyrus.views.properties;bundle-version="1.2.0",
org.eclipse.papyrus.views.properties.model;bundle-version="1.2.0"
Export-Package: org.eclipse.papyrus.infra.extendedtypes.emf,
org.eclipse.papyrus.infra.extendedtypes.emf.converter,
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/plugin.xml b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/plugin.xml index afdf6d9e6df..54992418010 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/plugin.xml +++ b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/plugin.xml @@ -43,14 +43,4 @@ editHelperAdvice="org.eclipse.papyrus.infra.extendedtypes.emf.setvaluesactionconfiguration.SetValuesActionEditHelperAdvice">
</aspectAction>
</extension>
-
- <extension
- point="org.eclipse.papyrus.infra.extendedtypes.aspectActionConfiguration">
- <aspectAction
- configurationClass="org.eclipse.papyrus.infra.extendedtypes.emf.runtimevalueseditionactionconfiguration.RuntimeValuesEditionActionConfiguration"
- configurationModelCreation="org.eclipse.papyrus.infra.extendedtypes.emf.runtimevalueseditionactionconfiguration.RuntimeValuesEditionActionConfigurationModelCreation"
- creationElementValidator="org.eclipse.papyrus.infra.extendedtypes.emf.runtimevalueseditionactionconfiguration.RuntimeValuesEditionActionCreationElementValidator"
- editHelperAdvice="org.eclipse.papyrus.infra.extendedtypes.emf.runtimevalueseditionactionconfiguration.RuntimeValuesEditionActionEditHelperAdvice">
- </aspectAction>
- </extension>
</plugin>
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/Activator.java b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/Activator.java index f1d094da345..f0e88f6b739 100644 --- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/Activator.java +++ b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/Activator.java @@ -1,6 +1,5 @@ /*****************************************************************************
- * Copyright (c) 2014 CEA LIST.
- *
+ * Copyright (c) 2014, 2016 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,17 +8,19 @@ *
* Contributors:
* Patrick Tessier (CEA LIST) - Initial API and implementation
+ * Christian W. Damus - bug 485220
+ *
/*****************************************************************************/
package org.eclipse.papyrus.infra.extendedtypes.emf;
+import org.eclipse.core.runtime.Plugin;
import org.eclipse.papyrus.infra.core.log.LogHelper;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
-public class Activator extends AbstractUIPlugin {
+public class Activator extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.extendedtypes.emf"; //$NON-NLS-1$
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/runtimevalueseditionactionconfiguration/RuntimeValuesEditionActionConfigurationModelCreation.java b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/runtimevalueseditionactionconfiguration/RuntimeValuesEditionActionConfigurationModelCreation.java deleted file mode 100644 index 517ac9a15f3..00000000000 --- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/runtimevalueseditionactionconfiguration/RuntimeValuesEditionActionConfigurationModelCreation.java +++ /dev/null @@ -1,30 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2013 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:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.extendedtypes.emf.runtimevalueseditionactionconfiguration;
-
-import org.eclipse.papyrus.infra.extendedtypes.IActionConfigurationModelCreation;
-import org.eclipse.papyrus.infra.extendedtypes.emf.setvaluesactionconfiguration.SetValuesActionConfiguration;
-
-/**
- * {@link IActionConfigurationModelCreation} for {@link SetValuesActionConfiguration}
- */
-public class RuntimeValuesEditionActionConfigurationModelCreation implements IActionConfigurationModelCreation<RuntimeValuesEditionActionConfiguration> {
-
- /**
- * {@inheritDoc}
- */
- @Override
- public RuntimeValuesEditionActionConfiguration createConfigurationModel() {
- return RuntimeValuesEditionActionConfigurationFactory.eINSTANCE.createRuntimeValuesEditionActionConfiguration();
- }
-}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/runtimevalueseditionactionconfiguration/RuntimeValuesEditionActionCreationElementValidator.java b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/runtimevalueseditionactionconfiguration/RuntimeValuesEditionActionCreationElementValidator.java deleted file mode 100644 index a7903b169fd..00000000000 --- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/runtimevalueseditionactionconfiguration/RuntimeValuesEditionActionCreationElementValidator.java +++ /dev/null @@ -1,39 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2013 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:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.extendedtypes.emf.runtimevalueseditionactionconfiguration;
-
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.infra.extendedtypes.IActionCreationElementValidator;
-import org.eclipse.papyrus.infra.extendedtypes.ICreationElementValidator;
-import org.eclipse.papyrus.infra.extendedtypes.emf.setvaluesactionconfiguration.SetValuesActionConfiguration;
-
-/**
- * {@link ICreationElementValidator} for {@link SetValuesActionConfiguration}
- */
-public class RuntimeValuesEditionActionCreationElementValidator implements IActionCreationElementValidator<RuntimeValuesEditionActionConfiguration> {
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean canCreate(CreateElementRequest request) {
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void init(RuntimeValuesEditionActionConfiguration configuration) {
- }
-}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/runtimevalueseditionactionconfiguration/RuntimeValuesEditionActionEditHelperAdvice.java b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/runtimevalueseditionactionconfiguration/RuntimeValuesEditionActionEditHelperAdvice.java deleted file mode 100644 index 5dfe294d9f2..00000000000 --- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/runtimevalueseditionactionconfiguration/RuntimeValuesEditionActionEditHelperAdvice.java +++ /dev/null @@ -1,140 +0,0 @@ -/*****************************************************************************
- * Copyright (c) 2013 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:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.infra.extendedtypes.emf.runtimevalueseditionactionconfiguration;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.papyrus.infra.extendedtypes.IActionEditHelperAdvice;
-import org.eclipse.papyrus.infra.extendedtypes.emf.setvaluesactionconfiguration.SetValuesActionConfiguration;
-import org.eclipse.papyrus.views.properties.contexts.View;
-import org.eclipse.papyrus.views.properties.creation.EditionDialog;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * advice for the {@link SetValuesActionConfiguration}
- */
-public class RuntimeValuesEditionActionEditHelperAdvice extends AbstractEditHelperAdvice implements IActionEditHelperAdvice<RuntimeValuesEditionActionConfiguration> {
-
- /** list of views to display */
- protected Set<View> viewsToDisplay;
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void init(RuntimeValuesEditionActionConfiguration configuration) {
- viewsToDisplay = new HashSet<View>();
- for (ViewToDisplay display : configuration.getViewsToDisplay()) {
- View view = display.getView();
- if (view != null) {
- viewsToDisplay.add(view);
- }
- }
- }
-
- /**
- * Default Constructor
- */
- public RuntimeValuesEditionActionEditHelperAdvice() {
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean approveRequest(IEditCommandRequest request) {
- return super.approveRequest(request);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ICommand getBeforeCreateCommand(CreateElementRequest request) {
- return super.getBeforeCreateCommand(request);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ICommand getAfterCreateCommand(CreateElementRequest request) {
- return super.getAfterCreateCommand(request);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ICommand getBeforeConfigureCommand(ConfigureRequest request) {
- return super.getBeforeConfigureCommand(request);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ICommand getAfterConfigureCommand(final ConfigureRequest request) {
- final EObject elementToConfigure = request.getElementToConfigure();
- if (elementToConfigure == null) {
- return null;
- }
-
- return new AbstractTransactionalCommand(request.getEditingDomain(), "Editing " + EMFCoreUtil.getName(elementToConfigure), Collections.singletonList(WorkspaceSynchronizer.getFile((elementToConfigure.eResource())))) {
- /**
- * {@inheritDoc}
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- Set<View> viewsToDisplay = getViewsToDisplay();
- if (!viewsToDisplay.isEmpty()) {
- EditionDialog dialog = new EditionDialog(Display.getCurrent().getActiveShell()) {
-
- };
- dialog.setTitle("Edit " + EMFCoreUtil.getName(elementToConfigure));
- dialog.setViews(viewsToDisplay);
- dialog.setInput(elementToConfigure);
-
- dialog.open();
- }
-
- return CommandResult.newOKCommandResult(elementToConfigure);
- }
- };
-
- }
-
-
- /**
- * @return the viewsToDisplay
- */
- public Set<View> getViewsToDisplay() {
- return viewsToDisplay;
- }
-
-}
|