[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] using tables in an eclipse form

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);