本文整理汇总了Java中javax.faces.event.SystemEventListener类的典型用法代码示例。如果您正苦于以下问题:Java SystemEventListener类的具体用法?Java SystemEventListener怎么用?Java SystemEventListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SystemEventListener类属于javax.faces.event包,在下文中一共展示了SystemEventListener类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: subscribeToEvent
import javax.faces.event.SystemEventListener; //导入依赖的package包/类
@Override
public void subscribeToEvent(Class<? extends SystemEvent> systemEventClass,
Class<?> sourceClass,
SystemEventListener listener)
{
// make unit tests happy
}
示例2: unsubscribeFromEvent
import javax.faces.event.SystemEventListener; //导入依赖的package包/类
@Override
public void unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass,
Class<?> sourceClass,
SystemEventListener listener)
{
// make unit tests happy
}
示例3: subscribeToEvent
import javax.faces.event.SystemEventListener; //导入依赖的package包/类
@Override
public void subscribeToEvent(Class<? extends SystemEvent> eventClass, ComponentSystemEventListener componentListener)
{
if (eventClass == null)
{
throw new NullPointerException("eventClass required");
}
if (componentListener == null)
{
throw new NullPointerException("componentListener required");
}
FacesBean bean = getFacesBean();
AttachedObjects<Class<? extends SystemEvent>, SystemEventListener> eventStorage =
(AttachedObjects<Class<? extends SystemEvent>, SystemEventListener>)bean.getProperty(_SYSTEM_EVENT_LISTENERS_KEY);
if (eventStorage == null)
{
eventStorage = new AttachedObjects<Class<? extends SystemEvent>, SystemEventListener>();
bean.setProperty(_SYSTEM_EVENT_LISTENERS_KEY, eventStorage);
}
if (componentListener instanceof SystemEventListener && componentListener instanceof StateHolder)
eventStorage.addAttachedObject(eventClass, (SystemEventListener) componentListener);
else
eventStorage.addAttachedObject(eventClass, new ComponentSystemEventListenerWrapper(componentListener, this));
}
示例4: unsubscribeFromEvent
import javax.faces.event.SystemEventListener; //导入依赖的package包/类
@Override
public void unsubscribeFromEvent(Class<? extends SystemEvent> eventClass,
ComponentSystemEventListener componentListener)
{
if (eventClass == null)
{
throw new NullPointerException("eventClass required");
}
if (componentListener == null)
{
throw new NullPointerException("componentListener required");
}
FacesBean bean = getFacesBean();
AttachedObjects<Class<? extends SystemEvent>, SystemEventListener> eventStorage =
(AttachedObjects<Class<? extends SystemEvent>, SystemEventListener>)bean.getProperty(_SYSTEM_EVENT_LISTENERS_KEY);
if (eventStorage == null)
{
return;
}
if (componentListener instanceof SystemEventListener && componentListener instanceof StateHolder)
{
eventStorage.removeAttachedObject(eventClass, (SystemEventListener) componentListener);
}
else
{
// ComponentSystemEventListenerWrapper implements equals() to compare listener and component
eventStorage.removeAttachedObject(eventClass, new ComponentSystemEventListenerWrapper(componentListener, this));
}
}
示例5: getListenersForEventClass
import javax.faces.event.SystemEventListener; //导入依赖的package包/类
@Override
public List<SystemEventListener> getListenersForEventClass(Class<? extends SystemEvent> eventClass)
{
FacesBean bean = getFacesBean();
AttachedObjects<Class<? extends SystemEvent>, SystemEventListener> eventStorage =
(AttachedObjects<Class<? extends SystemEvent>, SystemEventListener>)bean.getProperty(_SYSTEM_EVENT_LISTENERS_KEY);
if (eventStorage == null)
{
return Collections.emptyList();
}
return eventStorage.getAttachedObjectList(eventClass);
}
示例6: isListenerForSource
import javax.faces.event.SystemEventListener; //导入依赖的package包/类
@Override
public boolean isListenerForSource(Object source)
{
if (_delegate instanceof SystemEventListener)
{
return ((SystemEventListener)_delegate).isListenerForSource(source);
}
// From the spec: and its implementation of SystemEventListener.isListenerForSource(java.lang.Object) must return true
// if the instance class of this UIComponent is assignable from the argument to isListenerForSource.
return _componentClass.isAssignableFrom(source.getClass());
}
示例7: subscribeToEvent
import javax.faces.event.SystemEventListener; //导入依赖的package包/类
protected void subscribeToEvent(Class<? extends SystemEvent> eventClass, SystemEventListener listener) {
FacesContext.getCurrentInstance().getApplication().subscribeToEvent(eventClass, listener);
}
示例8: unsubscribeFromEvent
import javax.faces.event.SystemEventListener; //导入依赖的package包/类
protected void unsubscribeFromEvent(Class<? extends SystemEvent> eventClass, SystemEventListener listener) {
FacesContext.getCurrentInstance().getApplication().unsubscribeFromEvent(eventClass, listener);
}