Search in sources :

Example 11 with EJInternalForm

use of org.entirej.framework.core.internal.EJInternalForm in project rap by entirej.

the class EJRWTQueryAction method run.

@Override
public void run() {
    if (_currentBlock == null) {
        EJInternalForm form = _toolbar.getForm();
        EJInternalEditableBlock focusedBlock = form.getFocusedBlock();
        if (form != null && focusedBlock != null) {
            try {
                focusedBlock.enterQuery();
                focusedBlock.getManagedRenderer().gainFocus();
            } catch (Exception e) {
                form.getFrameworkManager().getApplicationManager().handleException(e);
            }
            _toolbar.synchronize(form.getFocusedBlock().getBlockController());
        }
    } else {
        try {
            _currentBlock.enterQuery();
            _currentBlock.getBlock().getManagedRenderer().gainFocus();
        } catch (Exception e) {
            _currentBlock.getFrameworkManager().getApplicationManager().handleException(e);
        }
        _toolbar.synchronize(_currentBlock);
    }
}
Also used : EJInternalEditableBlock(org.entirej.framework.core.internal.EJInternalEditableBlock) EJInternalForm(org.entirej.framework.core.internal.EJInternalForm)

Example 12 with EJInternalForm

use of org.entirej.framework.core.internal.EJInternalForm 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 13 with EJInternalForm

use of org.entirej.framework.core.internal.EJInternalForm 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

EJInternalForm (org.entirej.framework.core.internal.EJInternalForm)13 EJRWTFormRenderer (org.entirej.applicationframework.rwt.renderers.form.EJRWTFormRenderer)7 EJRWTFormSelectedListener (org.entirej.applicationframework.rwt.application.interfaces.EJRWTFormSelectedListener)5 EJInternalEditableBlock (org.entirej.framework.core.internal.EJInternalEditableBlock)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 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 FillLayout (org.eclipse.swt.layout.FillLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 Control (org.eclipse.swt.widgets.Control)1 EJRWTAbstractDialog (org.entirej.applicationframework.rwt.application.form.containers.EJRWTAbstractDialog)1 EJRWTFormPopUp (org.entirej.applicationframework.rwt.application.form.containers.EJRWTFormPopUp)1 EJRWTFormContainer (org.entirej.applicationframework.rwt.application.interfaces.EJRWTFormContainer)1 EJRWTEntireJGridPane (org.entirej.applicationframework.rwt.layout.EJRWTEntireJGridPane)1 EJRWTEntireJStackedPane (org.entirej.applicationframework.rwt.layout.EJRWTEntireJStackedPane)1