|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ui.dialogs.SearchPattern
A search pattern defines how search results are found.
This class is intended to be subclassed by clients. A default behavior is provided for each of the methods above, that clients can ovveride if they wish.
Field Summary | |
---|---|
static int |
RULE_BLANK_MATCH
Match rule: The search pattern is blank. |
static int |
RULE_CAMELCASE_MATCH
Match rule: The search pattern contains a Camel Case expression. |
static int |
RULE_CASE_SENSITIVE
Match rule: The search pattern matches the search result only if cases are the same. |
static int |
RULE_EXACT_MATCH
Match rule: The search pattern matches exactly the search result, that is, the source of the search result equals the search pattern. |
static int |
RULE_PATTERN_MATCH
Match rule: The search pattern contains one or more wild cards ('*' or '?'). |
static int |
RULE_PREFIX_MATCH
Match rule: The search pattern is a prefix of the search result. |
Constructor Summary | |
---|---|
SearchPattern()
Creates new instance of SearchPattern Default allowedRules for it is result of belong logic operation: ( RULE_EXACT_MATCH | RULE_PREFIX_MATCH | RULE_PATTERN_MATCH | RULE_CAMELCASE_MATCH ) |
|
SearchPattern(int allowedRules)
Creates a search pattern with the rule to apply for matching index keys. |
Method Summary | |
---|---|
boolean |
equalsPattern(SearchPattern pattern)
Tells whether the given SearchPattern equals this pattern. |
int |
getMatchRule()
Returns the rule to apply for matching keys. |
String |
getPattern()
Gets string pattern used by matcher |
protected boolean |
isNameCharAllowed(char nameChar)
Checks character of element's name is allowed for specified set. |
protected boolean |
isPatternCharAllowed(char patternChar)
Checks pattern's character is allowed for specified set. |
boolean |
isSubPattern(SearchPattern pattern)
Tells whether the given SearchPattern is a subpattern of
this pattern. |
protected boolean |
isValidCamelCaseChar(char ch)
Check if character is valid camelCase character |
boolean |
matches(String text)
Matches text with pattern. matching is determine by matchKind. |
void |
setPattern(String stringPattern)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int RULE_EXACT_MATCH
public static final int RULE_PREFIX_MATCH
public static final int RULE_PATTERN_MATCH
public static final int RULE_CASE_SENSITIVE
RULE_EXACT_MATCH
| RULE_CASE_SENSITIVE
public static final int RULE_BLANK_MATCH
public static final int RULE_CAMELCASE_MATCH
NPE
type string pattern will match
NullPointerException
and
NpPermissionException
types,NuPoEx
type string pattern will only match
NullPointerException
type.RULE_PREFIX_MATCH
match rule. For example,
when prefix match rule is combined with Camel Case match rule,
"nPE"
pattern will match nPException
. RULE_PATTERN_MATCH
may also be combined but both
rules will not be used simultaneously as they are mutually exclusive.
Used match rule depends on whether string pattern contains specific
pattern characters (e.g. '*' or '?') or not. If it does, then only
Pattern match rule will be used, otherwise only Camel Case match will be
used. For example, with "NPE"
string pattern, search will
only use Camel Case match rule, but with N*P*E*
string
pattern, it will use only Pattern match rule.
Constructor Detail |
public SearchPattern()
public SearchPattern(int allowedRules)
allowedRules
- one of RULE_EXACT_MATCH
, RULE_PREFIX_MATCH
,
RULE_PATTERN_MATCH
, RULE_CASE_SENSITIVE
,
RULE_CAMELCASE_MATCH
combined with one of following
values: RULE_EXACT_MATCH
, RULE_PREFIX_MATCH
,
RULE_PATTERN_MATCH
or RULE_CAMELCASE_MATCH
.
e.g. RULE_EXACT_MATCH
| RULE_CASE_SENSITIVE
if an exact and case sensitive match is requested,
RULE_PREFIX_MATCH
if a prefix non case sensitive
match is requested or RULE_EXACT_MATCH
if a non case
sensitive and erasure match is requested.Method Detail |
public String getPattern()
public void setPattern(String stringPattern)
stringPattern
- The stringPattern to set.public boolean matches(String text)
text
-
protected boolean isPatternCharAllowed(char patternChar)
patternChar
-
protected boolean isNameCharAllowed(char nameChar)
nameChar
- -
name of searched element
public final int getMatchRule()
protected boolean isValidCamelCaseChar(char ch)
ch
- character to be validated
public boolean equalsPattern(SearchPattern pattern)
SearchPattern
equals this pattern.
pattern
- pattern to be checked
public boolean isSubPattern(SearchPattern pattern)
SearchPattern
is a subpattern of
this pattern.
pattern
- pattern to be checked
|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.