Search in sources :

Example 1 with Margins

use of com.sencha.gxt.core.client.util.Margins in project activityinfo by bedatadriven.

the class TableView method formTreeChanged.

private void formTreeChanged(Observable<FormTree> tree) {
    if (tree.isLoaded()) {
        if (tree.get().hasVisibleSubForms()) {
            if (subFormPane == null) {
                subFormPane = new SubFormPane(viewModel, tree.get());
                BorderLayoutContainer.BorderLayoutData subFormPaneLayout = new BorderLayoutContainer.BorderLayoutData(0.3);
                subFormPaneLayout.setSplit(true);
                subFormPaneLayout.setMargins(new Margins(0, 0, 0, MARGINS));
                this.container.setSouthWidget(subFormPane, subFormPaneLayout);
                Scheduler.get().scheduleFinally(() -> container.forceLayout());
            }
        } else {
            if (subFormPane != null) {
                this.container.remove(subFormPane);
                Scheduler.get().scheduleFinally(() -> container.forceLayout());
                subFormPane = null;
            }
        }
    }
}
Also used : BorderLayoutContainer(com.sencha.gxt.widget.core.client.container.BorderLayoutContainer) Margins(com.sencha.gxt.core.client.util.Margins)

Example 2 with Margins

use of com.sencha.gxt.core.client.util.Margins in project activityinfo by bedatadriven.

the class FormPanel method addField.

private void addField(FormTree.Node node, FieldWidget fieldWidget) {
    Label fieldLabel = new Label(node.getField().getLabel());
    fieldLabel.addStyleName(InputResources.INSTANCE.style().fieldLabel());
    HTML validationMessage = new HTML();
    validationMessage.setVisible(false);
    CssFloatLayoutContainer fieldPanel = new CssFloatLayoutContainer();
    fieldPanel.setStyleName(InputResources.INSTANCE.style().field());
    fieldPanel.add(fieldLabel, new CssFloatLayoutContainer.CssFloatData(1));
    fieldPanel.add(fieldWidget, new CssFloatLayoutContainer.CssFloatData(1, new Margins(5, horizontalPadding, 5, horizontalPadding)));
    if (!Strings.isNullOrEmpty(node.getField().getDescription())) {
        Label descriptionLabel = new Label(node.getField().getDescription());
        descriptionLabel.addStyleName(InputResources.INSTANCE.style().fieldDescription());
        fieldPanel.add(descriptionLabel, new CssFloatLayoutContainer.CssFloatData(1));
    }
    fieldPanel.add(validationMessage, new CssFloatLayoutContainer.CssFloatData(1));
    panel.add(fieldPanel, new CssFloatLayoutContainer.CssFloatData(1, new Margins(10, horizontalPadding, 10, horizontalPadding)));
    fieldViews.add(new FieldView(node.getFieldId(), fieldWidget, validationMessage));
}
Also used : CssFloatLayoutContainer(com.sencha.gxt.widget.core.client.container.CssFloatLayoutContainer) FieldView(org.activityinfo.ui.client.input.view.field.FieldView) Label(com.google.gwt.user.client.ui.Label) Margins(com.sencha.gxt.core.client.util.Margins) HTML(com.google.gwt.user.client.ui.HTML)

Aggregations

Margins (com.sencha.gxt.core.client.util.Margins)2 HTML (com.google.gwt.user.client.ui.HTML)1 Label (com.google.gwt.user.client.ui.Label)1 BorderLayoutContainer (com.sencha.gxt.widget.core.client.container.BorderLayoutContainer)1 CssFloatLayoutContainer (com.sencha.gxt.widget.core.client.container.CssFloatLayoutContainer)1 FieldView (org.activityinfo.ui.client.input.view.field.FieldView)1