Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » using tables in an eclipse form
using tables in an eclipse form [message #325567] Fri, 22 February 2008 04:25
Eclipse UserFriend
Originally posted by: deeptisuri124.yahoo.com

I want to use a table in my eclipse form.
However, the table headers are gray and this spoils the look of the form.
Is there another way to use tables in eclipse forms?

I have used it in the following manner:



nasltab = toolkit.createTable(form.getBody(),SWT.SINGLE | SWT.FULL_SELECTION
|SWT.V_SCROLL);

nasltab.setHeaderVisible(true);

nasltab.setLinesVisible(true);


nasltab.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);


String nasllabels[] = {"Name", "Not Vulnerable Message", "Vulnerable
Message", "Vulnerable", "Not Vulnerable"};

column =new TableColumn[nasllabels.length];

for(int i = 0;i<column.length; i++) {

column[i] = new TableColumn(nasltab, SWT.NULL);

column[i].setText(nasllabels[i]);

column[i].pack();

column[i].setWidth(200);

}

if(event.nasls.nasl!=null) {

for(int i=0;i<event.nasls.nasl.length;i++)

{

TableItem item = new TableItem(nasltab, SWT.NULL);

NaslDetails a = event.nasls.nasl[i];

String naslvalues[] =
{a.nasl_name,a.nasl_not_vulnerable_message,a.nasl_vulnerable _message,a.vulnerable,a.not_vulnerable};

item.setText(naslvalues);

}

}

gd=new GridData();

gd.grabExcessHorizontalSpace=true;

nasltab.setLayoutData(gd);
Previous Topic:getting IResource objects for all files in an IResource directory
Next Topic:TreeViewer text spanning columns
Goto Forum:
  


Current Time: Tue Jul 22 13:05:57 EDT 2025

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

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

Back to the top