Home » Eclipse Projects » Remote Application Platform (RAP) » [RAP/RCP] Table row height
[RAP/RCP] Table row height [message #925295] |
Thu, 27 September 2012 15:25 |
Eclipse User |
|
|
|
Hello,
I have been working last month on transforming my Eclipse RCP software into an Eclipse RAP website, using single sourcing. It went pretty good so far, displaying nice graphics, and tables. But as soon as I wanted to change the height of my row in the tables. Everything fall appart
- So first I discover that SWT row height cannot be changed easily, you have to pass threw a SWT.MeasureItem Listener. But this Listener does not exist in RAP Target Platform.
- Then I tried to use better widget like Nebula Grid, to discover that height row changing is not yet implemented in the RAP version of Nebula Grid.
- Finally, I tried to go back in my code, and make it work anyway. Because my previous code was using an AWT table which can be modify entirely... But SWT_AWT bridge is not yet available for RAP.
So, what can I do now to have a table where row height can be changed, in a single source RCP/RAP way ?
Otherwise I will forget about single sourcing (which is a very cool feature in my project so I want to keep it) and do a pure "internet" oriented project. In that case what is the best Java base GUI which allow row height change ? JavaFX ?
Thank you in advance for your help.
|
|
|
Re: [RAP/RCP] Table row height [message #925361 is a reply to message #925295] |
Thu, 27 September 2012 16:46 |
|
Christophe,
Yes, custom row heights are limitation in SWT and RWT. You are correct, RWT does not support the SWT.MeasureItem listener or custom rendering of tables in general. The Developer's Guide has information about the differences between SWT and RWT[1]. As mentioned on that page, you can set custom row heights by setting a value for RWT.CUSTOM_ITEM_HEIGHT on the table widget:
table.setData(RWT.CUSTOM_ITEM_HEIGHT, 48);
Keep in mind that the table is still limited to a single height for all rows. So you can change all rows to be 48px high, but you can't change some to 48 and others to 96.
I am not familiar with the current state or future plans for the Nebula Grid, but it's possible this could be added.
You are correct, SWT_AWT bridge is not supported in RAP and probably never will be. Remember that RAP uses HTML elements in the browser to render widgets not Java. In theory, one could embed a Java applet with the AWT table or other widgets, but thus far no one as produced a generic solution. I have successfully embedded existing Java applets for charts, but there are a few caveats such as z-ordering.
Finally, if none of the other solutions work for you, a custom widget can be used[2]. You should consider using a standard html table in a browser widget, which may give you the results you desire.
[1] http://eclipse.org/rap/developers-guide/devguide.php?topic=rwt/differences.html
[2] http://eclipse.org/rap/developers-guide/devguide.php?topic=rwt/custom-widget.html
Hope that helps,
Cole
|
|
|
Re: [RAP/RCP] Table row height [message #925995 is a reply to message #925295] |
Fri, 28 September 2012 07:55 |
Ivan Furnadjiev Messages: 2429 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi,
the Nebula Grid port, which is in the incubator [1] supports variable
item heights.
[1]
http://git.eclipse.org/c/rap/incubator/org.eclipse.rap.incubator.nebula-grid.git
HTH,
Ivan
On 9/27/2012 6:25 PM, Missing name Mising name wrote:
> Hello,
>
> I have been working last month on transforming my Eclipse RCP software
> into an Eclipse RAP website, using single sourcing. It went pretty
> good so far, displaying nice graphics, and tables. But as soon as I
> wanted to change the height of my row in the tables. Everything fall
> appart :(
>
> So first I discover that SWT row height cannot be changed easily, you
> have to pass threw a SWT.MeasureItem Listener. But this Listener does
> not exist in RAP Target Platform.
> Then I tried to use better widget like Nebula Grid, to discover that
> height row changing is not yet implemented in the RAP version of
> Nebula Grid.
> Finally, I tried to go back in my code, and make it work anyway.
> Because my previous code was using an AWT table which can be modify
> entirely... But SWT_AWT bridge is not yet available for RAP.
>
>
> So, what can I do now to have a table where row height can be changed,
> in a single source RCP/RAP way ?
>
> Otherwise I will forget about single sourcing (which is a very cool
> feature in my project so I want to keep it) and do a pure "internet"
> oriented project. In that case what is the best Java base GUI which
> allow row height change ? JavaFX ?
>
> Thank you in advance for your help.
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Re: [RAP/RCP] Table row height [message #925999 is a reply to message #925361] |
Fri, 28 September 2012 08:02 |
Eclipse User |
|
|
|
Thanks Cole, you answered all my questions perfectly
So I test by using RWT.CUSTOM_ITEM_HEIGHT, and it works. I just want to change all row heights at the same time, so it suits me pretty well.
The problem is that it is done by using RWT code, so it does not run when I am in Eclipse RCP Target Platform, loosing the total single sourcing perspective. But I guess I was a bit ambitious by trying to do only one code for all.
I will have to create specific RCP and RAP code for data access (file saving stuff) and some specific GUI.
Thanks again
[Updated on: Wed, 03 October 2012 13:46] by Moderator Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue Jan 14 11:06:41 GMT 2025
Powered by FUDForum. Page generated in 0.03182 seconds
|