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


Java SystemEventListener类代码示例

本文整理汇总了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
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:8,代码来源:MApplication.java

示例2: unsubscribeFromEvent

import javax.faces.event.SystemEventListener; //导入依赖的package包/类
@Override
public void unsubscribeFromEvent(Class<? extends SystemEvent> systemEventClass,
                                 Class<?> sourceClass,
                                 SystemEventListener listener)
{
  // make unit tests happy
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:8,代码来源:MApplication.java

示例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));
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:29,代码来源:UIXComponentBase.java

示例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));
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:34,代码来源:UIXComponentBase.java

示例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);
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:16,代码来源:UIXComponentBase.java

示例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());
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:13,代码来源:UIXComponentBase.java

示例7: subscribeToEvent

import javax.faces.event.SystemEventListener; //导入依赖的package包/类
protected void subscribeToEvent(Class<? extends SystemEvent> eventClass, SystemEventListener listener) {
    FacesContext.getCurrentInstance().getApplication().subscribeToEvent(eventClass, listener);
}
 
开发者ID:dsalinux,项目名称:web-ifad,代码行数:4,代码来源:AbstractManager.java

示例8: unsubscribeFromEvent

import javax.faces.event.SystemEventListener; //导入依赖的package包/类
protected void unsubscribeFromEvent(Class<? extends SystemEvent> eventClass, SystemEventListener listener) {
    FacesContext.getCurrentInstance().getApplication().unsubscribeFromEvent(eventClass, listener);
}
 
开发者ID:dsalinux,项目名称:web-ifad,代码行数:4,代码来源:AbstractManager.java


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