Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Table themes
Table themes [message #771019] Sun, 25 December 2011 22:45 Go to next message
Chris Fairhall is currently offline Chris Fairhall
Messages: 99
Registered: February 2011
Member
I'm trying to make a basic table theme (modifying demo.business).
My application sets background colours on individual cells to signify errors, warnings, editable state etc.

I don't want there to be a difference between a row being selected and one not.

When the rows are not selected the background colours work fine.
No matter what I do I can't see to get the background colours set by the application to show when the row is selected.
Even with background-color: transparent; background-image: none; the selected rows have a white background set.

I'm having a similar problem with the Tree widget as well. When a TreeItem is selected I can't get it to retain the background colour
Re: Table themes [message #771068 is a reply to message #771019] Mon, 26 December 2011 02:29 Go to previous messageGo to next message
Amandeep Chahal is currently offline Amandeep Chahal
Messages: 85
Registered: September 2011
Location: India
Member
Adding this to my css works for me :
TableItem:selected {
  background-color: transparent;
}
Re: Table themes [message #771270 is a reply to message #771068] Mon, 26 December 2011 15:45 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris Fairhall
Messages: 99
Registered: February 2011
Member
Doesn't work for me. I tried both 'transparent' and 'inhert'. I'm using 1.5.0-N-20111225-0215.

I've tried all combinations of :selected :linesvisible and :even

It works for the :hover state.

[Updated on: Mon, 26 December 2011 17:07]

Report message to a moderator

Re: Table themes [message #771272 is a reply to message #771068] Mon, 26 December 2011 15:45 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris Fairhall
Messages: 99
Registered: February 2011
Member
[duplicate message]

[Updated on: Mon, 26 December 2011 17:04]

Report message to a moderator

Re: Table themes [message #774281 is a reply to message #771272] Tue, 03 January 2012 11:22 Go to previous messageGo to next message
Edin Edin is currently offline Edin Edin
Messages: 101
Registered: January 2010
Senior Member
Hello there, i have a similar question. I would also like to customize my theme, but sometime it works (i.E. for Buttons), and sometime it wont (ie MenuBar) Is there somewhere a list of all keywords, tha can be used in a custom theme.css (Button, TableItem, :hover, :selected,)? Does CSS3 work with RAP ?

There is also a theme editor in incubator, does it work well ? On which way i can get it to run ?

And last question is, how to customize the height of the TableHeaders? They are definitely looking to big for my own taste.

i'm using eclipse rap 1.5.0 M3

Best regards, Edin
Re: Table themes [message #774285 is a reply to message #771270] Tue, 03 January 2012 11:22 Go to previous messageGo to next message
David Wegener is currently offline David Wegener
Messages: 1298
Registered: July 2009
Senior Member
Hello there, i have a similar question. I would also like to customize my theme, but sometime it works (i.E. for Buttons), and sometime it wont (ie MenuBar) Is there somewhere a list of all keywords, tha can be used in a custom theme.css (Button, TableItem, :hover, :selected,)? Does CSS3 work with RAP ?

There is also a theme editor in incubator, does it work well ? On which way i can get it to run ?

And last question is, how to customize the height of the TableHeaders? They are definitely looking to big for my own taste.

i'm using eclipse rap 1.5.0 M3

Best regards, Edin
Re: Table themes [message #774449 is a reply to message #774285] Tue, 03 January 2012 18:49 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris Fairhall
Messages: 99
Registered: February 2011
Member
I haven't tried the theme editor in the incubator, it is several years old.

To find the names of the items for the theme I look at the *.default.css and *.theme.xml files in the org.eclipse.swt.internal.widgets.*kit packages in the rap.rwt plugin. and also the exisitng theme I'm customizing/overriding
Re: Table themes [message #774569 is a reply to message #774281] Wed, 04 January 2012 02:43 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1690
Registered: July 2009
Senior Member
Hi,
"RAP Theming Reference" is what you are looking for [1].
[1] http://help.eclipse.org/indigo/nav/49_3_2
Best,
Ivan

On 1/3/2012 6:22 PM, Missing name Mising name wrote:
> Hello there, i have a similar question. I would also like to customize
> my theme, but sometime it works (i.E. for Buttons), and sometime it
> wont (ie MenuBar) Is there somewhere a list of all keywords, tha can
> be used in a custom theme.css (Button, TableItem, :hover, :selected,)?
> Does CSS3 work with RAP ?
> There is also a theme editor in incubator, does it work well ? On
> which way i can get it to run ?
> And last question is, how to customize the height of the TableHeaders?
> They are definitely looking to big for my own taste.
>
> i'm using eclipse rap 1.5.0 M3
>
> Best regards, Edin

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Table themes [message #775103 is a reply to message #774569] Thu, 05 January 2012 05:28 Go to previous messageGo to next message
Edin Edin is currently offline Edin Edin
Messages: 101
Registered: January 2010
Senior Member
Hey guys, thnx for your help,

that is exactly what im looking for (overview and posibillity to see how the actual default theme is defined). Anyway, when i try to change Menu element, it has no effect for me. It stays gray. Im actually working with standalone version of RAP 1.5. so i have to create the shell on my own, and then add Menu instance. The MenuItems are correctly changed.
In my css im using this:
Menu {
color: #FFFFFF;
background-color: #0099CC;
}

And the menu is created on this way:
this.shell = new Shell(Display.getCurrent(), SWT.NO_TRIM);
Menu menuBar = new Menu(shell, SWT.BAR); //this remains gray, css has no affect!
MenuItem mainMenuHeader = new MenuItem(menuBar, SWT.CASCADE); //this works fine!

ANy idea why?

Is there a posibillity for a Widget to get its theme settings programatically and change them on the runtime. For example i have TableItem and if table is editable then css pointer property should be different then if its not editable. Or just simply to change the color and backgroundcolor (without setting it over SWT SYSTEM COLOR)?

UPS SORRY, WRONG THREAD!!!!

[Updated on: Thu, 05 January 2012 05:29]

Report message to a moderator

Re: Table themes [message #775105 is a reply to message #774569] Thu, 05 January 2012 05:28 Go to previous messageGo to next message
Missing name Missing name is currently offline Missing name Missing name
Messages: 59
Registered: July 2009
Member
Hey guys, thnx for your help,

that is exactly what im looking for (overview and posibillity to see how the actual default theme is defined). Anyway, when i try to change Menu element, it has no effect for me. It stays gray. Im actually working with standalone version of RAP 1.5. so i have to create the shell on my own, and then add Menu instance. The MenuItems are correctly changed.
In my css im using this:
Menu {
color: #FFFFFF;
background-color: #0099CC;
}

And the menu is created on this way:
this.shell = new Shell(Display.getCurrent(), SWT.NO_TRIM);
Menu menuBar = new Menu(shell, SWT.BAR); //this remains gray, css has no affect!
MenuItem mainMenuHeader = new MenuItem(menuBar, SWT.CASCADE); //this works fine!

ANy idea why?

Is there a posibillity for a Widget to get its theme settings programatically and change them on the runtime. For example i have TableItem and if table is editable then css pointer property should be different then if its not editable. Or just simply to change the color and backgroundcolor (without setting it over SWT SYSTEM COLOR)?
Re: Table themes [message #775239 is a reply to message #775105] Thu, 05 January 2012 11:01 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1690
Registered: July 2009
Senior Member
Hi,
try to set the color and background-color of MenuItem:onMenuBar like:
MenuItem:onMenuBar {
color: #FFFFFF;
background-color: #0099CC;
}
If you want to change the CSS in runtime you could set/reset a custom
variant.
TableItem.blue {
background-color: blue;
}
TableItem.red{
background-color: red;
}
and:
if( editable ) {
item.setData( WidgetUtil.CUSTOM_VARIANT, "blue" );
} else {
item.setData( WidgetUtil.CUSTOM_VARIANT, "red" );
// or reset item.setData( WidgetUtil.CUSTOM_VARIANT, null );
}
Ofcourse, you could change the background color programmatically too -
TableItem#setBackground. Colors set by code override colors set by theming.
HTH,
Ivan

On 1/5/2012 12:28 PM, Missing name Mising name wrote:
> Hey guys, thnx for your help,
>
> that is exactly what im looking for (overview and posibillity to see
> how the actual default theme is defined). Anyway, when i try to change
> Menu element, it has no effect for me. It stays gray. Im actually
> working with standalone version of RAP 1.5. so i have to create the
> shell on my own, and then add Menu instance. The MenuItems are
> correctly changed.
> In my css im using this:
> Menu {
> color: #FFFFFF;
> background-color: #0099CC;
> }
>
> And the menu is created on this way:
> this.shell = new Shell(Display.getCurrent(), SWT.NO_TRIM);
> Menu menuBar = new Menu(shell, SWT.BAR); //this remains gray, css has
> no affect!
> MenuItem mainMenuHeader = new MenuItem(menuBar, SWT.CASCADE); //this
> works fine!
>
> ANy idea why?
>
> Is there a posibillity for a Widget to get its theme settings
> programatically and change them on the runtime. For example i have
> TableItem and if table is editable then css pointer property should be
> different then if its not editable. Or just simply to change the color
> and backgroundcolor (without setting it over SWT SYSTEM COLOR)?
>
>
>

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Table themes [message #775369 is a reply to message #771019] Thu, 05 January 2012 16:14 Go to previous message
Chris Fairhall is currently offline Chris Fairhall
Messages: 99
Registered: February 2011
Member
I see my thread has been officially hijacked...
Does anyone know how to stop the :selected theme backgrounds from overriding my TreeItem.setBackground(int) colours? I can't use a custom variant because I need to set the backgrounds of the individual cells.
Previous Topic:Re: TableViewer Column resized event
Next Topic:Tomcat error
Goto Forum:
  


Current Time: Wed Apr 16 20:59:12 EDT 2014

Powered by FUDForum. Page generated in 0.03697 seconds