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

Examples of com.sencha.gxt.widget.core.client.menu.MenuItem$MenuItemAppearance


            }
          }
        }
      });
      Menu menu=new Menu();
      final MenuItem follow = new MenuItem("关注(接收报警)",
          new SelectionHandler<MenuItem>() {
            @Override
            public void onSelection(SelectionEvent<MenuItem> event) {
              final GroupJobTreeModel model = tree.getSelectionModel().getSelectedItem();
              int type = 0;
              if (model.isGroup()) {
                type = 1;
              } else if (model.isJob()) {
                type = 2;
              }
              RPCS.getTreeService().follow(type,
                  model.getId(),
                  new AbstractAsyncCallback<Void>() {
                    public void onSuccess(Void result) {
                      model.setFollow(true);
                      tree.refresh(model);
                      Info.display("成功", "关注成功");
                    }
                  });
                }
          });
      final MenuItem unfollow = new MenuItem("取消关注",
          new SelectionHandler<MenuItem>() {
            @Override
            public void onSelection(SelectionEvent<MenuItem> event) {
              final GroupJobTreeModel model = tree
                  .getSelectionModel().getSelectedItem();
              int type = 0;
              if (model.isGroup()) {
                type = 1;
              } else if (model.isJob()) {
                type = 2;
              }
              RPCS.getTreeService().unfollow(type,
                  model.getId(),
                  new AbstractAsyncCallback<Void>() {
                    public void onSuccess(Void result) {
                      model.setFollow(false);
                      tree.refresh(model);
                      Info.display("成功", "取消关注成功");
                    }
                  });
            }
          });
      menu.add(follow);
      menu.add(unfollow);
      tree.setContextMenu(menu);
      tree.addBeforeShowContextMenuHandler(new BeforeShowContextMenuHandler() {
        public void onBeforeShowContextMenu(BeforeShowContextMenuEvent event) {
          GroupJobTreeModel model=tree.getSelectionModel().getSelectedItem();
          if(model!=null){
            if(model.isFollow()){
              follow.hide();
              unfollow.show();
            }else{
              follow.show();
              unfollow.hide();
            }
          }
        }
      });
      filter=new StoreFilterField<GroupJobTreeModel>(){
View Full Code Here


          return null;
        }
      });

      Menu menu = new Menu();
      MenuItem reload = new MenuItem("重新加载",
          new SelectionHandler<MenuItem>() {
            @Override
            public void onSelection(SelectionEvent<MenuItem> event) {
              FileModel fm = commonTreeGrid.getSelectionModel()
                  .getSelectedItem();
              if (fm != null) {
                commonTreeStore.removeChildren(fm);
                loader.loadChildren(fm);
              }
            }
          });
      menu.add(reload);
      final MenuItem referMenuItem = getReferMenuItem(true);
      menu.add(referMenuItem);
      menu.addBeforeShowHandler(new BeforeShowHandler() {
        @Override
        public void onBeforeShow(BeforeShowEvent event) {
          if(getCommonTreeGrid().getSelectionModel().getSelectedItem().isFolder()){
            referMenuItem.setEnabled(false);
          }else{
            referMenuItem.setEnabled(true);
          }
        }
      });
      commonTreeGrid.setContextMenu(menu);
View Full Code Here

      ColumnModel<FileModel> cm = new ColumnModel<FileModel>(list);

      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()){
            referMenuItem.setEnabled(false);
          }else{
            referMenuItem.setEnabled(true);
          }
        }
      });
      myTreeGrid.setContextMenu(fileMenu);
      myTreeGrid.setHideHeaders(true);
View Full Code Here

  }
 


    private MenuItem getReferMenuItem(final boolean isCommon) {
        final MenuItem referMenuItem = new MenuItem("复制引用语句", new SelectionHandler<MenuItem>() {
        @Override
        public void onSelection(SelectionEvent<MenuItem> event) {
          FileModel m =isCommon?getCommonTreeGrid().getSelectionModel().getSelectedItem():getMyTreeGrid().getSelectionModel().getSelectedItem();
          Window w = new Window();
          final TextField f = new TextField(){
            @Override
            public void onBrowserEvent(Event event) {
              super.onBrowserEvent(event);
              selectAll();
            }
          };
          w.setModal(true);
          w.setHeadingText("脚本引用语句");
          w.setHeight(60);
          StringBuffer sb = new StringBuffer();
          sb.append("download[").append("doc://")
            .append(m.getId()).append(' ').append(m.getName().replace(' ', '_'))
            .append("]");
          f.setValue(sb.toString());
          f.setReadOnly(true);
          f.setWidth(350);
          w.setWidget(f);
          w.show();
          f.focus();
        }
      });
        referMenuItem.setIcon(Images.getImageResources().script());
      return referMenuItem;
    }
View Full Code Here

   
    setCollapsible(false);
   
    setContextMenu(contextMenu);
       
    stop = new MenuItem("停止运行", new SelectionHandler<MenuItem>() {
     
      @Override
      public void onSelection(final SelectionEvent<MenuItem> se) {
        final MessageBox box = new MessageBox("停止调试?", "确定要停止调试么?");
        box.setPredefinedButtons(
View Full Code Here

TOP

Related Classes of com.sencha.gxt.widget.core.client.menu.MenuItem$MenuItemAppearance

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.