Examples of UIMenu


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

    writer.writeIdAttribute(column.getClientId(facesContext));
    writer.writeClassAttribute(Classes.create(sheet, "selectorMenu"));
    writer.endElement(HtmlElements.DIV);

    if (UISheet.MULTI.equals(sheet.getSelectable())) {
      UIMenu menu = (UIMenu) CreateComponentUtils.createComponent(
          facesContext, UIMenu.COMPONENT_TYPE, RendererTypes.MENU, "selectorMenu");
      menu.setTransient(true);
      FacetUtils.setDropDownMenu(column, menu);
      menu.setImage("image/sheetSelectorMenu.gif");
      menu.setLabel("vv"); //todo remove this after fixing the image above

      String sheetId = column.getParent().getClientId(facesContext);

      createMenuItem(facesContext, menu, "sheetMenuSelect",
          "Tobago.Sheets.get('" + sheetId + "').selectAll()", "t_selectAll");
View Full Code Here

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

    next.setOnclick("/**/"); // XXX avoid submit

    // all: sub menu to select any tab directly
    UICommand all = (UICommand) CreateComponentUtils.createComponent(
        facesContext, UICommand.COMPONENT_TYPE, null, "all");
    UIMenu menu = (UIMenu) CreateComponentUtils.createComponent(
        facesContext, UIMenu.COMPONENT_TYPE, RendererTypes.MENU, "menu");
    FacetUtils.setDropDownMenu(all, menu);
    int index = 0;
    for (UIComponent child : (List<UIComponent>) tabGroup.getChildren()) {
      if (child instanceof UITab) {
        UITab tab = (UITab) child;
        if (tab.isRendered()) {
          UIMenuCommand entry = (UIMenuCommand) CreateComponentUtils.createComponent(
              facesContext, UIMenuCommand.COMPONENT_TYPE, RendererTypes.MENU_COMMAND, "entry-" + index);
          LabelWithAccessKey label = new LabelWithAccessKey(tab);
          entry.setLabel(label.getText());
          if (tab.isDisabled()) {
            entry.setDisabled(true);
          } else {
            entry.setOnclick(JQueryUtils.selectId(clientId)
                + ".find('.tobago-tab[tabgroupindex=" + index + "]')"
                + ".click();"
                + "if (event.stopPropagation === undefined) { "
                + "  event.cancelBubble = true; " // IE
                + "} else { "
                + "  event.stopPropagation(); " // other
                + "}"); // todo: register a onclick handler with jQuery
          }
          menu.getChildren().add(entry);
        }
        index++;
      }
    }
    UIToolBar toolBar = (UIToolBar) application.createComponent(UIToolBar.COMPONENT_TYPE);
View Full Code Here

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

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

    final UIMenu menu = (UIMenu) component;
    final boolean firstLevel = !RendererTypes.MENU.equals(menu.getParent().getRendererType());
    if (firstLevel) {
      ComponentUtils.addCurrentMarkup(menu, Markup.TOP);
    }
  }
View Full Code Here

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

  }

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

    final UIMenu menu = (UIMenu) component;
    TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    final boolean disabled = menu.isDisabled();
    final boolean firstLevel = !RendererTypes.MENU.equals(menu.getParent().getRendererType());
    final boolean isParentMenu = menu.getChildCount() > 0; // todo: may be not correct
    final String clientId = menu.getClientId(facesContext);

    writer.startElement(HtmlElements.LI, menu);
    writer.writeClassAttribute(Classes.create(menu, firstLevel ? Markup.TOP : null));
    writer.writeIdAttribute(clientId);
    if (menu.getImage() != null) {
      Style style = new Style();
      style.setBackgroundImage("url(" + menu.getImage() + ")");
      writer.writeStyleAttribute(style);
    }
    writer.startElement(HtmlElements.A, menu);
    writer.writeAttribute(HtmlAttributes.HREF, "#", false);
View Full Code Here

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

  }

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

    UIMenu menu = (UIMenu) component;
    TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    boolean isParentMenu = menu.getChildCount() > 0; // todo: may be not correct
    if (isParentMenu) {
      writer.endElement(HtmlElements.OL);
    }
    writer.endElement(HtmlElements.LI);
