Package org.apache.isis.viewer.wicket.model.models

Examples of org.apache.isis.viewer.wicket.model.models.ScalarModel


     * {@link Rendering#COMPACT compact} format.
     */
    @Override
    protected Component addComponentForCompact() {

        final ScalarModel scalarModel = getModel();
        final String name = scalarModel.getName();
       
        final Component entityLinkComponent = getComponentFactoryRegistry().createComponent(ComponentType.ENTITY_LINK, getModel());
        entityLink = (EntityLinkSelect2Panel) entityLinkComponent;
       
        entityLink.setOutputMarkupId(true);
View Full Code Here


            paramPanels.clear();
            for (final ActionParameterMemento apm : parameterMementos) {
                final WebMarkupContainer container = new WebMarkupContainer(rv.newChildId());
                rv.add(container);

                final ScalarModel argumentModel = actionModel.getArgumentModel(apm);
                argumentModel.setActionArgsHint(actionModel.getArgumentsAsArray());
                final Component component = getComponentFactoryRegistry().addOrReplaceComponent(container, ComponentType.SCALAR_NAME_AND_VALUE, argumentModel);
                final ScalarPanelAbstract paramPanel = component instanceof ScalarPanelAbstract ? (ScalarPanelAbstract) component : null;
                paramPanels.add(paramPanel);
                if(paramPanel != null) {
                    paramPanel.setOutputMarkupId(true);
View Full Code Here

        addMaxLengthValidator();
        addObjectAdapterValidator();
    }

    private void addMaxLengthValidator() {
        final ScalarModel scalarModel = getModel();
        final AbstractTextComponent<String> textField = getTextField();

        final ObjectSpecification facetHolder = scalarModel.getTypeOfSpecification();

        final MaxLengthFacet maxLengthFacet = facetHolder.getFacet(MaxLengthFacet.class);
        if (maxLengthFacet != null) {
            textField.add(StringValidator.maximumLength(maxLengthFacet.value()));
        }
View Full Code Here

            textField.add(StringValidator.maximumLength(maxLengthFacet.value()));
        }
    }

    private void addObjectAdapterValidator() {
        final ScalarModel scalarModel = getModel();
        final AbstractTextComponent<String> textField = getTextField();

        textField.add(new IValidator<String>() {
            private static final long serialVersionUID = 1L;

            @Override
            public void validate(final IValidatable<String> validatable) {
                final String proposedValue = validatable.getValue();
                final String reasonIfAny = scalarModel.parseAndValidate(proposedValue);
                if (reasonIfAny != null) {
                    final ValidationError error = new ValidationError();
                    error.setMessage(reasonIfAny);
                    validatable.error(error);
                }
View Full Code Here

    // First called as a side-effect of {@link #beforeRender()}
    @Override
    protected Component addComponentForCompact() {

        final ScalarModel scalarModel = getModel();
        final String name = scalarModel.getName();
       
        entitySimpleLink = (EntityLinkSimplePanel) getComponentFactoryRegistry().createComponent(ComponentType.ENTITY_LINK, getModel());
       
        entitySimpleLink.setOutputMarkupId(true);
        entitySimpleLink.setLabel(Model.of(name));
View Full Code Here


    // First called as a side-effect of {@link #beforeRender()}
    @Override
    protected FormGroup addComponentForRegular() {
        final ScalarModel scalarModel = getModel();
        final String name = scalarModel.getName();
       
        entityLink = new EntityLinkSelect2Panel(ComponentType.ENTITY_LINK.getWicketId(), this);
        syncWithInput();

        setOutputMarkupId(true);
View Full Code Here

        final CheckBoxX checkBox = new CheckBoxX(id, new Model<Boolean>() {
            private static final long serialVersionUID = 1L;

            @Override
            public Boolean getObject() {
                final ScalarModel model = getModel();
                final ObjectAdapter adapter = model.getObject();
                return adapter != null? (Boolean) adapter.getObject(): null;
            }

            @Override
            public void setObject(final Boolean object) {
View Full Code Here

    @Override
    public ApplicationAdvice appliesTo(final IModel<?> model) {
        if (!(model instanceof ScalarModel)) {
            return ApplicationAdvice.DOES_NOT_APPLY;
        }
        final ScalarModel scalarModel = (ScalarModel) model;
        final ObjectSpecification specification = scalarModel.getTypeOfSpecification();
        return appliesIf(specification != null && specification.containsFacet(ImageValueFacet.class));
    }
View Full Code Here

        return appliesIf(specification != null && specification.containsFacet(ImageValueFacet.class));
    }

    @Override
    public Component createComponent(final String id, final IModel<?> model) {
        final ScalarModel scalarModel = (ScalarModel) model;
        return new JavaAwtImagePanel(id, scalarModel);
    }
View Full Code Here

        super(id, scalarModel, BigDecimal.class);
        this.converter = converter;
    }
    protected TextField<BigDecimal> createTextField(final String id) {
        final ScalarModel model = getModel();
        return new BigDecimalTextField(id, newTextFieldValueModel(), cls, model, converter);
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.wicket.model.models.ScalarModel

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.