Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrschnekenbu2013-12-23 08:06:12 +0000
committerrschnekenbu2013-12-23 08:06:12 +0000
commit5135f4e7bba4bc73d9a7e66f3fa1566bc86d75e1 (patch)
tree353af9a9336e72efe2c5b793bf7b42a76531289e /plugins/infra
parent8905a28dac8c93248de10879fa58fa2d98177496 (diff)
downloadorg.eclipse.papyrus-5135f4e7bba4bc73d9a7e66f3fa1566bc86d75e1.tar.gz
org.eclipse.papyrus-5135f4e7bba4bc73d9a7e66f3fa1566bc86d75e1.tar.xz
org.eclipse.papyrus-5135f4e7bba4bc73d9a7e66f3fa1566bc86d75e1.zip
424402: [Core] Runtime deployment of the element types shall be possible
https://bugs.eclipse.org/bugs/show_bug.cgi?id=424402 - fixed incoherent dependencies => emf extended types has not been updated yet
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/.classpath1
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/META-INF/MANIFEST.MF12
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/build.properties2
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/plugin.xml27
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/providers/ModifySemanticValuesActionProvider.java186
5 files changed, 4 insertions, 224 deletions
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/.classpath b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/.classpath
index afb9bb46ef3..45f024e850e 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/.classpath
+++ b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/.classpath
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src-gen"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
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 ba3665039c8..699daa05edb 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
@@ -1,9 +1,5 @@
Manifest-Version: 1.0
-Export-Package: org.eclipse.papyrus.infra.extendedtypes.emf,
- org.eclipse.papyrus.infra.extendedtypes.emf.modifysemanticvaluesactionconfiguration,
- org.eclipse.papyrus.infra.extendedtypes.emf.modifysemanticvaluesactionconfiguration.impl,
- org.eclipse.papyrus.infra.extendedtypes.emf.modifysemanticvaluesactionconfiguration.util,
- org.eclipse.papyrus.infra.extendedtypes.emf.providers
+Export-Package: org.eclipse.papyrus.infra.extendedtypes.emf
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Bundle-Name: %pluginName
@@ -25,8 +21,6 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0",
Bundle-Vendor: %providerName
Bundle-Version: 0.10.1.qualifier
Bundle-ManifestVersion: 2
-Bundle-Activator: org.eclipse.papyrus.infra.extendedtypes.emf.Activato
- r
-Bundle-SymbolicName: org.eclipse.papyrus.infra.extendedtypes.emf;singl
- eton:=true
+Bundle-Activator: org.eclipse.papyrus.infra.extendedtypes.emf.Activator
+Bundle-SymbolicName: org.eclipse.papyrus.infra.extendedtypes.emf;singleton:=true
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/build.properties b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/build.properties
index 55e52586ddc..addbf2e7472 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/build.properties
+++ b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/build.properties
@@ -4,5 +4,5 @@ output..=bin/
bin.includes=.,model/,META-INF/,plugin.xml,plugin.properties,about.html
jars.compile.order=.
src.includes = about.html
-source..=src-gen/,src/
+source.. = src/
bin..=bin/
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 9d8c9c3ff06..01fcabfe799 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/plugin.xml
+++ b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/plugin.xml
@@ -10,31 +10,4 @@
<plugin>
- <extension point="org.eclipse.emf.ecore.generated_package">
- <package
- uri="http://www.eclipse.org/papyrus/diagram/types/modifysemanticvaluesactionconfiguration/0.8"
- class="org.eclipse.papyrus.infra.extendedtypes.emf.modifysemanticvaluesactionconfiguration.ModifySemanticValuesActionConfigurationPackage"
- genModel="model/ModifySemanticValuesActionConfiguration.genmodel"/>
- </extension>
-
- <extension point="org.eclipse.emf.ecore.extension_parser">
- <parser
- type="modifysemanticvaluesactionconfiguration"
- class="org.eclipse.papyrus.infra.extendedtypes.emf.modifysemanticvaluesactionconfiguration.util.ModifySemanticValuesActionConfigurationResourceFactoryImpl"/>
- </extension>
-
- <extension
- point="org.eclipse.papyrus.infra.extendedtypes.extendedElementTypeActionProvider">
- <extendedElementTypeActionProvider
- class="org.eclipse.papyrus.infra.extendedtypes.emf.providers.ModifySemanticValuesActionProvider"
- configurationClass="org.eclipse.papyrus.infra.extendedtypes.emf.modifysemanticvaluesactionconfiguration.ModifySemanticValuesActionConfiguration"
- description="Post action to set semantic values on created element"
- icon="icons/Values.gif"
- id="org.eclipse.papyrus.infra.extendedtypes.emf.modifysemanticvaluesactionconfiguration"
- name="Extended Element Type Modify Semantic Values Post Action">
- <Priority
- name="Lowest">
- </Priority>
- </extendedElementTypeActionProvider>
- </extension>
</plugin>
diff --git a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/providers/ModifySemanticValuesActionProvider.java b/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/providers/ModifySemanticValuesActionProvider.java
deleted file mode 100644
index 5ecc4b638bd..00000000000
--- a/plugins/infra/org.eclipse.papyrus.infra.extendedtypes.emf/src/org/eclipse/papyrus/infra/extendedtypes/emf/providers/ModifySemanticValuesActionProvider.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010 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) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.infra.extendedtypes.emf.providers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.papyrus.infra.extendedtypes.ActionConfiguration;
-import org.eclipse.papyrus.infra.extendedtypes.emf.Activator;
-import org.eclipse.papyrus.infra.extendedtypes.emf.modifysemanticvaluesactionconfiguration.ConstantValue;
-import org.eclipse.papyrus.infra.extendedtypes.emf.modifysemanticvaluesactionconfiguration.FeatureToSet;
-import org.eclipse.papyrus.infra.extendedtypes.emf.modifysemanticvaluesactionconfiguration.FeatureValue;
-import org.eclipse.papyrus.infra.extendedtypes.emf.modifysemanticvaluesactionconfiguration.ListValue;
-import org.eclipse.papyrus.infra.extendedtypes.emf.modifysemanticvaluesactionconfiguration.ModifySemanticValuesActionConfiguration;
-import org.eclipse.papyrus.infra.extendedtypes.emf.modifysemanticvaluesactionconfiguration.QueryExecutionValue;
-import org.eclipse.papyrus.infra.extendedtypes.emf.modifysemanticvaluesactionconfiguration.util.ModifySemanticValuesActionConfigurationSwitch;
-import org.eclipse.papyrus.infra.extendedtypes.providers.GetAllExtendedElementTypeActionProvidersOperation;
-import org.eclipse.papyrus.infra.extendedtypes.providers.GetExtendedElementTypeActionProviderOperation;
-import org.eclipse.papyrus.infra.extendedtypes.providers.IExtendedElementTypeActionProvider;
-import org.eclipse.papyrus.infra.queries.core.configuration.QueryConfiguration;
-import org.eclipse.papyrus.infra.queries.core.converter.ConverterNotfoundException;
-import org.eclipse.papyrus.infra.queries.core.converter.ConverterRegistry;
-import org.eclipse.papyrus.infra.queries.core.modisco.QueryUtil;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-
-/**
- * Provider for Action that set semantic values to an element on creation
- */
-public class ModifySemanticValuesActionProvider extends AbstractProvider implements IExtendedElementTypeActionProvider {
-
- /**
- * {@inheritDoc}
- */
- public boolean provides(IOperation operation) {
- if(operation instanceof GetAllExtendedElementTypeActionProvidersOperation) {
- return true;
- }
- if(operation instanceof GetExtendedElementTypeActionProviderOperation) {
- return (((GetExtendedElementTypeActionProviderOperation)operation).getActionConfiguration() instanceof ModifySemanticValuesActionConfiguration);
- }
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public ICommand getICommand(List<? extends Object> elementsToEdit, ActionConfiguration configuration) {
- // try to create the command that will apply the stereotypes
- if(!(configuration instanceof ModifySemanticValuesActionConfiguration)) {
- Activator.log.error("Trying to configure a modify semantic values action configuration with a configuration which is not a semantic value one: " + configuration, null);
- return UnexecutableCommand.INSTANCE;
- }
-
- CompositeCommand compositeCommand = new CompositeCommand("Set Values");
- ModifySemanticValuesActionConfiguration modifySemanticValuesActionConfiguration = (ModifySemanticValuesActionConfiguration)configuration;
-
- // for each object in the list of eobjects to edit, create the stereotype apply command
- for(Object objectToEdit : elementsToEdit) {
- // for each feature in the configuration, sets the value
- if(objectToEdit instanceof EObject) {
- for(FeatureToSet featureToSet : modifySemanticValuesActionConfiguration.getFeaturesToSet()) {
- // create a command from a set request and use the Papyrus edit service
- EObject eObject = (EObject)objectToEdit;
- EStructuralFeature feature = eObject.eClass().getEStructuralFeature(featureToSet.getFeatureName());
- if(feature != null && feature.isChangeable()) {
- // retrieve the value to set
- FeatureValue featureValue = featureToSet.getValue();
- Object value = computeValue(eObject, feature, featureValue);
- SetRequest request = new SetRequest(eObject, feature, value);
- IElementEditService service = ElementEditServiceUtils.getCommandProvider(eObject);
- ICommand command = service.getEditCommand(request);
- if(command != null) {
- compositeCommand.add(command);
- }
- }
- }
-
- // for dynamic features, opens the pop up and ask for the values to set
- }
- }
- return compositeCommand;
- }
-
- /**
- * Retrieves the value from the feature value parameter
- *
- * @param eObject
- * the context of the value
- * @param feature
- * the feature for which the value is computed
- * @param featureValue
- * the representation of the value of the feature from which to compute the real value
- * @return the value of the feature
- */
- protected Object computeValue(final EObject eObject, final EStructuralFeature feature, FeatureValue featureValue) {
- Object value = new ModifySemanticValuesActionConfigurationSwitch<Object>() {
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object caseListValue(ListValue listValue) {
- List<Object> values = new ArrayList<Object>();
- for(FeatureValue fValue : listValue.getValues()) {
- Object value = computeValue(eObject, feature, fValue);
- values.add(value);
- }
- return values;
- };
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object caseQueryExecutionValue(QueryExecutionValue queryExecutionValue) {
- Object value = null;
- QueryConfiguration configuration = queryExecutionValue.getConfiguration();
- try {
- value = QueryUtil.evaluateQuery(eObject, configuration);
- } catch (Exception e) {
- Activator.log.error(e);
- }
- return value;
- };
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object caseConstantValue(ConstantValue constantValue) {
- Class<?> parameterType = feature.getEType().getInstanceClass();
- try {
- Object convertedValue = ConverterRegistry.getSingleton().convert(parameterType, constantValue.getValueInstance());
- return convertedValue;
- } catch (ConverterNotfoundException e) {
- Activator.log.error(e);
- }
- return null;
- }
-
- }.doSwitch(featureValue);
-
- return value;
- }
-
- /**
- * {@inheritDoc}
- */
- public ICommand getBeforeCreateValidationCommand(List<? extends Object> elementsToEdit, ActionConfiguration configuration) {
- // here, element to edit should be the parent of the created element on which the stereotype is applied.
- ModifySemanticValuesActionConfiguration modifySemanticValuesActionConfiguration = (ModifySemanticValuesActionConfiguration)configuration;
-
- for(Object objectToEdit : elementsToEdit) {
- // FIXME ...
- }
- // returns a null command, which means it is possible to apply the stereotype
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public void setConfiguration(IConfigurationElement element) {
- // something to do here ?
- }
-
-}

Back to the top