View Full Code Here

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

    writer.writeIdAttribute(column.getClientId(facesContext));
    writer.writeClassAttribute(Classes.create(sheet, "selectorMenu"));
    writer.endElement(HtmlElements.DIV);

    if (UISheet.MULTI.equals(sheet.getSelectable())) {
      UIMenu menu = (UIMenu) CreateComponentUtils.createComponent(
          facesContext, UIMenu.COMPONENT_TYPE, RendererTypes.MENU, "selectorMenu");
      menu.setTransient(true);
      FacetUtils.setDropDownMenu(column, menu);
      menu.setImage("image/sheetSelectorMenu.gif");
      menu.setLabel("vv"); //todo remove this after fixing the image above

      String sheetId = column.getParent().getClientId(facesContext);

      createMenuItem(facesContext, menu, "sheetMenuSelect",
          "Tobago.Sheets.get('" + sheetId + "').selectAll()", "t_selectAll");
View Full Code Here

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

    // all: sub menu to select any tab directly
    final UICommand all = (UICommand) CreateComponentUtils.createComponent(
        facesContext, UICommand.COMPONENT_TYPE, null, viewRoot.createUniqueId());
    all.setOmit(true); // avoid submit

    final UIMenu menu = (UIMenu) CreateComponentUtils.createComponent(
        facesContext, UIMenu.COMPONENT_TYPE, RendererTypes.MENU, viewRoot.createUniqueId());
    menu.setTransient(true);
    ComponentUtils.addCurrentMarkup(menu, Markup.TOP);
    FacetUtils.setDropDownMenu(all, menu);
    int index = 0;
    for (final UIComponent child : tabGroup.getChildren()) {
      if (child instanceof UITab) {
        final UITab tab = (UITab) child;
        if (tab.isRendered()) {
          final UIMenuCommand entry = (UIMenuCommand) CreateComponentUtils.createComponent(
              facesContext, UIMenuCommand.COMPONENT_TYPE, RendererTypes.MENU_COMMAND, viewRoot.createUniqueId());
          entry.setTransient(true);
          entry.setOmit(true); // avoid submit
          final LabelWithAccessKey label = new LabelWithAccessKey(tab);
          entry.setLabel(label.getText());
          if (tab.isDisabled()) {
            entry.setDisabled(true);
          } else {
            ComponentUtils.putDataAttribute(entry, "tobago-index", index); // XXX todo, define a DataAttribute
          }
          menu.getChildren().add(entry);
        }
        index++;
      }
    }
    final UIToolBar toolBar = (UIToolBar) application.createComponent(UIToolBar.COMPONENT_TYPE);
View Full Code Here

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

  private UIToolBar createToolBar(final FacesContext facesContext, final UISheet sheet) {
    final Application application = facesContext.getApplication();
    final UICommand dropDown = (UICommand) CreateComponentUtils.createComponent(
        facesContext, UICommand.COMPONENT_TYPE, null, "dropDown");
    final UIMenu menu = (UIMenu) CreateComponentUtils.createComponent(
        facesContext, UIMenu.COMPONENT_TYPE, RendererTypes.MENU, "menu");
    FacetUtils.setDropDownMenu(dropDown, menu);
    final String sheetId = sheet.getClientId(facesContext);

    createMenuItem(facesContext, menu, "sheetMenuSelect", Markup.SHEET_SELECT_ALL, sheetId);
View Full Code Here

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

  private UIToolBar createToolBar(final FacesContext facesContext, final UISheet sheet) {
    final Application application = facesContext.getApplication();
    final UICommand dropDown = (UICommand) CreateComponentUtils.createComponent(
        facesContext, UICommand.COMPONENT_TYPE, null, "dropDown");
    final UIMenu menu = (UIMenu) CreateComponentUtils.createComponent(
        facesContext, UIMenu.COMPONENT_TYPE, RendererTypes.MENU, "menu");
    FacetUtils.setDropDownMenu(dropDown, menu);
    final String sheetId = sheet.getClientId(facesContext);

    createMenuItem(facesContext, menu, "sheetMenuSelect", Markup.SHEET_SELECT_ALL, sheetId);
View Full Code Here

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

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

    final UIMenu menu = (UIMenu) component;
    final boolean firstLevel = !RendererTypes.MENU.equals(menu.getParent().getRendererType());
    if (firstLevel) {
      ComponentUtils.addCurrentMarkup(menu, Markup.TOP);
    }
  }
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.