Package org.apache.myfaces.tobago.context

Examples of org.apache.myfaces.tobago.context.Markup


    writer.startElement(HtmlElements.LABEL, null);
    if (clientId != null) {
      writer.writeAttribute(HtmlAttributes.FOR, clientId, false);
    }
    writer.writeAttribute(HtmlAttributes.TITLE, detail, true);
    final Markup markup = ComponentUtils.markupOfSeverity(message.getSeverity());
    writer.writeClassAttribute(Classes.create(messages, "item", markup));
    boolean writeEmptyText = true;
    if (summary != null && messages.isShowSummary()) {
      writer.writeText(summary);
      writeEmptyText = false;
View Full Code Here


      addMarkupClass((SupportsMarkup) component, rendererName, null);
    }
  }

  public void addMarkupClass(final SupportsMarkup supportsMarkup, final String rendererName, final String sub) {
    final Markup m = supportsMarkup.getCurrentMarkup();
    if (m != null) {
      for (final String markup : m) {
        final Theme theme = ClientProperties.getInstance(FacesContext.getCurrentInstance()).getTheme();
        if (theme.getRenderersConfig().isMarkupSupported(rendererName, markup)) {
          addMarkupClass(rendererName, sub, markup);
View Full Code Here

  // XXX optimize synchronized
  private static synchronized Classes create(
      final UIComponent component, final boolean markupFromComponent, final String sub,
      final Markup explicit, final boolean ignoreCheck) {
    final String rendererName = StringUtils.uncapitalize(component.getRendererType());
    final Markup markup = markupFromComponent ? ((SupportsMarkup) component).getCurrentMarkup() : explicit;
    Classes value = (Classes) CACHE.get(rendererName, markup, sub);
    if (value == null) {
      value = new Classes(rendererName, markup, sub, ignoreCheck);
      CACHE.put(rendererName, markup, sub, value);
      if (LOG.isDebugEnabled()) {
View Full Code Here

   */
  public void prepareRender(final FacesContext facesContext, final UIComponent component) throws IOException {

    if (component instanceof SupportsMarkup) {
      final SupportsMarkup supportsMarkup = (SupportsMarkup) component;
      final Markup markup = ComponentUtils.updateMarkup(component, supportsMarkup.getMarkup());
      supportsMarkup.setCurrentMarkup(markup);
    }
  }
View Full Code Here

                + ResourceManagerUtils.getImageOrDisabledImageWithPath(facesContext, image, item.isDisabled())
                + "')");
            writer.writeStyleAttribute(style);
          }
        }
        Markup markup = item instanceof SupportsMarkup ? ((SupportsMarkup) item).getMarkup() : Markup.NULL;
        if (onlySelected == null && contains) {
          writer.writeAttribute(HtmlAttributes.SELECTED, true);
          markup = Markup.SELECTED.add(markup);
        }
        if (item.isDisabled()) {
View Full Code Here

      buttonStyle.setWidth(buttonStyle.getWidth().add(menuStyle.getWidth()));
    }
   
    // start rendering
    writer.startElement(HtmlElements.SPAN, command);
    Markup itemMarkup = Markup.NULL;
    if (selected) {
      itemMarkup = itemMarkup.add(Markup.SELECTED);
    }
    if (disabled) {
      itemMarkup = itemMarkup.add(Markup.DISABLED);
    }
    writer.writeClassAttribute(Classes.create(toolBar, "item", itemMarkup));
    final String title = HtmlRendererUtils.getTitleFromTipAndMessages(facesContext, command);
    if (title != null) {
      writer.writeAttribute(HtmlAttributes.TITLE, title, true);
View Full Code Here

    // adding the markups from the corresponding input component
    final UILabel label = (UILabel) component;
    final UIComponent corresponding = ComponentUtils.findFor(label);
    if (corresponding != null) {
      Markup markup = label.getCurrentMarkup();
      markup = ComponentUtils.updateMarkup(corresponding, markup);
      label.setCurrentMarkup(markup);
    }
  }
View Full Code Here

//          boolean noSelectionOption = uiSelectItem.isNoSelectionOption();
          if (label == null) {
            label = itemValue.toString();
          }
          String image = null;
          Markup markup = null;
          if (uiSelectItem instanceof org.apache.myfaces.tobago.component.UISelectItem) {
            org.apache.myfaces.tobago.component.UISelectItem tobagoSelectItem
                = (org.apache.myfaces.tobago.component.UISelectItem) uiSelectItem;
            image = tobagoSelectItem.getItemImage();
            markup = tobagoSelectItem.getCurrentMarkup();
View Full Code Here

          if (itemDescription != null) {
            itemDescription = itemDescription.toString();
          }
          final Boolean itemDisabled = getBooleanAttribute(currentUISelectItems, Attributes.ITEM_DISABLED, false);
          final String itemImage = (String) attributeMap.get(Attributes.ITEM_IMAGE);
          final Markup markup;
          if (currentUISelectItems instanceof SupportsMarkup) {
            markup = ((SupportsMarkup) currentUISelectItems).getCurrentMarkup();
          } else {
            markup = Markup.NULL;
          }
View Full Code Here

    writer.startElement(HtmlElements.LI, null);
    if (command != null && !command.isTransient()) {
      writer.writeIdAttribute(clientId);
    }
    Markup markup = null;
    if (command != null) {
      markup = command.getCurrentMarkup();
      if (firstLevel) {
        markup = Markup.TOP.add(markup);
      }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.tobago.context.Markup

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.