Package com.sencha.gxt.widget.core.client.menu

Examples of com.sencha.gxt.widget.core.client.menu.SeparatorMenuItem$SeparatorMenuItemAppearance


  }

  protected void addWidgetToMenu(Menu menu, Widget w) {
    // TODO do we really want all these types referenced here?
    if (w instanceof SeparatorToolItem) {
      menu.add(new SeparatorMenuItem());

    } else if (w instanceof SplitButton) {
      final SplitButton sb = (SplitButton) w;
      MenuItem item = new MenuItem(sb.getText(), sb.getIcon());
      item.setEnabled(sb.isEnabled());
      item.setItemId(sb.getItemId());
      if (sb.getData("gxt-menutext") != null) {
        item.setText(sb.getData("gxt-menutext").toString());
      }
      if (sb.getMenu() != null) {
        item.setSubMenu(sb.getMenu());
      }

      item.addSelectionHandler(new SelectionHandler<Item>() {

        @Override
        public void onSelection(SelectionEvent<Item> event) {
          sb.fireEvent(new SelectEvent());
        }
      });
      menu.add(item);

    } else if (w instanceof TextButton) {
      final TextButton b = (TextButton) w;

      MenuItem item = new MenuItem(b.getText(), b.getIcon());
      item.setItemId(b.getItemId());

      if (b.getData("gxt-menutext") != null) {
        item.setText(b.getData("gxt-menutext").toString());
      }
      if (b.getMenu() != null) {
        item.setHideOnClick(false);
        item.setSubMenu(b.getMenu());
      }
      item.setEnabled(b.isEnabled());

      item.addSelectionHandler(new SelectionHandler<Item>() {

        @Override
        public void onSelection(SelectionEvent<Item> event) {
          b.fireEvent(new SelectEvent());
        }
      });

      menu.add(item);
    } else if (w instanceof ButtonGroup) {
      ButtonGroup g = (ButtonGroup) w;
      g.setItemId(g.getItemId());
      menu.add(new SeparatorMenuItem());
      String heading = g.getHeadingText();
      if (heading != null && heading.length() > 0 && !heading.equals("&#160;")) {
        menu.add(new HeaderMenuItem(heading));
      }

      Widget con = g.getWidget();
      if (con != null && con instanceof HasWidgets) {
        HasWidgets widgets = (HasWidgets) con;
        Iterator<Widget> it = widgets.iterator();
        while (it.hasNext()) {
          addWidgetToMenu(menu, it.next());
        }
      }

      menu.add(new SeparatorMenuItem());
    } else if (w instanceof ToggleButton) {
      final ToggleButton b = (ToggleButton) w;

      final CheckMenuItem item = new CheckMenuItem(b.getText());
      item.setItemId(b.getItemId());
View Full Code Here


          @Override
          public void onSelection(SelectionEvent<Item> event) {
            groupBy(cm.getColumn(colIndex));
          }
        });
        menu.add(new SeparatorMenuItem());
        menu.add(groupBy);

        groupBy.setEnabled(cm.getColumnCount(true) > 1);

        initMenuColumnShowHideHandling(menu, groupBy);
