Examples of AttributeModifier


Examples of org.apache.wicket.AttributeModifier

  /** Tests simple behavior */
  @Test
  public void simple()
  {
    MyPage page = new MyPage();
    page.getContainer().add(new AttributeModifier("class", "border"));
    tester.startPage(page);

    assertTrue(tester.getLastResponseAsString().contains("class=\"border\""));
  }
View Full Code Here

Examples of org.apache.wicket.AttributeModifier

   * Tests the fact that url-behavior indexes do not change even if behaviors are removed/added
   */
  @Test
  public void urlIndexRendering()
  {
    Behavior border = new AttributeModifier("class", "border");
    Behavior border2 = new AttributeModifier("class2", "border");
    Behavior auto = new AttributeModifier("autocomplete", "off");
    Behavior auto2 = new AttributeModifier("autocomplete2", "off");
    Behavior link = new LinkBehavior("href");
    Behavior link2 = new LinkBehavior("onclick");

    MyPage page = new MyPage();

View Full Code Here

Examples of org.apache.wicket.AttributeModifier

   * Tests that removal of behaviors properly cleans up the data array
   */
  @Test
  public void behaviorDataArrayCleanup()
  {
    Behavior border = new AttributeModifier("class", "border");
    Behavior border2 = new AttributeModifier("class2", "border");
    Behavior auto = new AttributeModifier("autocomplete", "off");
    Behavior auto2 = new AttributeModifier("autocomplete2", "off");
    Behavior link = new LinkBehavior("href");
    Behavior link2 = new LinkBehavior("onclick");

    MyPage page = new MyPage();
    page.getContainer().add(border, auto, link, border2, link2, auto2);
View Full Code Here

Examples of org.apache.wicket.AttributeModifier

    protected void applyLabelAtRule(Label scalarName, MarkupContainer formGroup) {

        final LabelAtFacet facet = getModel().getFacet(LabelAtFacet.class);

        // TODO mgrigorov: Remove this. It is for debugging
        scalarName.add(new AttributeModifier("title", "labelAt=" + (facet != null? facet.value(): "(null)")));

        if (facet != null) {
            switch (facet.value()) {
                case LEFT:
                    formGroup.add(new CssClassAppender("label-left"));
View Full Code Here

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

Examples of org.apache.wicket.AttributeModifier

        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

Examples of org.apache.wicket.AttributeModifier

        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

Examples of org.apache.wicket.AttributeModifier

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

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

Examples of org.apache.wicket.AttributeModifier

        }

        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

Examples of org.apache.wicket.AttributeModifier

        // 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
TOP
Copyright © 2018 www.massapi.com. 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.