コード例 #1
0
  @WorkbenchMenu
  public Menus buildMenu() {
    return MenuFactory.newTopLevelCustomMenu(
            new MenuFactory.CustomMenuBuilder() {
              @Override
              public void push(MenuFactory.CustomMenuBuilder element) {}

              @Override
              public MenuItem build() {
                return new BaseMenuCustom<Button>() {

                  @Override
                  public Button build() {
                    return new Button() {
                      {
                        setIcon(IconType.HOME);
                        setTitle(Constants.INSTANCE.Home());
                        setSize(ButtonSize.SMALL);
                        addClickHandler(
                            new ClickHandler() {
                              @Override
                              public void onClick(ClickEvent event) {
                                refreshCacheAndGeneratesSelectEvent(loggedUser.getIdentifier());
                              }
                            });
                      }
                    };
                  }
                };
              }
            })
        .endMenu()
        .build();
  }
コード例 #2
0
 @WorkbenchMenu
 public Menus buildMenu() {
   return MenuFactory.newTopLevelCustomMenu(serverTemplateSelectorMenuBuilder)
       .endMenu()
       .newTopLevelCustomMenu(new RefreshMenuBuilder(this))
       .endMenu()
       .build();
 }
  @WorkbenchMenu
  public Menus buildMenu() {
    return MenuFactory.newTopLevelCustomMenu(
            new MenuFactory.CustomMenuBuilder() {

              @Override
              public void push(MenuFactory.CustomMenuBuilder element) {}

              @Override
              public MenuItem build() {
                return new BaseMenuCustom<IsWidget>() {

                  @Override
                  public IsWidget build() {
                    return view.getNewInstanceButton();
                  }
                };
              }
            })
        .endMenu()
        .newTopLevelCustomMenu(
            new MenuFactory.CustomMenuBuilder() {

              @Override
              public void push(MenuFactory.CustomMenuBuilder element) {}

              @Override
              public MenuItem build() {
                return new BaseMenuCustom<IsWidget>() {

                  @Override
                  public IsWidget build() {
                    return view.getOptionsButton();
                  }
                };
              }
            })
        .endMenu()
        .newTopLevelCustomMenu(
            new MenuFactory.CustomMenuBuilder() {

              @Override
              public void push(MenuFactory.CustomMenuBuilder element) {}

              @Override
              public MenuItem build() {
                return new BaseMenuCustom<IsWidget>() {

                  @Override
                  public IsWidget build() {
                    return view.getRefreshButton();
                  }
                };
              }
            })
        .endMenu()
        .newTopLevelCustomMenu(
            new MenuFactory.CustomMenuBuilder() {

              @Override
              public void push(MenuFactory.CustomMenuBuilder element) {}

              @Override
              public MenuItem build() {
                return new BaseMenuCustom<IsWidget>() {

                  @Override
                  public IsWidget build() {
                    return view.getCloseButton();
                  }
                };
              }
            })
        .endMenu()
        .build();
  }