Examples of PageState


Examples of org.apache.myfaces.tobago.model.PageState

   * @deprecated PageState is deprecated since 1.5.0
   */
  @Deprecated
  public PageState getPageState(FacesContext facesContext) {
    if (FacesUtils.hasValueBindingOrValueExpression(this, Attributes.STATE)) {
      PageState state = (PageState)
          FacesUtils.getValueFromValueBindingOrValueExpression(facesContext, this, Attributes.STATE);
      if (state == null) {
        state = new PageStateImpl();
        FacesUtils.setValueOfBindingOrExpression(facesContext, state, this, Attributes.STATE);
      }
View Full Code Here

Examples of org.apache.myfaces.tobago.model.PageState

    updatePageState(facesContext, component);
  }

  public void updatePageState(FacesContext facesContext, UIComponent component) {
    if (component instanceof UIPage) {
      PageState state = ((UIPage) component).getPageState(facesContext);
      String name;
      String value = null;
      try {
        name = component.getClientId(facesContext)
            + SUBCOMPONENT_SEP + "form-clientDimension";
        value = (String) facesContext.getExternalContext()
            .getRequestParameterMap().get(name);
        if (value != null) {
          StringTokenizer tokenizer = new StringTokenizer(value, ";");
          int width = Integer.parseInt(tokenizer.nextToken());
          int height = Integer.parseInt(tokenizer.nextToken());
          if (state != null) {
            state.setClientWidth(width);
            state.setClientHeight(height);
          }
          facesContext.getExternalContext().getRequestMap().put("tobago-page-clientDimension-width", width);
          facesContext.getExternalContext().getRequestMap().put("tobago-page-clientDimension-height", height);
        }
      } catch (Exception e) {
View Full Code Here

Examples of org.apache.myfaces.tobago.model.PageState

    super.processUpdates(context);
    updatePageState(context);
  }

  public void updatePageState(FacesContext facesContext) {
    PageState state = getPageState(facesContext);
    decodePageState(facesContext, state);
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.model.PageState

  }

  public PageState getPageState(FacesContext facesContext) {
    ValueBinding stateBinding = getValueBinding(ATTR_STATE);
    if (stateBinding != null) {
      PageState state = (PageState) stateBinding.getValue(facesContext);
      if (state == null) {
        state = new PageStateImpl();
        stateBinding.setValue(facesContext, state);
      }
      return state;
View Full Code Here

Examples of org.apache.myfaces.tobago.model.PageState

    updatePageState(facesContext, component);
  }

  public void updatePageState(FacesContext facesContext, UIComponent component) {
    if (component instanceof UIPage) {
      PageState state = ((UIPage) component).getPageState(facesContext);
      String name;
      String value = null;
      try {
        name = component.getClientId(facesContext)
            + SUBCOMPONENT_SEP + "form-clientDimension";
        value = (String) facesContext.getExternalContext()
            .getRequestParameterMap().get(name);
        if (value != null) {
          StringTokenizer tokenizer = new StringTokenizer(value, ";");
          int width = Integer.parseInt(tokenizer.nextToken());
          int height = Integer.parseInt(tokenizer.nextToken());
          if (state != null) {
            state.setClientWidth(width);
            state.setClientHeight(height);
          }
          facesContext.getExternalContext().getRequestMap().put("tobago-page-clientDimension-width", width);
          facesContext.getExternalContext().getRequestMap().put("tobago-page-clientDimension-height", height);
        }
      } catch (Exception e) {
View Full Code Here

Examples of org.apache.myfaces.tobago.model.PageState

      if (StringUtils.isNotBlank(value)) {
        final StringTokenizer tokenizer = new StringTokenizer(value, ";");
        final Measure width = Measure.valueOf(tokenizer.nextToken());
        final Measure height = Measure.valueOf(tokenizer.nextToken());
        // XXX remove me later
        final PageState pageState = page.getPageState(facesContext);
        if (pageState != null) {
          pageState.setClientWidth(width.getPixel());
          pageState.setClientHeight(height.getPixel());
        }
        final ClientProperties clientProperties = ClientProperties.getInstance(facesContext);
        clientProperties.setPageWidth(width);
        clientProperties.setPageHeight(height);
      }
View Full Code Here

Examples of org.exoplatform.portal.mop.page.PageState

                    Page page = configService.createPageTemplate(PAGE_TEMPLATE, siteKey.getTypeName(), siteKey.getName());
                    page.setName(DEFAULT_TAB_NAME);
                    page.setTitle(DEFAULT_TAB_NAME);

                    //
                    PageState pageState = new PageState(page.getTitle(), page.getDescription(), page.isShowMaxWindow(),
                            page.getFactoryId(), page.getAccessPermissions() != null ? Arrays.asList(page
                                    .getAccessPermissions()) : null, page.getEditPermission());
                    configService.getPageService().savePage(new PageContext(page.getPageKey(), pageState));

                    //
View Full Code Here

Examples of org.exoplatform.portal.mop.page.PageState

                            page.setChildren(new ArrayList<ModelObject>());
                        }

                        //
                        PageService pageService = uiPage.getApplicationComponent(PageService.class);
                        PageState pageState = new PageState(page.getTitle(), page.getDescription(), page.isShowMaxWindow(),
                                page.getFactoryId(), page.getAccessPermissions() != null ? Arrays.asList(page
                                        .getAccessPermissions()) : null, page.getEditPermission());
                        pageService.savePage(new PageContext(page.getPageKey(), pageState));

                        //
View Full Code Here

Examples of org.exoplatform.portal.mop.page.PageState

                    page.setChildren(new ArrayList<ModelObject>());
                }

                //
                PageService pageService = uiPage.getApplicationComponent(PageService.class);
                PageState pageState = new PageState(page.getTitle(), page.getDescription(), page.isShowMaxWindow(),
                        page.getFactoryId(), page.getAccessPermissions() != null ? Arrays.asList(page.getAccessPermissions())
                                : null, page.getEditPermission());
                pageService.savePage(new PageContext(page.getPageKey(), pageState));

                //
View Full Code Here

Examples of org.exoplatform.portal.mop.page.PageState

        return pages;
    }

    public static PageState toPageState(Page page) {
        return new PageState(page.getTitle(), page.getDescription(), page.isShowMaxWindow(), page.getFactoryId(),
                page.getAccessPermissions() != null ? Arrays.asList(page.getAccessPermissions()) : null,
                page.getEditPermission());
    }
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.