JavaPairMatcher discouraged -- bracket matching how to? [message #288784] |
Mon, 25 July 2005 03:16  |
Eclipse User |
|
|
|
Hi,
I'm implementing bracket matching for Eclipse plugin. All the examples
I've looked at are using something like this:
painter = new MatchingCharacterPainter(
sourceViewer,
new JavaPairMatcher(MATCHING_BRACKETS_PAIR)
);
However, Eclipse keeps underlining this JavaPairMatcher in yellow saying
that its use is discouraged (because it's an internal JDT API class afaik).
So, what's the right-thing-to-do here? What's the easiest way to
implement bracket matching without getting any yellow underlines? I
noticed that CDT copied the entire JavaPairMatcher class into it's own
source code which I thought was very ugly, this internal class also
depends only other internals classes etc.
Surely, it must be possible to implement bracket matching without
getting yellow line warnings AND not copy-paste coding?
Regards,
martin
|
|
|
Re: JavaPairMatcher discouraged -- bracket matching how to? [message #288792 is a reply to message #288784] |
Mon, 25 July 2005 05:31  |
Eclipse User |
|
|
|
There is no public implementation of ICharacterMatcher since determining
whether a bracket is the peer of another is usually language dependent
(just imaging commented out brackets, string literals etc).
A simple implementation should be trivial to come up with, though.
-tom
Martin Olsson wrote:
> Hi,
>
> I'm implementing bracket matching for Eclipse plugin. All the examples
> I've looked at are using something like this:
>
> painter = new MatchingCharacterPainter(
> sourceViewer,
> new JavaPairMatcher(MATCHING_BRACKETS_PAIR)
> );
>
>
> However, Eclipse keeps underlining this JavaPairMatcher in yellow saying
> that its use is discouraged (because it's an internal JDT API class afaik).
>
> So, what's the right-thing-to-do here? What's the easiest way to
> implement bracket matching without getting any yellow underlines? I
> noticed that CDT copied the entire JavaPairMatcher class into it's own
> source code which I thought was very ugly, this internal class also
> depends only other internals classes etc.
>
> Surely, it must be possible to implement bracket matching without
> getting yellow line warnings AND not copy-paste coding?
>
>
> Regards,
> martin
|
|
|
Powered by
FUDForum. Page generated in 0.02481 seconds