org.mockcentral.editor.search
Class FilterManager

java.lang.Object
  extended by org.mockcentral.editor.search.FilterManager
All Implemented Interfaces:
DuplicatedTypeNameProvider

public class FilterManager
extends java.lang.Object
implements DuplicatedTypeNameProvider

A Class used to manage element list filtering a SelectTypeDialog instance. This class provides methods to check the legality of a found type by assuring it has a public modifier and matches the search pattern supplied to the dialog (Class, Interface or Enum). It also provides code to enable the dialog's ILabelProvider to do it's job properly by qualifying any type names which are duplicates and inserting information about any enclosing types if necessary.

Author:
David Hutchinson

Constructor Summary
FilterManager()
           
 
Method Summary
 void addMemberType(MatchingType type)
           
 boolean containsMemberType(MatchingType matchingType)
           
 boolean isDuplicatedTypeName(java.lang.String typeName)
          Returns whether the supplied type name duplicates another.
 boolean isLegalElement(int elementMatchRule, MatchingType matchingType)
          Returns whether the supplied MatchingType is acceptable given the supplied match rule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterManager

public FilterManager()
Method Detail

addMemberType

public void addMemberType(MatchingType type)

containsMemberType

public boolean containsMemberType(MatchingType matchingType)

isDuplicatedTypeName

public boolean isDuplicatedTypeName(java.lang.String typeName)
Description copied from interface: DuplicatedTypeNameProvider
Returns whether the supplied type name duplicates another.

Specified by:
isDuplicatedTypeName in interface DuplicatedTypeNameProvider
Parameters:
typeName - the simple name of the type.
Returns:
whether the supplied type name duplicates another.

isLegalElement

public boolean isLegalElement(int elementMatchRule,
                              MatchingType matchingType)
Returns whether the supplied MatchingType is acceptable given the supplied match rule.

Parameters:
elementMatchRule - an int specifying the searched type, one of IJavaSearchConstants.CLASS, IJavaSearchConstants.CLASS_AND_INTERFACE and IJavaSearchConstants.ENUM
matchingType - the MatchingType.
Returns:
whether the supplied MatchingType is acceptable given the supplied match rule.