use of org.entirej.applicationframework.rwt.application.interfaces.EJRWTFormSelectedListener in project rap by entirej.
the class EJRWTStackedPaneFormContainer method addForm.
@Override
public EJInternalForm addForm(EJInternalForm form) {
final String name = form.getFormController().getEJForm().getName();
final EJInternalForm formByPage = getFormByPage(name);
if (formByPage != null) {
_stackPane.showPane(name);
EJRWTFormRenderer renderer = (EJRWTFormRenderer) formByPage.getRenderer();
renderer.gainInitialFocus();
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
formByPage.focusGained();
for (EJRWTFormSelectedListener listener : _formSelectedListeners) {
listener.fireFormSelected(formByPage);
}
}
});
return formByPage;
}
_stackedPages.put(form, name);
final EJRWTFormRenderer renderer = (EJRWTFormRenderer) form.getRenderer();
renderer.createControl(_stackPane);
_stackPane.add(name, new EJRWTEntireJStackedPane.StackedPage() {
@Override
public String getKey() {
return name;
}
public Control getControl() {
return renderer.getGuiComponent();
}
});
_stackPane.showPane(name);
renderer.gainInitialFocus();
form.focusGained();
for (EJRWTFormSelectedListener listener : _formSelectedListeners) {
listener.fireFormSelected(form);
}
return form;
}
use of org.entirej.applicationframework.rwt.application.interfaces.EJRWTFormSelectedListener in project rap by entirej.
the class EJRWTStackedPaneFormContainer method switchToForm.
@Override
public EJInternalForm switchToForm(String key) {
for (EJInternalForm form : _stackedPages.keySet()) {
if (form.getProperties().getName().equalsIgnoreCase(key)) {
EJRWTFormRenderer renderer = (EJRWTFormRenderer) form.getRenderer();
_stackPane.showPane(_stackedPages.get(form));
EJ_RWT.setAttribute(_stackPane, "ej-item-selection", form.getProperties().getName());
renderer.gainInitialFocus();
form.focusGained();
for (EJRWTFormSelectedListener listener : _formSelectedListeners) {
listener.fireFormSelected(form);
}
return form;
}
}
return null;
}
Aggregations