org.apache.wicket.markup.html.basic.Label.getDefaultModelObjectAsString()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(9.9k)|赞(0)|评价(0)|浏览(182)

本文整理了Java中org.apache.wicket.markup.html.basic.Label.getDefaultModelObjectAsString()方法的一些代码示例,展示了Label.getDefaultModelObjectAsString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.getDefaultModelObjectAsString()方法的具体详情如下:
包路径:org.apache.wicket.markup.html.basic.Label
类名称:Label
方法名:getDefaultModelObjectAsString

Label.getDefaultModelObjectAsString介绍

暂无

代码示例

代码示例来源:origin: org.onehippo.cms7/hippo-cms-console-frontend

@Override
  public boolean isVisible() {
    return selectedNs != null && !dump.getDefaultModelObjectAsString().equals("");
  }
};

代码示例来源:origin: org.onehippo.cms7/hippo-cms-plugins

@Override
  public boolean isVisible() {
    return selectedNs != null && !dump.getDefaultModelObjectAsString().equals("");
  }
};

代码示例来源:origin: apache/wicket

/**
 * {@inheritDoc}
 */
@Override
public void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag)
{
  replaceComponentTagBody(markupStream, openTag, getDefaultModelObjectAsString());
}

代码示例来源:origin: org.apache.wicket/wicket-core

/**
 * {@inheritDoc}
 */
@Override
public void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag)
{
  replaceComponentTagBody(markupStream, openTag, getDefaultModelObjectAsString());
}

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * @see org.apache.wicket.Component#onComponentTagBody(org.apache.wicket.markup.MarkupStream,
 *      org.apache.wicket.markup.ComponentTag)
 */
@Override
protected void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag)
{
  replaceComponentTagBody(markupStream, openTag, getDefaultModelObjectAsString());
}

代码示例来源:origin: org.opensingular/singular-form-wicket

/** Returns a String assertive for the label text. */
  @Nonnull
  public AbstractCharSequenceAssert<?, String> assertValue() {
    return Assertions.assertThat(getTarget().getDefaultModelObjectAsString());

  }
}

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * Asserts the text of a <code>Label</code> <code>Component</code>.
 * 
 * @param path
 *            path to <code>Label</code> <code>Component</code>
 * @param expectedLabelText
 *            expected text of the <code>Label</code>
 */
public void assertLabel(String path, String expectedLabelText)
{
  Label label = (Label)getComponentFromLastRenderedPage(path);
  Assert.assertEquals(expectedLabelText, label.getDefaultModelObjectAsString());
}

代码示例来源:origin: apache/wicket

/**
 * Asserts the text of a <code>Label</code> <code>Component</code>.
 *
 * @param path
 *            path to <code>Label</code> <code>Component</code>
 * @param expectedLabelText
 *            expected text of the <code>Label</code>
 */
public void assertLabel(String path, String expectedLabelText)
{
  Label label = (Label)getComponentFromLastRenderedPage(path);
  assertEquals(expectedLabelText, label.getDefaultModelObjectAsString());
}

代码示例来源:origin: org.apache.wicket/wicket-core

/**
 * Asserts the text of a <code>Label</code> <code>Component</code>.
 * 
 * @param path
 *            path to <code>Label</code> <code>Component</code>
 * @param expectedLabelText
 *            expected text of the <code>Label</code>
 */
public void assertLabel(String path, String expectedLabelText)
{
  Label label = (Label)getComponentFromLastRenderedPage(path);
  assertEquals(expectedLabelText, label.getDefaultModelObjectAsString());
}

代码示例来源:origin: org.ops4j.pax.wicket/pax-wicket-service

/**
 * assert the text of <code>Label</code> component.
 * 
 * @param path
 *            path to <code>Label</code> component
 * @param expectedLabelText
 *            expected label text
 * @return a <code>Result</code>
 */
public Result hasLabel(String path, String expectedLabelText)
{
  Label label = (Label)getComponentFromLastRenderedPage(path);
  return isEqual(expectedLabelText, label.getDefaultModelObjectAsString());
}

