Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/internal/ui/filters/OnlyDiFilter.java')
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/internal/ui/filters/OnlyDiFilter.java57
1 files changed, 57 insertions, 0 deletions
diff --git a/plugins/infra/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/internal/ui/filters/OnlyDiFilter.java b/plugins/infra/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/internal/ui/filters/OnlyDiFilter.java
new file mode 100644
index 00000000000..c16a65a8778
--- /dev/null
+++ b/plugins/infra/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/internal/ui/filters/OnlyDiFilter.java
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ * Copyright (c) 2011 Atos Origin Integration.
+ *
+ * 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:
+ * Tristan Faure (Atos Origin Integration) tristan.faure@atosorigin.com - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.onefile.internal.ui.filters;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.papyrus.infra.onefile.utils.OneFileUtils;
+
+/**
+ * Filter hiding di files and associated. the filter enables the content
+ * provider
+ *
+ * @author tfaure
+ *
+ */
+public class OnlyDiFilter extends ViewerFilter {
+
+ public static final String FILTER_ID = "org.eclipse.papyrus.infra.onefile.onlyDiFilter";
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers
+ * .Viewer, java.lang.Object, java.lang.Object)
+ *
+ * @Override
+ */
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ return OneFileUtils.isVisible(element);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.viewers.ViewerFilter#isFilterProperty(java.lang.Object,
+ * java.lang.String)
+ *
+ * @Override
+ */
+ @Override
+ public boolean isFilterProperty(Object element, String property) {
+ return true;
+ }
+
+}

Back to the top