Search in sources :

Example 1 with EJRWTFormRenderer

use of org.entirej.applicationframework.rwt.renderers.form.EJRWTFormRenderer in project rap by entirej.

the class EJRWTApplicationManager method createEmbeddedForm.

public EJInternalForm createEmbeddedForm(String formName, Composite parent) {
    try {
        EJInternalForm form = getFrameworkManager().createInternalForm(formName, null);
        if (form != null) {
            EJRWTFormRenderer renderer = (EJRWTFormRenderer) form.getRenderer();
            renderer.createControl(parent);
            EJRWTEntireJGridPane gridPane = renderer.getGuiComponent();
            gridPane.cleanLayout();
            embeddedForms.add(form);
            return form;
        }
    } catch (Exception e) {
        getApplicationMessenger().handleException(e, true);
    }
    return null;
}
Also used : EJRWTFormRenderer(org.entirej.applicationframework.rwt.renderers.form.EJRWTFormRenderer) EJInternalForm(org.entirej.framework.core.internal.EJInternalForm) EJRWTEntireJGridPane(org.entirej.applicationframework.rwt.layout.EJRWTEntireJGridPane) EJApplicationException(org.entirej.framework.core.EJApplicationException)

Example 2 with EJRWTFormRenderer

use of org.entirej.applicationframework.rwt.renderers.form.EJRWTFormRenderer in project rap by entirej.

the class EJRWTTabPaneFormContainer method switchToForm.

@Override
public EJInternalForm switchToForm(EJInternalForm aform) {
    for (EJInternalForm form : _tabPages.keySet()) {
        if (form.equals(aform)) {
            EJRWTFormRenderer renderer = (EJRWTFormRenderer) form.getRenderer();
            _folder.setSelection(_tabPages.get(form));
            EJ_RWT.setAttribute(_folder, "ej-item-selection", form.getProperties().getName());
            renderer.gainInitialFocus();
            return form;
        }
    }
    return null;
}
Also used : EJRWTFormRenderer(org.entirej.applicationframework.rwt.renderers.form.EJRWTFormRenderer) EJInternalForm(org.entirej.framework.core.internal.EJInternalForm)

Example 3 with EJRWTFormRenderer

use of org.entirej.applicationframework.rwt.renderers.form.EJRWTFormRenderer in project rap by entirej.

the class EJRWTStackedPaneFormContainer method switchToForm.

@Override
public EJInternalForm switchToForm(EJInternalForm aform) {
    for (EJInternalForm form : _stackedPages.keySet()) {
        if (form.equals(aform)) {
            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)

Example 4 with EJRWTFormRenderer

use of org.entirej.applicationframework.rwt.renderers.form.EJRWTFormRenderer in project rap by entirej.

the class EJRWTTabPaneFormContainer method addForm.

@Override
public EJInternalForm addForm(EJInternalForm form) {
    CTabItem tabItem = new CTabItem(_folder, SWT.NONE);
    _tabPages.put(form, tabItem);
    tabItem.setData(form);
    EJ_RWT.setTestId(tabItem, form.getProperties().getName());
    EJRWTFormRenderer renderer = (EJRWTFormRenderer) form.getRenderer();
    final ScrolledComposite scrollComposite = new EJRWTScrolledComposite(_folder, SWT.V_SCROLL | SWT.H_SCROLL);
    renderer.createControl(scrollComposite);
    scrollComposite.setContent(renderer.getGuiComponent());
    scrollComposite.setExpandHorizontal(true);
    scrollComposite.setExpandVertical(true);
    scrollComposite.setMinSize(form.getProperties().getFormWidth(), form.getProperties().getFormHeight());
    final EJCoreFormProperties coreFormProperties = form.getProperties();
    tabItem.setText(coreFormProperties.getTitle() == null ? coreFormProperties.getName() : coreFormProperties.getTitle());
    tabItem.setControl(scrollComposite);
    _folder.setSelection(tabItem);
    renderer.gainInitialFocus();
    return form;
}
Also used : EJRWTScrolledComposite(org.entirej.applicationframework.rwt.layout.EJRWTScrolledComposite) EJCoreFormProperties(org.entirej.framework.core.properties.EJCoreFormProperties) EJRWTFormRenderer(org.entirej.applicationframework.rwt.renderers.form.EJRWTFormRenderer) EJRWTScrolledComposite(org.entirej.applicationframework.rwt.layout.EJRWTScrolledComposite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) CTabItem(org.eclipse.swt.custom.CTabItem)

Example 5 with EJRWTFormRenderer

use of org.entirej.applicationframework.rwt.renderers.form.EJRWTFormRenderer in project rap by entirej.

the class EJRWTTabPaneFormContainer method switchToForm.

@Override
public EJInternalForm switchToForm(String key) {
    for (EJInternalForm form : _tabPages.keySet()) {
        if (form.getProperties().getName().equalsIgnoreCase(key)) {
            EJRWTFormRenderer renderer = (EJRWTFormRenderer) form.getRenderer();
            _folder.setSelection(_tabPages.get(form));
            EJ_RWT.setAttribute(_folder, "ej-item-selection", form.getProperties().getName());
            renderer.gainInitialFocus();
            return form;
        }
    }
    return null;
}
Also used : EJRWTFormRenderer(org.entirej.applicationframework.rwt.renderers.form.EJRWTFormRenderer) EJInternalForm(org.entirej.framework.core.internal.EJInternalForm)

Aggregations

EJRWTFormRenderer (org.entirej.applicationframework.rwt.renderers.form.EJRWTFormRenderer)8 EJInternalForm (org.entirej.framework.core.internal.EJInternalForm)7 EJRWTFormSelectedListener (org.entirej.applicationframework.rwt.application.interfaces.EJRWTFormSelectedListener)4 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)2 EJRWTScrolledComposite (org.entirej.applicationframework.rwt.layout.EJRWTScrolledComposite)2 EJCoreFormProperties (org.entirej.framework.core.properties.EJCoreFormProperties)2 Collection (java.util.Collection)1 CTabItem (org.eclipse.swt.custom.CTabItem)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 EJApplicationException (org.entirej.framework.core.EJApplicationException)1 EJPopupFormController (org.entirej.framework.core.data.controllers.EJPopupFormController)1