当前位置: 首页>>代码示例>>Java>>正文


Java FeedbackMessage.getMessage方法代码示例

本文整理汇总了Java中org.apache.wicket.feedback.FeedbackMessage.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java FeedbackMessage.getMessage方法的具体用法?Java FeedbackMessage.getMessage怎么用?Java FeedbackMessage.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.wicket.feedback.FeedbackMessage的用法示例。


在下文中一共展示了FeedbackMessage.getMessage方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: transform

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
@Override
public CharSequence transform(Component component, CharSequence cs) {
    CharSequence res = cs;
    FormComponent<?> fc = (FormComponent<?>) component;

    String span = "";
    if (!fc.isValid()) {
        for (FeedbackMessage message : fc.getFeedbackMessages()) {
            message.markRendered();
            String id = getWicketIdForErrorSpan(component);
            span = "<span id=\"" + id + "\" class=\"error-icon\">" + "<i class=\"" +
                    ValidationTooltipStyleGroupBehavior.VALIDATION_ERROR_ICON_CLASS +
                    "\" title = \""
                    + message.getMessage() + "\"></i></span>";
        }
    }
    res = cs + span;

    return res;
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:21,代码来源:ValidationTooltipStyleBehavior.java

示例2: getObject

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
@Override
public Object getObject() {
    StringBuffer initScript = new StringBuffer();

    // init
    String defaultFeedbackId = defaultFeedbackPanel == null
            ? "" : defaultFeedbackPanel.getMarkupId();

    initScript
            .append("(function(fd) {\n")
            .append("fd.init('")
            .append(defaultFeedbackId)
            .append("');\n");

    // add messages
    for (FeedbackMessage feedbackMessage : getCurrentMessages()) {
        feedbackMessage.markRendered();
        Serializable message = feedbackMessage.getMessage();

        String messageString = (message instanceof UnescapedFeedbackMessage) ?
                message.toString() : Strings.escapeMarkup(message.toString(), false, false).toString();
        initScript
                .append("fd.addMessage('")
                .append(getMarkupIdFor(feedbackMessage.getReporter()))
                .append("', '")
                .append(feedbackMessage.getLevelAsString())
                .append("', ")
                .append(asJsStringParam(messageString))
                .append(");\n");
    }

    initScript.append("fd.showMessages();\n");
    initScript.append("})(FeedbackDistributer);\n");
    return initScript;
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:36,代码来源:FeedbackDistributer.java

示例3: accept

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
@Override
public boolean accept(FeedbackMessage message) {
  Serializable value = message.getMessage();
  if (value instanceof AbstractFieldInstanceMessage<?>) {
    return matchesThisField((AbstractFieldInstanceMessage<?>)value);
  }
  return false;
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:9,代码来源:AbstractFieldInstancePanel.java

示例4: transform

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
@Override
public CharSequence transform(Component component, CharSequence cs) {
    CharSequence res = cs;
    FormComponent<?> fc = (FormComponent<?>) component;
    if (!fc.isValid() && showInlineError) {

        for (FeedbackMessage message : fc.getFeedbackMessages()) {
            message.markRendered();
            String id = getWicketIdForErrorSpan(component);
            res = cs + "<p id=\"" + id + "\" class=\"error\">" + message.getMessage() + "</p>";
        }
    }

    return res;
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:16,代码来源:ValidationStyleBehavior.java

示例5: newMessageDisplayComponent

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
@Override
protected Component newMessageDisplayComponent(String id, FeedbackMessage message) {
    Serializable serializable = message.getMessage();
    Label label = new Label(id, (serializable == null) ? "" : serializable.toString() + "<br/>");
    label.setEscapeModelStrings(false);
    return label;
}
 
开发者ID:documents4j,项目名称:documents4j,代码行数:8,代码来源:ColoredFeedbackPanel.java

示例6: renderFeedback

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
private String renderFeedback() {
	//	this.getComponent().getFeedbackMessage();
	FeedbackMessages fm = Session.get().getFeedbackMessages();
	
	Iterator<FeedbackMessage> iter = fm.iterator();
	StringBuilder sb = new StringBuilder();
	while (iter.hasNext()) {
		FeedbackMessage message = iter.next();
		if ((message.getReporter() != null) || message.isRendered()) {
			// if a component-level message, don't show it
			continue;
		}
		
		// if we are info stick set to info else set to message level
		String cssClassSuffix = "";
		switch (message.getLevel()) {
			case INFO_STICKY:
			case INFO_FADE:	
				cssClassSuffix = "INFO";
				break;
			case ERROR_STICKY:
				cssClassSuffix = "ERROR";
				break;
			default:
				cssClassSuffix = message.getLevelAsString();
				break;
		}			
		Serializable serializable = message.getMessage();
		
		// grab the message, if it's null use an empty string
		String msg = (serializable == null) ? StringUtils.EMPTY : serializable.toString();
		
		sb.append("$.jGrowl(\"").append(escape(msg)).append('\"');
		sb.append(", {");
		// set the css style, i.e. the theme
		sb.append("theme: \'jgrowl-").append(cssClassSuffix).append("\'");
           // set afterOpen
           String afterOpen = getAfterOpenJavaScript();
           if (StringUtils.isNotEmpty(afterOpen)) {
               sb.append(", afterOpen: " + getAfterOpenJavaScript());
           }
		// set sticky
		if (message.getLevel() > FeedbackMessage.INFO) {
			sb.append(", sticky: true");
		} else {
			// default is 3000 (3sec)
			sb.append(", life: 5000");
		}

		sb.append("});");

           message.markRendered();
	}
	
	return sb.toString();
}
 
开发者ID:nextreports,项目名称:nextreports-server,代码行数:57,代码来源:JGrowlAjaxBehavior.java

示例7: newMessageDisplayComponent

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
/**
 * Generates a component that is used to display the message inside the
 * feedback panel. This component must handle being attached to
 * <code>span</code> tags.
 * 
 * By default a {@link Label} is used.
 * 
 * Note that the created component is expected to respect feedback panel's
 * {@link #getEscapeModelStrings()} value
 * 
 * @param id
 *            parent id
 * @param message
 *            feedback message
 * @return component used to display the message
 */
   private Component newMessageDisplayComponent(String id,
                                                FeedbackMessage message) {
	Serializable serializable = message.getMessage();
	Label label = new Label(id, (serializable == null) ? ""
			: serializable.toString());
	label.setEscapeModelStrings(StyledFeedbackPanel.this
			.getEscapeModelStrings());
	return label;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:26,代码来源:StyledFeedbackPanel.java

示例8: newMessageDisplayComponent

import org.apache.wicket.feedback.FeedbackMessage; //导入方法依赖的package包/类
/**
 * Generates a component that is used to display the message inside the feedback panel. This component must handle being attached to
 * <code>span</code> tags.
 * 
 * By default a {@link Label} is used.
 * 
 * Note that the created component is expected to respect feedback panel's {@link #getEscapeModelStrings()} value
 * 
 * @param id
 *            parent id
 * @param message
 *            feedback message
 * @return component used to display the message
 */
protected Component newMessageDisplayComponent(String id, FeedbackMessage message) {
	Serializable serializable = message.getMessage();
	Label label = new Label(id, (serializable == null) ? "" : serializable.toString());
	label.setEscapeModelStrings(BootstrapFeedbackPanel.this.getEscapeModelStrings());
	return label;
}
 
开发者ID:aracrown,项目名称:ara-commons,代码行数:21,代码来源:BootstrapFeedbackPanel.java


注:本文中的org.apache.wicket.feedback.FeedbackMessage.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。