Package org.apache.isis.viewer.wicket.ui.components.widgets.bootstrap

Examples of org.apache.isis.viewer.wicket.ui.components.widgets.bootstrap.FormGroup


        setOutputMarkupId(true);
        entityLink.setOutputMarkupId(true);
        entityLink.setLabel(Model.of(name));

        final FormGroup labelIfRegular = new FormGroup(ID_SCALAR_IF_REGULAR, entityLink);
        labelIfRegular.add(entityLink);
       
        final String describedAs = getModel().getDescribedAs();
        if(describedAs != null) {
            labelIfRegular.add(new AttributeModifier("title", Model.of(describedAs)));
        }
       
        final Label scalarName = new Label(ID_SCALAR_NAME, getRendering().getLabelCaption(entityLink));
        labelIfRegular.add(scalarName);

        applyLabelAtRule(scalarName, labelIfRegular);

        addOrReplace(labelIfRegular);
       
        addFeedbackTo(labelIfRegular, entityLink);
        addAdditionalLinksTo(labelIfRegular);
       
        // add semantics
        entityLink.setRequired(getModel().isRequired());
        entityLink.add(new IValidator<ObjectAdapter>() {
       
            private static final long serialVersionUID = 1L;
       
            @Override
            public void validate(final IValidatable<ObjectAdapter> validatable) {
                final ObjectAdapter proposedAdapter = validatable.getValue();
                final String reasonIfAny = getModel().validate(proposedAdapter);
                if (reasonIfAny != null) {
                    final ValidationError error = new ValidationError();
                    error.setMessage(reasonIfAny);
                    validatable.error(error);
                }
            }
        });

        if(getModel().isRequired()) {
            labelIfRegular.add(new CssClassAppender("mandatory"));
        }
        return labelIfRegular;
    }
View Full Code Here


    @Override
    protected FormGroup addComponentForRegular() {
        fileUploadField = createFileUploadField(ID_SCALAR_VALUE);
        fileUploadField.setLabel(Model.of(getModel().getName()));
       
        final FormGroup labelIfRegular = new FormGroup(ID_SCALAR_IF_REGULAR, fileUploadField);
        labelIfRegular.add(fileUploadField);
   
        final Label scalarName = new Label(ID_SCALAR_NAME, getModel().getName());
        labelIfRegular.add(scalarName);

        applyLabelAtRule(scalarName, labelIfRegular);

        wicketImage = asWicketImage(ID_IMAGE);
        if(wicketImage != null) {
            wicketImage.setOutputMarkupId(true);
            labelIfRegular.addOrReplace(wicketImage);
        } else {
            Components.permanentlyHide(labelIfRegular, ID_IMAGE);
        }
       
        updateFileNameLabel(ID_FILE_NAME, labelIfRegular);
View Full Code Here

        checkBox = createCheckBox(ID_SCALAR_VALUE);

        checkBox.setLabel(Model.of(name));

        final FormGroup labelIfRegular = new FormGroup(ID_SCALAR_IF_REGULAR, checkBox);
        labelIfRegular.add(checkBox);
        if(getModel().isRequired()) {
            labelIfRegular.add(new CssClassAppender("mandatory"));
        }

        final String describedAs = getModel().getDescribedAs();
        if(describedAs != null) {
            labelIfRegular.add(new AttributeModifier("title", Model.of(describedAs)));
        }
       
        final Label scalarName = new Label(ID_SCALAR_NAME, getRendering().getLabelCaption(checkBox));
        labelIfRegular.add(scalarName);

        applyLabelAtRule(scalarName, labelIfRegular);

        addOrReplace(labelIfRegular);
       
View Full Code Here

        Fragment textFieldFragment = createTextFieldFragment("scalarValueContainer");
        final AbstractTextComponent<T> textField = getTextField();
        final String name = getModel().getName();
        textField.setLabel(Model.of(name));
       
        final FormGroup scalarNameAndValue = new FormGroup(ID_SCALAR_IF_REGULAR, textField);

        textFieldFragment.add(textField);
        scalarNameAndValue.add(textFieldFragment);

        return scalarNameAndValue;
    }
View Full Code Here

    protected MarkupContainer createFormComponentLabel() {
        final String name = getModel().getName();
        select2Field.setLabel(Model.of(name));

        final FormGroup labelIfRegular = new FormGroup(ID_SCALAR_IF_REGULAR, select2Field);

        final String describedAs = getModel().getDescribedAs();
        if(describedAs != null) {
            labelIfRegular.add(new AttributeModifier("title", Model.of(describedAs)));
        }

        labelIfRegular.add(select2Field);

        return labelIfRegular;
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.wicket.ui.components.widgets.bootstrap.FormGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.