public class SimpleErgonomics extends AbstractCmsEntryPoint {
private final static Log log = LogFactory.getLog(SimpleErgonomics.class);
+ private boolean uiInitialized = false;
private Composite headerArea;
private Composite bodyArea;
private final CmsUiProvider uiProvider;
bodyArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
bodyArea.setLayout(CmsUtils.noSpaceGridLayout());
+ uiInitialized = true;
refresh();
}
@Override
protected void refresh() {
+ if (!uiInitialized)
+ return;
+ if (getState() == null)
+ setState("");
refreshHeader();
refreshBody();
if (log.isTraceEnabled())
}
protected void refreshHeader() {
- if (headerArea == null)
- return;
for (Control child : headerArea.getChildren())
child.dispose();
try {
}
protected void refreshBody() {
- if (bodyArea == null)
- return;
// Exception
Throwable exception = getException();
if (exception != null) {
child.dispose();
bodyArea.setLayout(CmsUtils.noSpaceGridLayout());
- String state = getState();
try {
- if (state == null)
- setState("");
- // throw new CmsException("State cannot be null");
uiProvider.createUi(bodyArea, getNode());
} catch (RepositoryException e) {
throw new CmsException("Cannot refresh body", e);