I have a error when I try to open a riena's ViewPart in Design mode:
"Incompatible layout data set.
You are attempting to set FormData layout data for <null>. However Composite thisContentComposite has FillLayout and this Layout expects FillData layout data. Please remove invalid setLayoutData() invocation from your source."
I try to open the riena "HelloWorld" example ViewPart :
org.eclipse.riena.sample.app.client.helloworld.views.HelloWorldSubModuleView :
- Code: Select all
/**
* Very simple sub module view, that displays only a label with the text "Hello
* World!".
*
* @author schenkel
*/
public class HelloWorldSubModuleView extends SubModuleView<HelloWorldSubModuleController> {
public HelloWorldSubModuleView() {
}
public static final String ID = HelloWorldSubModuleView.class.getName();
/**
* Add a label with the text "Hello World!" to the view.
*
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void basicCreatePartControl(Composite parent) {
parent.setLayout(new FormLayout());
final Label helloLabel = new Label(parent, SWT.CENTER);
helloLabel.setLayoutData(new FormData());
addUIControl(helloLabel, "labelRidget"); //$NON-NLS-1$
// layout
FormData data = new FormData();
data.height = 20;
data.width = 90;
data.top = new FormAttachment(0, 25);
data.left = new FormAttachment(0, 5);
helloLabel.setLayoutData(data);
}
@Override
protected HelloWorldSubModuleController createController(ISubModuleNode subModuleNode) {
return new HelloWorldSubModuleController(subModuleNode);
}
}
The problem seem to be about LayoutData...
In the basicCreatePartControl method:
- Layout is set for the parent : FormLayout()
- LayoutData is set for the helloLabel : FormData()
The error message say that the parent has a FillLayout, but it's a FormLayout... I don't understand.
Could you help me to fix it?
Fabien