Examples of AbstractUIData


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

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

    final UITreeIndent indent = (UITreeIndent) component;
    final AbstractUITreeNode node = ComponentUtils.findAncestor(indent, AbstractUITreeNode.class);
    final AbstractUIData data = ComponentUtils.findAncestor(indent, AbstractUIData.class);

    final boolean folder = node.isFolder();
    final int level = node.getLevel();
    final List<Boolean> junctions = node.getJunctions();

    final boolean showRoot = data.isShowRoot();
    final boolean showJunctions = indent.isShowJunctions();
    final boolean showRootJunction = data.isShowRootJunction();
    final boolean expanded = folder && data.getExpandedState().isExpanded(node.getPath());
    final boolean showLines = showJunctions && data instanceof UITree; // sheet should not show lines
    final boolean showIcons = showJunctions;

    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
View Full Code Here

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

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

    final UITreeNode node = (UITreeNode) component;
    final AbstractUIData data = ComponentUtils.findAncestor(node, AbstractUIData.class);

    final boolean dataRendersRowContainer = data.isRendersRowContainer();
    final boolean folder = node.isFolder();
    final String clientId = node.getClientId(facesContext);
    final boolean ie6
        = VariableResolverUtils.resolveClientProperties(facesContext).getUserAgent().equals(UserAgent.MSIE_6_0);
    final String parentId = data.getRowParentClientId();
    final boolean visible = data.isRowVisible();

    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    writer.startElement(HtmlElements.DIV, null);
    writer.writeIdAttribute(clientId);
View Full Code Here

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

  }

  @Override
  public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
    final UITreeNode node = (UITreeNode) component;
    final AbstractUIData data = ComponentUtils.findAncestor(node, AbstractUIData.class);
    final int level = node.getLevel();
    final boolean folder = node.isFolder();
    final boolean expanded = folder && data.getExpandedState().isExpanded(node.getPath()) || level == 0;

    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    if (folder) {
      encodeIcon(facesContext, writer, expanded, node);
View Full Code Here

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

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

    final AbstractUITreeNode node = (AbstractUITreeNode) component;
    final AbstractUIData data = ComponentUtils.findAncestor(node, AbstractUIData.class);

    final boolean dataRendersRowContainer = data.isRendersRowContainer();
    final boolean folder = node.isFolder();
    final String clientId = node.getClientId(facesContext);
    final String parentId = data.getRowParentClientId();
    final boolean visible = data.isRowVisible();

    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    writer.startElement(HtmlElements.DIV, null);
View Full Code Here

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

  public void decode(FacesContext facesContext, UIComponent component) {

    final UITreeSelect select = (UITreeSelect) component;
    final AbstractUITreeNode node = ComponentUtils.findAncestor(select, AbstractUITreeNode.class);
    final AbstractUIData data = ComponentUtils.findAncestor(node, AbstractUIData.class);

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

    final String clientId = select.getClientId(facesContext);
    final String name;
    if (data.getSelectableAsEnum().isSingle()) {
      name = getClientIdWithoutRowIndex(data, clientId);
    } else {
      name = clientId;
    }
View Full Code Here

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

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

    final UITreeSelect select = (UITreeSelect) component;
    final AbstractUITreeNode node = ComponentUtils.findAncestor(select, AbstractUITreeNode.class);
    final AbstractUIData data = ComponentUtils.findAncestor(node, AbstractUIData.class);

    TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    if (data instanceof AbstractUITreeListbox) {
      writer.write(StringUtils.defaultString((String) select.getLabel()));
      return;
    }

    final String id = select.getClientId(facesContext);
    final String currentValue = getCurrentValue(facesContext, select);
    final boolean checked;
    if (select.isValueStoredInState()) {
      checked = data.getSelectedState().isSelected(node.getPath());
    } else {
      checked = "true".equals(currentValue);
    }

    final boolean folder = data.isFolder();
    final Selectable selectable = data.getSelectableAsEnum();


    writer.startElement(HtmlElements.SPAN, null);
    writer.writeClassAttribute(Classes.create(select));
    HtmlRendererUtils.writeDataAttributes(facesContext, writer, select);
View Full Code Here

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

  @Override
  public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
    super.prepareRender(facesContext, component);

    final AbstractUITreeNode node = (AbstractUITreeNode) component;
    final AbstractUIData data = ComponentUtils.findAncestor(node, AbstractUIData.class);
    if (data instanceof AbstractUITree && ((AbstractUITree) data).getSelectedState().isSelected(node.getPath())) {
      ComponentUtils.addCurrentMarkup(node, Markup.SELECTED);
    }
    if (node.isFolder()) {
      ComponentUtils.addCurrentMarkup(node, Markup.FOLDER);
      if (data.getExpandedState().isExpanded(node.getPath())) {
        ComponentUtils.addCurrentMarkup(node, Markup.EXPANDED);
      }
    }
  }
View Full Code Here

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

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

    final UITreeIcon image = (UITreeIcon) component;
    final AbstractUIData data = ComponentUtils.findAncestor(image, AbstractUIData.class);
    final UITreeNode node = ComponentUtils.findAncestor(image, UITreeNode.class);
    final boolean folder = node.isFolder();
    final boolean expanded = folder && data.getExpandedState().isExpanded(node.getPath());

    String source;
    final String openSource;
    final String closedSource;
View Full Code Here

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

  private static final Logger LOG = LoggerFactory.getLogger(TreeLabelRenderer.class);

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

    final AbstractUIData data = ComponentUtils.findAncestor(component, AbstractUIData.class);
    final boolean listbox = data instanceof AbstractUITreeListbox;

    final UITreeLabel label = (UITreeLabel) component;
    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);
    final String text = StringUtils.defaultString((String) label.getValue());
View Full Code Here

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

  @Override
  public void prepareRender(FacesContext facesContext, UIComponent component) throws IOException {
    super.prepareRender(facesContext, component);

    final UITreeNode node = (UITreeNode) component;
    final AbstractUIData data = ComponentUtils.findAncestor(node, AbstractUIData.class);
    if (data instanceof AbstractUITree && ((AbstractUITree) data).getMarkedState().isMarked(node.getPath())) {
      ComponentUtils.addCurrentMarkup(node, Markup.MARKED);
    }
    if (node.isFolder()) {
      ComponentUtils.addCurrentMarkup(node, Markup.FOLDER);
      if (data.getExpandedState().isExpanded(node.getPath())) {
        ComponentUtils.addCurrentMarkup(node, Markup.EXPANDED);
      }
    }
  }
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.