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


Java FeedbackMessage类代码示例

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


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

示例1: onInitialize

import org.apache.wicket.feedback.FeedbackMessage; //导入依赖的package包/类
@Override
protected void onInitialize() {
	super.onInitialize();

	add(AttributeAppender.append("class", new LoadableDetachableModel<String>() {

		@Override
		protected String load() {
			if (anyMessage(FeedbackMessage.ERROR) || anyMessage(FeedbackMessage.FATAL))
				return " error";
			else if (anyMessage(FeedbackMessage.WARNING))
				return " warning";
			else if (anyMessage(FeedbackMessage.SUCCESS))
				return " success";
			else
				return " info";
		}
		
	}));
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:21,代码来源:SessionFeedbackPanel.java

示例2: createMessageTooltip

import org.apache.wicket.feedback.FeedbackMessage; //导入依赖的package包/类
static String createMessageTooltip(final IModel<FeedbackMessage> model) {
	FeedbackMessage message = model.getObject();
	switch (message.getLevel()) {
		case FeedbackMessage.INFO:
			return "info";
		case FeedbackMessage.SUCCESS:
			return "success";
		case FeedbackMessage.ERROR:
			return "partialError";
		case FeedbackMessage.FATAL:
			return "fatalError";
		case FeedbackMessage.UNDEFINED:
			return "undefined";
		case FeedbackMessage.DEBUG:
			return "debug";
		case FeedbackMessage.WARNING:
		default:
			return "warn";
	}
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:21,代码来源:OperationResultPanel.java

示例3: getQualifier

import org.apache.wicket.feedback.FeedbackMessage; //导入依赖的package包/类
private String getQualifier(int level) {
    switch (level) {
        case FeedbackMessage.DEBUG:
            return DEBUG_CSS_QUALIFIER;
        case FeedbackMessage.INFO:
            return INFO_CSS_QUALIFIER;
        case FeedbackMessage.SUCCESS:
            return SUCCESS_CSS_QUALIFIER;
        case FeedbackMessage.WARNING:
            return WARNING_CSS_QUALIFIER;
        case FeedbackMessage.ERROR:
            return ERROR_CSS_QUALIFIER;
        case FeedbackMessage.FATAL:
            return FATAL_CSS_QUALIFIER;
        default:
            return "";
    }
}
 
开发者ID:acdh-oeaw,项目名称:vlo-curation,代码行数:19,代码来源:BootstrapFeedbackPanel.java

示例4: onConfigure

import org.apache.wicket.feedback.FeedbackMessage; //导入依赖的package包/类
@Override
protected void onConfigure() {
    final Component component = element.getContext()
            .getComponentRegistry()
            .getComponent(element.getModelWicketId());
    final FormComponent<?> formComponent = Components.asFormComponent(component);
    if (formComponent != null) {
        final StringBuilder sb = new StringBuilder();
        if (showHelpText()) {
            if (!formComponent.isValid()) {
                boolean firstMessage = true;
                for (final FeedbackMessage message : formComponent.getFeedbackMessages()) {
                    if (!firstMessage) {
                        sb.append("<br>");
                    }
                    firstMessage = false;
                    sb.append(message.getMessage());
                }
            }
            help.setDefaultModelObject(sb);
        }
        help.setVisible(sb.length() > 0);
    }
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:25,代码来源:GridColumnBorder.java

示例5: rememberAllFeedbackMessages

import org.apache.wicket.feedback.FeedbackMessage; //导入依赖的package包/类
/**
 * This method is called on each page refresh to remember the previous state of feedback messages for rollback
 */
public static void rememberAllFeedbackMessages(final Component component) {
    Assertions.assertThat(RequestCycle.get().getMetaData(KEY_PREVIOUS_MESSAGES)).isNull();
    //CHECKSTYLE:OFF
    final Map<String, List<FeedbackMessage>> markupId_previousMessages = new HashMap<String, List<FeedbackMessage>>();
    //CHECKSTYLE:ON
    component.getPage().visitChildren(new IVisitor<Component, Void>() {
        @Override
        public void component(final Component object, final IVisit<Void> visit) {
            if (object.hasFeedbackMessage()) {
                final List<FeedbackMessage> previousMessages = new ArrayList<FeedbackMessage>(
                        object.getFeedbackMessages().toList());
                markupId_previousMessages.put(object.getMarkupId(), previousMessages);
            }
        }
    });
    RequestCycle.get().setMetaData(KEY_PREVIOUS_MESSAGES, markupId_previousMessages);
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:21,代码来源:Components.java

示例6: rollbackAllFeedbackMessages

import org.apache.wicket.feedback.FeedbackMessage; //导入依赖的package包/类
public static void rollbackAllFeedbackMessages(final Component component) {
    final Map<String, List<FeedbackMessage>> markupId_previousMessages = RequestCycle.get()
            .getMetaData(KEY_PREVIOUS_MESSAGES);
    Assertions.assertThat(markupId_previousMessages).isNotNull();
    component.getPage().visitChildren(new IVisitor<Component, Void>() {
        @Override
        public void component(final Component object, final IVisit<Void> visit) {
            if (object != component) {
                object.getFeedbackMessages().clear();
                final List<FeedbackMessage> previousMessages = markupId_previousMessages.get(object.getMarkupId());
                if (previousMessages != null) {
                    for (final FeedbackMessage previousMessage : previousMessages) {
                        object.getFeedbackMessages().add(previousMessage);
                    }
                }
            }
        }
    });
    RequestCycle.get().setMetaData(KEY_PREVIOUS_MESSAGES, null);
}
 
开发者ID:subes,项目名称:invesdwin-nowicket,代码行数:21,代码来源:Components.java

示例7: getCSSClass

import org.apache.wicket.feedback.FeedbackMessage; //导入依赖的package包/类
@Override
protected String getCSSClass(FeedbackMessage message) {
    String cssClass = "alert alert-dismissable";
    switch (message.getLevel()) {
    case FeedbackMessage.ERROR:
    case FeedbackMessage.FATAL:
        cssClass += " alert-danger";
        break;
    case FeedbackMessage.SUCCESS:
        cssClass += " alert-success";
        break;
    case FeedbackMessage.WARNING:
        cssClass += " alert-warning";
        break;
    case FeedbackMessage.INFO:
        cssClass += " alert-info";
        break;
    default:
        break;
    }        
    return cssClass;
}
 
开发者ID:webanno,项目名称:webanno,代码行数:23,代码来源:BootstrapFeedbackPanel.java

示例8: afterRender

import org.apache.wicket.feedback.FeedbackMessage; //导入依赖的package包/类
@Override
public void afterRender(Component component) {
	FormComponent fc = (FormComponent) component;
	if (!fc.isValid()) {
		String error;
		if (fc.hasFeedbackMessage()) {
			FeedbackMessage first = fc.getFeedbackMessages().first();
			first.markRendered();
			error = first.getMessage().toString();
			
		} else {
			error = "Your input is invalid.";
		}
		fc.getResponse().write("*<span id=\"helpBlock2\" class=\"help-block\">"+error+"</span>");
		super.afterRender(component);
	}
}
 
开发者ID:MarcGiffing,项目名称:wicket-spring-boot,代码行数:18,代码来源:ValidationMsgBehavior.java

示例9: afterRender

import org.apache.wicket.feedback.FeedbackMessage; //导入依赖的package包/类
@Override
public void afterRender(Component component) {
    FormComponent<?> fc = (FormComponent<?>) component;
    Response r = component.getResponse();

    r.write("</span>");

    if (fc.hasFeedbackMessage()) {
        r.write("<span class=\"feedbackPanelTextField\">");

        IFeedbackMessageFilter filter = new ComponentFeedbackMessageFilter(component);

        for (FeedbackMessage message : fc.getFeedbackMessages().messages(filter)) {
            r.write("<span class=\"feedbackPanel");
            r.write(message.getLevelAsString().toUpperCase());
            r.write("\">");
            r.write(Strings.escapeMarkup(message.getMessage().toString()));
        }

        r.write("</span>");
    }
}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:23,代码来源:FieldFeedbackDecorator.java

示例10: newCancelLink

import org.apache.wicket.feedback.FeedbackMessage; //导入依赖的package包/类
/**
 * 
 * @return
 */
private Link<ProductManagementPage> newCancelLink() {
	return new Link<ProductManagementPage>("cancel") {
		private static final long serialVersionUID = -310533532532643267L;

		@Override
		public void onClick() {
			setResponsePage(ProductManagementPage.class,
					new PageParameters().set(
							MESSAGE_PARAM,
							new StringResourceModel("canceled.message", this, Model
									.of(product)).getString()).set(LEVEL_PARAM,
											FeedbackMessage.WARNING));
		}
	};
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:20,代码来源:ProductAddEditPage.java

示例11: save

import org.apache.wicket.feedback.FeedbackMessage; //导入依赖的package包/类
/** 
 * Save product, show message to the user and redirect to the product 
 * list
 * @param target
 */
   private void save(AjaxRequestTarget target) {
	// save product
	saveProduct();
	if (product.getId() == null) {
		// redirect to product list page
		setResponsePage(
				ProductManagementPage.class,
				new PageParameters().set(
						MESSAGE_PARAM,
						new StringResourceModel("add.confirmed", this, Model
								.of(product)).getString()).set(LEVEL_PARAM,
										FeedbackMessage.SUCCESS));
	} else {
		setResponsePage(ProductManagementPage.class,
				new PageParameters().set(MESSAGE_PARAM,
						new StringResourceModel("saved.message", this, Model
								.of(product)).getString()).set(LEVEL_PARAM,
										FeedbackMessage.SUCCESS));
	}
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:26,代码来源:ProductAddEditPage.java

示例12: save

import org.apache.wicket.feedback.FeedbackMessage; //导入依赖的package包/类
/**
 * Save adapter settings, show message to the user and redirect to the adapter list
 * 
 * @param target
 */
private void save(AjaxRequestTarget target) {

    // Persist the adapter settings
    saveSettings();

    // success message has to be associated to session so that it is shown
    // in the global feedback panel
    Session.get().success(new StringResourceModel("saved.message", this, Model.of(platformSettings)).getString());
    // redirect to adapter list page
    setResponsePage(
        PlatformSettingsPage.class,
        new PageParameters().set(MESSAGE_PARAM,
            new StringResourceModel("saved.message", this, Model.of(platformSettings)).getString()).set(LEVEL_PARAM,
            FeedbackMessage.SUCCESS));
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:21,代码来源:PlatformSettingsAddEditPage.java

示例13: newCancelLink

import org.apache.wicket.feedback.FeedbackMessage; //导入依赖的package包/类
/**
 * 
 * @return
 */
private Link<AdapterManagementPage> newCancelLink() {
	return new Link<AdapterManagementPage>("cancel") {

		/**
		 * 
		 */
		private static final long serialVersionUID = 6433075921789830757L;

		@Override
		public void onClick() {
			// redirect to adapter list page
			setResponsePage(
					AdapterManagementPage.class,
					new PageParameters().set(
							MESSAGE_PARAM,
							new StringResourceModel("canceled.message", this, Model
									.of(adapterSettings)).getString()).set(LEVEL_PARAM,
											FeedbackMessage.WARNING));
		}
	};
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:26,代码来源:AdapterAddEditPage.java

示例14: save

import org.apache.wicket.feedback.FeedbackMessage; //导入依赖的package包/类
/** 
 * Save adapter settings, show message to the user and redirect to the 
 * adapter list
 * @param target
 */
private void save(AjaxRequestTarget target) {

	// Set the QA Project for the Adapter
	adapterSettings.setProject(projectChoice.getModelObject());

	// Persist the adapter settings
	saveAdapterSettings();

	// success message has to be associated to session so that it is shown
	// in the global feedback panel
	if (adapterSettings.getId() == null){
		setResponsePage(AdapterManagementPage.class,
				new PageParameters().set(MESSAGE_PARAM,
						new StringResourceModel("add.confirmed", this, Model
								.of(adapterSettings)).getString()).set(LEVEL_PARAM,
										FeedbackMessage.SUCCESS));	
	} else {
		setResponsePage(AdapterManagementPage.class,
				new PageParameters().set(MESSAGE_PARAM,
						new StringResourceModel("saved.message", this, Model
								.of(adapterSettings)).getString()).set(LEVEL_PARAM,
										FeedbackMessage.SUCCESS));	
	}
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:30,代码来源:AdapterAddEditPage.java

示例15: displayMessage

import org.apache.wicket.feedback.FeedbackMessage; //导入依赖的package包/类
/**
 *
 * @param parameters
 */
private void displayMessage(final PageParameters parameters) {
	String message = parameters.get(MESSAGE_PARAM).toString(null);
	int messageLevel = parameters.get(LEVEL_PARAM).toInt(-1);
	if (message != null && messageLevel != -1) {
		switch (messageLevel) {
			case FeedbackMessage.SUCCESS:
				success(message);
				break;
			case FeedbackMessage.INFO:
				info(message);
				break;
			case FeedbackMessage.WARNING:
				warn(message);
				break;
			case FeedbackMessage.ERROR:
				error(message);
				break;
		}
	}
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:25,代码来源:BasePage.java


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