Search in sources :

Example 1 with FQNPrefixMatcher

use of org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher in project xtext-eclipse by eclipse.

the class Bug349773Test method createMatcher.

@Override
protected FQNPrefixMatcher createMatcher() {
    IgnoreCase ignoreCase = new PrefixMatcher.IgnoreCase();
    FQNPrefixMatcher result = new FQNPrefixMatcher();
    result.setDelegate(ignoreCase);
    result.setLastSegmentFinder(new FQNPrefixMatcher.DefaultLastSegmentFinder());
    return result;
}
Also used : IgnoreCase(org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher.IgnoreCase) FQNPrefixMatcher(org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher)

Example 2 with FQNPrefixMatcher

use of org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher in project xtext-eclipse by eclipse.

the class PrefixMatcherOutlineAdapterTest method createStringMatcher.

@Override
protected StringMatcher createStringMatcher(String pattern) {
    FQNPrefixMatcher fqnPrefixMatcher = new FQNPrefixMatcher();
    fqnPrefixMatcher.setLastSegmentFinder(new FQNPrefixMatcher.DefaultLastSegmentFinder());
    fqnPrefixMatcher.setDelegate(new PrefixMatcher.CamelCase());
    return new PrefixMatcherOutlineAdapter(pattern, fqnPrefixMatcher);
}
Also used : FQNPrefixMatcher(org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher) PrefixMatcher(org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher) PrefixMatcherOutlineAdapter(org.eclipse.xtext.ui.editor.outline.quickoutline.PrefixMatcherOutlineAdapter) FQNPrefixMatcher(org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher)

Example 3 with FQNPrefixMatcher

use of org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher in project xtext-eclipse by eclipse.

the class FQNPrefixMatcherTest method createMatcher.

@Override
protected FQNPrefixMatcher createMatcher() {
    IgnoreCase ignoreCase = new PrefixMatcher.IgnoreCase();
    FQNPrefixMatcher result = new FQNPrefixMatcher();
    result.setDelegate(ignoreCase);
    result.setLastSegmentFinder(new FQNPrefixMatcher.LastSegmentFinder() {

        @Override
        public String getLastSegment(String fqn, char delimiter) {
            int i = fqn.lastIndexOf(delimiter);
            if (i >= 0) {
                if (i != fqn.length() - 1)
                    return fqn.substring(i + 1);
                return "";
            }
            return fqn;
        }
    });
    return result;
}
Also used : IgnoreCase(org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher.IgnoreCase) FQNPrefixMatcher(org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher)

Aggregations

FQNPrefixMatcher (org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher)3 IgnoreCase (org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher.IgnoreCase)2 PrefixMatcher (org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher)1 PrefixMatcherOutlineAdapter (org.eclipse.xtext.ui.editor.outline.quickoutline.PrefixMatcherOutlineAdapter)1