Package com.smartgwt.client.widgets.menu.events

Examples of com.smartgwt.client.widgets.menu.events.ClickHandler


    acceptHeadersSubMenu.setItems(constructTurtle, constructXml, constructCsv, constructTsv);
    return acceptHeadersSubMenu;
  }
 
  private ClickHandler getContentTypeClickHandler(final boolean isConstruct, final String contentType) {
    return new ClickHandler() {
      @Override
      public void onClick(MenuItemClickEvent event) {
        if (isConstruct) {
          view.getSelectedTabSettings().setConstructContentType(contentType);
        } else {
View Full Code Here


      }
    };
  }
  private MenuItem getQueryParamMenuItem() {
    MenuItem queryParam = new MenuItem("Add query parameters");
    queryParam.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(MenuItemClickEvent event) {
        drawParamListGrid();
      }
    });
View Full Code Here

 
  private void addSubmenuItems() {
    Menu autocompletionsSubMenu = new Menu()
       
    MenuItem propMethods = new MenuItem("Change property autocompletion methods");
    propMethods.addClickHandler(new ClickHandler(){

      @Override
      public void onClick(MenuItemClickEvent event) {
        JsMethods.showPropAutocompletionMethods();
      }});
    MenuItem classMethods = new MenuItem("Change class autocompletion methods");
    classMethods.addClickHandler(new ClickHandler(){
     
      @Override
      public void onClick(MenuItemClickEvent event) {
        JsMethods.showClassAutocompletionMethods();
      }});
    autocompletionsSubMenu.setItems(propMethods, classMethods);
   
    MenuItem localhostAutocompletion;
    if (view.getOpenId() != null && view.getOpenId().isLoggedIn()) {
      localhostAutocompletion = new MenuItem("Manage personal autocompletions");
      localhostAutocompletion.addClickHandler(new ClickHandler(){
        @Override
        public void onClick(MenuItemClickEvent event) {
          new AutocompletionsConfigWindow(view);
        }});
    } else {
View Full Code Here

     * Configure the menu that will be the context menu of the product
     */
    private void popupProducts() {
        //create an item to add themes
        MenuItem openItem = new MenuItem(constants.addTheme(), "edit_add.png");
        ClickHandler aux = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {
                createFormTheme(PRODUCTS);
            }
        };
        openItem.addClickHandler(aux);

        //item to view the product selected.
        MenuItem viewItem = new MenuItem(constants.viewProduct(), "info.png");
        ClickHandler auxView = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {
                po.manageProducts(idProductSelected, SHOW);
            }
        };
View Full Code Here

     * Configure the menu that will be the context menu of the themes
     */
    private void popupThemes(final TreeNodeThemes record) {
        //create an item to add themes
        MenuItem openItem = new MenuItem(constants.addTheme(), "edit_add.png");
        ClickHandler aux = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {
                createFormTheme(THEMES);
            }
        };
        openItem.addClickHandler(aux);

        //item to view the theme selected.
        MenuItem viewItem = new MenuItem(constants.viewTheme(), "info.png");
        ClickHandler auxView = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {               
                to.manageThemeAction(idItemSelected,record.getName(),record.getInfo(), SHOW);
            }
        };
        viewItem.addClickHandler(auxView);
        /*
        //create an item to add stories
        MenuItem saveAsItem = new MenuItem(constants.addStory(), "icono_documento.png");
        ClickHandler auxStory = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {
                 createFormStory();
            }
        };
        saveAsItem.addClickHandler(auxStory);
         */
        MenuItemSeparator separator = new MenuItemSeparator();
        /*
        //item to copy the subtree selected
        MenuItem copyItem = new MenuItem(constants.copy(), "copiar.jpg");
        ClickHandler auxCopyTheme = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {
                typeitemToCopy = typeItemSelected;
                itemToCopy = idItemSelected;
            }
        };
        copyItem.addClickHandler(auxCopyTheme);

        //item to paste the subtree copied
        MenuItem pasteItem = new MenuItem(constants.paste(), "pegar.jpg");
        ClickHandler auxPasteTheme = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {
                paste(itemToCopy, typeitemToCopy, idItemSelected, typeItemSelected);
            }
        };
        pasteItem.addClickHandler(auxPasteTheme);
         */
        //item to modify the story selected
        MenuItem modifyItem = new MenuItem(constants.modify(), "configure.png");
        ClickHandler auxHandler = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {
                  to.manageThemeAction(idItemSelected,record.getName(),record.getInfo(), MODIFY);
            }
        };
        modifyItem.addClickHandler(auxHandler);

        //item to delete the story selected
        MenuItem projectItem = new MenuItem(constants.delete(), "editdelete.png");
        ClickHandler auxdeletetheme = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {
                    if (com.google.gwt.user.client.Window.confirm(constants.sureDeleteTheme())) {
                        to.deleteTheme(idItemSelected);
                    }
View Full Code Here

     * Configure the menu that will be the context menu of the stories
     */
    private void popupStories() {
        //create an item to add tasks
        MenuItem openItem = new MenuItem(constants.addTask(), "view_detailed.png");
        ClickHandler aux = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {
                    createFormTask();
            }
        };
        openItem.addClickHandler(aux);

        //item to view the story selected.
        MenuItem viewItem = new MenuItem(constants.viewStory(), "info.png");
         ClickHandler auxView = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {
                so.manageStory(idItemSelected, SHOW);
            }
        };
        viewItem.addClickHandler(auxView);

        MenuItemSeparator separator = new MenuItemSeparator();

        //item to modify the story selected
        MenuItem modifyItem = new MenuItem(constants.modify(), "configure.png");
        ClickHandler auxHandler = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {
                   so.manageStory(idItemSelected, MODIFY);
            }
        };
        modifyItem.addClickHandler(auxHandler);

        //item to delete the story selected
        MenuItem projectItem = new MenuItem(constants.delete(), "editdelete.png");
        ClickHandler auxdeletestory = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {
                    if (com.google.gwt.user.client.Window.confirm(constants.sureDeleteStory())) {
                         so.deleteStory(idItemSelected);
                    }
View Full Code Here

     * @param typeItemSelected
     */
    public final void popupTasks(Menu menuPopup, final String idItemSelected, final String username, final int typeItemSelected) {
        //create an item to add tasks
        MenuItem saveItem = new MenuItem(constants.viewTask(), "info.png", "Ctrl+S");
        ClickHandler auxview = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {
                tko.manageTask(idItemSelected, SHOW);
            }
        };
        saveItem.addClickHandler(auxview);

        MenuItemSeparator separator = new MenuItemSeparator();

        //create an item to modify a task
        MenuItem modifyItem = new MenuItem(constants.modify(), "configure.png");
        ClickHandler auxhandler = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {
                   tko.manageTask(idItemSelected, MODIFY);
            }
        };
        modifyItem.addClickHandler(auxhandler);

        //create an item to delete a task
        MenuItem projectItem = new MenuItem(constants.delete(), "editdelete.png");
        ClickHandler auxdeletetask = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {
                if (com.google.gwt.user.client.Window.confirm(constants.sureDeleteTask())) {
                    tko.deleteTask(idItemSelected);
                }
            }
        };
        projectItem.addClickHandler(auxdeletetask);

        //select the subtree selected for copy
        MenuItem copyItem = new MenuItem(constants.copy(), "copiar.jpg");
        ClickHandler auxcopytheme = new ClickHandler() {
            @Override
            public void onClick(MenuItemClickEvent event) {
                typeitemToCopy = typeItemSelected;
                itemToCopy = idItemSelected;
            }
View Full Code Here

        closeItem.setKeyTitle("Alt+C");
        KeyIdentifier closeKey = new KeyIdentifier();
        closeKey.setAltKey(true);
        closeKey.setKeyName("C");
        closeItem.setKeys(closeKey);
        closeItem.addClickHandler(new ClickHandler() {
            public void onClick(MenuItemClickEvent event) {
                int selectedTab = mainTabSet.getSelectedTabNumber();
                mainTabSet.removeTab(selectedTab);
                mainTabSet.selectTab(selectedTab - 1);
            }
        });

        MenuItem closeAllButCurrent = new MenuItem("Close All But Current");
        closeAllButCurrent.setEnableIfCondition(enableCondition);
        closeAllButCurrent.addClickHandler(new ClickHandler() {
            public void onClick(MenuItemClickEvent event) {
                int selected = mainTabSet.getSelectedTabNumber();
                Tab[] tabs = mainTabSet.getTabs();
                int[] tabsToRemove = new int[tabs.length - 2];
                int cnt = 0;
                for (int i = 1; i < tabs.length; i++) {
                    if (i != selected) {
                        tabsToRemove[cnt] = i;
                        cnt++;
                    }
                }
                mainTabSet.removeTabs(tabsToRemove);
            }
        });

        MenuItem closeAll = new MenuItem("Close All");
        closeAll.setEnableIfCondition(enableCondition);
        closeAll.addClickHandler(new ClickHandler() {
            public void onClick(MenuItemClickEvent event) {
                Tab[] tabs = mainTabSet.getTabs();
                int[] tabsToRemove = new int[tabs.length - 1];

                for (int i = 1; i < tabs.length; i++) {
View Full Code Here

        final ListGrid countryGrid = new ListGrid() {
            @Override
            protected MenuItem[] getHeaderContextMenuItems(final Integer fieldNum) {
                final MenuItem[] items = super.getHeaderContextMenuItems(fieldNum);
                MenuItem customItem = new MenuItem("Hello + " + fieldNum);
                customItem.addClickHandler(new ClickHandler() {
                    public void onClick(MenuItemClickEvent event) {
                        SC.say("Hello Column : " + fieldNum);
                    }
                });
                MenuItem[] newItems = new MenuItem[items.length + 1];
View Full Code Here

TOP

Related Classes of com.smartgwt.client.widgets.menu.events.ClickHandler

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.