Examples of UITreeMenu


Examples of org.apache.myfaces.tobago.component.UITreeMenu

    if (ComponentUtils.isOutputOnly(node)) {
      return;
    }

    final UITreeMenu tree = ComponentUtils.findAncestor(node, UITreeMenu.class);
    final String treeId = tree.getClientId(facesContext);
    final String nodeStateId = node.nodeStateId(facesContext);
    final Map<String, String> requestParameterMap = facesContext.getExternalContext().getRequestParameterMap();
    final String id = node.getClientId(facesContext);
    final boolean folder = node.isFolder();
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UITreeMenu

  @Override
  public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {

    final UITreeNode node = (UITreeNode) component;
    final UITreeMenu tree = ComponentUtils.findAncestor(node, UITreeMenu.class);

    final boolean folder = node.isFolder();
    final String id = node.getClientId(facesContext);
    final int level = node.getLevel();
    final boolean root = level == 0;
    final boolean expanded = folder && node.isExpanded() || level == 0;
    final boolean showRoot = tree.isShowRoot();
    final boolean ie6
        = VariableResolverUtils.resolveClientProperties(facesContext).getUserAgent().equals(UserAgent.MSIE_6_0);

    // XXX todo: find a better way to determine the parentId
    final String clientId = node.getClientId(facesContext);
    final int colon = clientId.lastIndexOf(":");
    final int underscore = clientId.substring(0, colon).lastIndexOf("_");
    final String parentId = root ? null : clientId.substring(0, underscore) + clientId.substring(colon);

    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    if (expanded) {
      tree.getExpandedCache().add(id);
    }

    if (showRoot || !root) {
      writer.startElement(HtmlElements.DIV, null);
      writer.writeIdAttribute(id);
      writer.writeClassAttribute(Classes.create(node));
      writer.writeAttribute(DataAttributes.TREEPARENT, parentId, false);

      if (!root && !tree.getExpandedCache().contains(parentId)) {
        Style style = new Style();
        style.setDisplay(Display.NONE);
        writer.writeStyleAttribute(style);
      }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UITreeMenu

    if (ComponentUtils.isOutputOnly(node)) {
      return;
    }

    final UITreeMenu tree = ComponentUtils.findAncestor(node, UITreeMenu.class);
    final String treeId = tree.getClientId(facesContext);
    final String nodeStateId = node.nodeStateId(facesContext);
    final Map<String, String> requestParameterMap = facesContext.getExternalContext().getRequestParameterMap();
    final String id = node.getClientId(facesContext);
    final boolean folder = node.isFolder();
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UITreeMenu

  @Override
  public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {

    final UITreeNode node = (UITreeNode) component;
    final UITreeMenu tree = ComponentUtils.findAncestor(node, UITreeMenu.class);

    final boolean folder = node.isFolder();
    final String id = node.getClientId(facesContext);
    final int level = node.getLevel();
    final boolean root = level == 0;
    final boolean expanded = folder && node.isExpanded() || level == 0;
    final boolean showRoot = tree.isShowRoot();
    final boolean ie6
        = VariableResolverUtils.resolveClientProperties(facesContext).getUserAgent().equals(UserAgent.MSIE_6_0);

    // XXX todo: find a better way to determine the parentId
    final String clientId = node.getClientId(facesContext);
    final int colon2 = clientId.lastIndexOf(":");
    final int colon1 = clientId.substring(0, colon2 - 1).lastIndexOf(":");
    final String structure = clientId.substring(colon1 + 1, colon2);
    String parentStructure = getParentStructure(structure);
    final String parentId = root ? null : clientId.substring(0, colon1 + 1) + parentStructure + clientId.substring(colon2);

    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    if (expanded) {
      tree.getExpandedCache().add(structure);
    }

    if (showRoot || !root) {
      writer.startElement(HtmlElements.DIV, null);
      writer.writeIdAttribute(id);
      writer.writeClassAttribute(Classes.create(node));
      writer.writeAttribute(DataAttributes.TREEPARENT, parentId, false);
      HtmlRendererUtils.writeDataAttributes(facesContext, writer, node);

      if (!root) {
        while (parentStructure != null) {
          if (!tree.getExpandedCache().contains(parentStructure)) {
            Style style = new Style();
            style.setDisplay(Display.NONE);
            writer.writeStyleAttribute(style);
            break;
          }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UITreeMenu

    if (ComponentUtils.isOutputOnly(node)) {
      return;
    }

    final UITreeMenu tree = ComponentUtils.findAncestor(node, UITreeMenu.class);
    final String treeId = tree.getClientId(facesContext);
    final String nodeStateId = node.nodeStateId(facesContext);
    final Map<String, String> requestParameterMap = facesContext.getExternalContext().getRequestParameterMap();
    final String id = node.getClientId(facesContext);
    final boolean folder = node.isFolder();
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UITreeMenu

  @Override
  public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {

    final UITreeNode node = (UITreeNode) component;
    final UITreeMenu tree = ComponentUtils.findAncestor(node, UITreeMenu.class);

    final boolean folder = node.isFolder();
    final String id = node.getClientId(facesContext);
    final int level = node.getLevel();
    final boolean root = level == 0;
    final boolean expanded = folder && node.isExpanded() || level == 0;
    final boolean showRoot = tree.isShowRoot();
    final boolean ie6
        = VariableResolverUtils.resolveClientProperties(facesContext).getUserAgent().equals(UserAgent.MSIE_6_0);

    // XXX todo: find a better way to determine the parentId
    final String clientId = node.getClientId(facesContext);
    final int colon2 = clientId.lastIndexOf(":");
    final int colon1 = clientId.substring(0, colon2 - 1).lastIndexOf(":");
    final String structure = clientId.substring(colon1 + 1, colon2);
    String parentStructure = getParentStructure(structure);
    final String parentId
        = root ? null : clientId.substring(0, colon1 + 1) + parentStructure + clientId.substring(colon2);

    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    if (expanded) {
      tree.getExpandedCache().add(structure);
    }

    if (showRoot || !root) {
      writer.startElement(HtmlElements.DIV, null);
      writer.writeIdAttribute(id);
      writer.writeClassAttribute(Classes.create(node));
      writer.writeAttribute(DataAttributes.TREE_PARENT, parentId, false);
      HtmlRendererUtils.writeDataAttributes(facesContext, writer, node);

      if (!root) {
        while (parentStructure != null) {
          if (!tree.getExpandedCache().contains(parentStructure)) {
            Style style = new Style();
            style.setDisplay(Display.NONE);
            writer.writeStyleAttribute(style);
            break;
          }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UITreeMenu

  }

  @Override
  protected void setProperties(final UIComponent uiComponent) {
    super.setProperties(uiComponent);
    final UITreeMenu component = (UITreeMenu) uiComponent;
    final FacesContext context = FacesContext.getCurrentInstance();
    final Application application = context.getApplication();
    if (markup != null) {
      if (!markup.isLiteralText()) {
        component.setValueExpression("markup", markup);
      } else {
        component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
      }
    }
    if (state != null) {
      if (!state.isLiteralText()) {
        component.setValueExpression("state", state);
      /*} else {
        component.setState(state.getExpressionString());*/
      }
    }
    if (showRoot != null) {
      if (!showRoot.isLiteralText()) {
        component.setValueExpression("showRoot", showRoot);
      } else {
        component.setShowRoot(Boolean.parseBoolean(showRoot.getExpressionString()));
      }
    }
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UITreeMenu

    if (ComponentUtils.isOutputOnly(node)) {
      return;
    }

    final UITreeMenu tree = ComponentUtils.findAncestor(node, UITreeMenu.class);
    final String treeId = tree.getClientId(facesContext);
    final String nodeStateId = node.nodeStateId(facesContext);
    final Map<String, String> requestParameterMap = facesContext.getExternalContext().getRequestParameterMap();
    final String id = node.getClientId(facesContext);
    final boolean folder = node.isFolder();
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UITreeMenu

  @Override
  public void encodeBegin(FacesContext facesContext, UIComponent component) throws IOException {

    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
    final UITreeNode node = (UITreeNode) component;
    final UITreeMenu tree = ComponentUtils.findAncestor(node, UITreeMenu.class);

    final boolean folder = node.isFolder();
    final String id = node.getClientId(facesContext);
    final int level = node.getLevel();
    final boolean root = level == 0;
    final boolean expanded = folder && node.isExpanded() || level == 0;
    final boolean showRoot = tree.isShowRoot();
    final boolean ie6
        = VariableResolverUtils.resolveClientProperties(facesContext).getUserAgent().equals(UserAgent.MSIE_6_0);

    if (showRoot || !root) {
      writer.startElement(HtmlElements.DIV, null);
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UITreeMenu

  }

  @Override
  protected void setProperties(final UIComponent uiComponent) {
    super.setProperties(uiComponent);
    final UITreeMenu component = (UITreeMenu) uiComponent;
    final FacesContext context = FacesContext.getCurrentInstance();
    final Application application = context.getApplication();
    if (markup != null) {
      if (!markup.isLiteralText()) {
        component.setValueExpression("markup", markup);
      } else {
        component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
      }
    }
    if (var != null) {
      component.setValueExpression("var", var);
    }

    if (state != null) {
      if (!state.isLiteralText()) {
        component.setValueExpression("state", state);
      /*} else {
        component.setState(state.getExpressionString());*/
      }
    }
    if (showRoot != null) {
      if (!showRoot.isLiteralText()) {
        component.setValueExpression("showRoot", showRoot);
      } else {
        component.setShowRoot(Boolean.parseBoolean(showRoot.getExpressionString()));
      }
    }
    if (value != null) {
      component.setValueExpression("value", value);
    }

  }
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.