|
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 |
Eclipse User |
|
|
|
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 #290099 is a reply to message #290042] |
Thu, 18 August 2005 15:33 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02533 seconds