Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Table Viewer Layout !!
Table Viewer Layout !! [message #325454] Tue, 19 February 2008 07:14 Go to next message
Eclipse UserFriend
Originally posted by: meenakshi.sharma.barco.com

Hello All,

I have created a Table viewer with a single column using label and content providers.I have to show the table items in multiple columns as in Windows explorer's list view.

Can any body help me how this can be done.

The label provider is being used by other views also which displays different values in different columns.

Regards,
Meenakshi
Re: Table Viewer Layout !! [message #325458 is a reply to message #325454] Tue, 19 February 2008 08:32 Go to previous messageGo to next message
Eclipse UserFriend
http://wiki.eclipse.org/JFaceSnippets

Tom

Meenakshi schrieb:
> Hello All,
>
> I have created a Table viewer with a single column using label and content providers.I have to show the table items in multiple columns as in Windows explorer's list view.
>
> Can any body help me how this can be done.
>
> The label provider is being used by other views also which displays different values in different columns.
>
> Regards,
> Meenakshi


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Table Viewer Layout !! [message #325523 is a reply to message #325458] Thu, 21 February 2008 00:18 Go to previous message
Eclipse UserFriend
Originally posted by: meenakshi.sharma.barco.com

Hello Tom,

Thanks for ur reply, but I didnt find any sample code on this link which would solve my problem. let me explain in detail:

I have created a viewer which extends the Table Viewer. Inside that class I have added one column which shows the name(and image) of the respective object using label provider in following way.(i.e. by implementing the getColumnText and getColumnImage methods)

// =========================================================

public String getColumnText (Object element, int columnIndex)
{
if (element == null || !(element instanceof Decorator))
return "";

String result = "";
Decorator decorator = (Decorator) element;

switch (columnIndex)
{
case 0 :
result = decorator.getName();
break;

case 1 :
result = decorator.getDescription();
break;

case 2 :
result = getTag(decorator);
break;

default :
break;
}

return result;
}

// ============================================================

Now, I have to use the same provider in different views: one view which shows all the properties i.e detail view as in Windows explore and in another view i.e. list view which shows items in single column as in Windows explorer.

Now, the problem is that in my list viewer (which extends Table viewer as i want to show the images as well of the objects) has one column which gets its values from the first column.The requirement is this that I have to make it similar to the Windows explorer in presentation respect.i.e. the items should be rearranged in multiple columns if we decrease the height of the viewer and if enough width is available to show them in multiple columns in the viewer.

I dont want to make the coding complex by creating the columns based on calculations on resize. Is there any possibility that if I can achieve this by changing the layout of the table or somthing like that...

Waiting for ur reply..

Regards,
Meenakshi
Previous Topic:Creation of IFIles to slow
Next Topic:Classpath in Launchconfiguration
Goto Forum:
  


Current Time: Wed Jul 23 04:38:25 EDT 2025

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

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

Back to the top