bracket matching [message #319806] |
Sat, 01 September 2007 02:18  |
Eclipse User |
|
|
|
Hi,
I'm trying to give bracket matching to my Editor.
I added a PairMatcher to my SourceViewerDecorationSupport - with no
results.
protected void
configureSourceViewerDecorationSupport(SourceViewerDecoratio nSupport
support) {
char[] pairs= new char[] {'(',')'};
JavaPairMatcher jpm = new JavaPairMatcher(pairs);
support.setCharacterPairMatcher(jpm);
support.setMatchingCharacterPainterPreferenceKeys(
"matchingBrackets","matchingBracketsColor");
super.configureSourceViewerDecorationSupport(support);
}
I also tried to do the install method - still no visual result...
IPreferenceStore pref =
JavaEditorExamplePlugin.getDefault().getPreferenceStore();
support.install(pref);
How can I make the bracket matching work ?
|
|
|
|
Re: bracket matching [message #319809 is a reply to message #319807] |
Sat, 01 September 2007 13:23  |
Eclipse User |
|
|
|
Kristof - Thanks a lot !!
that did the trick.
You saved me a few days of chasing my tail...
Kristof Szabados wrote:
> Hi,
> When I had the same problem, I solved it by chaining my preference store
> after the original one like this:
> IPreferenceStore[] stores = {getPreferenceStore(), myPreferenceStore};
> setPreferenceStore(new ChainedPreferenceStore(stores));
> Hope this.
> Kristof
> "Nir" <no1999@walla.com> wrote in message
> news:d9b7a571abf57fc7b95a97fbbab32429$1@www.eclipse.org...
>> Hi,
>> I'm trying to give bracket matching to my Editor.
>> I added a PairMatcher to my SourceViewerDecorationSupport - with no
>> results.
>>
>> protected void
>> configureSourceViewerDecorationSupport(SourceViewerDecoratio nSupport
>> support) {
>>
>> char[] pairs= new char[] {'(',')'};
>>
>> JavaPairMatcher jpm = new JavaPairMatcher(pairs);
>>
>> support.setCharacterPairMatcher(jpm);
>> support.setMatchingCharacterPainterPreferenceKeys(
>>
>> "matchingBrackets","matchingBracketsColor");
>>
>> super.configureSourceViewerDecorationSupport(support);
>>
>> }
>>
>> I also tried to do the install method - still no visual result...
>>
>> IPreferenceStore pref =
>> JavaEditorExamplePlugin.getDefault().getPreferenceStore();
>> support.install(pref);
>>
>>
>> How can I make the bracket matching work ?
>>
|
|
|
Powered by
FUDForum. Page generated in 0.03125 seconds