Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » bracket matching
bracket matching [message #319806] Sat, 01 September 2007 02:18 Go to next message
Eclipse UserFriend
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 #319807 is a reply to message #319806] Sat, 01 September 2007 08:18 Go to previous messageGo to next message
Eclipse UserFriend
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 ?
>
Re: bracket matching [message #319809 is a reply to message #319807] Sat, 01 September 2007 13:23 Go to previous message
Eclipse UserFriend
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 ?
>>
Previous Topic:[TableViewer] Table Selection Overriding Background color
Next Topic:Serialise/deserialise model (including workingset)
Goto Forum:
  


Current Time: Sat May 10 06:30:06 EDT 2025

Powered by FUDForum. Page generated in 0.03125 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top