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


Java IFeedbackMessageFilter类代码示例

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


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

示例1: afterRender

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的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

示例2: onConfigure

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
@Override
protected void onConfigure() {
	super.onConfigure();
	
	filter = new IFeedbackMessageFilter() {
		private static final long serialVersionUID = -7726392072697648969L;

		public boolean accept(final FeedbackMessage msg) {
			Boolean b = visitChildren(FormComponent.class, new IVisitor<FormComponent<?>, Boolean>() {
				@Override
				public void component(FormComponent<?> arg0, IVisit<Boolean> arg1) {
					if (arg0.equals(msg.getReporter()))
						arg1.stop(true);
				}
			});

			if (b == null)
				return false;

			return b;
		}
	};
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:24,代码来源:BootstrapControlGroupFeedback.java

示例3: onInitialize

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

	filter = new IFeedbackMessageFilter() {
		private static final long serialVersionUID = -7726392072697648969L;

		public boolean accept(final FeedbackMessage msg) {
			Boolean b = visitChildren(FormComponent.class, new IVisitor<FormComponent<?>, Boolean>() {
				@Override
				public void component(FormComponent<?> arg0, IVisit<Boolean> arg1) {
					if (arg0.equals(msg.getReporter()))
						arg1.stop(true);
				}
			});

			if (b == null)
				return false;

			return b;
		}
	};

}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:25,代码来源:BootstrapFeedbackPopover.java

示例4: BootstrapFeedbackPanel

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
/**
 * @see org.apache.wicket.Component#Component(String)
 * 
 * @param id
 *            The non-null id of this component
 * @param filter
 *            feedback message filter
 */
public BootstrapFeedbackPanel(final String id, IFeedbackMessageFilter filter) {
	super(id);
	WebMarkupContainer messagesContainer = new WebMarkupContainer("feedbackul") {
		private static final long serialVersionUID = 1L;

		@Override
		protected void onConfigure() {
			super.onConfigure();
			setVisible(anyMessage());
		}
	};
	add(messagesContainer);
	messageListView = new BootstrapMessageListView("messages");
	messageListView.setVersioned(false);
	messagesContainer.add(messageListView);

	if (filter != null) {
		setFilter(filter);
	}
}
 
开发者ID:aracrown,项目名称:ara-commons,代码行数:29,代码来源:BootstrapFeedbackPanel.java

示例5: NextFeedbackPanel

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
public NextFeedbackPanel(String s, final Form<?> form) {
    super(s);
    
    if (form != null) {
        setFilter(new IFeedbackMessageFilter() {
        	
private static final long serialVersionUID = 1L;

public boolean accept(FeedbackMessage message) {
                final List<FormComponent<?>> components = getFormComponents(form);
                return !components.contains(message.getReporter());
            }

        });
    }
}
 
开发者ID:nextreports,项目名称:nextreports-server,代码行数:17,代码来源:NextFeedbackPanel.java

