Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Backround of TableViewer is always blue/grey.
Backround of TableViewer is always blue/grey. [message #511961] Wed, 03 February 2010 14:41 Go to next message
Jens Keller is currently offline Jens Keller
Messages: 50
Registered: December 2009
Location: Leipzig, Germany
Member
This only happens when i'm using e4. Using Eclipse 3.6 the backround is white. I checked the color of the table at runtime and it is white. The TreeViewer works fine. I have no idea where this strange backround is coming from.

Here is a sample:

http://i50.tinypic.com/13z5tus.jpg

Jens Keller
Re: Backround of TableViewer is always blue/grey. [message #512116 is a reply to message #511961] Wed, 03 February 2010 23:29 Go to previous messageGo to next message
Remy Suen is currently offline Remy Suen
Messages: 462
Registered: July 2009
Senior Member
Jens Keller wrote on Wed, 03 February 2010 09:41
This only happens when i'm using e4. Using Eclipse 3.6 the backround is white.

Please provide a) the code to reproduce the problem, b) the e4 SDK build you were using, and c) information about your setup such as OS, JVM version, etc, etc.
Re: Backround of TableViewer is always blue/grey. [message #512148 is a reply to message #511961] Thu, 04 February 2010 08:04 Go to previous messageGo to next message
Jens Keller is currently offline 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
Re: Backround of TableViewer is always blue/grey. [message #512226 is a reply to message #512148] Thu, 04 February 2010 13:01 Go to previous messageGo to next message
Remy Suen is currently offline Remy Suen
Messages: 462
Registered: July 2009
Senior Member
Jens Keller wrote on Thu, 04 February 2010 03:04
I'm using:

- Eclipse 3.6M4 with e4 1.0M3 as target platform

- Java 6 Update 17

- Windows XP Service Pack 3
I have SP2 with IBM JVMs and could not reproduce the problem. Please try reproducing with the code below and/or change the code below sufficiently to reproduce the problem.

Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout(1, true));

TableViewer table = new TableViewer(shell, SWT.H_SCROLL | SWT.V_SCROLL
		| SWT.MULTI | SWT.BORDER);
GridData 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(ArrayContentProvider.getInstance());
table.setLabelProvider(new LabelProvider());
table.setInput(new String[] { "a", "b" });

shell.pack();
shell.open();
while (!shell.isDisposed()) {
	if (!display.readAndDispatch())
		display.sleep();
}
display.dispose();

Re: Backround of TableViewer is always blue/grey. [message #512298 is a reply to message #512226] Thu, 04 February 2010 15:30 Go to previous message
Jens Keller is currently offline Jens Keller
Messages: 50
Registered: December 2009
Location: Leipzig, Germany
Member
I found out whats wrong. It was a entry in the css-file:

Table {
	background-color: #e8e8e8 #cccccc 60%;
	color: black;
	font: Verdana 8px;
}


How stupid is that? A leftover from trying out e4 a while ago.

Thanks for your help.

Jens Keller
Previous Topic:Project Plan
Next Topic:Backround of TableViewer is always blue/grey.
Goto Forum:
  


Current Time: Fri Oct 24 18:09:00 GMT 2014

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

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