Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » CSS Styling for Nebula Widgets(Is it possible to enable CSS Styling for Nebula Widgets ?)
CSS Styling for Nebula Widgets [message #792687] Tue, 07 February 2012 09:29 Go to next message
Tom K. is currently offline Tom K.Friend
Messages: 22
Registered: July 2009
Junior Member
We are using a Grid and we thought it would be great if we could use the new e4 css features to style cells..
Has anybody done this before or do you have some ideas how it could be easily done...
Re: CSS Styling for Nebula Widgets [message #792698 is a reply to message #792687] Tue, 07 February 2012 09:47 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
No but it should quite straigt forward because the e4 css implementation
simply calls the Java-API of a widget.

All you need to do is to define your own properties similar to how
css.swt does it for standard SWT-Controls (see
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/bundles/org.eclipse.e4.ui.css.swt).

Tom

Am 07.02.12 10:29, schrieb Tom K.:
> We are using a Grid and we thought it would be great if we could use the
> new e4 css features to style cells.. Has anybody done this before or do
> you have some ideas how it could be easily done...
Re: CSS Styling for Nebula Widgets [message #792715 is a reply to message #792698] Tue, 07 February 2012 10:21 Go to previous messageGo to next message
Tom K. is currently offline Tom K.Friend
Messages: 22
Registered: July 2009
Junior Member
We have solved it now with a CellLabel Provider.
There we have in the
public void update(ViewerCell cell)
method access to the Cell Widgets.
We set the Style ID accordingly the Cell Data and it works..

public void update(ViewerCell cell) {
        ...
        Control control = cell.getControl();
        stylingEngine.setId(control, "GridCell");
 }
Re: CSS Styling for Nebula Widgets [message #792731 is a reply to message #792715] Tue, 07 February 2012 10:48 Go to previous messageGo to next message
Tom K. is currently offline Tom K.Friend
Messages: 22
Registered: July 2009
Junior Member
Oopps this doesn't work for everything... cell.getControl(); gives back the Grid
But we want to style Columns and Cells...

Do you have some hints - we keep trying Wink
Re: CSS Styling for Nebula Widgets [message #794434 is a reply to message #792731] Thu, 09 February 2012 09:30 Go to previous messageGo to next message
Tom K. is currently offline Tom K.Friend
Messages: 22
Registered: July 2009
Junior Member
To keep you updated:
We used now a kind of workaround to render cells with the css values

In the CellLabelProvider we used the org.eclipse.e4.ui.css.core.engine.CSSEngine to get the current styles of our Cells (Class GridItem in the css)

What I'am not happy about, is that we cannot get the CSSEngine without casting down to a internal class:
public CSSBaseCellLabelProvider(IThemeEngine engine, StructuredViewer viewer) {
        this.cssengine = ((ThemeEngine) engine).getCSSEngine();
}


Is there coming a proper solution for cell specific rendering with CSS on the Grid ? Something like a org.eclipse.jface.viewers.StyledCellLabelProvider
but adapted for Nebula and e4 css?

[Updated on: Thu, 09 February 2012 09:32]

Report message to a moderator

Re: CSS Styling for Nebula Widgets [message #794445 is a reply to message #794434] Thu, 09 February 2012 09:48 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Are you in Eclipse 4 or are you by chance useing the e4 bridge in an
Eclipse 3 env?

There should get access to an org.eclipse.e4.ui.services.IStylingEngine
through DI which has a getStyle(Object) method.

Tom

Am 09.02.12 10:30, schrieb Tom K.:
> To keep you updated:
> We used now a kind of workaround to render cells with the css values
>
> In the CellLabelProvider we used the
> org.eclipse.e4.ui.css.core.engine.CSSEngine to get the current styles of
> our Cells (Class GridItem in the css)
> What I'am not happy about, is that we cannot get the CSSEngine without
> casting down to a internal class:
> ((ThemeEngine) engine).getCSSEngine();
>
> Is there coming a proper solution for cell specific rendering with CSS
> on the Grid ? Something like a
> org.eclipse.jface.viewers.StyledCellLabelProvider but adapted for Nebula
> and e4 css?
>
>
Re: CSS Styling for Nebula Widgets [message #794644 is a reply to message #794445] Thu, 09 February 2012 14:34 Go to previous messageGo to next message
Tom K. is currently offline Tom K.Friend
Messages: 22
Registered: July 2009
Junior Member
Eclipse e4 pure - without bridge Wink - With IDE 4.2M4

We use the CSSEngine to convert CSS2FontProperties to Color or Font
But I'am sure there is a another hidden way to do that Wink

[Updated on: Thu, 09 February 2012 14:44]

Report message to a moderator

Re: CSS Styling for Nebula Widgets [message #794693 is a reply to message #794644] Thu, 09 February 2012 15:29 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
So then you should get the IStyleEngine without problems through @Inject

Tom

Am 09.02.12 15:34, schrieb Tom K.:
> Eclipse e4 pure - without bridge ;)
Re: CSS Styling for Nebula Widgets [message #797260 is a reply to message #794693] Mon, 13 February 2012 08:41 Go to previous message
Tom K. is currently offline Tom K.Friend
Messages: 22
Registered: July 2009
Junior Member
We use the CSSEngine to convert CSS2FontProperties to Color or Font
But I'am sure there is a another way to do that..
Previous Topic:[Nebula Gallery] The best way to dispose of items
Next Topic:CompositeTable w/o table?
Goto Forum:
  


Current Time: Wed Apr 24 20:34:51 GMT 2024

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

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

Back to the top