Search in sources :

Example 1 with EJManagedFormRendererWrapper

use of org.entirej.framework.core.renderers.EJManagedFormRendererWrapper in project rap by entirej.

the class EJRWTFormPopUp method showForm.

public void showForm() {
    final int height = _popupController.getPopupForm().getProperties().getFormHeight();
    final int width = _popupController.getPopupForm().getProperties().getFormWidth();
    EJManagedFormRendererWrapper wrapper = _popupController.getPopupForm().getManagedRenderer();
    final EJRWTAppFormRenderer formRenderer = (EJRWTAppFormRenderer) wrapper.getUnmanagedRenderer();
    _popupDialog = new EJRWTAbstractDialog(_mainShell) {

        @Override
        public void createBody(Composite parent) {
            parent.setLayout(new FillLayout());
            final ScrolledComposite scrollComposite = new EJRWTScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
            formRenderer.createControl(scrollComposite);
            scrollComposite.setContent(formRenderer.getGuiComponent());
            scrollComposite.setExpandHorizontal(true);
            scrollComposite.setExpandVertical(true);
            scrollComposite.setMinSize(width, height);
        }

        @Override
        public void canceled() {
            _popupController.getPopupForm().close();
        }
    };
    _popupDialog.create();
    _popupDialog.getShell().setText(_popupController.getPopupForm().getProperties().getTitle());
    // add offset
    _popupDialog.getShell().setSize(width + 50, height + 70);
    _popupDialog.open();
    _popupDialog.activateDialog();
}
Also used : EJRWTScrolledComposite(org.entirej.applicationframework.rwt.layout.EJRWTScrolledComposite) EJRWTScrolledComposite(org.entirej.applicationframework.rwt.layout.EJRWTScrolledComposite) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) EJRWTScrolledComposite(org.entirej.applicationframework.rwt.layout.EJRWTScrolledComposite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) FillLayout(org.eclipse.swt.layout.FillLayout) EJManagedFormRendererWrapper(org.entirej.framework.core.renderers.EJManagedFormRendererWrapper) EJRWTAppFormRenderer(org.entirej.applicationframework.rwt.renderer.interfaces.EJRWTAppFormRenderer)

Aggregations

ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)1 FillLayout (org.eclipse.swt.layout.FillLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 EJRWTScrolledComposite (org.entirej.applicationframework.rwt.layout.EJRWTScrolledComposite)1 EJRWTAppFormRenderer (org.entirej.applicationframework.rwt.renderer.interfaces.EJRWTAppFormRenderer)1 EJManagedFormRendererWrapper (org.entirej.framework.core.renderers.EJManagedFormRendererWrapper)1