Not able to display color on linux using getBackGroundColor() [message #460922] |
Fri, 09 September 2005 19:55  |
Eclipse User |
|
|
|
Hi -
I am implementing ITableColorProvider for my ILabelProvider -for some
reason the background colors do not seem to get reconized at all -
I get the getForeground colors all ok -
Am I doing something wrong?
I did see a bug : https://bugs.eclipse.org/bugs/attachment.cgi?id=19476
but that says there should *not* be a problem with the 20 system colors
and I think SWT.COLOR_RED and SWT.COLOR_BLUE are one among them.
Any help?
Thanks!
Anima.
public class WorkflowMovieListLabelProvider extends LabelProvider
implements TableLabelProvider, ITableColorProvider{
....
.....
public static Color COLOR_HIGH_PRIORITY =
Display.getCurrent().getSystemColor(SWT.COLOR_RED);
public static Color COLOR_THEATRICALS =
Display.getCurrent().getSystemColor(SWT.COLOR_BLUE);
public Color getBackground(Object element, int columnIndex) {
// TODO Auto-generated method stub
if (element instanceof WorkflowMovie) {
WorkflowMovie m = (WorkflowMovie)element;
if (m.getPriority()!=null && m.getPriority().intValue()==1){
return COLOR_HIGH_PRIORITY;
}
if (m.getMovie().getMasterUPC()==null){
return COLOR_THEATRICALS;
}
return null;
}
public Color getForeground(Object element, int columnIndex) {
// TODO Auto-generated method stub
return null;
//eturn getBackground(element, columnIndex);
}
...
....
}
|
|
|
Re: Not able to display color on linux using getBackGroundColor() [message #461023 is a reply to message #460922] |
Wed, 14 September 2005 17:38  |
Eclipse User |
|
|
|
reposting this question...
Anima Gupta wrote:
> Hi -
>
> I am implementing ITableColorProvider for my ILabelProvider -for some
> reason the background colors do not seem to get reconized at all -
>
> I get the getForeground colors all ok -
>
> Am I doing something wrong?
>
> I did see a bug : https://bugs.eclipse.org/bugs/attachment.cgi?id=19476
>
> but that says there should *not* be a problem with the 20 system colors
> and I think SWT.COLOR_RED and SWT.COLOR_BLUE are one among them.
>
> Any help?
>
> Thanks!
>
> Anima.
>
>
>
> public class WorkflowMovieListLabelProvider extends LabelProvider
> implements TableLabelProvider, ITableColorProvider{
>
> ...
> ....
>
>
> public static Color COLOR_HIGH_PRIORITY =
> Display.getCurrent().getSystemColor(SWT.COLOR_RED);
> public static Color COLOR_THEATRICALS =
> Display.getCurrent().getSystemColor(SWT.COLOR_BLUE);
>
>
>
> public Color getBackground(Object element, int columnIndex) {
> // TODO Auto-generated method stub
> if (element instanceof WorkflowMovie) {
> WorkflowMovie m = (WorkflowMovie)element;
> if (m.getPriority()!=null && m.getPriority().intValue()==1){
> return COLOR_HIGH_PRIORITY;
> }
> if (m.getMovie().getMasterUPC()==null){
> return COLOR_THEATRICALS;
> }
>
> return null;
> }
>
> public Color getForeground(Object element, int columnIndex) {
> // TODO Auto-generated method stub
> return null;
> //eturn getBackground(element, columnIndex);
> }
>
> ..
> ...
> }
>
|
|
|
Powered by
FUDForum. Page generated in 0.03346 seconds