Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » TableViewer
TableViewer [message #463243] Wed, 07 February 2007 06:48 Go to next message
Eclipse UserFriend
Hello,

I'm trying to use a TableViewer in my RCP Applcation. Unfortunately I do
not how to use it correctly. Can someone here give me a description of
how the TableViewer works? Or maybe someone knows a tutorial on this
topic.

To explain a little more in detail. I'have with 6 coloumns and several
lines which I want to display in my application. Also the data to
display will change from time to time.

Thanks in advance for any help.


Christian Hager
Re: TableViewer [message #463244 is a reply to message #463243] Wed, 07 February 2007 06:54 Go to previous messageGo to next message
Eclipse UserFriend
Christian Hager wrote:
> Hello,
>
> I'm trying to use a TableViewer in my RCP Applcation. Unfortunately I do
> not how to use it correctly. Can someone here give me a description of
> how the TableViewer works? Or maybe someone knows a tutorial on this
> topic.
>
> To explain a little more in detail. I'have with 6 coloumns and several
> lines which I want to display in my application. Also the data to
> display will change from time to time.
>
> Thanks in advance for any help.
>
>
> Christian Hager
This page should get you started
http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/Demonstrat esTableViewers.htm

Regards
Stefan
Re: TableViewer [message #463247 is a reply to message #463243] Wed, 07 February 2007 07:22 Go to previous messageGo to next message
Eclipse UserFriend
Christian Hager schrieb:
> Hello,
>
> I'm trying to use a TableViewer in my RCP Applcation. Unfortunately I do
> not how to use it correctly. Can someone here give me a description of
> how the TableViewer works? Or maybe someone knows a tutorial on this
> topic.
>
> To explain a little more in detail. I'have with 6 coloumns and several
> lines which I want to display in my application. Also the data to
> display will change from time to time.
>
> Thanks in advance for any help.
>
>
> Christian Hager

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.s nippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippet s/viewers/

Tom
Re: TableViewer [message #463746 is a reply to message #463247] Thu, 15 February 2007 05:04 Go to previous messageGo to next message
Eclipse UserFriend
hey in ur discussion i have a point!
using content providers u will place the content by using its getelemnts
method.
if u create 10 model objects with 2 columns in the viewer,the 10 objects
gets laced in the first column and also in the second.

What do i need to do if i want something as if i want to place first 5
objects in first column and the second five in the next column.
Re: TableViewer [message #463752 is a reply to message #463746] Thu, 15 February 2007 05:18 Go to previous messageGo to next message
Eclipse UserFriend
In this case you should do somthing like this in your labelprovider

class ViewLabelProvider extends LabelProvider implements ITableLabelProvider
{
public String getColumnText (Object obj, int index)
{
switch (index)
{
case 0:
return obj.someThing;
case 1:
return obj.someThingElse;
case 2:
return obj.someThingDifferent;
case 3:
return obj.someOtherThing;
case 4:
return obj.againSomeThingElse;
}
}
}

"George" <george@gmail.com> schrieb im Newsbeitrag
news:4328bd7761fa0be2f577b1b5f41a6736$1@www.eclipse.org...
>
> hey in ur discussion i have a point!
> using content providers u will place the content by using its getelemnts
> method.
> if u create 10 model objects with 2 columns in the viewer,the 10 objects
> gets laced in the first column and also in the second.
>
> What do i need to do if i want something as if i want to place first 5
> objects in first column and the second five in the next column.
>
>
>
>
Re: TableViewer [message #463759 is a reply to message #463752] Thu, 15 February 2007 06:36 Go to previous message
Eclipse UserFriend
Thanks a lot but does it make model unique.
I mean u can visually see that contents in column one and column 2 are
different
but will the underlying model also differ.
Previous Topic:Problems contributing and using a Font Definition
Next Topic:Is there a Eclips RCP FAQ site?
Goto Forum:
  


Current Time: Sat Mar 15 17:47:22 EDT 2025

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

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

Back to the top