Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Change Icon of checkable Table
Change Icon of checkable Table [message #1060221] Thu, 23 May 2013 11:14 Go to next message
David Marx is currently offline David Marx
Messages: 6
Registered: April 2013
Junior Member
Hi!

When a table in scout is configured "checkable" a check box is displayed for each row, like in the following screen shot:
index.php/fa/15027/0/

In the RAP client, the style of various elements can be defined via css, e.g. the font size of table rows. I noticed the check box itself is an image (rather than a HTML element) and RAP offers the possibility to set a background image for "Table-Checkbox".

Is this supported in Eclipse Scout? Can a custom check box style be set with images and corresponding entries in the css?

Thanks in Advance,

David
  • Attachment: Table.PNG
    (Size: 5.01KB, Downloaded 75 times)
Re: Change Icon of checkable Table [message #1060275 is a reply to message #1060221] Thu, 23 May 2013 15:46 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 267
Registered: October 2011
Senior Member
David Marx wrote on Thu, 23 May 2013 17:14
Is this supported in Eclipse Scout? Can a custom check box style be set with images and corresponding entries in the css?


I do not think that you will find something as easy as CSS for RAP.

Can you indicate the renderer (and if swing the look and feel) and the version, where you want to do this?
Re: Change Icon of checkable Table [message #1060314 is a reply to message #1060275] Fri, 24 May 2013 02:43 Go to previous messageGo to next message
David Marx is currently offline David Marx
Messages: 6
Registered: April 2013
Junior Member
Hi!

The Scout version is 3.8.2 (with Eclipse Juno). I'm only interested in RAP as renderer, Swing/SWT are not used here.

For the font color I added the following to the generated theme/application.css:
Table {
color: #FF0000;
}

Also a background image for the table can set with:
Table {
background-image:url(theme/background.png);
}

I tried to achieve custom check boxes in the RAP client with:
Table-Checkbox {
background-image:url(theme/check_box.png);
}

But this has no effect.

I hope i provided all necessary information.

Thanks,

David
Re: Change Icon of checkable Table [message #1060384 is a reply to message #1060314] Fri, 24 May 2013 07:27 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio Guglielmo
Messages: 100
Registered: March 2010
Senior Member
Hi David

The theming does not work in this case because the rap table ui of scout does not use the checkbox mechanism provided by rwt/swt (SWT.CHECK) due to some limitations. Instead it uses the scout icon provider servies to resolve the checkbox icon.

To replace the icon with another one you have to make sure that at least one of the registered icon provider services finds your checkbox icons.

To do so just register the IconProviderService as extension in your rap-plugin with a high priority:

<extension
        point="org.eclipse.scout.service.services">
     <service
           class="org.eclipse.scout.rt.client.services.common.icon.IconProviderService"
           createImmediately="false"
           factory="org.eclipse.scout.service.DefaultServiceFactory"
           ranking="100">
     </service>

The IconProviderService loads the icons from the folder resources/icons of the host plugin, so put your icons in that folder of the rap-plugin. Make sure the names are correct ("checkbox_no.png/gif", "checkbox_yes.png/gif").

Regards
Claudio
Re: Change Icon of checkable Table [message #1060574 is a reply to message #1060384] Mon, 27 May 2013 03:00 Go to previous message
David Marx is currently offline David Marx
Messages: 6
Registered: April 2013
Junior Member
Hi Claudio,

many thanks for your quick answer, it works perfectly for table check boxes.

However it seems check box fields (AbstractCheckBox) are not covered by this configuration:

index.php/fa/15056/0/

Can the icon of these fields also be configured with the IconProvider? Or via CSS?

Thanks,

David
Previous Topic:[META] Searching the forum for my own posts
Next Topic:Validating a custom field
Goto Forum:
  


Current Time: Tue May 28 03:12:46 EDT 2013

Powered by FUDForum. Page generated in 0.02387 seconds