Examples of FileDownloadActionListener


Examples of org.apache.myfaces.trinidadinternal.taglib.listener.FileDownloadActionListener

  public void apply(FaceletContext faceletContext,
          UIComponent parent) throws IOException, FacesException, FaceletException, ELException
  {
    if(ComponentHandler.isNew(parent))
    {
      FileDownloadActionListener listener = new FileDownloadActionListener();
      if (_filename != null)
      {
        if (_filename.isLiteral())
          listener.setFilename(_filename.getValue());
        else
        {
          ValueExpression valueExp = _filename.getValueExpression(faceletContext,
                                                                  Object.class);
          listener.setValueExpression(FileDownloadActionListener.FILENAME_KEY,
                                     valueExp);
        }
      }

      if (_contentType != null)
      {
        if (_contentType.isLiteral())
          listener.setContentType(_contentType.getValue());
        else
        {
          ValueExpression valueExp = _contentType.getValueExpression(faceletContext,
                                                                  Object.class);
          listener.setValueExpression(FileDownloadActionListener.CONTENT_TYPE_KEY,
                                      valueExp);
        }
      }
     
      MethodExpression me = _method.getMethodExpression(faceletContext,
                                                        Object.class,
                                                        _METHOD_PARAMS);
      listener.setMethod(me);

      ActionSource actionSource = (ActionSource)parent;
      actionSource.addActionListener(listener);
    }
  }
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.taglib.listener.FileDownloadActionListener

  public void apply(FaceletContext faceletContext,
          UIComponent parent) throws IOException, FacesException, FaceletException, ELException
  {
    if(ComponentHandler.isNew(parent))
    {
      FileDownloadActionListener listener = new FileDownloadActionListener();
      if (_filename != null)
      {
        if (_filename.isLiteral())
          listener.setFilename(_filename.getValue());
        else
        {
          ValueExpression valueExp = _filename.getValueExpression(faceletContext,
                                                                  Object.class);
          listener.setValueExpression(FileDownloadActionListener.FILENAME_KEY,
                                     valueExp);
        }
      }

      if (_contentType != null)
      {
        if (_contentType.isLiteral())
          listener.setContentType(_contentType.getValue());
        else
        {
          ValueExpression valueExp = _contentType.getValueExpression(faceletContext,
                                                                  Object.class);
          listener.setValueExpression(FileDownloadActionListener.CONTENT_TYPE_KEY,
                                      valueExp);
        }
      }
     
      MethodExpression me = _method.getMethodExpression(faceletContext,
                                                        Object.class,
                                                        _METHOD_PARAMS);
      listener.setMethod(me);

      ActionSource actionSource = (ActionSource)parent;
      actionSource.addActionListener(listener);
    }
  }
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.taglib.listener.FileDownloadActionListener

  public void apply(FaceletContext faceletContext,
          UIComponent parent) throws IOException, FacesException, FaceletException, ELException
  {
    if(ComponentSupport.isNew(parent))
    {
      FileDownloadActionListener listener = new FileDownloadActionListener();
      if (_filename != null)
      {
        if (_filename.isLiteral())
          listener.setFilename(_filename.getValue());
        else
        {
          ValueExpression valueExp = _filename.getValueExpression(faceletContext,
                                                                  Object.class);
          listener.setValueExpression(FileDownloadActionListener.FILENAME_KEY,
                                     valueExp);
        }
      }

      if (_contentType != null)
      {
        if (_contentType.isLiteral())
          listener.setContentType(_contentType.getValue());
        else
        {
          ValueExpression valueExp = _contentType.getValueExpression(faceletContext,
                                                                  Object.class);
          listener.setValueExpression(FileDownloadActionListener.CONTENT_TYPE_KEY,
                                      valueExp);
        }
      }
     
      MethodExpression me = _method.getMethodExpression(faceletContext,
                                                        Object.class,
                                                        _METHOD_PARAMS);
      listener.setMethod(me);

      ActionSource actionSource = (ActionSource)parent;
      actionSource.addActionListener(listener);
    }
  }
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.taglib.listener.FileDownloadActionListener

  public void apply(FaceletContext faceletContext,
          UIComponent parent) throws IOException, FacesException, FaceletException, ELException
  {
    if(ComponentSupport.isNew(parent))
    {
      FileDownloadActionListener listener = new FileDownloadActionListener();
      if (_filename != null)
      {
        if (_filename.isLiteral())
          listener.setFilename(_filename.getValue());
        else
        {
          ValueExpression valueExp = _filename.getValueExpression(faceletContext,
                                                                  Object.class);
          listener.setValueBinding(FileDownloadActionListener.FILENAME_KEY,
                                   new LegacyValueBinding(valueExp));
        }
      }

      if (_contentType != null)
      {
        if (_contentType.isLiteral())
          listener.setContentType(_contentType.getValue());
        else
        {
          ValueExpression valueExp = _contentType.getValueExpression(faceletContext,
                                                                  Object.class);
          listener.setValueBinding(FileDownloadActionListener.CONTENT_TYPE_KEY,
                                   new LegacyValueBinding(valueExp));
        }
      }
     
      MethodExpression me = _method.getMethodExpression(faceletContext,
                                                        Object.class,
                                                        _METHOD_PARAMS);
      listener.setMethod(new LegacyMethodBinding(me));

      ActionSource actionSource = (ActionSource)parent;
      actionSource.addActionListener(listener);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.