代码示例来源:origin: org.apache.wicket/wicket-core

/**
 * assert the text of <code>Label</code> component.
 *
 * @param path
 *            path to <code>Label</code> component
 * @param expectedLabelText
 *            expected label text
 * @return a <code>Result</code>
 */
public Result hasLabel(String path, String expectedLabelText)
{
  Label label = (Label)getComponentFromLastRenderedPage(path);
  return isEqual(expectedLabelText, label.getDefaultModelObjectAsString());
}

代码示例来源:origin: apache/wicket

/**
 * assert the text of <code>Label</code> component.
 *
 * @param path
 *            path to <code>Label</code> component
 * @param expectedLabelText
 *            expected label text
 * @return a <code>Result</code>
 */
public Result hasLabel(String path, String expectedLabelText)
{
  Label label = (Label)getComponentFromLastRenderedPage(path);
  return isEqual(expectedLabelText, label.getDefaultModelObjectAsString());
}

代码示例来源:origin: de.agilecoders.wicket/bootstrap

/**
 * Update the 'visible' flag to indicate the existence (or lack thereof) of feedback messages
 */
@Override
protected void onBeforeRender() {
  super.onBeforeRender();
  // Get the messages for the current page
  List<FeedbackMessage> feedbackMessageList = collectFeedbackMessages();
  if (feedbackMessageList != null && !feedbackMessageList.isEmpty()) {
    FeedbackMessage feedbackMessage = feedbackMessageList.get(0);
    feedback.setDefaultModel(new Model<Serializable>(feedbackMessage.getMessage()));
    feedback.setVisible(true);
    add(new CssClassNameAppender(feedbackMessage.getLevelAsString().toLowerCase()));
  } else {
    feedback.setVisible(false);
  }
  
  label.setVisible(!Strings.isNullOrEmpty(label.getDefaultModelObjectAsString()));
  help.setVisible(!Strings.isNullOrEmpty(help.getDefaultModelObjectAsString()));
}

代码示例来源:origin: de.agilecoders.wicket/bootstrap

@Override
protected void onConfigure() {
  super.onConfigure();
  if (useFadein()) {
    add(new CssClassNameAppender("fade"));
  }
  if (Strings.isEmpty(headerLabel.getDefaultModelObjectAsString())) {
    // there must be at least on character inside the header to prevent
    // layout problems.
    headerLabel.setDefaultModelObject("&nbsp;");
    headerLabel.setEscapeModelStrings(false);
  }
  footer.setVisible(buttons.size() > 0);
}

代码示例来源:origin: de.agilecoders.wicket/bootstrap

@Override
  protected void onConfigure() {
    super.onConfigure();

    if (Strings.isNullOrEmpty(inlineHeader.getDefaultModelObjectAsString())) {
      this.inlineHeader.setVisible(false);
      this.blockHeader.setVisible(false);
    } else {
      this.inlineHeader.setVisible(useInlineHeader);
      this.blockHeader.setVisible(!useInlineHeader);
    }

    this.message.setDefaultModel(getDefaultModel());

    if (closeButton.isVisible()) {
      add(BootstrapResourcesBehavior.instance());
    }
  }
}

代码示例来源:origin: de.agilecoders.wicket/wicket-bootstrap-core

@Override
  protected void onConfigure() {
    super.onConfigure();

    if (Strings.isEmpty(inlineHeader.getDefaultModelObjectAsString())) {
      this.inlineHeader.setVisible(false);
      this.blockHeader.setVisible(false);
    } else {
      this.inlineHeader.setVisible(useInlineHeader);
      this.blockHeader.setVisible(!useInlineHeader);
    }

    this.message.setDefaultModel(getDefaultModel());
  }
}

代码示例来源:origin: org.geoserver.web/gs-web-demo

