Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Problem with MultiLineRule
Problem with MultiLineRule [message #448337] Fri, 21 April 2006 02:52 Go to next message
Eclipse UserFriend
Hi!

I have a problem with a MultiLineRule in the SourceViewerConfiguration of my
editor.

I created a rule for comment swith the following code:

private IRule createMultiLineCommentRule()
{
IToken procToken = new Token(new TextAttribute(new
Color(Display.getCurrent(),Configuration.JPL_COLOR_COMMENT)) );

// procToken gets active when line begins with '//'
MultiLineRule procRule = new MultiLineRule("/*","*/",procToken);
return procRule;
}

The rules works, but the words affected are not highlighted directly after
the rule matches.
Sometimes I have to re-open the file in the editor, then the words are
highlighted correctly.

Can anyone help me with this problem?

Thanks!

Greetz
Carsten
Re: Problem with MultiLineRule [message #448338 is a reply to message #448337] Fri, 21 April 2006 02:59 Go to previous messageGo to next message
Eclipse UserFriend
Carsten, AFAIK, syntax highlighting is line-based, which would mean that
MultiLineRule cannot be used for syntax coloring, but only for partitioning.

-tom

Carsten Spieker wrote:
> Hi!
>
> I have a problem with a MultiLineRule in the SourceViewerConfiguration of my
> editor.
>
> I created a rule for comment swith the following code:
>
> private IRule createMultiLineCommentRule()
> {
> IToken procToken = new Token(new TextAttribute(new
> Color(Display.getCurrent(),Configuration.JPL_COLOR_COMMENT)) );
>
> // procToken gets active when line begins with '//'
> MultiLineRule procRule = new MultiLineRule("/*","*/",procToken);
> return procRule;
> }
>
> The rules works, but the words affected are not highlighted directly after
> the rule matches.
> Sometimes I have to re-open the file in the editor, then the words are
> highlighted correctly.
>
> Can anyone help me with this problem?
>
> Thanks!
>
> Greetz
> Carsten
>
>
Re: Problem with MultiLineRule [message #448339 is a reply to message #448338] Fri, 21 April 2006 03:16 Go to previous message
Eclipse UserFriend
Hi Tom,

thanks for your reply.

But when I use the MultiLineRule with a special token, the lines affected
by this rule are colored with the attributes given in that token. I meant
this with
highlighting in this case. And this "highlighting" isn
Re: Problem with MultiLineRule [message #448340 is a reply to message #448339] Fri, 21 April 2006 03:15 Go to previous message
Eclipse UserFriend
Carsten Spieker wrote:
> But when I use the MultiLineRule with a special token, the lines affected
> by this rule are colored with the attributes given in that token. I meant
> this with
> highlighting in this case. And this "highlighting" isn´t updated
> immediately.

I believe this is due exactly to what I said before: intially, the
multi-line rule works, but the incremental updating (damage & repair)
doesn't work. AFAIR, I tried this a couple weeks back and found that
DefaultDamagerRepairer did not work with MultiLineRule.

tom
Previous Topic:Two selection providers on a same view
Next Topic:About Tabbed View
Goto Forum:
  


Current Time: Sat Nov 15 01:30:13 EST 2025

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

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

Back to the top