Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptessier2014-04-03 09:37:04 -0400
committerptessier2014-04-03 09:37:04 -0400
commit46940c8b6c5517e3e7abdfb30de83411b80340fb (patch)
treefc247e05b8f10fa35436eea29f4e6cf9e3077299 /plugins
parent0055a29b2a603c54f63a90de39cae25bf5c62c50 (diff)
parentcc50dbf1ba45ce0d4edf4bb54581774654fc8ca3 (diff)
downloadorg.eclipse.papyrus-46940c8b6c5517e3e7abdfb30de83411b80340fb.tar.gz
org.eclipse.papyrus-46940c8b6c5517e3e7abdfb30de83411b80340fb.tar.xz
org.eclipse.papyrus-46940c8b6c5517e3e7abdfb30de83411b80340fb.zip
Merge branch 'master' of ssh://ptessier@git.eclipse.org/gitroot/papyrus/org.eclipse.papyrus.git
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java13
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/Constants.java12
-rw-r--r--plugins/team/org.eclipse.papyrus.team.svn/META-INF/MANIFEST.MF3
-rw-r--r--plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java48
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/StereotypePropertyCellManager.java70
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java28
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/CustomElementOperations.java16
7 files changed, 170 insertions, 20 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java
index 8def89fed89..4c29552fa06 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/provider/PasteEObjectAxisInNattableCommandProvider.java
@@ -273,6 +273,11 @@ public class PasteEObjectAxisInNattableCommandProvider {
sharedMap.put(Constants.PASTED_ELEMENT_CONTAINER_KEY, tableContext);
sharedMap.put(Constants.REFERENCES_TO_SET_KEY, new ArrayList<IValueSetter>());
sharedMap.put(Constants.CELLS_TO_ADD_KEY, new ArrayList<Cell>());
+
+ //used to be able to apply stereotypes required by columns properties, in detached mode even if there is no post actions defined in the table configuration
+ //see bug 431691: [Table 2] Paste from Spreadsheet must be able to apply required stereotypes for column properties in all usecases
+ //https://bugs.eclipse.org/bugs/show_bug.cgi?id=431691
+ sharedMap.put(Constants.ADDITIONAL_POST_ACTIONS_TO_CONCLUDE_PASTE_KEY, new ArrayList<String>());
if(!useProgressMonitor) {
final ICommand pasteCommand = getPasteFromStringCommandInDetachedMode(contextEditingDomain, tableEditingDomain, new NullProgressMonitor(), sharedMap);
@@ -442,6 +447,14 @@ public class PasteEObjectAxisInNattableCommandProvider {
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
//initialize lists
final Collection<String> postActions = getPostActions();
+
+ //we add the post actions added by cell manager
+ //see bug 431691: [Table 2] Paste from Spreadsheet must be able to apply required stereotypes for column properties in all usecases
+ //https://bugs.eclipse.org/bugs/show_bug.cgi?id=431691
+ @SuppressWarnings("unchecked")
+ final Collection<String> postActionsAddedByCellManagers = (Collection<String>)sharedMap.get(Constants.ADDITIONAL_POST_ACTIONS_TO_CONCLUDE_PASTE_KEY);
+ postActions.addAll(postActionsAddedByCellManagers);
+
@SuppressWarnings("unchecked")
final List<Cell> cells = (List<Cell>)sharedMap.get(Constants.CELLS_TO_ADD_KEY);
@SuppressWarnings("unchecked")
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/Constants.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/Constants.java
index 16ca7e7c874..ccc528dbd0e 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/Constants.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/Constants.java
@@ -69,9 +69,21 @@ public class Constants {
* the key used to store the references to set after to have attached the pasted element to the model
*/
public static final String REFERENCES_TO_SET_KEY = "referencesToSet";
+
+ /**
+ * the key used to register additional post actions to conclude the paste. the returned value must be a Collection<String>
+ * These post actions have been executed by CellManager, but they must be concluded.
+ * These post actions are not defined in the configuration of the table, but added by CellManager
+ *
+ * This key is used to be able to apply stereotype required by columns properties, when there are no post actions defined
+ * in the paste configuration of the table
+ * see bug 431691: [Table 2] Paste from Spreadsheet must be able to apply required stereotypes for column properties in all usecases
+ */
+ public static final String ADDITIONAL_POST_ACTIONS_TO_CONCLUDE_PASTE_KEY = "additionnal_post_actions_to_conclude_paste";
/**
* the key used to store the cells to attached to the model
*/
public static final String CELLS_TO_ADD_KEY = "cellsToAdd";
+
}
diff --git a/plugins/team/org.eclipse.papyrus.team.svn/META-INF/MANIFEST.MF b/plugins/team/org.eclipse.papyrus.team.svn/META-INF/MANIFEST.MF
index ccbb19289aa..a01439adc4d 100644
--- a/plugins/team/org.eclipse.papyrus.team.svn/META-INF/MANIFEST.MF
+++ b/plugins/team/org.eclipse.papyrus.team.svn/META-INF/MANIFEST.MF
@@ -9,7 +9,8 @@ Require-Bundle: org.eclipse.papyrus.infra.onefile;bundle-version="1.0.0",
org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.0.0",
org.eclipse.emf.edit,
org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
- com.google.guava;bundle-version="11.0.0"
+ com.google.guava;bundle-version="11.0.0",
+ org.eclipse.team.core;bundle-version="3.7.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.0.0.qualifier
diff --git a/plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java b/plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java
index f40ac894de2..3c91cb81f08 100644
--- a/plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java
+++ b/plugins/team/org.eclipse.papyrus.team.svn/src/org/eclipse/papyrus/team/svn/SVNLockHandler.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2011 Atos Origin.
+ * Copyright (c) 2011, 2014 Atos Origin, CEA, and others.
*
*
* All rights reserved. This program and the accompanying materials
@@ -9,13 +9,17 @@
*
* Contributors:
* Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
+ * Christian W. Damus (CEA) - bug 429826
*
*****************************************************************************/
package org.eclipse.papyrus.team.svn;
import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.resources.team.FileModificationValidationContext;
@@ -24,16 +28,27 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.papyrus.infra.emf.readonly.AbstractReadOnlyHandler;
+import org.eclipse.papyrus.infra.core.resource.AbstractReadOnlyHandler;
+import org.eclipse.papyrus.infra.core.resource.ReadOnlyAxis;
+import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.svn.core.IStateFilter;
import org.eclipse.team.svn.core.svnstorage.SVNRemoteStorage;
import org.eclipse.team.svn.core.utility.FileUtility;
import org.eclipse.team.svn.ui.SVNTeamModificationValidator;
import com.google.common.base.Optional;
+import com.google.common.collect.Sets;
+/**
+ * The Subversion file read-only handler is permission-based.
+ */
public class SVNLockHandler extends AbstractReadOnlyHandler {
+ // This is defined by SVNTeamPlugin.NATURE_ID constant, but we don't want a dependency
+ // on that class (although, technically, it should be compiled into this class's constant
+ // pool, let's be explicit about it)
+ private static final String SVN_NATURE_ID = "org.eclipse.team.svn.core.nature"; //$NON-NLS-1$
+
FileModificationValidator validator = null;
public SVNLockHandler(EditingDomain editingDomain) {
@@ -44,9 +59,9 @@ public class SVNLockHandler extends AbstractReadOnlyHandler {
}
}
- public Optional<Boolean> anyReadOnly(URI[] uris) {
+ public Optional<Boolean> anyReadOnly(Set<ReadOnlyAxis> axes, URI[] uris) {
- if (validator != null) {
+ if ((validator != null) && axes.contains(ReadOnlyAxis.PERMISSION)) {
IResource[] needsLockResources = FileUtility.filterResources(getIFiles(uris), IStateFilter.SF_NEEDS_LOCK, IResource.DEPTH_ZERO);
for(IResource needsLockResource : needsLockResources) {
if(!SVNRemoteStorage.instance().asLocalResource(needsLockResource).isLocked()) {
@@ -57,9 +72,30 @@ public class SVNLockHandler extends AbstractReadOnlyHandler {
return Optional.absent();
}
+
+ @Override
+ public Optional<Boolean> canMakeWritable(Set<ReadOnlyAxis> axes, URI[] uris) {
+ if((validator != null) && axes.contains(ReadOnlyAxis.PERMISSION)) {
+ // get the unique set of projects to check for SVN team provider
+ IFile[] files = getIFiles(uris);
+ Set<IProject> projects = Sets.newHashSet();
+ for(int i = 0; i < files.length; i++) {
+ projects.add(files[i].getProject());
+ }
+
+ boolean result = false;
+ for(Iterator<IProject> iter = projects.iterator(); !result && iter.hasNext();) {
+ result = RepositoryProvider.getProvider(iter.next(), SVN_NATURE_ID) != null;
+ }
+
+ return Optional.of(result);
+ }
+
+ return Optional.absent();
+ }
- public Optional<Boolean> makeWritable(URI[] uris) {
- if (validator != null) {
+ public Optional<Boolean> makeWritable(Set<ReadOnlyAxis> axes, URI[] uris) {
+ if ((validator != null) && axes.contains(ReadOnlyAxis.PERMISSION)) {
IStatus result = validator.validateEdit(getIFiles(uris), FileModificationValidationContext.VALIDATE_PROMPT);
return Optional.of(result.isOK());
}
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/StereotypePropertyCellManager.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/StereotypePropertyCellManager.java
index a7279a39c2b..05391d17b1e 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/StereotypePropertyCellManager.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/manager/cell/StereotypePropertyCellManager.java
@@ -37,6 +37,7 @@ import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattablecell.Cell;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableproblem.Problem;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableproblem.StringResolutionProblem;
+import org.eclipse.papyrus.infra.nattable.paste.PastePostActionRegistry;
import org.eclipse.papyrus.infra.nattable.utils.AxisUtils;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
@@ -50,10 +51,12 @@ import org.eclipse.papyrus.uml.nattable.paste.StereotypeApplicationStructure;
import org.eclipse.papyrus.uml.nattable.utils.Constants;
import org.eclipse.papyrus.uml.nattable.utils.UMLTableUtils;
import org.eclipse.papyrus.uml.tools.commands.ApplyStereotypeCommand;
+import org.eclipse.papyrus.uml.tools.utils.CustomElementOperations;
import org.eclipse.papyrus.uml.tools.utils.EnumerationUtil;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Enumeration;
import org.eclipse.uml2.uml.EnumerationLiteral;
+import org.eclipse.uml2.uml.NamedElement;
import org.eclipse.uml2.uml.PrimitiveType;
import org.eclipse.uml2.uml.Property;
import org.eclipse.uml2.uml.Stereotype;
@@ -165,7 +168,15 @@ public class StereotypePropertyCellManager extends UMLFeatureCellManager {
}
}
-
+ /**
+ *
+ * @see org.eclipse.papyrus.infra.nattable.manager.cell.AbstractCellManager#isCellEditable(java.lang.Object, java.lang.Object, java.util.Map)
+ *
+ * @param columnElement
+ * @param rowElement
+ * @param sharedMap
+ * @return
+ */
@Override
public boolean isCellEditable(final Object columnElement, final Object rowElement, final Map<?, ?> sharedMap) {
final List<Object> umlObjects = organizeAndResolvedObjects(columnElement, rowElement, sharedMap);
@@ -173,12 +184,27 @@ public class StereotypePropertyCellManager extends UMLFeatureCellManager {
final String id = (String)umlObjects.get(1);
switch(UMLTableUtils.getAppliedStereotypesWithThisProperty(el, id, sharedMap).size()) {
+ case 0:
+ //the element is not yet in the resource, and the stereotype required by a column is not yet applied
+ //see bug 431691: [Table 2] Paste from Spreadsheet must be able to apply required stereotypes for column properties in all usecases
+ //https://bugs.eclipse.org/bugs/show_bug.cgi?id=431691
+ final Object container = sharedMap.get(org.eclipse.papyrus.infra.nattable.utils.Constants.PASTED_ELEMENT_CONTAINER_KEY);
+ if(container instanceof Element) {
+ Element parent = (Element)container;
+ Property prop1 = UMLTableUtils.getRealStereotypeProperty(parent, id);
+ if(prop1 != null && prop1.getOwner() instanceof Stereotype) {
+ return CustomElementOperations.isStereotypeApplicable(parent, el, (Stereotype)prop1.eContainer());
+ }
+ }
+ break;
+
case 1:
final Property prop = UMLTableUtils.getRealStereotypeProperty(el, id, sharedMap);
return !prop.isDerived() && !prop.isReadOnly();
default:
return false;
}
+ return false;
}
/**
@@ -363,13 +389,55 @@ public class StereotypePropertyCellManager extends UMLFeatureCellManager {
return new GMFtoEMFCommandWrapper(cmd);
}
+ /**
+ * This method is used when we are pasting elements in detached mode
+ *
+ * @param columnElement
+ * the column element
+ * @param rowElement
+ * the row element
+ * @param valueAsString
+ * the value as string
+ * @param valueConverter
+ * the value converter to use
+ * @param tableManager
+ * the table manager
+ * @param sharedMap
+ * a map with shared elements. The method may read/add elements to the shared map. These contributions will be managed by a paste post
+ * action or by the paste manager itself
+ */
@Override
public void setStringValue(Object columnElement, Object rowElement, String valueAsString, AbstractStringValueConverter valueSolver, INattableModelManager tableManager, Map<?, ?> sharedMap) {
+ if(valueAsString ==null || valueAsString.isEmpty()){
+ return;
+ }
final List<Object> umlObjects = organizeAndResolvedObjects(columnElement, rowElement, sharedMap);
final Element el = (Element)umlObjects.get(0);
final String id = (String)umlObjects.get(1);
Property prop = UMLTableUtils.getRealStereotypeProperty(el, id, sharedMap);
List<Stereotype> stereotypes = UMLTableUtils.getAppliedStereotypesWithThisProperty(el, id, sharedMap);
+
+ if(stereotypes.size() == 0) {
+ Object parentElement = sharedMap.get(org.eclipse.papyrus.infra.nattable.utils.Constants.PASTED_ELEMENT_CONTAINER_KEY);
+ final Element element = prop.getOwner();
+ if(element instanceof Stereotype && parentElement instanceof Element) {
+ boolean isApplicable = CustomElementOperations.isStereotypeApplicable(((Element)parentElement).getNearestPackage(), el, (Stereotype)element);
+ if(isApplicable) {
+ //apply stereotype required by the column property using post actions mecanism
+ final String postActionId = Constants.POST_ACTION_APPLY_STEREOTYPE_PREFIX + ((NamedElement)element).getQualifiedName();
+
+ //we register a special post actions to conclude the stereotype application
+ @SuppressWarnings("unchecked")
+ final Collection<String> postActionIds = (Collection<String>)sharedMap.get(org.eclipse.papyrus.infra.nattable.utils.Constants.ADDITIONAL_POST_ACTIONS_TO_CONCLUDE_PASTE_KEY);
+ postActionIds.add(postActionId);
+ //we do the post action : we apply the streotype
+ PastePostActionRegistry.INSTANCE.doPostAction(tableManager, postActionId, (EObject)parentElement, el, (Map<Object, Object>)sharedMap, id);
+ stereotypes = UMLTableUtils.getAppliedStereotypesWithThisProperty(el, id, sharedMap);
+ }
+ }
+ }
+
+
ConvertedValueContainer<?> solvedValue = null;
EObject stereotypeApplication = null;
EStructuralFeature steApFeature = null;
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java
index 946701bce32..c6aaa80b212 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable/src/org/eclipse/papyrus/uml/nattable/utils/UMLTableUtils.java
@@ -55,15 +55,17 @@ public class UMLTableUtils {
assert id.startsWith(PROPERTY_OF_STEREOTYPE_PREFIX);
if(eobject instanceof Element) {
final Element element = (Element)eobject;
- final String propertyQN = id.replace(UMLTableUtils.PROPERTY_OF_STEREOTYPE_PREFIX, ""); //$NON-NLS-1$
- final String propertyName = NamedElementUtil.getNameFromQualifiedName(propertyQN);
- final String stereotypeQN = NamedElementUtil.getParentQualifiedName(propertyQN);
- final String stereotypeName = NamedElementUtil.getNameFromQualifiedName(stereotypeQN);
- final String profileQN = NamedElementUtil.getParentQualifiedName(stereotypeQN);
- final Profile profile = element.getNearestPackage().getAppliedProfile(profileQN, true);
- if(profile != null) {
- final Stereotype ste = profile.getOwnedStereotype(stereotypeName);
- return (Property)ste.getMember(propertyName);
+ if(element.getNearestPackage() != null) {
+ final String propertyQN = id.replace(UMLTableUtils.PROPERTY_OF_STEREOTYPE_PREFIX, ""); //$NON-NLS-1$
+ final String propertyName = NamedElementUtil.getNameFromQualifiedName(propertyQN);
+ final String stereotypeQN = NamedElementUtil.getParentQualifiedName(propertyQN);
+ final String stereotypeName = NamedElementUtil.getNameFromQualifiedName(stereotypeQN);
+ final String profileQN = NamedElementUtil.getParentQualifiedName(stereotypeQN);
+ final Profile profile = element.getNearestPackage().getAppliedProfile(profileQN, true);
+ if(profile != null) {
+ final Stereotype ste = profile.getOwnedStereotype(stereotypeName);
+ return (Property)ste.getMember(propertyName);
+ }
}
}
@@ -182,8 +184,10 @@ public class UMLTableUtils {
final List<Stereotype> stereotypes = new ArrayList<Stereotype>();
if(sharedMap != null) {
final List<StereotypeApplicationStructure> struct = findStereotypeApplicationDataStructure(element, id, sharedMap);
- for(final StereotypeApplicationStructure current : struct) {
- stereotypes.add(current.getStereotype());
+ if(struct != null) {
+ for(final StereotypeApplicationStructure current : struct) {
+ stereotypes.add(current.getStereotype());
+ }
}
}
if(element.eResource() != null) {
@@ -209,7 +213,7 @@ public class UMLTableUtils {
* a map owning interesting information, like {@link StereotypeApplicationStructure} which can be used to find stereotype, stereotype
* application and so on
* @return
- * the list of the found data structure
+ * the list of the found data structure or <code>null</code> if not found
*/
public static final List<StereotypeApplicationStructure> findStereotypeApplicationDataStructure(final Element editedElement, final String id, final Map<?, ?> sharedMap) {
//TODO : enhance the data structure to look for an editedElement + a propQn as Key!
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/CustomElementOperations.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/CustomElementOperations.java
index 50a0b37ed7b..6dd84e2b478 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/CustomElementOperations.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools.utils/src/org/eclipse/papyrus/uml/tools/utils/CustomElementOperations.java
@@ -55,6 +55,22 @@ public class CustomElementOperations extends ElementOperations {
/**
*
+ * @param parentElement
+ * the parent of the element (required because the element is probably to yet attached to its parent
+ * @param element
+ * the element on which we want apply a stereotype
+ * @param stereotype
+ * the stereotype to apply
+ * @return
+ * <code>true</code> if the stereotype can be applied on this element
+ */
+ public static boolean isStereotypeApplicable(final Element parentElement, Element element, Stereotype stereotype) {
+ return getDefinition(parentElement, stereotype) != null && getExtension(element, stereotype) != null;
+
+ }
+
+ /**
+ *
* @param element
* @param stereotype
* @return

Back to the top