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


Java ActionListener类代码示例

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


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

示例1: broadcast

import javax.faces.event.ActionListener; //导入依赖的package包/类
@Override
public void broadcast(FacesEvent event) throws AbortProcessingException
{
  super.broadcast(event);

  // Notify the specified action listener method (if any),
  // and the default action listener
  if (event instanceof ActionEvent)
  {
    FacesContext context = getFacesContext();
    MethodBinding mb = getActionListener();
    if (mb != null)
      mb.invoke(context, new Object[] { event });

    ActionListener defaultActionListener =
      context.getApplication().getActionListener();
    if (defaultActionListener != null)
    {
      defaultActionListener.processAction((ActionEvent) event);
    }
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:23,代码来源:UIXProgressTemplate.java

示例2: processEvent

import javax.faces.event.ActionListener; //导入依赖的package包/类
@Override
public void processEvent(SystemEvent event) throws AbortProcessingException {
    if (event instanceof PreValidateEvent) {
        UIViewRoot viewRoot = getUIViewRoot(event);
        if (null != viewRoot) {
            ActionListener listener
                = createActionEventListener(event, PROP_VALIDATOR_PREFIX);
            if (null != listener) {
                // PreValidaeEventは必要な場合だけ登録されるので、存在しない場合でも
                // エラーではありません.
                ActionEvent ae = new ActionEvent(viewRoot);
                listener.processAction(ae);
            }
        }
    }
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:17,代码来源:PreValidateEventListener.java

示例3: initJsfActionListener

import javax.faces.event.ActionListener; //导入依赖的package包/类
static void initJsfActionListener() {
	// cette indirection entre FilterContext et JsfActionListener est probablement nécessaire pour la JVM IBM J9
	// afin de ne pas dépendre des classes FacesContext et ActionListenerImpl et afin de ne pas avoir de ClassNotFound dans J9
	try {
		final FacesContext facesContext = FacesContext.getCurrentInstance();
		if (facesContext != null && facesContext.getApplication() != null) {
			// ceci est a priori équivalent à l'ajout d'un action-listener dans WEB-INF/faces-config.xml de l'application :
			// <application><action-listener>net.bull.javamelody.JsfActionListener</action-listener></application>
			// et on ne peut pas avoir un fichier META-INF/faces-config.xml dans le jar de javamelody avec cet action-listener
			// car dans Apache MyFaces, cela ferait certainement une ClassNotFoundException rendant javamelody inutilisable
			final ActionListener delegateActionListener = facesContext.getApplication()
					.getActionListener();
			final JsfActionListener jsfActionListener = new JsfActionListener(
					delegateActionListener);
			facesContext.getApplication().setActionListener(jsfActionListener);
		}
	} catch (final Exception e) {
		// issue 204: initialisation du JsfActionListener échouée, tant pis, il n'y aura pas les statistiques pour JSF.
		// no stack-trace, because in JBoss 7 because in some cases the class com.sun.faces.application.ActionListenerImpl is available but the ApplicationFactory isn't (issue 393)
		LOG.info("initialization of jsf action listener failed, skipping");
	}
}
 
开发者ID:javamelody,项目名称:javamelody,代码行数:23,代码来源:JsfActionHelper.java

示例4: broadcast

import javax.faces.event.ActionListener; //导入依赖的package包/类
@Override
public void broadcast(FacesEvent event) throws AbortProcessingException
{
  // Perform standard superclass processing
  super.broadcast(event);


  FacesContext context = getFacesContext();

  // Notify the specified listener method (if any)
  if (event instanceof ActionEvent)
  {
    if (getActionType() == PREVIOUS_ACTION_TYPE)
    {
      broadcastToMethodBinding(event, getPreviousActionListener());
    }
    else
    {
      broadcastToMethodBinding(event, getNextActionListener());
    }

    ActionListener defaultActionListener =
                           context.getApplication().getActionListener();

    if (defaultActionListener != null)
      defaultActionListener.processAction((ActionEvent) event);
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:29,代码来源:UIXSingleStepTemplate.java

示例5: JsfActionListener

import javax.faces.event.ActionListener; //导入依赖的package包/类
/**
 * Constructeur.
 * @param delegateActionListener ActionListener
 */
public JsfActionListener(ActionListener delegateActionListener) {
	super();
	// quand cet ActionListener est utilisé, le compteur est affiché
	// sauf si le paramètre displayed-counters dit le contraire
	JSF_COUNTER.setDisplayed(!COUNTER_HIDDEN);
	JSF_COUNTER.setUsed(true);
	LOG.debug("jsf action listener initialized");
	this.delegateActionListener = delegateActionListener;
}
 
开发者ID:javamelody,项目名称:javamelody,代码行数:14,代码来源:JsfActionListener.java

示例6: bindCommand

import javax.faces.event.ActionListener; //导入依赖的package包/类
public void bindCommand(final EmptyEventHandler handler) {
	if (handler == null)
		return;
	((UICommand) component).addActionListener(new ActionListener() {
		@Override
		public void processAction(ActionEvent event)
				throws AbortProcessingException {
			handler.handle();
		}
	});
}
 
开发者ID:Doctusoft,项目名称:jsf-builder,代码行数:12,代码来源:JsfBaseComponentRenderer.java

示例7: actionListener

import javax.faces.event.ActionListener; //导入依赖的package包/类
/**
 * Execute action listeners on a tab.
 * @param index the index of the tab to execute action listeners.
 */
private void actionListener(final int index) {
    final UIComponent component = getItemComponent(index);
    final ActionListener[] actions = (ActionListener[]) component.getAttributes().get("actionListeners");
    if (actions != null && actions.length > 0) {
        final ActionEvent event = new ActionEvent(component);
        for (final ActionListener action : actions) {
            action.processAction(event);
        }
    }
}
 
开发者ID:qjafcunuas,项目名称:jbromo,代码行数:15,代码来源:UIDynamicTabPanel.java

示例8: getWrappedActionListener

import javax.faces.event.ActionListener; //导入依赖的package包/类
private ActionListener getWrappedActionListener()
{
    //TODO re-visit it
    //was:
    //SecurityViolationAwareActionListener securityViolationAwareActionListener =
    //        new SecurityViolationAwareActionListener(this.wrapped);

    return new ViewControllerActionListener(this.wrapped);
}
 
开发者ID:apache,项目名称:deltaspike,代码行数:10,代码来源:DeltaSpikeActionListener.java

示例9: ExceptionActionListener

import javax.faces.event.ActionListener; //导入依赖的package包/类
public ExceptionActionListener(ActionListener delegate) {
    this.delegate = delegate;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:4,代码来源:ExceptionActionListener.java

示例10: getActionListener

import javax.faces.event.ActionListener; //导入依赖的package包/类
@Override
public ActionListener getActionListener() {
    throw new UnsupportedOperationException();
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:5,代码来源:ApplicationStub.java

示例11: setActionListener

import javax.faces.event.ActionListener; //导入依赖的package包/类
@Override
public void setActionListener(ActionListener arg0) {
    throw new UnsupportedOperationException();
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:5,代码来源:ApplicationStub.java

示例12: getActionListener

import javax.faces.event.ActionListener; //导入依赖的package包/类
@Override
public ActionListener getActionListener()
{
  throw new UnsupportedOperationException("Should not be called during rendering");
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:6,代码来源:MApplication.java

示例13: setActionListener

import javax.faces.event.ActionListener; //导入依赖的package包/类
@Override
public void setActionListener(ActionListener listener)
{
  throw new UnsupportedOperationException("Should not be called during rendering");
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:6,代码来源:MApplication.java

示例14: broadcast

import javax.faces.event.ActionListener; //导入依赖的package包/类
@Override
public void broadcast(FacesEvent event) throws AbortProcessingException
{
  // Perform special processing for ActionEvents:  tell
  // the RequestContext to remember this command instance
  // so that the NavigationHandler can locate us to queue
  // a LaunchEvent.
  if (event instanceof ActionEvent)
  {
    RequestContext afContext = RequestContext.getCurrentInstance();
    afContext.getDialogService().setCurrentLaunchSource(this);

    try
    {
      // Perform standard superclass processing
      super.broadcast(event);

      // Notify the specified action listener method (if any),
      // and the default action listener
      broadcastToMethodBinding(event, getActionListener());

      FacesContext context = getFacesContext();
      ActionListener defaultActionListener =
        context.getApplication().getActionListener();
      if (defaultActionListener != null)
      {
        defaultActionListener.processAction((ActionEvent) event);
      }
    }
    finally
    {
      afContext.getDialogService().setCurrentLaunchSource(null);
    }
  }
  else
  {
    // Perform standard superclass processing
    super.broadcast(event);

    if (event instanceof LaunchEvent)
    {
      broadcastToMethodExpression(event, getLaunchListener());
      boolean useWindow = 
        Boolean.TRUE.equals(getAttributes().get("useWindow"));

      ((LaunchEvent) event).launchDialog(useWindow);
    }
    else if (event instanceof ReturnEvent)
    {
      broadcastToMethodExpression(event, getReturnListener());
      // =-=AEW: always jump to render response???  Seems the safest
      // option, because we don't want to immediately update a model
      // or really perform any validation.
      getFacesContext().renderResponse();
    }
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:58,代码来源:UIXCommandTemplate.java

示例15: broadcast

import javax.faces.event.ActionListener; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void broadcast(FacesEvent event) throws AbortProcessingException
{
  if (event instanceof ActionEvent)
  {
    RequestContext afContext = RequestContext.getCurrentInstance();
    afContext.getDialogService().setCurrentLaunchSource(this);

    try
    {
      // Perform standard superclass processing
      super.broadcast(event);

      // Notify the specified action listener method (if any),
      // and the default action listener
      broadcastToMethodBinding(event, getActionListener());

      FacesContext context = getFacesContext();
      ActionListener defaultActionListener =
        context.getApplication().getActionListener();
      if (defaultActionListener != null)
      {
        defaultActionListener.processAction((ActionEvent) event);
      }
    }
    finally
    {
      afContext.getDialogService().setCurrentLaunchSource(null);
    }
  }
  else if (event instanceof LaunchEvent)
  {
    // =-=AEW Support launch listeners on SelectInput?
    // super.broadcast(event);
    //
    // __broadcast(event, getLaunchListener());
    ((LaunchEvent) event).launchDialog(true);
  }
  else if (event instanceof ReturnEvent)
  {
    super.broadcast(event);

    broadcastToMethodExpression(event, getReturnListener());
    Object returnValue = ((ReturnEvent) event).getReturnValue();
    if (returnValue != null)
    {
      setSubmittedValue(returnValue);
    }

    // =-=AEW: always jump to render response???  Seems the safest
    // option, because we don't want to immediately update a model
    // or really perform any validation.
    getFacesContext().renderResponse();
  }
  else
  {
    super.broadcast(event);
  }
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:63,代码来源:UIXSelectInputTemplate.java


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