Package org.apache.myfaces.trinidad.context

Examples of org.apache.myfaces.trinidad.context.RequestContext$StubWindowManager


    Object       returnValue)
  {
    if (!_supportsSeparateWindow(context))
      return false;

    RequestContext afC = RequestContext.getCurrentInstance();
    try
    {
      String returnId = (String) afC.getPageFlowScope().get(_RETURN_ID);

      if (returnId == null)
        throw new IllegalStateException("No returnId is available for returning from the dialog;  this usually means that you aren't in a dialog in the first place.");

      // Deliver callback in the context of the launching window
View Full Code Here



  static private ResponseWriter _addDebugResponseWriters(
     ResponseWriter responseWriter)
  {
    RequestContext requestContext = RequestContext.getCurrentInstance();
    if (requestContext.isDebugOutput())
    {
      responseWriter = new IndentingResponseWriter(responseWriter);
      responseWriter = new DebugResponseWriter(responseWriter);
      if ("text/html".equals(responseWriter.getContentType()))
        responseWriter = new DebugHtmlResponseWriter(responseWriter);
View Full Code Here

    }

    @Override
    public void dispatch(String path) throws IOException
    {
      RequestContext afc = RequestContext.getCurrentInstance();
      if (afc != null)
      {
        path = afc.getPageResolver().getPhysicalURI(path);
      }

      super.dispatch(path);
    }
View Full Code Here

  {
  }

  public static boolean isPartialRequest(FacesContext context)
  {
    RequestContext rc = RequestContext.getCurrentInstance();
    if (rc == null)
      return false;
    return rc.isPartialRequest(context);
  }
View Full Code Here

  private DateFormat _getDateFormat(
    FacesContext context,
    String pattern
    )
  {
    RequestContext reqContext = RequestContext.getCurrentInstance();

    Locale locale = getLocale();
    if (null == locale)
    {
      if (reqContext != null)
        locale = reqContext.getFormattingLocale();
      if (locale == null)
      {
        locale = context.getViewRoot().getLocale();
      }
    }

    TimeZone tZone = _getTimeZone();

    DateFormat format = _getCachedFormat(locale, tZone, pattern);

    if (format != null)
    {
      format.setTimeZone(tZone);
    }
    else
    {
      // create a format off of the styles.
      // We will change shortish to short only at place where it is required.
      // Otherwise we may end up throwing convert exception for case where
      // dateStyle is invalid. So evaluating only at the required place.
      if ( null == pattern )
      {
        int type = _getType(getType());

        if (type == _TYPE_DATE || type == _TYPE_BOTH)
        {
          int actualDateStyle = _getDateStyle(getDateStyle());
          int dateStyle = _changeShortishAsShortIfNeeded(actualDateStyle);

          if (type == _TYPE_DATE)
          {
            format = DateFormat.getDateInstance(dateStyle, locale);
          }
          else
          {
            int timeStyle = _getTimeStyle(getTimeStyle());
            format = DateFormat.getDateTimeInstance(dateStyle, timeStyle, locale);
          }
        }
        if (type == _TYPE_TIME)
        {
          int timeStyle = _getTimeStyle(getTimeStyle());
          format = DateFormat.getTimeInstance(timeStyle, locale);
        }
      }
      else
      {
        // create a format off of the pattern
        format = _getSimpleDateFormat(pattern, locale);
      }

      if (format instanceof SimpleDateFormat)
      {
        SimpleDateFormat simpleFormat = (SimpleDateFormat)format;

        // make sure that we have a 4 digit year for "shortish"
        // dates
        // DO NOT CHANGE THE FOLLOWING LINE to "dateStyle";  this
        // must be retrieved from the instance variable!  (See above)
        // and we need to apply shortish only if it is of date type or
        // type is date and time.
        if (null == pattern && "shortish".equals(getDateStyle()) )
        {
          int type = _getType(getType());
          if (type == _TYPE_DATE || type == _TYPE_BOTH )
          {
            simpleFormat = _get4YearFormat(simpleFormat, locale);
            format = simpleFormat;
          }
        }

        Calendar cal;
        if (reqContext == null)
        {
          cal = null;
          if(_LOG.isWarning())
          {
            _LOG.warning("Cannot find RequestContext; two-digit-year-start will be defaulted");
          }
        }
        else
        {
          cal = new GregorianCalendar(reqContext.getTwoDigitYearStart(), 0, 0);
        }
        if (cal != null)
          simpleFormat.set2DigitYearStart(cal.getTime());
      }
View Full Code Here

  {
    TimeZone tZone = getTimeZone();

    if (tZone == null)
    {
      RequestContext context = RequestContext.getCurrentInstance();
      if (context == null)
      {
        _LOG.warning("Cannot find RequestContext;  TimeZone will default.");
      }
      else
      {
        tZone = context.getTimeZone();
      }

      // If RequestContext is null or if it returns a null,
      // then set it to the default time zone which is GMT time zone
      if (tZone == null)
View Full Code Here

    UIViewRoot   viewToRender) throws IOException, FacesException
  {
    String entryKey = (String) context.getExternalContext().getRequestParameterMap().get(__ENTRY_KEY_PARAM);
    if (entryKey == null)
    {
      RequestContext requestContext = RequestContext.getCurrentInstance();
      if (requestContext != null)
      {
        Object o = requestContext.getPageFlowScope().get(__ENTRY_KEY_PARAM);
        if (o != null)
          entryKey = o.toString();
      }
    }
View Full Code Here

    // 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
View Full Code Here

  @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?
View Full Code Here

    String treeId = page.getClientId(context) + TREE_SUFFIX;
   
    if ( treeId.equals(source))
    {         
      TreeUtils.decodeExpandEvents(parameters, page, Collections.emptyList());
      RequestContext afContext = RequestContext.getCurrentInstance();
      if (afContext != null)
        afContext.addPartialTarget(component);
    }
  } 
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.context.RequestContext$StubWindowManager

Copyright © 2018 www.massapicom. 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.