Search in sources :

Example 1 with EJCanvasController

use of org.entirej.framework.core.data.controllers.EJCanvasController in project rap by entirej.

the class EJRWTFormRenderer method setupGui.

private void setupGui(final Composite parent) {
    EJFormProperties formProperties = _form.getProperties();
    EJCanvasController canvasController = _form.getCanvasController();
    // Now loop through all the forms blocks and create controllers for them
    for (EJInternalBlock block : _form.getAllBlocks()) {
        String canvasName = block.getProperties().getCanvasName();
        // displayed.
        if (canvasName == null || canvasName.trim().length() == 0) {
            continue;
        }
        _blocks.put(canvasName, block);
    }
    _mainPane = new EJRWTEntireJGridPane(parent, formProperties.getNumCols());
    _mainPane.setData(EJ_RWT.CUSTOM_VARIANT, EJ_RWT.CSS_CV_FORM);
    for (EJCanvasProperties canvasProperties : formProperties.getCanvasContainer().getAllCanvasProperties()) {
        createCanvas(_mainPane, canvasProperties, canvasController);
    }
    _mainPane.addDisposeListener(new DisposeListener() {

        @Override
        public void widgetDisposed(DisposeEvent event) {
            Collection<CanvasHandler> values = _canvases.values();
            for (CanvasHandler canvasHandler : values) {
                if (canvasHandler instanceof PopupCanvasHandler) {
                    PopupCanvasHandler handler = (PopupCanvasHandler) canvasHandler;
                    if (handler._popupDialog != null && handler._popupDialog.getShell() != null) {
                        handler._popupDialog.getShell().dispose();
                    }
                }
            }
        }
    });
}
Also used : EJFormProperties(org.entirej.framework.core.properties.interfaces.EJFormProperties) DisposeListener(org.eclipse.swt.events.DisposeListener) EJCanvasController(org.entirej.framework.core.data.controllers.EJCanvasController) EJInternalBlock(org.entirej.framework.core.internal.EJInternalBlock) EJCanvasProperties(org.entirej.framework.core.properties.interfaces.EJCanvasProperties) Collection(java.util.Collection) DisposeEvent(org.eclipse.swt.events.DisposeEvent) EJRWTEntireJGridPane(org.entirej.applicationframework.rwt.layout.EJRWTEntireJGridPane)

Aggregations

Collection (java.util.Collection)1 DisposeEvent (org.eclipse.swt.events.DisposeEvent)1 DisposeListener (org.eclipse.swt.events.DisposeListener)1 EJRWTEntireJGridPane (org.entirej.applicationframework.rwt.layout.EJRWTEntireJGridPane)1 EJCanvasController (org.entirej.framework.core.data.controllers.EJCanvasController)1 EJInternalBlock (org.entirej.framework.core.internal.EJInternalBlock)1 EJCanvasProperties (org.entirej.framework.core.properties.interfaces.EJCanvasProperties)1 EJFormProperties (org.entirej.framework.core.properties.interfaces.EJFormProperties)1