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

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

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

Label.setDefaultModelObject介绍

暂无

代码示例

代码示例来源:origin: org.wicketstuff/wicketstuff-datetime-yui

@Override
public DateLabel setModelObject(Date object) {
  super.setDefaultModelObject(object);
  return this;
}

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

@Override
  public void onClick() {
    counter++;
    counterLabel.setDefaultModelObject(counterLabel);
  }
});

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

public boolean refresh(final int number) {
    if (this.number != number) {
      this.number = number;
      numberLabel.setDefaultModelObject(number);
      return true;
    }
    return false;
  }
}

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

@Override
public void setModelObject(Date object) {
  super.setDefaultModelObject(object);
}

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

protected void setHeader(final AjaxRequestTarget target, final String header) {
  this.header.setDefaultModelObject(header == null
      ? StringUtils.EMPTY
      : header.length() >= 40 ? (header.substring(0, 30) + " ... ") : header);
  target.add(this.header);
}

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

public final void refreshLatestAlerts(final AjaxRequestTarget target) {
  latestAlerts.getObject().clear();
  latestAlerts.getObject().addAll(lastRemediations);
  int latestAlertSize = getLatestAlertsSize();
  linkAlertsNumber.setDefaultModelObject(latestAlertSize);
  target.add(linkAlertsNumber);
  headerAlertsNumber.setDefaultModelObject(latestAlertSize);
  target.add(headerAlertsNumber);
  target.add(latestAlertsList);
  lastRemediations.clear();
  lastRemediations.addAll(latestAlerts.getObject());
}

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

protected void onUpdate(AjaxRequestTarget target) {
  refValueValidationMessage.setDefaultModelObject(null);
  refValueValidationMessage.setVisible(false);
  target.add(referenceValueContainer);
}

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

@Override
protected void onBeforeRender() {
  CoordinateReferenceSystem crs = (CoordinateReferenceSystem) getModelObject();
  if (crs != null) {
    srsTextField.setModelObject(toSRS(crs));
    wktLabel.setDefaultModelObject(crs.getName().toString());
  } else {
    wktLabel.setDefaultModelObject(null);
    wktLink.setEnabled(false);
  }
  super.onBeforeRender();
}

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

@Override
protected void onBeforeRender() {
  CoordinateReferenceSystem crs = (CoordinateReferenceSystem) getModelObject();
  if ( crs != null ) {
    srsTextField.setModelObject( toSRS(crs) );
    wktLabel.setDefaultModelObject( crs.getName().toString() );    
  } else {
    wktLabel.setDefaultModelObject(null);
    wktLink.setEnabled(false);
  }
  
  super.onBeforeRender();
}

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

@Override
  protected void onUpdate(AjaxRequestTarget target) {
    convertInput();
    
    CoordinateReferenceSystem crs = (CoordinateReferenceSystem) getConvertedInput();
    if(crs != null) {
      setModelObject(crs);
      wktLabel.setDefaultModelObject(crs.getName().toString());
      wktLink.setEnabled(true);
    } else {
      wktLabel.setDefaultModelObject(null);
      wktLink.setEnabled(false);
    }
    target.addComponent(wktLink);
    
    onSRSUpdated(toSRS(crs), target);
  }
});

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

@Override
  protected void onUpdate(AjaxRequestTarget target) {
    convertInput();
    CoordinateReferenceSystem crs =
        (CoordinateReferenceSystem) getConvertedInput();
    if (crs != null) {
      setModelObject(crs);
      wktLabel.setDefaultModelObject(crs.getName().toString());
      wktLink.setEnabled(true);
    } else {
      wktLabel.setDefaultModelObject(null);
      wktLink.setEnabled(false);
    }
    target.add(wktLink);
    onSRSUpdated(toSRS(crs), target);
  }
});

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

private void disableDimension(
    Class<?> type, final WebMarkupContainer configs, Label noAttributeMessage) {
  // no attributes of the required type, no party
  enabled.setEnabled(false);
  enabled.setModelObject(false);
  configs.setVisible(false);
  ParamResourceModel typeName =
      new ParamResourceModel("AttributeType." + type.getSimpleName(), null);
  ParamResourceModel error =
      new ParamResourceModel("missingAttribute", this, typeName.getString());
  noAttributeMessage.setDefaultModelObject(error.getString());
}

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

private void disableDimension(Class type, final WebMarkupContainer configs,
    Label noAttributeMessage) {
  // no attributes of the required type, no party
  enabled.setEnabled(false);
  enabled.setModelObject(false);
  configs.setVisible(false);
  ParamResourceModel typeName = new ParamResourceModel("AttributeType."
      + type.getSimpleName(), null);
  ParamResourceModel error = new ParamResourceModel("missingAttribute", this, typeName
      .getString());
  noAttributeMessage.setDefaultModelObject(error.getString());
}

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