View Full Code Here

  protected void onContextMenu(HeaderContextMenuEvent event) {
    int column = event.getColumnIndex();

    if (separatorItem == null) {
      separatorItem = new SeparatorMenuItem();
    }
    separatorItem.removeFromParent();

    if (checkFilterItem == null) {
      checkFilterItem = new CheckMenuItem(DefaultMessages.getMessages().gridFilters_filterText());
View Full Code Here

    afterMenu = new DateMenu();
    afterMenu.addValueChangeHandler(handler);
    afterItem.setSubMenu(afterMenu);
    menu.add(afterItem);

    menu.add(new SeparatorMenuItem());

    onItem = new CheckMenuItem();
    onItem.addCheckChangeHandler(handler);
    onMenu = new DateMenu();
    onMenu.addValueChangeHandler(handler);
View Full Code Here

  protected void onContextMenu(HeaderContextMenuEvent event) {
    int column = event.getColumnIndex();

    if (separatorItem == null) {
      separatorItem = new SeparatorMenuItem();
    }
    separatorItem.removeFromParent();

    if (checkFilterItem == null) {
      checkFilterItem = new CheckMenuItem(DefaultMessages.getMessages().gridFilters_filterText());
View Full Code Here

          @Override
          public void onSelection(SelectionEvent<Item> event) {
            groupBy(cm.getColumn(colIndex));
          }
        });
        menu.add(new SeparatorMenuItem());
        menu.add(groupBy);
      }
      if (enableGrouping && enableNoGroups) {
        final CheckMenuItem showInGroups = new CheckMenuItem(
            DefaultMessages.getMessages().groupingView_showGroupsText());
View Full Code Here

    afterMenu = new DateMenu();
    afterMenu.addValueChangeHandler(handler);
    afterItem.setSubMenu(afterMenu);
    menu.add(afterItem);

    menu.add(new SeparatorMenuItem());

    onItem = new CheckMenuItem();
    onItem.addCheckChangeHandler(handler);
    onMenu = new DateMenu();
    onMenu.addValueChangeHandler(handler);
View Full Code Here

  }

  protected void addWidgetToMenu(Menu menu, Widget w) {
    // TODO do we really want all these types referenced here?
    if (w instanceof SeparatorToolItem) {
      menu.add(new SeparatorMenuItem());

    } else if (w instanceof SplitButton) {
      final SplitButton sb = (SplitButton) w;
      MenuItem item = new MenuItem(sb.getText(), sb.getIcon());
      item.setEnabled(sb.isEnabled());
      item.setItemId(sb.getItemId());
      if (sb.getData("gxt-menutext") != null) {
        item.setText(sb.getData("gxt-menutext").toString());
      }
      if (sb.getMenu() != null) {
        item.setSubMenu(sb.getMenu());
      }

      item.addSelectionHandler(new SelectionHandler<Item>() {

        @Override
        public void onSelection(SelectionEvent<Item> event) {
          sb.fireEvent(new SelectEvent());
        }
      });
      menu.add(item);

    } else if (w instanceof TextButton) {
      final TextButton b = (TextButton) w;

      MenuItem item = new MenuItem(b.getText(), b.getIcon());
      item.setItemId(b.getItemId());

      if (b.getData("gxt-menutext") != null) {
        item.setText(b.getData("gxt-menutext").toString());
      }
      if (b.getMenu() != null) {
        item.setHideOnClick(false);
        item.setSubMenu(b.getMenu());
      }
      item.setEnabled(b.isEnabled());

      item.addSelectionHandler(new SelectionHandler<Item>() {

        @Override
        public void onSelection(SelectionEvent<Item> event) {
          b.fireEvent(new SelectEvent());
        }
      });

      menu.add(item);
    } else if (w instanceof ButtonGroup) {
      ButtonGroup g = (ButtonGroup) w;
      g.setItemId(g.getItemId());
      menu.add(new SeparatorMenuItem());
      String heading = g.getHeadingText();
      if (heading != null && heading.length() > 0 && !heading.equals("&#160;")) {
        menu.add(new HeaderMenuItem(heading));
      }

      Widget con = g.getWidget();
      if (con != null && con instanceof HasWidgets) {
        HasWidgets widgets = (HasWidgets) con;
        Iterator<Widget> it = widgets.iterator();
        while (it.hasNext()) {
          addWidgetToMenu(menu, it.next());
        }
      }

      menu.add(new SeparatorMenuItem());
    } else if (w instanceof ToggleButton) {
      final ToggleButton b = (ToggleButton)w;
     
      final CheckMenuItem item = new CheckMenuItem(b.getText());
      item.setItemId(b.getItemId());
View Full Code Here

  public Menu getFileMenu() {
    if (fileMenu == null) {
      fileMenu = new Menu();
      fileMenu.add(getCreateFolderMenuItem());
      fileMenu.add(new SeparatorMenuItem());
      fileMenu.add(getCreateHiveMenuItem());
      fileMenu.add(getCreateShellMenuItem());
      fileMenu.add(getCreateTextMenuItem());
      fileMenu.add(new SeparatorMenuItem());
      fileMenu.add(getExpandMenuItem());
      fileMenu.add(getCollapseMenuItem());
      fileMenu.add(new SeparatorMenuItem());
      fileMenu.add(getEditNameMenuItem());
      fileMenu.add(new SeparatorMenuItem());
      fileMenu.add(getOpenMenuItem());
      fileMenu.add(new SeparatorMenuItem());
      fileMenu.add(getDeleteMenuItem());
      fileMenu.addBeforeShowHandler(getBeforeShowHandler());
    }
    return fileMenu;
  }
View Full Code Here

      myTreeGrid = new FileTreeGrid(context, getMyTreeStore(), cm, name);
      Menu fileMenu = new FileMenu(fileManagerPresenter)
          .getFileMenu();
      final MenuItem referMenuItem = getReferMenuItem(false);
      fileMenu.add(new SeparatorMenuItem());
      fileMenu.add(referMenuItem);
      fileMenu.addBeforeShowHandler(new BeforeShowHandler() {
        @Override
        public void onBeforeShow(BeforeShowEvent event) {
          if(getMyTreeGrid().getSelectionModel().getSelectedItem().isFolder()){
View Full Code Here

TOP

Related Classes of com.sencha.gxt.widget.core.client.menu.SeparatorMenuItem$SeparatorMenuItemAppearance

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.