by 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() {
}
}