@Test
public void testWfsOutputFormatValueUrlEncoding() {
  tester.startPage(MapPreviewPage.class);
  tester.assertRenderedPage(MapPreviewPage.class);
  Label optionLabel =
      (Label)
          tester.getComponentFromLastRenderedPage(
              "table:listContainer:items:4:itemProperties:4:component:menu:wfs:wfsFormats:3");
  assertTrue(optionLabel.getDefaultModelObjectAsString().equals("GML3.2"));
  for (Iterator<? extends Behavior> itBehaviors = optionLabel.getBehaviors().iterator();
      itBehaviors.hasNext(); ) {
    Behavior b = itBehaviors.next();
    if (b instanceof AttributeModifier) {
      AttributeModifier am = (AttributeModifier) b;
      String url = am.toString();
      assertTrue(!url.contains("gml+xml"));
      assertTrue(url.contains("gml%2Bxml"));
      break;
    }
  }
}

代码示例来源:origin: org.geoserver.web/web-demo

public void XtestLayerNamesPrefixed() throws Exception {
    Catalog cat = getCatalog();

    LayerInfo ly = cat.getLayerByName(getLayerId(MockData.STREAMS));
    
    assertNotNull(ly);

    tester.startPage(MapPreviewPage.class);
    tester.assertRenderedPage(MapPreviewPage.class);

    //move to next page
    tester.clickLink("table:navigatorBottom:navigator:next", true);

    DataView data = 
        (DataView) tester.getComponentFromLastRenderedPage("table:listContainer:items");

    boolean exists = false;
    for (Iterator it = data.iterator(); it.hasNext(); ) {
      MarkupContainer c = (MarkupContainer) it.next();
      Label l = (Label) c.get("itemProperties:1:component");
      if (getLayerId(MockData.STREAMS).equals(l.getDefaultModelObjectAsString())) {
        exists = true;
      }
    }

    assertTrue(exists);
  }
}

代码示例来源:origin: org.geoserver.web/gs-web-demo

@Test
@Ignore
public void testLayerNamesPrefixed() throws Exception {
  Catalog cat = getCatalog();
  LayerInfo ly = cat.getLayerByName(getLayerId(MockData.STREAMS));
  assertNotNull(ly);
  tester.startPage(MapPreviewPage.class);
  tester.assertRenderedPage(MapPreviewPage.class);
  // move to next page
  tester.clickLink("table:navigatorBottom:navigator:next", true);
  DataView data =
      (DataView) tester.getComponentFromLastRenderedPage("table:listContainer:items");
  boolean exists = false;
  for (Iterator it = data.iterator(); it.hasNext(); ) {
    MarkupContainer c = (MarkupContainer) it.next();
    Label l = (Label) c.get("itemProperties:1:component");
    if (getLayerId(MockData.STREAMS).equals(l.getDefaultModelObjectAsString())) {
      exists = true;
    }
  }
  assertTrue(exists);
}

代码示例来源:origin: org.geoserver.web/web-demo

public void testLayerGroupNamesPrefixed() throws Exception {
  Catalog cat = getCatalog();
  LayerGroupInfo lg = cat.getFactory().createLayerGroup();
  lg.setName("foo");
  lg.setWorkspace(cat.getWorkspaceByName("sf"));
  lg.getLayers().add(cat.getLayerByName(getLayerId(MockData.PRIMITIVEGEOFEATURE)));
  new CatalogBuilder(cat).calculateLayerGroupBounds(lg);
  cat.add(lg);
  tester.startPage(MapPreviewPage.class);
  tester.assertRenderedPage(MapPreviewPage.class);
  //move to next page
  tester.clickLink("table:navigatorBottom:navigator:next", true);
  DataView data = 
      (DataView) tester.getComponentFromLastRenderedPage("table:listContainer:items");
  boolean exists = false;
  for (Iterator it = data.iterator(); it.hasNext(); ) {
    MarkupContainer c = (MarkupContainer) it.next();
    Label l = (Label) c.get("itemProperties:1:component");
    if ("sf:foo".equals(l.getDefaultModelObjectAsString())) {
      exists = true;
    }
  }
  assertTrue(exists);
}

相关文章