Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreperico2010-01-21 12:04:32 -0500
committereperico2010-01-21 12:04:32 -0500
commit9acfe6cfaa500bf10e62e5af36da0cac409de0fb (patch)
treec1ee49d977d749227acac0355ce6d27db22c08ec /plugins/profile-tool/org.eclipse.papyrus.resource
parent9cf37f13e2a0a4214bfebd1f82d631bf478c0aee (diff)
downloadorg.eclipse.papyrus-9acfe6cfaa500bf10e62e5af36da0cac409de0fb.tar.gz
org.eclipse.papyrus-9acfe6cfaa500bf10e62e5af36da0cac409de0fb.tar.xz
org.eclipse.papyrus-9acfe6cfaa500bf10e62e5af36da0cac409de0fb.zip
NEW - bug 300359: [Model Explorer] Handle stereotyped element for diagram profile based
https://bugs.eclipse.org/bugs/show_bug.cgi?id=300359
Diffstat (limited to 'plugins/profile-tool/org.eclipse.papyrus.resource')
-rw-r--r--plugins/profile-tool/org.eclipse.papyrus.resource/META-INF/MANIFEST.MF4
-rw-r--r--plugins/profile-tool/org.eclipse.papyrus.resource/plugin.xml10
-rw-r--r--plugins/profile-tool/org.eclipse.papyrus.resource/src/org/eclipse/papyrus/resource/filters/HideStereotypeApplicationsViewerFilter.java40
3 files changed, 53 insertions, 1 deletions
diff --git a/plugins/profile-tool/org.eclipse.papyrus.resource/META-INF/MANIFEST.MF b/plugins/profile-tool/org.eclipse.papyrus.resource/META-INF/MANIFEST.MF
index c7410ccf469..f45735ad7b3 100644
--- a/plugins/profile-tool/org.eclipse.papyrus.resource/META-INF/MANIFEST.MF
+++ b/plugins/profile-tool/org.eclipse.papyrus.resource/META-INF/MANIFEST.MF
@@ -11,5 +11,7 @@ Export-Package: org.eclipse.papyrus.resource,
org.eclipse.papyrus.resource.impl,
org.eclipse.papyrus.resource.util
Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.emf.ecore;visibility:=reexport
+ org.eclipse.emf.ecore;visibility:=reexport,
+ org.eclipse.ui.navigator,
+ org.eclipse.jface
Bundle-ActivationPolicy: lazy
diff --git a/plugins/profile-tool/org.eclipse.papyrus.resource/plugin.xml b/plugins/profile-tool/org.eclipse.papyrus.resource/plugin.xml
index 4266258f20b..6f1e188dbaf 100644
--- a/plugins/profile-tool/org.eclipse.papyrus.resource/plugin.xml
+++ b/plugins/profile-tool/org.eclipse.papyrus.resource/plugin.xml
@@ -16,5 +16,15 @@
class="org.eclipse.papyrus.resource.ResourcePackage"
genModel="model/resource.genmodel"/>
</extension>
+ <extension
+ point="org.eclipse.ui.navigator.navigatorContent">
+ <commonFilter
+ activeByDefault="true"
+ class="org.eclipse.papyrus.resource.filters.HideStereotypeApplicationsViewerFilter"
+ description="Hide Steretype Applications items in the navigator"
+ id="org.eclipse.papyrus.navigator.filters.HideStereotypeApplicationsViewerFilter"
+ name="Stereotype Applications">
+ </commonFilter>
+ </extension>
</plugin>
diff --git a/plugins/profile-tool/org.eclipse.papyrus.resource/src/org/eclipse/papyrus/resource/filters/HideStereotypeApplicationsViewerFilter.java b/plugins/profile-tool/org.eclipse.papyrus.resource/src/org/eclipse/papyrus/resource/filters/HideStereotypeApplicationsViewerFilter.java
new file mode 100644
index 00000000000..1a289031f1c
--- /dev/null
+++ b/plugins/profile-tool/org.eclipse.papyrus.resource/src/org/eclipse/papyrus/resource/filters/HideStereotypeApplicationsViewerFilter.java
@@ -0,0 +1,40 @@
+/*****************************************************************************
+ * Copyright (c) 2009 Atos Origin.
+ *
+ *
+ * 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:
+ * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.resource.filters;
+
+import org.eclipse.emf.ecore.impl.DynamicEObjectImpl;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.papyrus.resource.ResourceEObject;
+
+/**
+ * Filter Stereotype application elements in navigator in order to hide.
+ *
+ * @author eperico
+ */
+public class HideStereotypeApplicationsViewerFilter extends ViewerFilter {
+
+ /**
+ * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer,
+ * java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (element instanceof DynamicEObjectImpl || element instanceof ResourceEObject) {
+ return false;
+ }
+ return true;
+ }
+
+}

Back to the top