Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
Eclipse UserFriend
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 Sad


  1. 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.
  2. 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.
  3. 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 Go to previous messageGo to next message
Cole Markham is currently offline Cole MarkhamFriend
Messages: 150
Registered: July 2009
Location: College Station, TX
Senior Member

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 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
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 Go to previous message
Eclipse UserFriend
Thanks Cole, you answered all my questions perfectly Razz
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

Previous Topic:RAP 1.5.1
Next Topic:Convert enter key with tab key
Goto Forum:
  


Current Time: Sat Apr 20 11:39:51 GMT 2024

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

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

Back to the top