Eclipse Platform
Release 3.3

org.eclipse.ui.dialogs
Class FilteredItemsSelectionDialog.ItemsFilter

java.lang.Object
  extended byorg.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter
Direct Known Subclasses:
FilteredResourcesSelectionDialog.ResourceFilter
Enclosing class:
FilteredItemsSelectionDialog

protected abstract class FilteredItemsSelectionDialog.ItemsFilter
extends Object

Filters elements using SearchPattern by comparing the names of items with the filter pattern.


Field Summary
protected  SearchPattern patternMatcher
           
 
Constructor Summary
FilteredItemsSelectionDialog.ItemsFilter()
          Creates new instance of ItemsFilter.
FilteredItemsSelectionDialog.ItemsFilter(SearchPattern searchPattern)
          Creates new instance of ItemsFilter.
 
Method Summary
 boolean equalsFilter(FilteredItemsSelectionDialog.ItemsFilter filter)
          Checks whether the provided filter is equal to the current filter.
 int getMatchRule()
          Returns the rule to apply for matching keys.
 String getPattern()
          Returns the pattern string.
 boolean isCamelCasePattern()
          Checks whether the pattern's match rule is camel case.
abstract  boolean isConsistentItem(Object item)
          Checks consistency of an item.
 boolean isSubFilter(FilteredItemsSelectionDialog.ItemsFilter filter)
          Check if the given filter is a sub-filter of current filter.
protected  boolean matches(String text)
          Matches text with filter.
 boolean matchesRawNamePattern(Object item)
          General method for matching raw name pattern.
abstract  boolean matchItem(Object item)
          Matches an item against filter conditions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

patternMatcher

protected SearchPattern patternMatcher
Constructor Detail

FilteredItemsSelectionDialog.ItemsFilter

public FilteredItemsSelectionDialog.ItemsFilter()
Creates new instance of ItemsFilter.


FilteredItemsSelectionDialog.ItemsFilter

public FilteredItemsSelectionDialog.ItemsFilter(SearchPattern searchPattern)
Creates new instance of ItemsFilter.

Parameters:
searchPattern - the pattern to be used when filtering
Method Detail

isSubFilter

public boolean isSubFilter(FilteredItemsSelectionDialog.ItemsFilter filter)
Check if the given filter is a sub-filter of current filter. The default implementation checks if the SearchPattern from the current filter is a sub-pattern of the one from the provided filter.

Parameters:
filter - the filter to be checked, or null
Returns:
true if the given filter is sub-filter of the current, false if the given filter isn't a sub-filter or is null
See Also:
SearchPattern.isSubPattern(org.eclipse.ui.dialogs.SearchPattern)

equalsFilter

public boolean equalsFilter(FilteredItemsSelectionDialog.ItemsFilter filter)
Checks whether the provided filter is equal to the current filter. The default implementation checks if SearchPattern from current filter is equal to the one from provided filter.

Parameters:
filter - filter to be checked, or null
Returns:
true if the given filter is equal to current filter, false if given filter isn't equal to current one or if it is null
See Also:
SearchPattern.equalsPattern(org.eclipse.ui.dialogs.SearchPattern)

isCamelCasePattern

public boolean isCamelCasePattern()
Checks whether the pattern's match rule is camel case.

Returns:
true if pattern's match rule is camel case, false otherwise

getPattern

public String getPattern()
Returns the pattern string.

Returns:
pattern for this filter
See Also:
SearchPattern.getPattern()

getMatchRule

public int getMatchRule()
Returns the rule to apply for matching keys.

Returns:
match rule
See Also:
SearchPattern.getMatchRule()

matches

protected boolean matches(String text)
Matches text with filter.

Parameters:
text -
Returns:
true if text matches with filter pattern, false otherwise

matchesRawNamePattern

public boolean matchesRawNamePattern(Object item)
General method for matching raw name pattern. Checks whether current pattern is prefix of name provided item.

Parameters:
item - item to check
Returns:
true if current pattern is a prefix of name provided item, false if item's name is shorter than prefix or sequences of characters don't match.

matchItem

public abstract boolean matchItem(Object item)
Matches an item against filter conditions.

Parameters:
item -
Returns:
true if item matches against filter conditions, false otherwise

isConsistentItem

public abstract boolean isConsistentItem(Object item)
Checks consistency of an item. Item is inconsistent if was changed or removed.

Parameters:
item -
Returns:
true if item is consistent, false if item is inconsistent

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.