@Override
  protected Component newMessageDisplayComponent(String id, FeedbackMessage message) {
    Component component = super.newMessageDisplayComponent(id, message);
    if (component instanceof Label) {
      final Label label = (Label) component;

      if (message instanceof SFeedbackMessage) {
        final SFeedbackMessage bfm = (SFeedbackMessage) message;

        final SInstance instance = bfm.getInstanceModel().getObject();
        final SInstance parentContext = WicketFormUtils.resolveInstance(getFence()).orElse(null);
        final String labelPath = StringUtils.defaultString(
          WicketFormUtils.generateTitlePath(getFence(), parentContext, message.getReporter(), instance),
          SFormUtil.generatePath(instance, it -> it == parentContext));

        label.setDefaultModelObject(labelPath + " : " + bfm.getMessage());
      }
    }
    return component;
  }
}

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

@Override
  protected void onError(AjaxRequestTarget target, RuntimeException e) {
    super.onError(target, e);
    if (referenceValue.hasErrorMessage()) {
      refValueValidationMessage.setDefaultModelObject(
          referenceValue.getFeedbackMessages().first());
      refValueValidationMessage.setVisible(true);
    }
    target.add(referenceValueContainer);
  }
});

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

protected Component newMessageDisplayComponent(String id, IModel<ValidationError> error) {
  final Component component = new Label(id, $m.map(error, ValidationError::getMessage));
  component.setEscapeModelStrings(SValidationFeedbackPanel.this.getEscapeModelStrings());
  component.add($b.classAppender($m.map(error, this::getCSSClass)));
  final Label label = (Label) component;
  if (error instanceof SFeedbackMessage) {
    final SFeedbackMessage bfm = (SFeedbackMessage) error;
    final SInstance           instance      = bfm.getInstanceModel().getObject();
    final SInstance           parentContext = WicketFormUtils.resolveInstance(getFence().getMainContainer()).orElse(null);
    final Optional<Component> reporter      = WicketFormUtils.findChildByInstance(getFence().getMainContainer(), instance);
    final String labelPath = StringUtils.defaultString(
        reporter.map(it -> WicketFormUtils.generateTitlePath(getFence().getMainContainer(), parentContext, it, instance)).orElse(null),
        SFormUtil.generatePath(instance, it -> Objects.equals(it, parentContext)));
    label.setDefaultModelObject(labelPath + " : " + bfm.getMessage());
  }
  return component;
}

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

protected Component newMessageDisplayComponent(String id, IModel<IValidationError> error) {
  final Component component = new Label(id, $m.map(error, IValidationError::getMessage));
  component.setEscapeModelStrings(SValidationFeedbackPanel.this.getEscapeModelStrings());
  component.add($b.classAppender($m.map(error, this::getCSSClass)));
  final Label label = (Label) component;
  if (error instanceof SFeedbackMessage) {
    final SFeedbackMessage bfm = (SFeedbackMessage) error;
    final SInstance           instance      = bfm.getInstanceModel().getObject();
    final SInstance           parentContext = WicketFormUtils.resolveInstance(getFence().getMainContainer()).orElse(null);
    final Optional<Component> reporter      = WicketFormUtils.findChildByInstance(getFence().getMainContainer(), instance);
    final String labelPath = StringUtils.defaultString(
        reporter.map(it -> WicketFormUtils.generateTitlePath(getFence().getMainContainer(), parentContext, it, instance)).orElse(null),
        SFormUtil.generatePath(instance, it -> Objects.equals(it, parentContext)));
    label.setDefaultModelObject(labelPath + " : " + bfm.getMessage());
  }
  return component;
}

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

@Override
  protected void onCodeClicked(AjaxRequestTarget target, String epsgCode) {
    popupWindow.close(target);
    
    String srs =  "EPSG:" + epsgCode ;
    srsTextField.setModelObject( srs );
    target.addComponent( srsTextField );
    
    CoordinateReferenceSystem crs = fromSRS( srs );
    wktLabel.setDefaultModelObject( crs.getName().toString() );
    wktLink.setEnabled(true);
    target.addComponent( wktLink );
    
    onSRSUpdated(srs, target);
  }
};

代码示例来源: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: webanno/webanno

void updateRememberLayer()
{
  AnnotatorState state = getModelObject();
  if (state.getPreferences().isRememberLayer()) {
    if (state.getDefaultAnnotationLayer() == null) {
      state.setDefaultAnnotationLayer(state.getSelectedAnnotationLayer());
    }
  }
  else if (!state.getSelection().isArc()) {
    state.setDefaultAnnotationLayer(state.getSelectedAnnotationLayer());
  }
  // if no layer is selected in Settings
  if (state.getSelectedAnnotationLayer() != null) {
    selectedAnnotationLayer.setDefaultModelObject(
      state.getSelectedAnnotationLayer().getUiName());
  }
}

相关文章