summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-10-15 09:01:59 (EDT)
committer Stephan Born2012-10-15 09:01:59 (EDT)
commit370963943548fc393e175b463c139e0d96a98b14 (patch)
tree3f5c6febbd6a9f82411a9b2fba6d4d65a508851e
parentbb94a3c722dc76a7b2a8680063eacf06b8f88cf1 (diff)
downloadorg.eclipse.stardust.ide-370963943548fc393e175b463c139e0d96a98b14.zip
org.eclipse.stardust.ide-370963943548fc393e175b463c139e0d96a98b14.tar.gz
org.eclipse.stardust.ide-370963943548fc393e175b463c139e0d96a98b14.tar.bz2
CRNT-26527 Pepper: Implement Filter to hide external model elements in the outline
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@60044 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelBuilderFacade.java64
-rw-r--r--model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelerConstants.java2
2 files changed, 65 insertions, 1 deletions
diff --git a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelBuilderFacade.java b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelBuilderFacade.java
index aac88c5..42bc36e 100644
--- a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelBuilderFacade.java
+++ b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelBuilderFacade.java
@@ -110,6 +110,7 @@ import org.eclipse.stardust.model.xpdl.xpdl2.XpdlFactory;
import org.eclipse.stardust.model.xpdl.xpdl2.XpdlPackage;
import org.eclipse.stardust.model.xpdl.xpdl2.util.ExtendedAttributeUtil;
import org.eclipse.stardust.model.xpdl.xpdl2.util.TypeDeclarationUtils;
+import org.eclipse.stardust.modeling.repository.common.Connection;
import org.eclipse.stardust.modeling.repository.common.descriptors.ReplaceEObjectDescriptor;
import org.eclipse.stardust.modeling.repository.common.descriptors.ReplaceModelElementDescriptor;
import org.eclipse.stardust.modeling.repository.common.util.ImportUtils;
@@ -2415,5 +2416,68 @@ public class ModelBuilderFacade
return null;
}
+ public boolean isExternalReference(EObject modelElement)
+ {
+ if (modelElement != null)
+ {
+ if (modelElement instanceof ActivityType)
+ {
+ return false;
+ }
+ if (modelElement instanceof IExtensibleElement)
+ {
+ if (AttributeUtil.getAttributeValue((IExtensibleElement) modelElement,
+ IConnectionManager.URI_ATTRIBUTE_NAME) != null)
+ {
+ String uri = AttributeUtil.getAttributeValue(
+ (IExtensibleElement) modelElement,
+ IConnectionManager.URI_ATTRIBUTE_NAME);
+ ModelType model = ModelUtils.findContainingModel(modelElement);
+ if (model == null)
+ {
+ return false;
+ }
+ Connection connection = (Connection) model.getConnectionManager()
+ .findConnection(uri);
+ if (connection != null)
+ {
+ String importString = connection.getAttribute("importByReference"); //$NON-NLS-1$
+ if (importString != null && importString.equalsIgnoreCase("false")) //$NON-NLS-1$
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ if (modelElement instanceof Extensible)
+ {
+ if (ExtendedAttributeUtil.getAttributeValue((Extensible) modelElement,
+ IConnectionManager.URI_ATTRIBUTE_NAME) != null)
+ {
+ String uri = ExtendedAttributeUtil.getAttributeValue(
+ (Extensible) modelElement, IConnectionManager.URI_ATTRIBUTE_NAME);
+ ModelType model = ModelUtils.findContainingModel(modelElement);
+ if (model == null)
+ {
+ return false;
+ }
+ Connection connection = (Connection) model.getConnectionManager()
+ .findConnection(uri);
+ if (connection != null)
+ {
+ String importString = connection.getAttribute("importByReference"); //$NON-NLS-1$
+ if (importString != null && importString.equalsIgnoreCase("false")) //$NON-NLS-1$
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
}
diff --git a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelerConstants.java b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelerConstants.java
index 7993d5a..f8f52fa 100644
--- a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelerConstants.java
+++ b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelerConstants.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.stardust.model.xpdl.builder.utils;
-import org.eclipse.stardust.model.xpdl.carnot.util.ModelUtils;
public class ModelerConstants
{
@@ -188,4 +187,5 @@ public class ModelerConstants
public static final String ANNOTATION_SYMBOLS = "annotationSymbols";
public static final String CONTENT_PROPERTY = "content";
public static final String COMMENTS_PROPERTY = "comments";
+ public static final String EXTERNAL_REFERENCE_PROPERTY = "externalReference";
}