I'm having problems using JFace Viewers with Forms.
I first create my Table control using the
toolkit and then create a checkbox table viewer passing the table in the constructor.
The Designer does not understand this concept.
If I comment the creation of the Viewer, the form is displayed successfully in the design view. As soon as I uncomment the creation of the viewer, the Parsing error is displayed.
I tried 3.00 and 3.0.1 versions with the same result.
In general, even if it works, it does not seem right that I have to create the viewer manually in code to use the toolkit table creation.
Here is the source code snipet:
table = toolkit.createTable(client, SWT.HIDE_SELECTION | SWT.CHECK);
table.setLayoutData(new GridData(GridData.FILL_BOTH));
table.addControlListener(new TableControlListener());
final TableColumn tableColumn = new TableColumn(table, SWT.NONE);
tableColumn.setResizable(false);
tableColumn.setWidth(-1);
tableColumn.setText("Questions");
// Table viewer
//tableViewer = new CheckboxTableViewer(table);
The error stack trace:
!STACK 0
java.lang.ClassCastException
at com.swtdesigner.model.swt.jface.viewer.CheckboxTableViewerInfo.acceptAsParent(SourceFile:32)
at com.swtdesigner.model.parser.JavaInfoParser.isParentAndChild(SourceFile:792)
at com.swtdesigner.model.parser.JavaInfoParser.findParentFor(SourceFile:710)
at com.swtdesigner.model.parser.JavaInfoParser.getRootNodes(SourceFile:321)
at com.swtdesigner.gef.DesignerEditor.parseCompilationUnit(SourceFile:726)
....