use of org.entirej.framework.core.renderers.interfaces.EJApplicationComponentRenderer in project rap by entirej.
the class EJRWTApplicationContainer method createComponent.
private void createComponent(Composite parent, EJCoreLayoutItem.LayoutComponent component) {
try {
EJApplicationComponentRenderer applicationComponentRenderer = EJRendererFactory.getInstance().getApplicationComponentRenderer(component.getRenderer());
if (applicationComponentRenderer instanceof EJRWTFormContainer) {
if (_formContainer != null) {
throw new IllegalStateException("Multiple EJRWTFormContainer setup in layout");
}
_formContainer = (EJRWTFormContainer) applicationComponentRenderer;
}
if (applicationComponentRenderer instanceof EJRWTApplicationStatusbar) {
if (_statusbar != null) {
throw new IllegalStateException("Multiple EJRWTApplicationStatusbar setup in layout");
}
_statusbar = (EJRWTApplicationStatusbar) applicationComponentRenderer;
}
if (applicationComponentRenderer instanceof EJRWTSingleFormContainer) {
_singleFormContainers.add((EJRWTSingleFormContainer) applicationComponentRenderer);
}
if (applicationComponentRenderer instanceof EJRWTApplicationComponent) {
_addedComponents.add((EJRWTApplicationComponent) applicationComponentRenderer);
}
EJRWTAppComponentRenderer renderer = (EJRWTAppComponentRenderer) applicationComponentRenderer;
renderer.createContainer(_applicationManager, parent, component.getRendereProperties());
EJ_RWT.setTestId(renderer.getGuiComponent(), component.getName());
renderer.getGuiComponent().setLayoutData(createGridData(component));
return;
} catch (Exception e) {
_applicationManager.getApplicationMessenger().handleException(e, true);
}
// fail over
Composite layoutBody = new Composite(parent, SWT.NO_FOCUS | SWT.BORDER);
layoutBody.setLayoutData(createGridData(component));
layoutBody.setLayout(new GridLayout());
Label spaceLabel = new Label(layoutBody, SWT.NONE);
spaceLabel.setText(String.format("<%s>", component.getRenderer() == null || component.getRenderer().length() == 0 ? "<component>" : component.getRenderer()));
spaceLabel.setLayoutData(createGridData(component));
spaceLabel.setLayoutData(new GridData(GridData.FILL_BOTH));
}
Aggregations