if (!isEditEnabled()) {
return new DisplayerView(displayerSettings).draw();
}
// TODO encapsulate the editor in a DisplayerSettingsView, similar to the DisplayerView, for coherency ?
DisplayerSettingsEditor settingsEditor = DisplayerSettingsEditorLocator.get().lookupSettingsEditor(displayerSettings);
SimplePanel editorPanel = new SimplePanel();
editorPanel.setWidth("500px");
editorPanel.add(settingsEditor);
final SimplePanel viewerPanel = new SimplePanel();
viewerPanel.add(new DisplayerView(displayerSettings).draw());
settingsEditor.setListener(new DisplayerSettingsEditorListener() {
public void onDisplayerSettingsChanged(DisplayerSettingsEditor editor) {
viewerPanel.clear();
viewerPanel.setWidget(new DisplayerView(displayerSettings).draw());
}
});