|
|
Re: Backround of TableViewer is always blue/grey. [message #512148 is a reply to message #511961] |
Thu, 04 February 2010 08:04 |
Jens Keller Messages: 50 Registered: December 2009 Location: Leipzig, Germany |
Member |
|
|
Sorry, i forgot the important part.
The code:
// Table
table = new TableViewer( group2, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.BORDER );
gd = new GridData( GridData.FILL_BOTH );
gd.minimumWidth = 300;
table.getControl().setLayoutData( gd );
table.getTable().setLinesVisible( true );
table.getTable().setHeaderVisible( true );
TableViewerColumn columnName = new TableViewerColumn(table, SWT.NONE);
columnName.getColumn().setText( "Spaltenbezeichnung" );
columnName.getColumn().setWidth( 200 );
columnName.getColumn().setResizable(true);
table.setContentProvider( new TableContentProvider() );
table.setLabelProvider( new TableLabelProvider() );
table.setInput( columnsTemp );
// Content provider
class TableContentProvider implements IStructuredContentProvider {
@Override
public Object[] getElements( Object inputElement ) {
return columnsTemp.toArray();
}
@Override
public void dispose() {
}
@Override
public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) {
}
}
// Label provider
class TableLabelProvider implements ITableLabelProvider {
@Override
public Image getColumnImage( Object element, int columnIndex ) {
return null;
}
@Override
public String getColumnText( Object element, int columnIndex ) {
return ((FeatureAttributeConfigColumn) element).getLabel();
}
@Override
public void addListener( ILabelProviderListener listener ) {
}
@Override
public void dispose() {
}
@Override
public boolean isLabelProperty( Object element, String property ) {
return true;
}
@Override
public void removeListener( ILabelProviderListener listener ) {
}
}
I'm using:
- Eclipse 3.6M4 with e4 1.0M3 as target platform
- Java 6 Update 17
- Windows XP Service Pack 3
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03346 seconds