Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Problem with Table(Viewer) in Forms(How to handle table (viewer) in an eclipse form page/view)
Problem with Table(Viewer) in Forms [message #641964] Mon, 29 November 2010 11:52 Go to next message
Dirk Alexander Schaefer is currently offline Dirk Alexander SchaeferFriend
Messages: 12
Registered: July 2009
Junior Member
hello,

i'm trying to develop a rcp application. in that application i've got a 'navigation' view on the left side while the most space is on the right side, the editor area.

in the navigation view i'm working with a form. in that form i would like to put three "rows" of different widgets.

1. a section with elements to define filter data.
2. a textField to input a search string.
3. a table listing all the entities available for editing.

i got row 1 and 2 working but i'm having problems with row 3. also the table is shown it does not look and behave the way i want it to do. i would like to have it:

1. exactlly be as high as the space left (minus the two upper rows) in the form's parent view including refreshing/redrawing when the size changes due to window resizing by the user.
2. be as width as the view is including resizing when the user makes the view wider or smaller.
3. show a vertical scrollbar in the table widget if there are more items in the table than can be shown currently.
4. show a horizontal scrollbar in the table if the text of one or more items is longer than the table's parent view's widht. or even better, cut the text followed by three dots or somthing like that.
5. draw the table that way that the whole line is selected when an item gets selected, not only the item it self.

up to now i got it to be shown but it is only as width as it needs in order to show the items and if i put an item into it whose text is longer than the view containing the formTable, the table is wider and the parent view shows a horizontal scrollbar. if i then add an item programmatically, the table starts showing a vertical scrollbar.

[Updated on: Mon, 29 November 2010 11:56]

Report message to a moderator

Re: Problem with Table(Viewer) in Forms [message #643033 is a reply to message #641964] Fri, 03 December 2010 17:15 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 423
Registered: July 2009
Senior Member
Hi Dirk,

Did you manage to get it working? What exactly is your question?

--

Best Regards,
Wim Jongman

> hallo,
>
> i'm trying to develop a rcp application. in that application i've got a
'navigation' view on the left side while the most space is on the right side,
the editor area.
>
> in the navigation view i'm working with a form. in that form i would like
to put three "rows" of different widgets.
>
> 1. a section with elements to define filter data.
> 2. a textField to input a search string.
> 3. a table listing all the entities available for editing.
>
> i got row 1 and 2 working but i'm having problems with row 3. also the
table is shown it does not look and behave the way i want it to do. i would
like to have it:
>
> 1. exactlly be as high as the space left (minus the two upper rows) in the
form's parent view including refreshing/redrawing when the size changes due
to window resizing by the user.
> 2. be as width as the view is including resizing when the user makes the
view wider or smaller.
> 3. show a vertical scrollbar in the table widget if there are more items in
the table than can be shown currently.
> 4. show a horizontal scrollbar in the table if the text of one or more
items is longer than the table's parent view's widht. or even better, cut the
text followed by three dots or somthing like that.
> 5. draw the table that way that the whole line is selected when an item
gets selected, not only the item it self.
>
> up to now i got it to be shown but it is only as width as it needs in order
to show the items and if i put an item into it whose text is longer than the
view containing the formTable, the table is wider and the parent view shows a
horizontal scrollbar. if i then add an item programmatically, the table
starts showing a vertical scrollbar.
Re: Problem with Table(Viewer) in Forms [message #643067 is a reply to message #641964] Fri, 03 December 2010 21:09 Go to previous messageGo to next message
Dirk Alexander Schaefer is currently offline Dirk Alexander SchaeferFriend
Messages: 12
Registered: July 2009
Junior Member
hi wim,

no, unfortunately not.i already thought that no one will understand my description... Wink i give it another try.

i'm developing a rcp application. in that application i use a common layout where about 20% of the window on the left side is used for navigating through a list of entities hence called the navView, let's say person objects. the rest of the window is reserved for the editor space.

if i place an ordinary table in the navView i got it managed to have it behave in the way that the table fills all the available space of the view it is placed in, the parent. if i resize the view, the table gets resized, too. if the view is not wide enough to show the whole lines in the table, the table rows' text get cut with three dots at the end. vertically the table does not exceed the available visible area of the view and a scroll bar is being shown thus i can scroll through the list. all in all exactly as i want it to behave.

i then added a further view on the left side. this time i placed a form in the view as i want to have three "parts" to be shown stacked vertically. at the top a section which contains controls to define filters for the list of persons. below that section a line with a textField and a button to enter search strings. the rest of the visible area i would like to fill with a table that behaves the same way as the table i placed directly into the other view. but what ever i do, what ever layout i use i do not get it behave the way the other table does. the table always flows over the visible area in the background horizontally and vertically. furthermore the table does not show a scrollbar until i add another row programmatically. the only thing that gets a scrollbar is the form if i use a ScrolledFrom. but if i use a scrolled form the whole content of the parent view gets scrolled, not just the table content.

i hope i explained it a bit more comprehensible this time... Wink

any idea on how to get this problem solved?

thx a lot,
gree,

dirk

[Updated on: Fri, 03 December 2010 21:12]

Report message to a moderator

Re: Re: Problem with Table(Viewer) in Forms [message #643121 is a reply to message #643067] Sat, 04 December 2010 19:28 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 423
Registered: July 2009
Senior Member
Hi Dirk,

Can you put a screenshot on the web somewhere and place the link here.

--

Best Regards,
Wim Jongman

> hi wim,
>
> no, unfortunately not.i already thought that no one will understand my
description... ;) i give it another try.
>
> i'm developing a rcp application. in that application i use a common layout
where about 20% of the window on the left side is used for navigating through
a list of entities hence called the navView, let's say person objects. the
rest of the window is reserved for the editor space.
>
> if i place an ordinary table in the navView i got managed to have it behave
in the way that the table fills all the available space of the view it is
placed in, the parent. if i resize the view, the table gets resized, too. if
the view is not wide enough to show the whole lines in the table, the table
rows' text get cut with three dots at the end. vertivally the table does not
exceed the available visible area of the view and a scroll bar is being shown
thus i can scroll through the list. all in all exactly as i want it to
behave.
>
> i than added a further view on the left side. this time i placed a form in
the view as i want to have three "parts" to be shown stacked vertically. at
the top a section which contains controls to define filters for the list of
persons. below that section a line with a textField and a button to enter
search strings. the rest of the visible area i would like to fill with a
table that behaves the same way as the table i placed directly into the other
view. but what ever i do, what ever layout i use i do not get it behave the
way the other table does. the table always flows over the visible area in the
background horizontally and vertically. furthermore the table does not show a
scrollbar until i add another row programmatically. the only thing that gets
a scrollbar is the form if i use a ScrolledFrom. but if i use a scrolled form
the whole content of the parent view gets scrolled, not just the table
content.
>
> i hope i explained it a bit more comprehensible this time... ;)
>
> any idea on how to get this problem solved?
>
> thx a lot,
> gree,
>
> dirk
Re: Problem with Table(Viewer) in Forms [message #643158 is a reply to message #641964] Sun, 05 December 2010 14:38 Go to previous messageGo to next message
Dirk Alexander Schaefer is currently offline Dirk Alexander SchaeferFriend
Messages: 12
Registered: July 2009
Junior Member
hi wim,

for sure i can provide screenshots. you'll find them here: http://gallery.das-online.org/v/sharing/eclipse_community_fo rums/problemWithTableViewerInForms

thank you very much for your help so far!

greez,

dirk
Re: Re: Problem with Table(Viewer) in Forms [message #643246 is a reply to message #643158] Mon, 06 December 2010 09:17 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 423
Registered: July 2009
Senior Member
Hi Dirk,

I see what you mean. The table dows not wrap correctly...

This has to do with the layout manager, which can be tricky to figure out if
you do it by code only. Especially if you are inexperienced with this kind of
stuff (which I assume you are, but correct me if I am wrong).

Try to install the former Instantiations tools (Window Builder Pro). They are
now free since google purchased them. This enables you ty wysiwyg design your
form and execute the layout managers at design time. This should help you
solve your problems. If it does not, come back and post your source.

http://code.google.com/javadevtools/wbpro/

--

Best Regards,
Wim Jongman

> hi wim,
>
> for sure i can provide screenshots. you'll find them here:
http://gallery.das-online.org/v/sharing/eclipse_community_fo rums/problemWithTableViewerInForms
>
> thank you very much for your help so far!
>
> greez,
>
> dirk
Re: Problem with Table(Viewer) in Forms [message #643361 is a reply to message #641964] Mon, 06 December 2010 16:14 Go to previous messageGo to next message
Dirk Alexander Schaefer is currently offline Dirk Alexander SchaeferFriend
Messages: 12
Registered: July 2009
Junior Member
hi wim,

yes, you're right, im totaly inexperienced as this is my first eclipse based application... Wink

i'll give that tool a try and come back once i know more.

but one little question. do you mind giving me a hint - if you can - on which layout to use?

greez,

dirk
Re: Re: Problem with Table(Viewer) in Forms [message #643640 is a reply to message #643361] Tue, 07 December 2010 17:44 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 423
Registered: July 2009
Senior Member
Hi,

Yes, my all time favourite is GridLayout. I hardly use anything else.

It basically lays out the parent in columns.
children can "grab" excess horizontal and vertical space
children can cover more than 1 column



--

Best Regards,
Wim Jongman

> hi wim,
>
> yes, you're right, im totaly inexperienced as this is my first eclipse
based application... ;)
>
> i'll give that tool a try and come back once i know more.
>
> but one little question. do you mind giving me a hint - if you can - on
which layout to use?
>
> greez,
>
> dirk
Re: Re: Problem with Table(Viewer) in Forms [message #643921 is a reply to message #643640] Wed, 08 December 2010 17:22 Go to previous messageGo to next message
eshvar60  is currently offline eshvar60 Friend
Messages: 51
Registered: March 2010
Member
Hey Dirk,

I had the EXACT same problem with the exact same type of view.

I am guessing/hoping you are using the GridLayout for your filter area. In this case make sure that the composite grabs the horizantal and vertical space. Also, and this is the key part, make sure that the align is set to (SWT.FILL and SWT.CENTER)

For the table composite make sure that the table is wrapped in a Composite with a GridLayoutData object that grabs space horizontally and vertically.

The layout of this composite should be the TableColumnLayout.

I HIGHLY recommend looking at this example here and actually using his library that contains the TableViewerBuilder.

I am using that now and its a huge help!


Re: Problem with Table(Viewer) in Forms [message #643928 is a reply to message #641964] Wed, 08 December 2010 17:43 Go to previous message
Dirk Alexander Schaefer is currently offline Dirk Alexander SchaeferFriend
Messages: 12
Registered: July 2009
Junior Member
hi all,

meanwhile i managed to get it working as i want it to do. thank you very much, wim. the tool you suggessted is great. i think i will not create views in any other way anymore for a long time... Wink

for those who are interested: in set a FillLayout in the parent composite passed to the public void createPartControl(Composite parent) method. i then added a composite to that parent having a GridLayout set which is the container for all the "viewParts". i added one composite to that "containerComposite" which is the parent of the table and i set a TableColumnLayout for that composite.

by doing it that way, things are working now.

thank you all very much for your help!

greez,

dirk

[Updated on: Wed, 08 December 2010 17:47]

Report message to a moderator

Previous Topic:Export wont recognize selected Target
Next Topic:Drop Widget in MultipageEditor PAge
Goto Forum:
  


Current Time: Thu Apr 25 17:27:05 GMT 2024

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

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

Back to the top