Search in sources :

Example 6 with EJRWTFormSelectedListener

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;
}
Also used : Control(org.eclipse.swt.widgets.Control) EJRWTFormRenderer(org.entirej.applicationframework.rwt.renderers.form.EJRWTFormRenderer) EJRWTFormSelectedListener(org.entirej.applicationframework.rwt.application.interfaces.EJRWTFormSelectedListener) EJRWTEntireJStackedPane(org.entirej.applicationframework.rwt.layout.EJRWTEntireJStackedPane) EJInternalForm(org.entirej.framework.core.internal.EJInternalForm)

Example 7 with EJRWTFormSelectedListener

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;
}
Also used : EJRWTFormRenderer(org.entirej.applicationframework.rwt.renderers.form.EJRWTFormRenderer) EJRWTFormSelectedListener(org.entirej.applicationframework.rwt.application.interfaces.EJRWTFormSelectedListener) EJInternalForm(org.entirej.framework.core.internal.EJInternalForm)

Aggregations

EJRWTFormSelectedListener (org.entirej.applicationframework.rwt.application.interfaces.EJRWTFormSelectedListener)7 EJInternalForm (org.entirej.framework.core.internal.EJInternalForm)5 EJRWTFormRenderer (org.entirej.applicationframework.rwt.renderers.form.EJRWTFormRenderer)4 FillLayout (org.eclipse.swt.layout.FillLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 Collection (java.util.Collection)1 CTabFolder (org.eclipse.swt.custom.CTabFolder)1 CTabFolder2Adapter (org.eclipse.swt.custom.CTabFolder2Adapter)1 CTabFolderEvent (org.eclipse.swt.custom.CTabFolderEvent)1 CTabItem (org.eclipse.swt.custom.CTabItem)1 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)1 FocusEvent (org.eclipse.swt.events.FocusEvent)1 FocusListener (org.eclipse.swt.events.FocusListener)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Control (org.eclipse.swt.widgets.Control)1 Label (org.eclipse.swt.widgets.Label)1 EJRWTAbstractDialog (org.entirej.applicationframework.rwt.application.form.containers.EJRWTAbstractDialog)1 EJRWTFormPopUp (org.entirej.applicationframework.rwt.application.form.containers.EJRWTFormPopUp)1