Package org.apache.myfaces.tobago.internal.component

Examples of org.apache.myfaces.tobago.internal.component.AbstractUIPage


  public static AbstractUIPage findPage(final FacesContext context, final UIComponent component) {
    final UIViewRoot view = context.getViewRoot();
    if (view != null) {
      TransientStateHolder stateHolder = (TransientStateHolder) view.getAttributes().get(PAGE_KEY);
      if (stateHolder == null || stateHolder.isEmpty()) {
        final AbstractUIPage page = findPage(component);
        stateHolder = new TransientStateHolder(page);
        context.getViewRoot().getAttributes().put(PAGE_KEY, stateHolder);
      }
      return (AbstractUIPage) stateHolder.get();
    } else {
View Full Code Here


      if (child instanceof AbstractUIPage) {
        return (AbstractUIPage) child;
      }
    }
    for (final UIComponent child : component.getChildren()) {
      final AbstractUIPage result = findPageBreadthFirst(child);
      if (result != null) {
        return result;
      }
    }
    return null;
View Full Code Here

  private static final TobagoResourceBundle RESOURCE_BUNDLE = new TobagoResourceBundle();
  private static final TobagoMessageBundle MESSAGE_BUNDLE = new TobagoMessageBundle();

  public Box getActionPosition() {
    final FacesContext facesContext = FacesContext.getCurrentInstance();
    final AbstractUIPage page = ComponentUtils.findPage(facesContext);
    return page.getActionPosition();
  }
View Full Code Here

   * Returns the dimension of the page. Might be useful to set the size of a popup.
   * E. g. <code>width="#{tobagoContext.pageDimension.width.pixel - 100}"</code>
   */
  public Dimension getPageDimension() {
    final FacesContext facesContext = FacesContext.getCurrentInstance();
    final AbstractUIPage page = ComponentUtils.findPage(facesContext);
    return new Dimension(page.getWidth(), page.getHeight());
  }
View Full Code Here

  public static AbstractUIPage findPage(FacesContext context, UIComponent component) {
    UIViewRoot view = context.getViewRoot();
    if (view != null) {
      TransientStateHolder stateHolder = (TransientStateHolder) view.getAttributes().get(PAGE_KEY);
      if (stateHolder == null || stateHolder.isEmpty()) {
        AbstractUIPage page = findPage(component);
        stateHolder = new TransientStateHolder(page);
        context.getViewRoot().getAttributes().put(PAGE_KEY, stateHolder);
      }
      return (AbstractUIPage) stateHolder.get();
    } else {
View Full Code Here

      if (child instanceof AbstractUIPage) {
        return (AbstractUIPage) child;
      }
    }
    for (UIComponent child : component.getChildren()) {
      AbstractUIPage result = findPageBreadthFirst(child);
      if (result != null) {
        return result;
      }
    }
    return null;
View Full Code Here

// LAYOUT End

    final String clientId = popup.getClientId(facesContext);

    // XXX May be computed in the "Layout Manager Phase"
    AbstractUIPage page = ComponentUtils.findPage(facesContext);
    if (popup.getLeft() == null) {
      popup.setLeft(page.getWidth().subtract(popup.getWidth()).divide(2));
    }
    if (popup.getTop() == null) {
      popup.setTop(page.getHeight().subtract(popup.getWidth()).divide(2));
    }

    writer.startElement(HtmlElements.DIV, popup);
    writer.writeIdAttribute(clientId);
    Style style = new Style(facesContext, popup);
View Full Code Here

      throw new NullPointerException("context");
    }
    final Map<String, UIComponent> ajaxComponents = AjaxInternalUtils.parseAndStoreComponents(context);
    if (ajaxComponents != null) {
      // first decode the page
      final AbstractUIPage page = ComponentUtils.findPage(context);
      page.decode(context);
      page.markSubmittedForm(context);
      FacesContextUtils.setAjax(context, true);

      // decode the action if actionComponent not inside one of the ajaxComponents
      // otherwise it is decoded there
      decodeActionComponent(context, page, ajaxComponents);
View Full Code Here

  private static final TobagoResourceBundle RESOURCE_BUNDLE = new TobagoResourceBundle();
  private static final TobagoMessageBundle MESSAGE_BUNDLE = new TobagoMessageBundle();

  public Box getActionPosition() {
    final FacesContext facesContext = FacesContext.getCurrentInstance();
    final AbstractUIPage page = ComponentUtils.findPage(facesContext);
    return page.getActionPosition();
  }
View Full Code Here

   * Returns the dimension of the page. Might be useful to set the size of a popup.
   * E. g. <code>width="#{tobagoContext.pageDimension.width.pixel - 100}"</code>
   */
  public Dimension getPageDimension() {
    final FacesContext facesContext = FacesContext.getCurrentInstance();
    final AbstractUIPage page = ComponentUtils.findPage(facesContext);
    return new Dimension(page.getWidth(), page.getHeight());
  }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.tobago.internal.component.AbstractUIPage

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.