Examples of UITreeLabel


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

  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());

    if (listbox) {
      writer.writeText(text);
    } else {
      writer.startElement(HtmlElements.LABEL, label);
View Full Code Here

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

  }

  @Override
  protected void setProperties(final UIComponent uiComponent) {
    super.setProperties(uiComponent);
    final UITreeLabel component = (UITreeLabel) 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 (tip != null) {
      component.setValueExpression("tip", tip);
    }

    if (value != null) {
      component.setValueExpression("value", value);
    }

  }
View Full Code Here

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

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

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

    final UITreeLabel label = (UITreeLabel) component;
    final UITreeNode node = ComponentUtils.findAncestor(label, UITreeNode.class);
    final boolean folder = node.isFolder();

    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    writer.startElement(HtmlElements.LABEL, label);
    writer.writeClassAttribute(Classes.create(label));
    writer.writeStyleAttribute(createStyle(facesContext, label));
    HtmlRendererUtils.renderTip(label, writer);

    if (label.getValue() != null) {
      writer.writeText((String) label.getValue());
    }
    writer.endElement(HtmlElements.LABEL);
  }
View Full Code Here

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

    }

    writer.writeAttribute(HtmlAttributes.SIZE, 9); // must be > 1, but the real size comes from the layout
//    writer.writeAttribute(HtmlAttributes.MULTIPLE, siblingMode);

    final UITreeLabel label = ComponentUtils.findDescendant(tree, UITreeLabel.class);
    final Object labelValue = label.getValue();
    if (labelValue != null) {
      writer.startElement(HtmlElements.OPTGROUP, tree);
      writer.writeAttribute(HtmlAttributes.LABEL, labelValue.toString(), true);
      writer.endElement(HtmlElements.OPTGROUP);
    }
View Full Code Here

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

  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());

    if (listbox) {
      writer.writeText(text);
    } else {
      writer.startElement(HtmlElements.LABEL, label);
View Full Code Here

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

  public void encodeBegin(final FacesContext facesContext, final 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());

    if (listbox) {
      writer.writeText(text);
    } else {
      writer.startElement(HtmlElements.LABEL, label);
View Full Code Here

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

  }

  @Override
  protected void setProperties(final UIComponent uiComponent) {
    super.setProperties(uiComponent);
    final UITreeLabel component = (UITreeLabel) 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 (tip != null) {
      component.setValueExpression("tip", tip);
    }

    if (value != null) {
      component.setValueExpression("value", value);
    }

  }
View Full Code Here

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

  public void encodeBegin(final FacesContext facesContext, final 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());

    if (listbox) {
      writer.writeText(text);
    } else {
      writer.startElement(HtmlElements.LABEL, label);
View Full Code Here

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

    }

    writer.writeAttribute(HtmlAttributes.SIZE, 9); // must be > 1, but the real size comes from the layout
//    writer.writeAttribute(HtmlAttributes.MULTIPLE, siblingMode);

    final UITreeLabel label = ComponentUtils.findDescendant(tree, UITreeLabel.class);
    final Object labelValue = label.getValue();
    if (labelValue != null) {
      writer.startElement(HtmlElements.OPTGROUP, tree);
      writer.writeAttribute(HtmlAttributes.LABEL, labelValue.toString(), true);
      writer.endElement(HtmlElements.OPTGROUP);
    }
View Full Code Here

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

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

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

    final UITreeLabel label = (UITreeLabel) component;
    final UITreeNode node = ComponentUtils.findAncestor(label, UITreeNode.class);
    final boolean folder = node.isFolder();

    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    writer.startElement(HtmlElements.LABEL, label);
    writer.writeClassAttribute(Classes.create(label));
    HtmlRendererUtils.writeDataAttributes(facesContext, writer, label);
    writer.writeStyleAttribute(createStyle(facesContext, label));
    HtmlRendererUtils.renderTip(label, writer);

    if (label.getValue() != null) {
      writer.writeText((String) label.getValue());
    }
    writer.endElement(HtmlElements.LABEL);
  }
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.