Java 类org.eclipse.ui.internal.misc.StringMatcher 实例源码

项目:mytourbook    文件:MsgEditorPreferences.java   
/**
 * @return The StringMatchers compiled from #getFilterLocalesStringMatcher()
 */
public synchronized StringMatcher[] getFilterLocalesStringMatchers() {
    if (cachedCompiledLocaleFilter != null) {
        return cachedCompiledLocaleFilter;
    }

    String pref = PREFS.getString(FILTER_LOCALES_STRING_MATCHERS);
    StringTokenizer tokenizer = new StringTokenizer(pref, ";, ", false);
    cachedCompiledLocaleFilter = new StringMatcher[tokenizer.countTokens()];
    int ii = 0;
    while (tokenizer.hasMoreTokens()) {
        StringMatcher pattern = new StringMatcher(tokenizer.nextToken().trim(), true, false);
        cachedCompiledLocaleFilter[ii] = pattern;
        ii++;
    }
    return cachedCompiledLocaleFilter;
}
项目:mytourbook    文件:UIUtils.java   
/**
 * @param locale
 * @return true if the locale is selected by the local-filter defined in the rpeferences
 * @see MsgEditorPreferences#getFilterLocalesStringMatcher()
 */
public static boolean isDisplayed(Locale locale) {
    if (ROOT_LOCALE.equals(locale) || locale == null) {
        return true;
    }
    StringMatcher[] patterns = 
        MsgEditorPreferences.getInstance().getFilterLocalesStringMatchers();
    if (patterns == null || patterns.length == 0) {
        return true;
    }
    String locStr = locale.toString();
    for (int i = 0; i < patterns.length; i++) {
        if (patterns[i].match(locStr)) {
            return true;
        }
    }
    return false;
}
项目:mytourbook    文件:MsgEditorPreferences.java   
/**
 * @return The StringMatchers compiled from #getFilterLocalesStringMatcher()
 */
public synchronized StringMatcher[] getFilterLocalesStringMatchers() {
    if (cachedCompiledLocaleFilter != null) {
        return cachedCompiledLocaleFilter;
    }

    String pref = PREFS.getString(FILTER_LOCALES_STRING_MATCHERS);
    StringTokenizer tokenizer = new StringTokenizer(pref, ";, ", false);
    cachedCompiledLocaleFilter = new StringMatcher[tokenizer.countTokens()];
    int ii = 0;
    while (tokenizer.hasMoreTokens()) {
        StringMatcher pattern = new StringMatcher(tokenizer.nextToken().trim(), true, false);
        cachedCompiledLocaleFilter[ii] = pattern;
        ii++;
    }
    return cachedCompiledLocaleFilter;
}
项目:mytourbook    文件:UIUtils.java   
/**
 * @param locale
 * @return true if the locale is selected by the local-filter defined in the rpeferences
 * @see MsgEditorPreferences#getFilterLocalesStringMatcher()
 */
public static boolean isDisplayed(Locale locale) {
    if (ROOT_LOCALE.equals(locale) || locale == null) {
        return true;
    }
    StringMatcher[] patterns = 
        MsgEditorPreferences.getInstance().getFilterLocalesStringMatchers();
    if (patterns == null || patterns.length == 0) {
        return true;
    }
    String locStr = locale.toString();
    for (int i = 0; i < patterns.length; i++) {
        if (patterns[i].match(locStr)) {
            return true;
        }
    }
    return false;
}
项目:mytourbook    文件:MsgEditorPreferences.java   
/**
 * @return The StringMatchers compiled from #getFilterLocalesStringMatcher()
 */
public synchronized StringMatcher[] getFilterLocalesStringMatchers() {
    if (cachedCompiledLocaleFilter != null) {
        return cachedCompiledLocaleFilter;
    }

    String pref = PREFS.getString(FILTER_LOCALES_STRING_MATCHERS);
    StringTokenizer tokenizer = new StringTokenizer(pref, ";, ", false);
    cachedCompiledLocaleFilter = new StringMatcher[tokenizer.countTokens()];
    int ii = 0;
    while (tokenizer.hasMoreTokens()) {
        StringMatcher pattern = new StringMatcher(tokenizer.nextToken().trim(), true, false);
        cachedCompiledLocaleFilter[ii] = pattern;
        ii++;
    }
    return cachedCompiledLocaleFilter;
}
项目:mytourbook    文件:UIUtils.java   
/**
 * @param locale
 * @return true if the locale is selected by the local-filter defined in the rpeferences
 * @see MsgEditorPreferences#getFilterLocalesStringMatcher()
 */
public static boolean isDisplayed(Locale locale) {
    if (ROOT_LOCALE.equals(locale) || locale == null) {
        return true;
    }
    StringMatcher[] patterns = 
        MsgEditorPreferences.getInstance().getFilterLocalesStringMatchers();
    if (patterns == null || patterns.length == 0) {
        return true;
    }
    String locStr = locale.toString();
    for (int i = 0; i < patterns.length; i++) {
        if (patterns[i].match(locStr)) {
            return true;
        }
    }
    return false;
}
项目:GrayTin    文件:ProjectSelectionDialog.java   
public void setFilter(String pattern, boolean ignoreCase, boolean ignoreWildCards) {
    fMatcher = new StringMatcher('*'+pattern + '*', ignoreCase, ignoreWildCards);
}