示例6: SessionFeedbackPanel

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
public SessionFeedbackPanel(String id) {
	super(id, new IFeedbackMessageFilter() {
		
		@Override
		public boolean accept(FeedbackMessage message) {
			return message.getReporter() == null;
		}
	});
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:10,代码来源:SessionFeedbackPanel.java

示例7: commonInit

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
private void commonInit() {
	getSession().setLocale(Locale.ENGLISH);

	feedbackPanel = new FeedbackPanel("feedbackPanel");
	feedbackPanel.setOutputMarkupId(true);
	feedbackPanel.add(new AttributeModifier("class", "error"));
	feedbackPanel.setFilter(new IFeedbackMessageFilter(){
		@Override
		public boolean accept(FeedbackMessage aMessage) {
			String username = "anonymous";
			if (aMessage.isFatal())
				LOG.fatal(username + ": " + aMessage.getMessage());
			else
			if (aMessage.isError())
				LOG.error(username + ": " + aMessage.getMessage());
			else
			if (aMessage.isWarning())
				LOG.warn(username + ": " + aMessage.getMessage());
			else
			if (aMessage.isInfo())
				LOG.info(username + ": " + aMessage.getMessage());
			else
			if (aMessage.isDebug())
				LOG.debug(username + ": " + aMessage.getMessage());
			return true;
		}
	});

	Properties props = getVersionProperties();
	String versionString = props.getProperty("version");
	versionLabel = new Label("version", versionString);

	add(feedbackPanel);
	add(versionLabel);

	add(new BookmarkablePageLink<Void>("homeButton", HomePage.class));
	add(new BookmarkablePageLink<Void>("footerHomeLink", HomePage.class));
}
 
开发者ID:UKPLab,项目名称:coling2016-marketing-blunders,代码行数:39,代码来源:ApplicationPageBase.java

示例8: StyledFeedbackPanel

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
/**
 * @see org.apache.wicket.Component#Component(String)
 * 
 * @param id
 * @param filter
 */
public StyledFeedbackPanel(final String id, IFeedbackMessageFilter filter) {
	super(id);
	setOutputMarkupId(true);
	feedbackContainer = new WebMarkupContainer("feedbackdiv") {

		private static final long serialVersionUID = -8736469161089673840L;

		@Override
		protected void onConfigure() {
			setVisible(anyMessage());
		}
	};
	add(feedbackContainer);

	AjaxLink<Void> closeLink = new AjaxLink<Void>("closeLink") {

		private static final long serialVersionUID = -6970077602640428876L;

		@Override
		public void onClick(AjaxRequestTarget target) {
			Effects.fadeOutElem(target,
					StyledFeedbackPanel.this.getMarkupId());
		}
	};
	feedbackContainer.add(closeLink);

	final WebMarkupContainer messagesContainer = new WebMarkupContainer(
			"feedbackul");
	feedbackContainer.add(messagesContainer);
	messageListView = new MessageListView("messages");
	messageListView.setVersioned(false);
	messagesContainer.add(messageListView);

	if (filter != null) {
		setFilter(filter);
	}
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:44,代码来源:StyledFeedbackPanel.java

示例9: accept

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
/**
 * @param message
 *            The message to test for inclusion
 * @return True if the message should be included, false to exclude it
 */
@Override
public boolean accept(FeedbackMessage message) {
	for (IFeedbackMessageFilter filter : filters) {
		if (!filter.accept(message)) {
			return false;
		}
	}
	return true;
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:15,代码来源:AndMessageFilter.java

示例10: add

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
/**
 * Add the provided filter(s). Allows chaining.
 * @param filters The filter(s) to be added
 * @return This CompositeAndMessageFilter, to allow chaining
 */
public AndMessageFilter add(IFeedbackMessageFilter... filters) {
	for (IFeedbackMessageFilter filter : filters) {
		this.filters.add(filter);
	}
	return this;
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:12,代码来源:AndMessageFilter.java

示例11: accept

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
/**
 * @param message
 *            The message to test for inclusion
 * @return True if the message should be included, false to exclude it
 */
@Override
public boolean accept(FeedbackMessage message) {
	for (IFeedbackMessageFilter filter : filters) {
		if (filter.accept(message)) {
			return true;
		}
	}
	return false;
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:15,代码来源:OrMessageFilter.java

示例12: add

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
/**
 * Add the provided filter(s). Allows chaining.
 * @param filters The filter(s) to be added
 * @return This CompositeAndMessageFilter, to allow chaining
 */
public OrMessageFilter add(IFeedbackMessageFilter... filters) {
	for (IFeedbackMessageFilter filter : filters) {
		this.filters.add(filter);
	}
	return this;
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:12,代码来源:OrMessageFilter.java

示例13: accept

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
public boolean accept(FeedbackMessage message) {
	for ( IFeedbackMessageFilter f : filters ) {
		if ( !f.accept(message) ) {
			return false;
		}
	}
	return true;
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:9,代码来源:BootstrapFeedbackPanel.java

示例14: setIgnoreLevels

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
/**
 * Defines which message levels should be ignored.
 *
 * @param l the l
 * @return DMDFeedbackPanel reference
 */
public DMDFeedbackPanel setIgnoreLevels(Integer... l) {
    final List<Integer> levels = Arrays.asList(l);
    getFeedbackMessagesModel().setFilter(new IFeedbackMessageFilter() {
        private static final long serialVersionUID = 1L;

        @Override
        public boolean accept(FeedbackMessage message) {
            return !levels.contains(message.getLevel());
        }
    });
    return this;
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:19,代码来源:DMDFeedbackPanel.java

示例15: LocalFeedbackPanel

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
public LocalFeedbackPanel(String id, final MarkupContainer container) {
	super(id, new IFeedbackMessageFilter() {
		private static final long serialVersionUID = -1883211501894198761L;

		public boolean accept(FeedbackMessage message) {
			return container.contains(message.getReporter(), true);
		}
	});
}
 
开发者ID:rla,项目名称:old-blog,代码行数:10,代码来源:LocalFeedbackPanel.java


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