use of org.entirej.applicationframework.rwt.renderer.interfaces.EJRWTAppFormRenderer 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();
}
use of org.entirej.applicationframework.rwt.renderer.interfaces.EJRWTAppFormRenderer in project rap by entirej.
the class EJRWTSingleFormContainer method createContainer.
@Override
public void createContainer(EJRWTApplicationManager manager, Composite parent, EJFrameworkExtensionProperties rendererprop) {
String formid = null;
formid = getFormId(rendererprop);
if (formid != null) {
try {
_form = manager.getFrameworkManager().createInternalForm(formid, null);
if (_form != null) {
Composite composite = new Composite(parent, rendererprop.getBooleanProperty("BORDER", true) ? SWT.BORDER : SWT.NONE);
FillLayout fillLayout = new FillLayout();
fillLayout.marginHeight = 5;
fillLayout.marginWidth = 5;
String style = rendererprop.getStringProperty("CSS");
if (style != null)
composite.setData(EJ_RWT.CUSTOM_VARIANT, style);
composite.setLayout(fillLayout);
EJRWTAppFormRenderer renderer = (EJRWTAppFormRenderer) _form.getRenderer();
renderer.createControl(composite);
EJRWTEntireJGridPane gridPane = (EJRWTEntireJGridPane) renderer.getGuiComponent();
gridPane.cleanLayout();
gridPane.addFocusListener(new FocusListener() {
@Override
public void focusLost(FocusEvent arg0) {
// ignore
}
@Override
public void focusGained(FocusEvent arg0) {
for (EJRWTFormSelectedListener listener : _formSelectedListeners) {
listener.fireFormSelected(_form);
}
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
_form.focusGained();
}
});
}
});
_control = composite;
return;
}
} catch (Exception e) {
manager.getApplicationMessenger().handleException(e, true);
}
}
Label label = new Label(parent, SWT.NONE);
label.setText("Form could not be found ID#:" + (formid != null ? formid : "<null>"));
_control = label;
}
Aggregations