summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Maggi2014-03-11 04:45:11 (EDT)
committerVincent Lorenzo2014-03-18 10:03:32 (EDT)
commit70a02f83656e35d37b0cc9c19a4e6d42ce64bafd (patch)
tree0a8737864bb9ceec8bcbb98f15b665956e96e30a
parentcaa1146af753a46f2aadd6646a08bb2afc20af11 (diff)
downloadorg.eclipse.papyrus-70a02f83656e35d37b0cc9c19a4e6d42ce64bafd.zip
org.eclipse.papyrus-70a02f83656e35d37b0cc9c19a4e6d42ce64bafd.tar.gz
org.eclipse.papyrus-70a02f83656e35d37b0cc9c19a4e6d42ce64bafd.tar.bz2
#290261: Add Preferences for stereotype strategy
Signed-off-by: Benoit Maggi <benoit.maggi@cea.fr>
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml15
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/IStereotypePasteStrategyPreferenceConstant.java31
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/StereotypePasteStrategyPreferenceInitializer.java38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/StereotypePasteStrategyPreferencePage.java53
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/strategy/paste/StereotypePasteStrategy.java196
5 files changed, 241 insertions, 92 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml
index dd1c21e..4d4323f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml
@@ -613,4 +613,19 @@
strategy="org.eclipse.papyrus.uml.diagram.common.strategy.copy.RootOnlyCopyStrategy">
</strategy>
</extension>
+<extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.eclipse.papyrus.infra.gmfdiag.paste.preferences"
+ class="org.eclipse.papyrus.uml.diagram.common.preferences.StereotypePasteStrategyPreferencePage"
+ id="org.eclipse.papyrus.uml.diagram.common.StereotypePasteStrategyPreferencePage"
+ name="Stereotype Strategy">
+ </page>
+</extension>
+<extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer
+ class="org.eclipse.papyrus.uml.diagram.common.preferences.StereotypePasteStrategyPreferenceInitializer">
+ </initializer>
+</extension>
</plugin>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/IStereotypePasteStrategyPreferenceConstant.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/IStereotypePasteStrategyPreferenceConstant.java
new file mode 100644
index 0000000..2396b4e
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/IStereotypePasteStrategyPreferenceConstant.java
@@ -0,0 +1,31 @@
+/*****************************************************************************
+ * 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.preferences;
+
+/**
+ * Constant to use for the management of stereotype strategy
+ */
+
+public interface IStereotypePasteStrategyPreferenceConstant {
+
+ public String PROFILE_STRATEGY = "PROFILE_STRATEGY";
+
+ // choices for PROFILE_STRATEGY
+
+ public String ASK_POPUP = "ASK_POPUP";
+
+ public String IMPORT_MISSING_PROFILE = "IMPORT_MISSING_PROFILE";
+
+ public String IGNORE_MISSING_PROFILE = "IGNORE_MISSING_PROFILE";
+
+ /// end
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/StereotypePasteStrategyPreferenceInitializer.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/StereotypePasteStrategyPreferenceInitializer.java
new file mode 100644
index 0000000..93d60fb
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/StereotypePasteStrategyPreferenceInitializer.java
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+
+
+/**
+ * This preference initializer initializes Stereotype strategy preferences
+ */
+public class StereotypePasteStrategyPreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /**
+ * Initialize default preferences
+ */
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = getPreferenceStore();
+ store.setDefault(IStereotypePasteStrategyPreferenceConstant.PROFILE_STRATEGY, IStereotypePasteStrategyPreferenceConstant.IGNORE_MISSING_PROFILE);
+ }
+
+ /**
+ * Get the preference store
+ */
+ protected IPreferenceStore getPreferenceStore() {
+ return Activator.getDefault().getPreferenceStore();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/StereotypePasteStrategyPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/StereotypePasteStrategyPreferencePage.java
new file mode 100644
index 0000000..0a276cb
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/StereotypePasteStrategyPreferencePage.java
@@ -0,0 +1,53 @@
+/*****************************************************************************
+ * 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.preferences;
+
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.RadioGroupFieldEditor;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+/**
+ * Preference page for stereotype paste strategy
+ *
+ */
+public class StereotypePasteStrategyPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+ protected RadioGroupFieldEditor dblClkFieldEditor;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ public void init(IWorkbench workbench) {
+ setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+ */
+ @Override
+ protected void createFieldEditors() {
+ String[][] labelAndValues = new String[][]{
+// { "Ask before Aplying Profile", IStereotypePasteStrategyPreferenceConstant.ASK_POPUP },
+ { "Always import missing profiles", IStereotypePasteStrategyPreferenceConstant.IMPORT_MISSING_PROFILE },
+ { "Never import missing profiles", IStereotypePasteStrategyPreferenceConstant.IGNORE_MISSING_PROFILE }
+ };
+ dblClkFieldEditor = new RadioGroupFieldEditor(
+ IStereotypePasteStrategyPreferenceConstant.PROFILE_STRATEGY, "Missing profiles strategy :", 1,
+ labelAndValues,
+ getFieldEditorParent());
+ addField(dblClkFieldEditor);
+ dblClkFieldEditor.setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/strategy/paste/StereotypePasteStrategy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/strategy/paste/StereotypePasteStrategy.java
index e47dd57..a234f5c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/strategy/paste/StereotypePasteStrategy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/strategy/paste/StereotypePasteStrategy.java
@@ -17,21 +17,27 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.command.UnexecutableCommand;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.papyrus.commands.wrappers.EMFtoGEFCommandWrapper;
import org.eclipse.papyrus.infra.core.clipboard.IClipboardAdditionalData;
import org.eclipse.papyrus.infra.core.clipboard.PapyrusClipboard;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy;
import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.preferences.IStereotypePasteStrategyPreferenceConstant;
+import org.eclipse.papyrus.uml.tools.commands.ApplyProfileCommand;
import org.eclipse.papyrus.uml.tools.commands.ApplyStereotypeCommand;
+import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
import org.eclipse.swt.graphics.Image;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Model;
@@ -141,72 +147,84 @@ public class StereotypePasteStrategy implements IPasteStrategy {
*/
@Override
public org.eclipse.emf.common.command.Command getSemanticCommand(EditingDomain domain, EObject targetOwner, PapyrusClipboard<Object> papyrusClipboard) {
- CompoundCommand compoundCommand = new CompoundCommand("Copy all stereotypes"); //$NON-NLS-1$
- Map<Profile,List<ApplyStereotypeCommand>> missingProfiles = new HashMap<Profile,List<ApplyStereotypeCommand>>();
-
- Package targetPackage = ((Element)targetOwner).getNearestPackage();
-
- // 1. init all ApplyStereotypeCommand
- for(Iterator<Object> iterator = papyrusClipboard.iterator(); iterator.hasNext();) {
- Object object = (Object)iterator.next();
- // get target Element
- EObject target = papyrusClipboard.getTragetCopyFromInternalClipboardCopy(object);
- if(target != null && target instanceof Element) {
- // get affiliate StereotypeClipboard
- Map<Object, ?> additionalDataMap = papyrusClipboard.getAdditionalDataForStrategy(getID());
- Object additionnalData = additionalDataMap.get(object);
- if(additionnalData instanceof StereotypeClipboard) {
- StereotypeClipboard stereotypeClipboard = (StereotypeClipboard)additionnalData;
- Collection<Stereotype> stereotypes = stereotypeClipboard.getStereotypes();
-// Collection<Stereotype> stereotypeListInTargetContext = new ArrayList<Stereotype>();
- for(Stereotype stereotype : stereotypes) {
- // reload the stereotype in the new Contex-ResourceSet (Required because in org.eclipse.uml2.uml.internal.operations.PackageOperations
- // L960 in getProfileApplication the test is using == instead of equals)
- Stereotype stereotypeInTargetContext = EMFHelper.reloadIntoContext(stereotype, targetOwner);
-
- Profile profile = stereotypeInTargetContext.getProfile();
- ApplyStereotypeCommand applyStereotypeCommand = new ApplyStereotypeCommand((Element)target, stereotypeInTargetContext, (TransactionalEditingDomain)domain);
- if (isProfileAppliedRecursive(targetPackage, profile)){
- compoundCommand.append(applyStereotypeCommand);
- } else { // Profile is missing
- Activator.getDefault().logWarning(profile.getName()+" is missing", null);
- List<ApplyStereotypeCommand> list = missingProfiles.get(profile);
- if (list!= null && !list.isEmpty()){
- list.add(applyStereotypeCommand);
- } else {
- list = new ArrayList<ApplyStereotypeCommand>();
- missingProfiles.put(profile, list);
+ if (targetOwner instanceof Element){
+ CompoundCommand compoundCommand = new CompoundCommand("Copy all stereotypes"); //$NON-NLS-1$
+
+ Map<Profile,List<ApplyStereotypeCommand>> missingProfiles = new HashMap<Profile,List<ApplyStereotypeCommand>>();
+ Package targetPackage = ((Element)targetOwner).getNearestPackage();
+
+ // 1. init all ApplyStereotypeCommand
+ for(Iterator<Object> iterator = papyrusClipboard.iterator(); iterator.hasNext();) {
+ Object object = (Object)iterator.next();
+ // get target Element
+ EObject target = papyrusClipboard.getTragetCopyFromInternalClipboardCopy(object);
+ if(target != null && target instanceof Element) {
+ // get affiliate StereotypeClipboard
+ Map<Object, ?> additionalDataMap = papyrusClipboard.getAdditionalDataForStrategy(getID());
+ Object additionnalData = additionalDataMap.get(object);
+ if(additionnalData instanceof StereotypeClipboard) {
+ StereotypeClipboard stereotypeClipboard = (StereotypeClipboard)additionnalData;
+ Collection<Stereotype> stereotypes = stereotypeClipboard.getStereotypes();
+// Collection<Stereotype> stereotypeListInTargetContext = new ArrayList<Stereotype>();
+ for(Stereotype stereotype : stereotypes) {
+ // reload the stereotype in the new Contex-ResourceSet (Required because in org.eclipse.uml2.uml.internal.operations.PackageOperations
+ // L960 in getProfileApplication the test is using == instead of equals)
+ Stereotype stereotypeInTargetContext = EMFHelper.reloadIntoContext(stereotype, targetOwner);
+
+ Profile profile = stereotypeInTargetContext.getProfile();
+ ApplyStereotypeCommand applyStereotypeCommand = new ApplyStereotypeCommand((Element)target, stereotypeInTargetContext, (TransactionalEditingDomain)domain);
+ if (isProfileAppliedRecursive(targetPackage, profile)){
+ compoundCommand.append(applyStereotypeCommand);
+ } else { // Profile is missing
+// Activator.getDefault().logWarning(profile.getName()+" is missing", null);
+ List<ApplyStereotypeCommand> stereotypeListMissingProfiles = missingProfiles.get(profile);
+ if (stereotypeListMissingProfiles!= null && !stereotypeListMissingProfiles.isEmpty()){
+ stereotypeListMissingProfiles.add(applyStereotypeCommand);
+ } else {
+ stereotypeListMissingProfiles = new ArrayList<ApplyStereotypeCommand>();
+ stereotypeListMissingProfiles.add(applyStereotypeCommand);
+ missingProfiles.put(profile, stereotypeListMissingProfiles);
+ }
}
}
-
-// stereotypeListInTargetContext.add(stereotypeInTargetContext);
}
- // append command to apply stereotype
-// ApplyStereotypeCommand applyStereotypeCommand = new ApplyStereotypeCommand((Element)target, stereotypeListInTargetContext, (TransactionalEditingDomain)domain);
-// applyStereotypeCommandList.add(applyStereotypeCommand);
}
}
- }
-
- // TODO: 2. user choices (Apply profiles, data...)
+
+ // 2. user preferences (Apply profiles, data...)
+ IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
+ String preferenceProfileStrategy = preferenceStore.getString(IStereotypePasteStrategyPreferenceConstant.PROFILE_STRATEGY);
- // first draft remove all unapplicable commd
-
-
-
-
- //3. construct compoundCommand
-
-
-
- // An empty can't be executed
- if(compoundCommand.getCommandList().isEmpty()) {
- return null;
+ if (IStereotypePasteStrategyPreferenceConstant.ASK_POPUP.equals(preferenceProfileStrategy)){// Ask user for instruction
+ // TODO: 2. user choices (Apply profiles, data...)
+ } else if (IStereotypePasteStrategyPreferenceConstant.IMPORT_MISSING_PROFILE.equals(preferenceProfileStrategy)){ // apply profile
+ Set<Profile> keySet = missingProfiles.keySet();
+ Package rootPackage = PackageUtil.getRootPackage((Element)targetOwner);
+ ApplyProfileCommand applyProfileCommand = new ApplyProfileCommand(rootPackage, keySet, (TransactionalEditingDomain)domain);
+ compoundCommand.append(applyProfileCommand);
+ for(Profile profile : keySet) {
+ List<ApplyStereotypeCommand> list = missingProfiles.get(profile);
+ for(ApplyStereotypeCommand applyStereotypeCommand : list) {
+ compoundCommand.append(applyStereotypeCommand);
+ }
+ }
+ }
+
+
+ // An empty can't be executed
+ if(compoundCommand.getCommandList().isEmpty()) {
+ return null;
+ }
+ return compoundCommand;
}
- return compoundCommand;
+ return UnexecutableCommand.INSTANCE;
+
}
+
+
+
/*
* (non-Javadoc)
*
@@ -216,11 +234,11 @@ public class StereotypePasteStrategy implements IPasteStrategy {
@Override
public Command getGraphicalCommand(EditingDomain domain, org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart targetEditPart, PapyrusClipboard<Object> papyrusClipboard) {
org.eclipse.gef.commands.CompoundCommand compoundCommand = new org.eclipse.gef.commands.CompoundCommand("Stereotype Semantic And Graphical paste"); //$NON-NLS-1$
+ Map<Profile,List<ApplyStereotypeCommand>> missingProfiles = new HashMap<Profile,List<ApplyStereotypeCommand>>();
View view = (View)targetEditPart.getModel();
EObject modelTargetOwner = (EObject)view.getElement();
Package targetPackage = ((Element)modelTargetOwner).getNearestPackage();
// apply stereotypes
- List<ApplyStereotypeCommand> applyStereotypeCommandList = new ArrayList<ApplyStereotypeCommand>();
for(Iterator<Object> iterator = papyrusClipboard.iterator(); iterator.hasNext();) {
Object object = (Object)iterator.next();
// get target Element
@@ -243,48 +261,42 @@ public class StereotypePasteStrategy implements IPasteStrategy {
EMFtoGEFCommandWrapper emFtoGEFCommandWrapper = new EMFtoGEFCommandWrapper(applyStereotypeCommand);
compoundCommand.add(emFtoGEFCommandWrapper);
} else { // Profile is missing
- Activator.getDefault().logWarning(profile.getName()+" is missing", null);
+ List<ApplyStereotypeCommand> stereotypeListMissingProfiles = missingProfiles.get(profile);
+ if (stereotypeListMissingProfiles!= null && !stereotypeListMissingProfiles.isEmpty()){
+ stereotypeListMissingProfiles.add(applyStereotypeCommand);
+ } else {
+ stereotypeListMissingProfiles = new ArrayList<ApplyStereotypeCommand>();
+ stereotypeListMissingProfiles.add(applyStereotypeCommand);
+ missingProfiles.put(profile, stereotypeListMissingProfiles);
+ }
}
- // applyStereotypeCommandList.add(applyStereotypeCommand);
}
}
}
}
- // TODO : test profile application
- // List<Profile> missingProfiles = new ArrayList<Profile>();
- // if(modelTargetOwner != null && modelTargetOwner instanceof Element) {
- // Package nearestPackage = ((Element)modelTargetOwner).getNearestPackage();
- //
- // for(ApplyStereotypeCommand applyStereotypeCommand : applyStereotypeCommandList) {
- //
- // Collection<Stereotype> stereotypes = applyStereotypeCommand.getStereotypes();
- // for(Stereotype stereotype : stereotypes) {
- // Profile profile = stereotype.getProfile();
- // boolean profileApplied = isProfileAppliedRecursive(nearestPackage, profile);
- // if(!profileApplied) {
- // missingProfiles.add(profile);
- // Map<EditPart, Set<EObject>> availableLinks = new HashMap<EditPart, Set<EObject>>();
- // Collection<EObject> initialSelection = new ArrayList<EObject>();
- // Map<EObject, LinkEndsMapper> linkMapping = new HashMap<EObject, LinkEndsMapper>();
- // Collection<EditPart> selectedEditPart = new ArrayList<EditPart>();
- // // ICommand openDialogCommand = getOpenDialogCommand((TransactionalEditingDomain)domain, selectedEditPart, availableLinks, initialSelection, linkMapping);
- // //
- // // try {
- // // openDialogCommand.execute(new NullProgressMonitor(), null);
- // // } catch (ExecutionException e) {
- // // // TODO Auto-generated catch block
- // // e.printStackTrace();
- // // }
- // // domain.getCommandStack().execute(openDialogCommand);
- // } else {
- // EMFtoGEFCommandWrapper emFtoGEFCommandWrapper = new EMFtoGEFCommandWrapper(applyStereotypeCommand);
- //// compoundCommand.add(emFtoGEFCommandWrapper);
- // }
- // }
- // }
- // }
+ // 2. user preferences (Apply profiles, data...)
+ IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
+ String preferenceProfileStrategy = preferenceStore.getString(IStereotypePasteStrategyPreferenceConstant.PROFILE_STRATEGY);
+
+ if (IStereotypePasteStrategyPreferenceConstant.ASK_POPUP.equals(preferenceProfileStrategy)){// Ask user for instruction
+ // TODO: 2. user choices (Apply profiles, data...)
+ } else if (IStereotypePasteStrategyPreferenceConstant.IMPORT_MISSING_PROFILE.equals(preferenceProfileStrategy)){ // apply profile
+ Set<Profile> keySet = missingProfiles.keySet();
+ Package rootPackage = PackageUtil.getRootPackage((Element)modelTargetOwner);
+ ApplyProfileCommand applyProfileCommand = new ApplyProfileCommand(rootPackage, keySet, (TransactionalEditingDomain)domain);
+ EMFtoGEFCommandWrapper emFtoGEFCommandWrapper = new EMFtoGEFCommandWrapper(applyProfileCommand);
+ compoundCommand.add(emFtoGEFCommandWrapper);
+ for(Profile profile : keySet) {
+ List<ApplyStereotypeCommand> list = missingProfiles.get(profile);
+ for(ApplyStereotypeCommand applyStereotypeCommand : list) {
+ compoundCommand.add(new EMFtoGEFCommandWrapper(applyStereotypeCommand));
+ }
+ }
+ }
+
+
if(compoundCommand.size() == 0) {// TODO : use unwrap if no use of UnexecutableCommand.INSTANCE
return null;
}