aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Becher2012-02-22 14:48:41 (EST)
committerOleg Besedin2012-02-22 14:48:41 (EST)
commit0bf67b68cc62c58a7ac3f12856ba70db74236dc9 (patch)
treee851341c315cba6cad0cca6dfa7066ac331e4258
parent20c138787b1af031189d81824e7edf15d5161a64 (diff)
downloadeclipse.platform.ui-0bf67b68cc62c58a7ac3f12856ba70db74236dc9.zip
eclipse.platform.ui-0bf67b68cc62c58a7ac3f12856ba70db74236dc9.tar.gz
eclipse.platform.ui-0bf67b68cc62c58a7ac3f12856ba70db74236dc9.tar.bz2
Bug 186404 - [Viewers] Update PatternFilter API to allow extensionsv20120222-1948
-rw-r--r--bundles/org.eclipse.ui.workbench/.settings/.api_filters45
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/PatternFilter.java36
2 files changed, 42 insertions, 39 deletions
diff --git a/bundles/org.eclipse.ui.workbench/.settings/.api_filters b/bundles/org.eclipse.ui.workbench/.settings/.api_filters
index 4b5b176..a46c9ce 100644
--- a/bundles/org.eclipse.ui.workbench/.settings/.api_filters
+++ b/bundles/org.eclipse.ui.workbench/.settings/.api_filters
@@ -1,9 +1,36 @@
-<?xml version="1.0" encoding="UTF-8"?><component id="org.eclipse.ui.workbench" version="2">
- <resource path="Eclipse UI/org/eclipse/ui/XMLMemento.java" type="org.eclipse.ui.XMLMemento">
- <filter id="1143996420">
- <message_arguments>
- <message_argument value="getChildren()"/>
- </message_arguments>
- </filter>
- </resource>
-</component> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.ui.workbench" version="2">
+ <resource path="Eclipse UI/org/eclipse/ui/XMLMemento.java" type="org.eclipse.ui.XMLMemento">
+ <filter id="1143996420">
+ <message_arguments>
+ <message_argument value="getChildren()"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="Eclipse UI/org/eclipse/ui/dialogs/PatternFilter.java" type="org.eclipse.ui.dialogs.PatternFilter">
+ <filter comment="Reverting temporary change for bug 186404" id="338792546">
+ <message_arguments>
+ <message_argument value="org.eclipse.ui.dialogs.PatternFilter"/>
+ <message_argument value="doFilter(Viewer, Object, Object[])"/>
+ </message_arguments>
+ </filter>
+ <filter comment="Reverting temporary change for bug 186404" id="388018290">
+ <message_arguments>
+ <message_argument value="org.eclipse.ui.dialogs.PatternFilter"/>
+ <message_argument value="foundAnyCache"/>
+ </message_arguments>
+ </filter>
+ <filter comment="Reverting temporary change for bug 186404" id="388018290">
+ <message_arguments>
+ <message_argument value="org.eclipse.ui.dialogs.PatternFilter"/>
+ <message_argument value="useCache"/>
+ </message_arguments>
+ </filter>
+ <filter comment="Reverting temporary change for bug 186404" id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.ui.dialogs.PatternFilter"/>
+ <message_argument value="select(Viewer, Object, Object)"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/PatternFilter.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/PatternFilter.java
index 2c43b5c..51c252a 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/PatternFilter.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/PatternFilter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
+ * Copyright (c) 2004, 2012 IBM Corporation and others.
* 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
@@ -11,11 +11,11 @@
*******************************************************************************/
package org.eclipse.ui.dialogs;
+import com.ibm.icu.text.BreakIterator;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
@@ -24,8 +24,6 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.ui.internal.misc.StringMatcher;
-import com.ibm.icu.text.BreakIterator;
-
/**
* A filter used in conjunction with <code>FilteredTree</code>. In order to
* determine if a node should be filtered it uses the content and label provider
@@ -42,19 +40,12 @@ public class PatternFilter extends ViewerFilter {
*/
private Map cache = new HashMap();
- /**
+ /*
* Maps parent elements to TRUE or FALSE
- *
- * @since 3.8
*/
- protected Map foundAnyCache = new HashMap();
+ private Map foundAnyCache = new HashMap();
- /**
- * Specifies if caching of filter results should be used.
- *
- * @since 3.8
- */
- protected boolean useCache = false;
+ private boolean useCache = false;
/**
* Whether to include a leading wildcard for all provided patterns. A
@@ -85,22 +76,7 @@ public class PatternFilter extends ViewerFilter {
if (!useCache) {
return super.filter(viewer, parent, elements);
}
- return doFilter(viewer, parent, elements);
- }
- /**
- * Filters the given elements for the given viewer using local cache.
- *
- * @param viewer
- * the viewer
- * @param parent
- * the parent element
- * @param elements
- * the elements to filter
- * @return the filtered elements
- * @since 3.8
- */
- protected Object[] doFilter(Viewer viewer, Object parent, Object[] elements) {
Object[] filtered = (Object[]) cache.get(parent);
if (filtered == null) {
Boolean foundAny = (Boolean) foundAnyCache.get(parent);
@@ -164,7 +140,7 @@ public class PatternFilter extends ViewerFilter {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
- public boolean select(Viewer viewer, Object parentElement,
+ public final boolean select(Viewer viewer, Object parentElement,
Object element) {
return isElementVisible(viewer, element);
}