|
Re: Where is common used Color symbolic name defined? [message #549579 is a reply to message #549519] |
Tue, 27 July 2010 09:19 |
|
Hi Yau,
You should use the theming [1] for this kind of setting. For example,
you can set the normal and gray text color for a Text field like this:
Text {
color: black;
}
Text:disabled {
color: #cecece;
}
You can get the default text color by calling display.getSystemColor(
SWT.COLOR_WIDGET_FOREGROUND ), but there is no such constant for
disabled text.
HTH, Ralf
Yau wrote:
> Hi, I want use some Color in different situation. For example, I want
> use GRAY_TEXT_COLOR for disabled text foreground, NORMAL_TEXT for
> enabled. But I dont known which class defines these constants. If there
> is such class, the other question is: Can theses constant work with theme?
>
> Thanks.
|
|
|
|
Re: Where is common used Color symbolic name defined? [message #549756 is a reply to message #549595] |
Tue, 27 July 2010 20:13 |
|
Hi Yau,
as I said, there is no API - neither in SWT nor in RAP - to get the
disabled text color from the theme. I'd suggest that you define your own
RGB constant and keep it in sync with your theme.
Would this be an option?
Regards, Ralf
Yau wrote:
> Thanks, for example, I have an LabelProvider and override the method
>
> public Color getForeground(Object element) {
> if (the element is disabled)
> return the disabled-text-color;
> else
> return the default-text-color;
> }
>
> So, how can I get the color definition or color description(which has
> the disabled symantic) from the current using theme?
--
Ralf Sternberg
Need professional support for RAP and RCP?
http://www.eclipsesource.com/support/
Twitter: @eclipsesource
Blog: http://www.eclipsesource.com/blogs/
|
|
|
|
Powered by
FUDForum. Page generated in 0.04044 seconds