Package org.apache.wicket

Examples of org.apache.wicket.AttributeModifier


            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);
View Full Code Here


        labelIfRegular.add(scalarName);

        final String describedAs = getModel().getDescribedAs();
        if(describedAs != null) {
            labelIfRegular.add(new AttributeModifier("title", Model.of(describedAs)));
        }
       
        addFeedbackTo(labelIfRegular, textField);
        addAdditionalLinksTo(labelIfRegular);
       
View Full Code Here

        if(typicalLength != null && maxLength != null && typicalLength > maxLength) {
            typicalLength = maxLength;
        }
       
        if (typicalLength != null) {
            textField.add(new AttributeModifier("size", Model.of("" + typicalLength)));
        }
       
        if(maxLength != null) {
            textField.add(new AttributeModifier("maxlength", Model.of("" + maxLength)));
        }
    }
View Full Code Here

        textField.setEnabled(true);
        setTitleAttribute("");
    }

    private void setTitleAttribute(final String titleAttribute) {
        textField.add(new AttributeModifier("title", Model.of(titleAttribute)));
    }
View Full Code Here

        }

        link.addOrReplace(this.label = newLabel(ID_ENTITY_TITLE, titleAbbreviated(title)));

        String entityTypeName = adapter.getSpecification().getSingularName();
        link.add(new AttributeModifier("title", entityTypeName + ": " + title));
       
        return link;
    }
View Full Code Here

        // adding an amount because seemed to truncate in tables in certain circumstances
        final int lengthAdjust =
                getLengthAdjustHint() != null ? getLengthAdjustHint() : 1;
        final String dateTimePattern = converter.getDateTimePattern(getLocale());
        final int length = dateTimePattern.length() + lengthAdjust;
        label.add(new AttributeModifier("size", Model.of("" + length)));

        compactFragment.add(label);

        scalarTypeContainer.addOrReplace(compactFragment);
        return label;
View Full Code Here

        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);
View Full Code Here

        super.onBeforeRenderWhenDisabled(disableReason);
        syncWithInput();
        final EntityModel entityLinkModel = (EntityModel) entityLink.getModel();
        entityLinkModel.toViewMode();
        entityLink.setEnabled(false);
        entityLink.add(new AttributeModifier("title", Model.of(disableReason)));
    }
View Full Code Here

            // show link...
            markupContainer.add(link);
            link.add(label);

            if(this.description != null) {
                label.add(new AttributeModifier("title", Model.of(description)));
            }
            if(this.blobOrClob) {
                link.add(new CssClassAppender("noVeil"));
            }
            if(this.prototype) {
                link.add(new CssClassAppender("btn-warning"));
            } else {
                link.add(new CssClassAppender("btn-default"));
            }
            if(this.cssClass != null) {
                link.add(new CssClassAppender(this.cssClass));
            }
            link.add(new CssClassAppender(this.actionIdentifier));

            String cssClassFa = getCssClassFa();
            if (Strings.isNullOrEmpty(cssClassFa)) {
                Components.permanentlyHide(link, "menuLinkFontAwesome");
            } else {
                Label dummy = new Label("menuLinkFontAwesome", "");
                dummy.add(new CssClassAppender(cssClassFa));
                link.add(dummy);
            }

            // .. and hide label
            Components.permanentlyHide(markupContainer, CssMenuItem.ID_MENU_LABEL);
            return link;
        } else {
            // hide link...
            Components.permanentlyHide(markupContainer, ID_MENU_LINK);
            // ... and show label, along with disabled reason
            label.add(new AttributeModifier("title", Model.of(this.getDisabledReason())));
            label.add(new AttributeModifier("class", Model.of("disabled")));

            markupContainer.add(label);

            return label;
        }
View Full Code Here

    protected static void applyCssVisibility(final Component component, final boolean visible) {
        if(component == null) {
            return;
        }
        AttributeModifier modifier = visible ? new CssClassRemover(INVISIBLE_CLASS) : new CssClassAppender(INVISIBLE_CLASS);
        component.add(modifier);
    }
View Full Code Here

TOP

Related Classes of org.apache.wicket.AttributeModifier

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.