Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2015-10-21 08:23:24 -0400
committerAnton Leherbauer2015-10-21 08:23:24 -0400
commit597f0a78a56b94f768b37eb50a9927f6b03f972d (patch)
treeeb9882fd0298c6e7bd8d2defb3e55d71c9c08ed0
parent6239c7c1b602282a74b207a5516393f9abf591df (diff)
downloadorg.eclipse.tcf-597f0a78a56b94f768b37eb50a9927f6b03f972d.tar.gz
org.eclipse.tcf-597f0a78a56b94f768b37eb50a9927f6b03f972d.tar.xz
org.eclipse.tcf-597f0a78a56b94f768b37eb50a9927f6b03f972d.zip
Target Explorer: Allow to disable filters in FSFolderSelectionDialog
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSFolderSelectionDialog.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSFolderSelectionDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSFolderSelectionDialog.java
index 4d028048b..285f5b479 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSFolderSelectionDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/dialogs/FSFolderSelectionDialog.java
@@ -9,8 +9,10 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.filesystem.ui.dialogs;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IStatus;
@@ -88,6 +90,7 @@ public final class FSFolderSelectionDialog extends ElementTreeSelectionDialog {
// The nodes that are being moved.
private List<IFSTreeNode> movedNodes;
private final int mode;
+ private final Set<String> fDisabledFilters = new HashSet<String>();
public static final int MODE_ALL = 0;
public static final int MODE_ALL_WARNING_NOT_WRITABLE = 1;
@@ -162,13 +165,24 @@ public final class FSFolderSelectionDialog extends ElementTreeSelectionDialog {
FilterDescriptor[] filterDescriptors = ViewerStateManager.getInstance().getFilterDescriptors(IFSConstants.ID_TREE_VIEWER_FS, input);
Assert.isNotNull(filterDescriptors);
for (FilterDescriptor descriptor : filterDescriptors) {
- if (descriptor.isEnabled()) {
+ if (descriptor.isEnabled() && !fDisabledFilters.contains(descriptor.getId())) {
addFilter(descriptor.getFilter());
}
}
}
/**
+ * Disable the filter with given ID.
+ * <p>
+ * <strong>Note:</strong> Must be called before {@link #setInput}.
+ * </p>
+ * @param filterId the filter ID
+ */
+ public final void disableFilter(String filterId) {
+ fDisabledFilters.add(filterId);
+ }
+
+ /**
* Create a decorating label provider using the specified label provider.
*
* @param labelProvider The label provider that actually provides labels and images.

Back to the top