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

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


  }

  private void addResetSettings() {
    MenuItem reset = new MenuItem("Reset my settings");
    reset.setIcon(Imgs.CROSS.get());
    reset.addClickHandler(new ClickHandler(){
      public void onClick(MenuItemClickEvent event) {
        LocalStorageHelper.clearSettings();
        Window.Location.reload();
      }});
    items.add(reset);
View Full Code Here


  }

  private void addTooltipsItem() {
    MenuItem about = new MenuItem("Show help bubbles");
    about.setIcon(Imgs.TOOLTIP.get());
    about.addClickHandler(new ClickHandler(){
      public void onClick(MenuItemClickEvent event) {
        view.showTooltips(0); //show from version 0 onwards
      }});
    items.add(about);
  }
View Full Code Here

  private void addOpenIdItem() {
    if (view.getSettings().isDbSet()) {
      if (view.getOpenId() != null && view.getOpenId().isLoggedIn()) {
        logOutMenuItem = new MenuItem("Log out");
        logOutMenuItem.setIcon(Imgs.LOG_OUT.get());
        logOutMenuItem.addClickHandler(new ClickHandler(){
          public void onClick(MenuItemClickEvent event) {
            view.getOpenId().logOut();
          }});
        items.add(logOutMenuItem);
      } else {
        logInMenuItem = new MenuItem("Log in");
        logInMenuItem.setIcon(Imgs.LOG_IN.get());
        logInMenuItem.addClickHandler(new ClickHandler(){
          public void onClick(MenuItemClickEvent event) {
            view.getOpenId().showOpenIdProviders();
          }});
        items.add(logInMenuItem);
      }
View Full Code Here

  }
 
  private void addAboutItem() {
    MenuItem about = new MenuItem("About (version " + StaticConfig.VERSION + ")");
    about.setIcon(Imgs.QUESTION_MARK.get());
    about.addClickHandler(new ClickHandler(){
      public void onClick(MenuItemClickEvent event) {
        new About(view);
      }});
    items.add(about);
  }
View Full Code Here

    if (!compatabilities.allSupported()) {
      compatibility.setIcon(Imgs.WARNING.get());
    } else {
      compatibility.setIcon(Imgs.COMPATIBLE.get());
    }
    compatibility.addClickHandler(new ClickHandler(){
      @Override
      public void onClick(MenuItemClickEvent event) {
        compatabilities.drawContent();
      }});
    items.add(compatibility);
View Full Code Here

  private void addRefreshSubMenu() {
   
    Menu refreshSubMenu = new Menu()
       
    MenuItem prefixUpdate = new MenuItem("Force prefixes update");
    prefixUpdate.addClickHandler(new ClickHandler(){

      @Override
      public void onClick(MenuItemClickEvent event) {
        view.setAutocompletePrefixes(true);
      }});
    MenuItem endpointsUpdate = null;
    if (view.getEnabledFeatures().endpointSelectionEnabled()) {
      endpointsUpdate = new MenuItem("Force endpoints update");
      endpointsUpdate.addClickHandler(new ClickHandler(){
        @Override
        public void onClick(MenuItemClickEvent event) {
          view.initEndpointDataSource(true);
        }});
    }
View Full Code Here

  private void setContextMenu() {
    Menu menu = new Menu();
    MenuItem copy = new MenuItem();
    copy.setTitle("Create copy");
    copy.setIcon(Imgs.COPY_TAB.get());
    copy.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(MenuItemClickEvent event) {
        int tabNumber = ((QueryTabs) getTabSet()).getTabNumber(getTabObject().getID());
        TabSettings tabSettings = (TabSettings) view.getSettings().getTabArray().get(tabNumber).clone();
        tabSettings.setTabTitle("Copy of " + tabSettings.getTabTitle());
        ((QueryTabs) getTabSet()).addTab(tabSettings, true);
        view.getSettings().addTabSettings(tabSettings);
      }
    });

    MenuItem renameTab = new MenuItem();
    renameTab.setTitle("Rename Tab");
    renameTab.setIcon(Imgs.EDIT_TEXT.get());
    renameTab.addClickHandler(new ClickHandler() {

      @Override
      public void onClick(MenuItemClickEvent event) {
        ((QueryTabs) getTabSet()).editTabTitle(getTabObject());
      }
    });
    MenuItem closeTab = new MenuItem();
    closeTab.setTitle("Close");
    closeTab.setIcon(Imgs.CLOSE_TAB_SINGLE.get());
    closeTab.addClickHandler(new ClickHandler() {

      @Override
      public void onClick(MenuItemClickEvent event) {
        ((QueryTabs) getTabSet()).removeAndPostProcessTab(getTabObject());
        view.getHistory().setHistoryCheckpoint();
      }
    });
    MenuItem closeOtherTabs = new MenuItem();
    closeOtherTabs.setTitle("Close others");
    closeOtherTabs.setIcon(Imgs.CLOSE_TAB_OTHERS.get());
    closeOtherTabs.addClickHandler(new ClickHandler() {

      @Override
      public void onClick(MenuItemClickEvent event) {
        ((QueryTabs) getTabSet()).removeAllExcept(getTabObject());
        view.getHistory().setHistoryCheckpoint();
      }
    });

    MenuItem closeAll = new MenuItem();
    closeAll.setTitle("Close all");
    closeAll.setIcon(Imgs.CLOSE_TAB_ALL.get());
    closeAll.addClickHandler(new ClickHandler() {

      @Override
      public void onClick(MenuItemClickEvent event) {
        ((QueryTabs) getTabSet()).removeAllTabs();
        view.getHistory().setHistoryCheckpoint();
View Full Code Here

    setMenu(mainMenu);
  }
 
  private MenuItem getNamedGraphMenuItem() {
    MenuItem namedGraphMenuItem = new MenuItem("Specify Named Graphs");
    namedGraphMenuItem.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(MenuItemClickEvent event) {
        drawGraphWindow(GraphListGrid.GraphArgType.NAMED_GRAPH);
      }
    });
View Full Code Here

      }});
    return namedGraphMenuItem;
  }
  private MenuItem getDefaultGraphMenuItem() {
    MenuItem defaultGraphMenuItem = new MenuItem("Specify Default Graphs");
    defaultGraphMenuItem.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(MenuItemClickEvent event) {
        drawGraphWindow(GraphListGrid.GraphArgType.DEFAULT_GRAPH);
      }
    });
View Full Code Here

      @Override
      public boolean execute(Canvas target, Menu menu, MenuItem item) {
        return view.getSelectedTabSettings().getRequestMethod().equals(REQUEST_GET);
      }});
   
    post.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(MenuItemClickEvent event) {
        view.getSelectedTabSettings().setRequestMethod(REQUEST_POST);
        LocalStorageHelper.storeSettings(view.getSettings());
      }
    });
    get.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(MenuItemClickEvent event) {
        view.getSelectedTabSettings().setRequestMethod(REQUEST_GET);
        LocalStorageHelper.storeSettings(view.getSettings());
      }
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.