Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Not able to display color on linux using getBackGroundColor()
Not able to display color on linux using getBackGroundColor() [message #460922] Fri, 09 September 2005 23:55 Go to next message
Anima Gupta is currently offline Anima GuptaFriend
Messages: 44
Registered: July 2009
Member
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 21:38 Go to previous message
Anima Gupta is currently offline Anima GuptaFriend
Messages: 44
Registered: July 2009
Member
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);
> }
>
> ..
> ...
> }
>
Previous Topic:FileChooser
Next Topic:Examples
Goto Forum:
  


Current Time: Fri Apr 19 04:09:40 GMT 2024

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

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

Back to the top