Strange Problem - CheckBoxTableViewer

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Strange Problem - CheckBoxTableViewer

Postby jleotta » Wed Sep 15, 2004 11:18 am

Hello Eric,

I place a CheckboxTableViewer on the Composite I am working on when I run the application I get an Invocation Target Exception and nothing on the composite is visible. When I go back into the designer the tableviewer is no longer visible on the composite or in the list of widget variables in the upper left corner of the designer. Any help would be appreciated.

The new release that fixes the "minor memory leak" is much appreciated.

Jim Leotta
jleotta
 
Posts: 31
Joined: Tue Aug 03, 2004 9:46 am

Re: Strange Problem - CheckBoxTableViewer

Postby Eric Clayberg » Wed Sep 15, 2004 12:53 pm

jleotta wrote:I place a CheckboxTableViewer on the Composite I am working on when I run the application I get an Invocation Target Exception and nothing on the composite is visible. When I go back into the designer the tableviewer is no longer visible on the composite or in the list of widget variables in the upper left corner of the designer. Any help would be appreciated.

What version of Designer are you using? Do any exceptions appear in your Eclipse ".log" file?
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby jleotta » Wed Sep 15, 2004 12:55 pm

More Info,

It seems that the checkboxTable.setInput(new Object()) creates the problem in my application. The composite holding all my widgets becomes visible if I remove that line. It doesnt fix the problem with it disappearing in the designer. I am using the latest release of the designer.

- Jim
jleotta
 
Posts: 31
Joined: Tue Aug 03, 2004 9:46 am

Postby jleotta » Thu Sep 16, 2004 11:27 am

I am using 2.1.1. There were error messages that are no longer appearing when I removed all prior versions of the designer. If I place the viewer on the composite and exit the application and reenter the viewer is no longer displayed in the designer either on the composite or in the list of widgets.

The source code contains the viewer and is unchanged yet it still will not appear.
jleotta
 
Posts: 31
Joined: Tue Aug 03, 2004 9:46 am

Postby Eric Clayberg » Thu Sep 16, 2004 2:14 pm

It would be helpful if you posted the code you are using that does not work (or send it to support@swt-designer.com). It would also be helpful, if you posted the content of any exceptions you encountered (which should be recoreded to the Eclipse ".log" file). Screen shots of what you are seeing (or not seeing) might also be useful.

Based on what you have provided so far, I don't know what the problem might be. I was able to create an example with a CheckboxTableViewer and open it with out a problem.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby jleotta » Fri Sep 17, 2004 7:45 am

Here is the code. I completely reinstalled eclipse, swtdesigner, and java and am still having this problem. I can now see the table in the widget box in the upper left side but the combo at the top of the list has 'composite' and then 'tableviewer' when I switch the combo to the table I can see the heirarchy of widgets yet they will not appear on the composite.

/*
* Created on Sep 17, 2004
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package org.fairhousing;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.SWT;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.widgets.Label;
import com.swtdesigner.ResourceManager;
import org.eclipse.swt.widgets.TableColumn;

/**
* @author jleotta
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class TestTable extends Composite {

public TestTable(Composite parent, int style) {
super(parent, style);
setLayout(new FormLayout());

final CheckboxTableViewer checkboxTableViewer = CheckboxTableViewer.newCheckList(this, SWT.BORDER);
final Table table = checkboxTableViewer.getTable();
table.setHeaderVisible(true);
final FormData formData = new FormData();
formData.right = new FormAttachment(0, 375);
formData.top = new FormAttachment(0, 130);
formData.left = new FormAttachment(0, 105);
table.setLayoutData(formData);

final TableColumn tableColumn = new TableColumn(table, SWT.NONE);
tableColumn.setWidth(100);
tableColumn.setText("New column");

final TableColumn tableColumn_1 = new TableColumn(table, SWT.NONE);
tableColumn_1.setWidth(100);
tableColumn_1.setText("New column");
checkboxTableViewer.setInput(new Object());

final Label label = new Label(this, SWT.NONE);
label.setFont(ResourceManager.getFont("", 10, SWT.BOLD));
final FormData formData_1 = new FormData();
formData_1.top = new FormAttachment(0, 105);
formData_1.left = new FormAttachment(0, 155);
label.setLayoutData(formData_1);
label.setText("This Table");
//
}

public void dispose() {
super.dispose();
}

protected void checkSubclass() {
}
}
jleotta
 
Posts: 31
Joined: Tue Aug 03, 2004 9:46 am

Postby jleotta » Fri Sep 17, 2004 12:47 pm

Ok, so it seems that the table viewer needs to be a second composite other then the primary composite. Also just for your information when you add a CheckBoxTableViewer the code generates an unecessary import of a TableViewer.

Thanks, and by the way this is a great product!! It is totally a snap to layout Gui's and saves a lot of boring time.

Peace,
Jim
jleotta
 
Posts: 31
Joined: Tue Aug 03, 2004 9:46 am

Postby Eric Clayberg » Sat Sep 18, 2004 12:28 pm

Thanks for the example. We are investigating the problem and should have a fix soon.

jleotta wrote:Also just for your information when you add a CheckBoxTableViewer the code generates an unecessary import of a TableViewer.

We have fixed this for the next build.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby Eric Clayberg » Sun Sep 19, 2004 8:11 am

Eric Clayberg wrote:We are investigating the problem and should have a fix soon.

This problem has now been fixed in the latest v2.1.1 build.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 1 guest