• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java IFeedbackMessageFilter类的典型用法和代码示例

java 9次浏览

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

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

示例1: afterRender

点赞 3

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

点赞 3

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

点赞 3

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

点赞 3

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

点赞 3

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

点赞 2

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

点赞 2

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

点赞 2

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

点赞 2

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

点赞 2

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

点赞 2

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

点赞 2

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

点赞 2

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

点赞 2

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

点赞 2

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

示例16: GlobalFeedbackPanel

点赞 2

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

		public boolean accept(FeedbackMessage message) {
			return message.getReporter() == null;
		}
	});
}
 

开发者ID:rla,
项目名称:old-blog,
代码行数:10,
代码来源:GlobalFeedbackPanel.java

示例17: setFilter

点赞 2

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
public final void setFilter(IFeedbackMessageFilter filter) {
    FeedbackMessagesModel model = (FeedbackMessagesModel) getFeedbackListView().getDefaultModel();
    model.setFilter(filter);
}
 

开发者ID:Pardus-Engerek,
项目名称:engerek,
代码行数:5,
代码来源:FeedbackAlerts.java

示例18: commonInit

点赞 2

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
private void commonInit()
{
    Properties settings = SettingsUtil.getSettings();
    
    // Override locale to be used by application
    String locale = settings.getProperty(SettingsUtil.CFG_LOCALE, "en");
    switch (locale) {
    case "auto":
        // Do nothing - locale is picked up from browser
        break;
    default:
        // Override the locale in the session
        getSession().setLocale(Locale.forLanguageTag(locale));
        break;
    }
    
    // Add menubar
    try {
        Class<? extends Component> menubarClass = getApplication().getMetaData(MENUBAR_CLASS);
        if (menubarClass == null) {
            menubarClass = MenuBar.class;
        }
        add(ConstructorUtils.invokeConstructor(menubarClass, "menubar"));
    }
    catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException
            | InstantiationException e1) {
        throw new RuntimeException(e1);
    }

    feedbackPanel = new BootstrapFeedbackPanel("feedbackPanel");
    feedbackPanel.setOutputMarkupId(true);
    feedbackPanel.setFilter((IFeedbackMessageFilter) aMessage -> {
        Authentication auth = SecurityContextHolder.getContext().getAuthentication();
        String username = auth != null ? auth.getName() : "SYSTEM";
        if (aMessage.isFatal()) {
            LOG.error("{}: {}", 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;
    });
    add(feedbackPanel);
    
    versionLabel = new Label("version", SettingsUtil.getVersionString());
    add(versionLabel);
    
    // set up warnings shown when using an embedded DB or some unsupported browser
    boolean isBrowserWarningVisible = isBrowserWarningVisible(settings);
    boolean isDatabaseWarningVisible = isDatabaseWarningVisible(settings);
    
    embeddedDbWarning = new Label("embeddedDbWarning", new ResourceModel("warning.database"));
    embeddedDbWarning.setVisible(isDatabaseWarningVisible);
    add(embeddedDbWarning);
    browserWarning = new Label("browserWarning", new ResourceModel("warning.browser"));
    browserWarning.setVisible(isBrowserWarningVisible);
    add(browserWarning);
    
    WebMarkupContainer warningsContainer = new WebMarkupContainer("warnings");
    warningsContainer.setVisible(isBrowserWarningVisible || isDatabaseWarningVisible);  
    add(warningsContainer);
}
 

开发者ID:webanno,
项目名称:webanno,
代码行数:72,
代码来源:ApplicationPageBase.java

示例19: BootstrapFeedbackPanel

点赞 2

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
public BootstrapFeedbackPanel(String id, IFeedbackMessageFilter filter) {
    super(id, filter);
    
    initCloseAll();
}
 

开发者ID:webanno,
项目名称:webanno,
代码行数:6,
代码来源:BootstrapFeedbackPanel.java

示例20: FeedbackPanel

点赞 2

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
public FeedbackPanel(String id, IFeedbackMessageFilter filter) {
	super(id, filter);
}
 

开发者ID:MarcGiffing,
项目名称:wicket-spring-boot,
代码行数:4,
代码来源:FeedbackPanel.java

示例21: getFilter

点赞 2

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
/**
 * @return The current message filter
 */
public final IFeedbackMessageFilter getFilter() {
	return getFeedbackMessagesModel().getFilter();
}
 

开发者ID:U-QASAR,
项目名称:u-qasar.platform,
代码行数:7,
代码来源:StyledFeedbackPanel.java

示例22: AndMessageFilter

点赞 2

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
public AndMessageFilter() {
	filters = new ArrayList<IFeedbackMessageFilter>();
	filters.add(IFeedbackMessageFilter.ALL);
}
 

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

示例23: OrMessageFilter

点赞 2

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
public OrMessageFilter() {
	filters = new ArrayList<IFeedbackMessageFilter>();
	filters.add(IFeedbackMessageFilter.NONE);
}
 

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

示例24: getFeedbackMessageFilter

点赞 2

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
protected IFeedbackMessageFilter getFeedbackMessageFilter(){
	return filter;
}
 

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

示例25: AndComposedFeedbackMessageFilter

点赞 2

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
protected AndComposedFeedbackMessageFilter(IFeedbackMessageFilter... filters) {
	this.filters = filters;
}
 

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

示例26: FeedbackPanel

点赞 2

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
public FeedbackPanel(String id, IFeedbackMessageFilter filter) {
    this(id, filter, true);
}
 

开发者ID:flex-oss,
项目名称:flex-ui,
代码行数:4,
代码来源:FeedbackPanel.java

示例27: FormGroupFeedback

点赞 2

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
public FormGroupFeedback(String id, IFeedbackMessageFilter filter) {
    super(id, filter);
}
 

开发者ID:Evolveum,
项目名称:gizmo-v3,
代码行数:4,
代码来源:FormGroupFeedback.java

示例28: setFilter

点赞 1

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
/**
 * Sets a filter to use on the feedback messages model
 * 
 * @param filter
 *            The message filter to install on the feedback messages model
 * 
 * @return FeedbackPanel this.
 */
   private StyledFeedbackPanel setFilter(IFeedbackMessageFilter filter) {
	getFeedbackMessagesModel().setFilter(filter);
	return this;
}
 

开发者ID:U-QASAR,
项目名称:u-qasar.platform,
代码行数:13,
代码来源:StyledFeedbackPanel.java

示例29: BootstrapFeedbackPanel

点赞 1

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
/**
 * Constructor. Builds a feedback panel which filters messages based on the component
 * 
 * @param id
 * 				the component id
 * @param filter
 * 				filter to be applied to each message
 * 
 * @see org.apache.wicket.markup.html.panel.ComponentFeedbackPanel
 */
public BootstrapFeedbackPanel(String id, IFeedbackMessageFilter filter) {
	super(id);
	this.filter = filter;
	uniqueMessages();
}
 

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

示例30: getFilter

点赞 1

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
/**
 * Get the filter used by this feedback collector.
 *
 * @return the filter
 */
public IFeedbackMessageFilter getFilter(){
	return filter;
}
 

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

示例31: setFilter

点赞 1

import org.apache.wicket.feedback.IFeedbackMessageFilter; //导入依赖的package包/类
/**
 * Sets a filter to use on the feedback messages model.
 * 
 * @param filter
 *            The message filter to install on the feedback messages model
 * 
 * @return FeedbackPanel this.
 */
public final BootstrapFeedbackPanel setFilter(IFeedbackMessageFilter filter) {
	getFeedbackMessagesModel().setFilter(filter);
	return this;
}
 

开发者ID:aracrown,
项目名称:ara-commons,
代码行数:13,
代码来源:BootstrapFeedbackPanel.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)