Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to change color in editor when the new color was set in preferences
How to change color in editor when the new color was set in preferences [message #290039] Thu, 18 August 2005 03:02 Go to next message
zhang wei is currently offline zhang weiFriend
Messages: 84
Registered: July 2009
Member
Hi all,

I use "Plug-in with an editor" template to create a plug-in
project sample. So it auto implements syntax highlighting.

I extend this function, and I can set syntax highlighting color
in Preferences.

Now, I open my editor and set the color in Preferences, but the
syntax highlighting color not changed in my editor.
I must close the editor and re-open it, then new color efficiently.

How to change color immediately when the new color was set?

THX
Re: How to change color in editor when the new color was set in preferences [message #290041 is a reply to message #290039] Thu, 18 August 2005 03:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"wei zhang" <zhang-wei@sinocom.cn> wrote in message
news:17f07edeeed0f7bb7e206d7d60412aa5$1@www.eclipse.org...
> Hi all,
>
> I use "Plug-in with an editor" template to create a plug-in project
> sample. So it auto implements syntax highlighting.
>
> I extend this function, and I can set syntax highlighting color in
> Preferences.
>
> Now, I open my editor and set the color in Preferences, but the
> syntax highlighting color not changed in my editor.
> I must close the editor and re-open it, then new color efficiently.
>
> How to change color immediately when the new color was set?
Add a property change listener to the preferencestore. When the color
settings change, update the syntax highlighting rules with the new tokens.
Then invalidateTextPresentation for the document. That will rescan the
document and update the colors.
---
Sunil
Re: How to change color in editor when the new color was set in preferences [message #290042 is a reply to message #290041] Thu, 18 August 2005 05:15 Go to previous messageGo to next message
zhang wei is currently offline zhang weiFriend
Messages: 84
Registered: July 2009
Member
Sunil Kamath wrote:


> "wei zhang" <zhang-wei@sinocom.cn> wrote in message
> news:17f07edeeed0f7bb7e206d7d60412aa5$1@www.eclipse.org...
>> Hi all,
>>
>> I use "Plug-in with an editor" template to create a plug-in project
>> sample. So it auto implements syntax highlighting.
>>
>> I extend this function, and I can set syntax highlighting color in
>> Preferences.
>>
>> Now, I open my editor and set the color in Preferences, but the
>> syntax highlighting color not changed in my editor.
>> I must close the editor and re-open it, then new color efficiently.
>>
>> How to change color immediately when the new color was set?
> Add a property change listener to the preferencestore. When the color
> settings change, update the syntax highlighting rules with the new tokens.
> Then invalidateTextPresentation for the document. That will rescan the
> document and update the colors.
How to invalidateTextPresentation the document?
Is there a method can be called?
Re: How to change color in editor when the new color was set in preferences [message #290099 is a reply to message #290042] Thu, 18 August 2005 15:33 Go to previous message
Eclipse UserFriend
Originally posted by: sunil_kamath.nohotspammail.com

"wei zhang" <zhang-wei@sinocom.cn> wrote in message
news:ab6630b05dac27ec3fb09aeb19a15ba3$1@www.eclipse.org...
> Sunil Kamath wrote:
>
>
>> "wei zhang" <zhang-wei@sinocom.cn> wrote in message
>> news:17f07edeeed0f7bb7e206d7d60412aa5$1@www.eclipse.org...
>>> Hi all,
>>>
>>> I use "Plug-in with an editor" template to create a plug-in project
>>> sample. So it auto implements syntax highlighting.
>>>
>>> I extend this function, and I can set syntax highlighting color in
>>> Preferences.
>>>
>>> Now, I open my editor and set the color in Preferences, but the
>>> syntax highlighting color not changed in my editor.
>>> I must close the editor and re-open it, then new color efficiently.
>>>
>>> How to change color immediately when the new color was set?
>> Add a property change listener to the preferencestore. When the color
>> settings change, update the syntax highlighting rules with the new
>> tokens.
>> Then invalidateTextPresentation for the document. That will rescan the
>> document and update the colors.
> How to invalidateTextPresentation the document? Is there a method can be
> called?
>
ITextViewer.invalidateTextPresentation()
---
Sunil
Previous Topic:control handle in X
Next Topic:Eclipse Help Browser issue
Goto Forum:
  


Current Time: Thu Sep 19 07:13:30 GMT 2024

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

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

Back to the top