Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Color of StatusLineManager
Color of StatusLineManager [message #461107] Fri, 16 September 2005 11:03 Go to next message
Eclipse UserFriend
Originally posted by: herr_bugenhagen.yahoo.de

Hi!

Is it possible to change the background color of a jface StatusLineManager?
The method getControl().setBackground() does not do anything.

thanks,
Christoph
Re: Color of StatusLineManager [message #461724 is a reply to message #461107] Wed, 28 September 2005 14:13 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
The widget inside the StatusLineManager is a StatusLine. This is a JFace
component and it does not provide API for setting the background colour.

As a workaround you could do the following:

mgr = new StatusLineManager();

Control c = mgr.createControl(myParent, SWT.NONE);

Color blue = c.getDisplay.getSystemColor(SWT.COLOR_BLUE);

c.setBackground(blue);

if (c instanceof Composite) {

// reach in and get the children and set their backgrounds

Composite parent = (Composite)c;

Control [] children = parent.getChildren();

for (int i = 0; i < children.length; i++) {

children[i].setBackground(blue);

}

}

Note that if you have progress bars or other components, these are not
created by the StatusLine in its constructor so you will have to get the
children again after you have caused the new children to be created.

"Christoph Karlberger" <herr_bugenhagen@yahoo.de> wrote in message
news:dge8pi$4cd$1@news.eclipse.org...
> Hi!
>
> Is it possible to change the background color of a jface
> StatusLineManager?
> The method getControl().setBackground() does not do anything.
>
> thanks,
> Christoph
Previous Topic:Tricky problem with FocusListener
Next Topic:SWT font sensitive
Goto Forum:
  


Current Time: Mon Sep 28 12:40:59 GMT 2020

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

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

Back to the top