本文整理汇总了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>");
}
}
示例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;
}
};
}
示例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;
}
};
}
示例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);
}
}
示例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());
}
});
}
}
示例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;
}
});
}
示例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));
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
});
}