Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.SelectionAdapter


    button_ok.setImage(SWTImageRepository.getImage("ok.png"));
    GridData data = new GridData();
    data.horizontalAlignment = GridData.CENTER;
    data.widthHint = 60;
    button_ok.setLayoutData(data);
    button_ok.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        shell.close();
    }});
   
    shell.setSize(300,400);
View Full Code Here


    popup_menu = new Menu(peers_table);
   
    MenuItem column_setup = new MenuItem(popup_menu,SWT.NONE);
    column_setup.setText(_._("uploadinfowindow.tab.peerlist.menu.column_setup"));
    column_setup.setImage(SWTImageRepository.getImage("columns_setup.png"));
    column_setup.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        peers_table.showColumnEditorWindow();
      }
    });
   
View Full Code Here

    grid_data.horizontalAlignment = GridData.END;
    grid_data.widthHint = 60;
    grid_data.grabExcessHorizontalSpace = true;
    button.setLayoutData(grid_data);
   
    button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        shell.close();
      }
    });
  }
View Full Code Here

    no_downloads_menu = new Menu(this);
   
    MenuItem paste_ed2k_file_links = new MenuItem(no_downloads_menu,SWT.PUSH);
    paste_ed2k_file_links.setText(_._("mainwindow.transferstab.downloads.popupmenu.paste_ed2k_links"));
    paste_ed2k_file_links.setImage(SWTImageRepository.getImage("ed2k_link_paste.png"));
    paste_ed2k_file_links.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        pasteED2KLink();
    }});

    new MenuItem(no_downloads_menu,SWT.SEPARATOR);
   
    MenuItem column_setup = new MenuItem(no_downloads_menu,SWT.PUSH);
    column_setup.setText(_._("mainwindow.transferstab.downloads.popupmenu.column_setup"));
    column_setup.setImage(SWTImageRepository.getImage("columns_setup.png"));
    column_setup.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        showColumnEditorWindow();
      }
    });
   
    single_download_selected = new Menu(this);
   
    set_download_status = new MenuItem(single_download_selected,SWT.PUSH);
    set_download_status.setText(_._("mainwindow.transferstab.downloads.popupmenu.start_download"));
    set_download_status.setImage(SWTImageRepository.getImage("start_download.png"));
    set_download_status.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        if (getSelectedObject().isStarted())
          stopSelectedDownloads();
        else
          startSelectedDownloads();
    }});
   
    MenuItem single_cancel_download = new MenuItem(single_download_selected,SWT.PUSH);
    single_cancel_download.setText(_._("mainwindow.transferstab.downloads.popupmenu.cancel_download"));
    single_cancel_download.setImage(SWTImageRepository.getImage("cancel.png"));
    single_cancel_download.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        cancelSelectedDownloads();
    }});
     
    new MenuItem(single_download_selected,SWT.SEPARATOR);
   
    MenuItem copy_ed2k_link = new MenuItem(single_download_selected,SWT.PUSH);
    copy_ed2k_link.setText(_._("mainwindow.transferstab.downloads.popupmenu.copy_ed2k_link"));
    copy_ed2k_link.setImage(SWTImageRepository.getImage("ed2k_link.png"));
    copy_ed2k_link.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        copyED2KLink();
      }
    });
   
   
    MenuItem paste_ed2k_link = new MenuItem(single_download_selected,SWT.PUSH);
    paste_ed2k_link.setText(_._("mainwindow.transferstab.downloads.popupmenu.paste_ed2k_link"));
    paste_ed2k_link.setImage(SWTImageRepository.getImage("ed2k_link_paste.png"));
    paste_ed2k_link.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        pasteED2KLink();
    }});
   
    new MenuItem(single_download_selected,SWT.SEPARATOR);
   
    column_setup = new MenuItem(single_download_selected,SWT.PUSH);
    column_setup.setText(_._("mainwindow.transferstab.downloads.popupmenu.column_setup"));
    column_setup.setImage(SWTImageRepository.getImage("columns_setup.png"));
    column_setup.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        showColumnEditorWindow();
    }});
   
    new MenuItem(single_download_selected,SWT.SEPARATOR);
   
    MenuItem download_details = new MenuItem(single_download_selected,SWT.PUSH);
    download_details.setText(_._("mainwindow.transferstab.downloads.popupmenu.details"));
    download_details.setImage(SWTImageRepository.getImage("info.png"));
   
    download_details.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        try {
          DownloadInfoWindow download_info_window = new DownloadInfoWindow(getSelectedObject());
          download_info_window.getCoreComponents();
          download_info_window.initUIComponents();
        }catch(Throwable es) {
          es.printStackTrace();
        }
    }});
   
    multiple_downloads_selected = new Menu(this);
   
    multiple_start_download = new MenuItem(multiple_downloads_selected,SWT.PUSH);
    multiple_start_download.setText(_._("mainwindow.transferstab.downloads.popupmenu.start_downloads"));
    multiple_start_download.setImage(SWTImageRepository.getImage("start_download.png"));
    multiple_start_download.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        startSelectedDownloads();
    }});
   
    multiple_stop_download = new MenuItem(multiple_downloads_selected,SWT.PUSH);
    multiple_stop_download.setText(_._("mainwindow.transferstab.downloads.popupmenu.stop_downloads"));
    multiple_stop_download.setImage(SWTImageRepository.getImage("stop_download.png"));
    multiple_stop_download.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        stopSelectedDownloads();
    }});
   
    MenuItem multiple_cancel_download = new MenuItem(multiple_downloads_selected,SWT.PUSH);
    multiple_cancel_download.setText(_._("mainwindow.transferstab.downloads.popupmenu.cancel_downloads"));
    multiple_cancel_download.setImage(SWTImageRepository.getImage("cancel.png"));
    multiple_cancel_download.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        cancelSelectedDownloads();
    }})
   
    new MenuItem(multiple_downloads_selected,SWT.SEPARATOR);
   
    MenuItem multiple_copy_ed2k_links = new MenuItem(multiple_downloads_selected, SWT.PUSH);
    multiple_copy_ed2k_links.setText(_._("mainwindow.transferstab.downloads.popupmenu.copy_ed2k_links"));
    multiple_copy_ed2k_links.setImage(SWTImageRepository.getImage("ed2k_link_paste.png"));
    multiple_copy_ed2k_links.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        copyED2KLink();
      }
    });
   
    new MenuItem(multiple_downloads_selected,SWT.SEPARATOR);
   
    column_setup = new MenuItem(multiple_downloads_selected,SWT.PUSH);
    column_setup.setText(_._("mainwindow.transferstab.downloads.popupmenu.column_setup"));
    column_setup.setImage(SWTImageRepository.getImage("columns_setup.png"));
    column_setup.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        showColumnEditorWindow();
    }});
   
    for(DownloadSession session : download_manager.getDownloads() ) {
View Full Code Here

    grid_data.widthHint = 60;
    grid_data.grabExcessHorizontalSpace = true;
    button_ok.setFocus();
    button_ok.setLayoutData(grid_data);
   
    button_ok.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        shell.close();
      }
    });
   
View Full Code Here

      setKadStatus.setEnabled(false);
    }
    g = new GridData();
    g.widthHint = 150;
    setKadStatus.setLayoutData(g);
    setKadStatus.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        if (_core.getJKadManager().isConnected())
          _core.getJKadManager().disconnect();
        else
          if (_core.getJKadManager().isConnecting())
View Full Code Here

   
    final MenuItem copy_item = new MenuItem(popup_menu,SWT.PUSH);
    copy_item.setText(_._("mainwindow.logtab.popupmenu.copy"));
    copy_item.setImage(SWTImageRepository.getImage("copy.png"));
   
    copy_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        Utils.setClipBoardText(log_content.getSelectionText());
      }
    });
   
    final MenuItem save_item = new MenuItem(popup_menu,SWT.PUSH);
    save_item.setText(_._("mainwindow.logtab.popupmenu.save"));
    save_item.setImage(SWTImageRepository.getImage("save.png"));
    save_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        FileDialog dialog = new FileDialog (getShell(), SWT.SAVE);
        dialog.setFilterNames (new String [] {"All Files (*.*)"});
        dialog.setFilterExtensions (new String [] {"*.*"});
        dialog.open();
        String filename = dialog.getFileName();
        if (filename == null) return ;
        final String full_path = (dialog.getFilterPath() + File.separator + filename);
        final String content = log_content.getText();
        new Thread( new JMRunnable() {
          public void JMRun() {
            try {
              FileWriter file_writer = new FileWriter(full_path);
              file_writer.write(content);
              file_writer.close();
            } catch (IOException e) {
            }
          }}).start();
      }
    });
   
    final MenuItem select_all_item = new MenuItem(popup_menu,SWT.PUSH);
    select_all_item.setText(_._("mainwindow.logtab.popupmenu.select_all"));
    select_all_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        log_content.selectAll();
      }
    });
   
    new MenuItem(popup_menu,SWT.SEPARATOR);
   
    final MenuItem clear_item = new MenuItem(popup_menu,SWT.PUSH);
    clear_item.setText(_._("mainwindow.logtab.popupmenu.clear"));
    clear_item.setImage(SWTImageRepository.getImage("remove_all.png"));
    clear_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        log_content.setText("");
      }
    });
   
View Full Code Here

    button_close.setLayoutData(grid_data);
   
    button_close.setFont(skin.getButtonFont());
    button_close.setText(Localizer._("uploadinfowindow.button.close"));
   
    button_close.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        for(Refreshable refreshable : tabs) {
          GUIUpdater.getInstance().removeRefreshable(refreshable);
        }
        shell.close();
View Full Code Here

   
    MenuItem new_server_item = new MenuItem(new_submenu,SWT.PUSH);
    new_server_item.setText(_._("mainwindow.mainmenu.file.new.new_server"));
    new_server_item.setImage(SWTImageRepository.getMenuImage("server_add.png"));
   
    new_server_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        new NewWindow(NewWindow.WindowType.SERVER);     
      }
    });
   
    MenuItem new_download_item = new MenuItem(new_submenu,SWT.PUSH);
    new_download_item.setText(_._("mainwindow.mainmenu.file.new.new_download"));
    new_download_item.setImage(SWTImageRepository.getMenuImage("folder_down.png"));
    new_download_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        new NewWindow(NewWindow.WindowType.DOWNLOAD);     
      }
    });
   
    MenuItem new_shared_folder_item = new MenuItem(new_submenu,SWT.PUSH);
    new_shared_folder_item.setText(_._("mainwindow.mainmenu.file.new.new_shared_dir"));
    new_shared_folder_item.setImage(SWTImageRepository.getMenuImage("share_folder.png"));
    new_shared_folder_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        new NewWindow(NewWindow.WindowType.SHARED_DIR);     
      }
    });
   
    MenuItem import_servers = new MenuItem (submenu, SWT.PUSH);
    import_servers.setText(Localizer._("mainwindow.mainmenu.file.import"));
    import_servers.setImage(SWTImageRepository.getMenuImage("import.png"));
    import_servers.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        ServerListImportWindow window = new ServerListImportWindow();
        window.getCoreComponents();
        window.initUIComponents();
      }
     
    });
   
    new MenuItem (submenu, SWT.SEPARATOR);

    MenuItem exit_item = new MenuItem (submenu, SWT.PUSH);
    exit_item.setText(Localizer._("mainwindow.mainmenu.file.exit"));
    exit_item.setImage(SWTImageRepository.getMenuImage("door_in.png"));
    exit_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.close();
      }
     
    });
   
    // View menu
    MenuItem viewItem = new MenuItem (this, SWT.CASCADE);
    viewItem.setText (Localizer._("mainwindow.mainmenu.view"));
   
    submenu = new Menu (shell, SWT.DROP_DOWN);
    viewItem.setMenu (submenu);
   
    MenuItem tabs_item = new MenuItem (submenu, SWT.CASCADE);
    tabs_item.setText(Localizer._("mainwindow.mainmenu.view.tabs"));
   
    Menu tabs_menu = new Menu (submenu);
    tabs_item.setMenu(tabs_menu);
   
    MenuItem servers_item = new MenuItem (tabs_menu, SWT.RADIO);
    servers_item.setText(Localizer._("mainwindow.mainmenu.view.tabs.servers"));
    tab_map.put(JMULE_TABS.SERVERLIST,servers_item);
   
    servers_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.setTab(JMULE_TABS.SERVERLIST);
      }
    });
   
    MenuItem kad_item = new MenuItem (tabs_menu, SWT.RADIO);
    kad_item.setText(Localizer._("mainwindow.mainmenu.view.tabs.kad"));
    tab_map.put(JMULE_TABS.KAD,kad_item);
   
    kad_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.setTab(JMULE_TABS.KAD);
      }
    });
   
    MenuItem transfers_item = new MenuItem (tabs_menu, SWT.RADIO);
    transfers_item.setText(Localizer._("mainwindow.mainmenu.view.tabs.transfers"));
    tab_map.put(JMULE_TABS.TRANSFERS,transfers_item);
    transfers_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.setTab(JMULE_TABS.TRANSFERS);
      }
    });
   
    MenuItem search_item = new MenuItem (tabs_menu, SWT.RADIO);
    search_item.setText(Localizer._("mainwindow.mainmenu.view.tabs.search"));
    tab_map.put(JMULE_TABS.SEARCH ,search_item);
   
    search_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.setTab(JMULE_TABS.SEARCH);
      }
     
    });
   
    MenuItem shared_item = new MenuItem (tabs_menu, SWT.RADIO);
    shared_item.setText(Localizer._("mainwindow.mainmenu.view.tabs.shared"));
    tab_map.put(JMULE_TABS.SHARED,shared_item);
   
    shared_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.setTab(JMULE_TABS.SHARED);
      }
     
    });
   
    MenuItem stats_item = new MenuItem (tabs_menu, SWT.RADIO);
    stats_item.setText(Localizer._("mainwindow.mainmenu.view.tabs.stats"));
    tab_map.put(JMULE_TABS.STATISTICS,stats_item);
    stats_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.setTab(JMULE_TABS.STATISTICS);
      }
    });
   
    MenuItem log_item = new MenuItem (tabs_menu, SWT.RADIO);
    log_item.setText(Localizer._("mainwindow.mainmenu.view.tabs.logs"));
    tab_map.put(JMULE_TABS.LOGS,log_item);
    log_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.setTab(JMULE_TABS.LOGS);
      }
    });
   
    MenuItem toolbar_item = new MenuItem (submenu, SWT.CHECK);
    if (!SWTPreferences.getInstance().isToolBarVisible())
      toolbar_item.setSelection(false);
    else
      toolbar_item.setSelection(true);
    toolbar_item.setText(Localizer._("mainwindow.mainmenu.view.toolbar"));
    toolbar_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.toolbarToogleVisibility();
      }
     
    });
   
    MenuItem status_item = new MenuItem (submenu, SWT.CHECK);
    if (!SWTPreferences.getInstance().isStatusBarVisible())
      status_item.setSelection(false);
    else
      status_item.setSelection(true);
    status_item.setText(Localizer._("mainwindow.mainmenu.view.statusbar"));
    status_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.statusBarToogleVisibility();
      }
    });
   
    //Tools menu
    MenuItem toolsItem = new MenuItem (this, SWT.CASCADE);
    toolsItem.setText (Localizer._("mainwindow.mainmenu.tools"));
    submenu = new Menu (shell, SWT.DROP_DOWN);
    toolsItem.setMenu (submenu);
   
    MenuItem gui_chooser_item = new MenuItem (submenu, SWT.PUSH);
    gui_chooser_item.setImage(SWTImageRepository.getMenuImage("switchui.png"));
    gui_chooser_item.setText(Localizer._("mainwindow.mainmenu.tools.uichooser"));
    gui_chooser_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        UIChooserWizad ui_chooser_wizard = new UIChooserWizad(new JFrame());
        ui_chooser_wizard.setSize(500, 400);
        ui_chooser_wizard.setVisible(true);
      }
    });
   
    MenuItem wizard_item = new MenuItem (submenu, SWT.PUSH);
    wizard_item.setImage(SWTImageRepository.getMenuImage("wizard.png"));
    wizard_item.setText(Localizer._("mainwindow.mainmenu.tools.wizard"));
    wizard_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        SetupWizard setup_wizard = new SetupWizard();
        setup_wizard.setVisible(true);
      }
    });
   
    new MenuItem (submenu, SWT.SEPARATOR);
   
    MenuItem options_item = new MenuItem (submenu, SWT.PUSH);
    options_item.setImage(SWTImageRepository.getMenuImage("cog_edit.png"));
    options_item.setText(Localizer._("mainwindow.mainmenu.tools.options"));
   
    options_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        SettingsWindow window = new SettingsWindow();
        window.getCoreComponents();
        window.initUIComponents();
      }
    });
   
    // Help menu
    MenuItem helpItem = new MenuItem (this, SWT.CASCADE);
    helpItem.setText (Localizer._("mainwindow.mainmenu.help"));

    submenu = new Menu (shell, SWT.DROP_DOWN);
    helpItem.setMenu (submenu);
   
    MenuItem open_support_item = new MenuItem (submenu, SWT.PUSH);
    open_support_item.setText(Localizer._("mainwindow.mainmenu.help.open_support"));
    open_support_item.setImage(SWTImageRepository.getMenuImage("world_link.png"));
    open_support_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        SWTThread.getDisplay().asyncExec(new JMRunnable() {
          public void JMRun() {
            Program.launch(JMConstants.OPEN_SUPPORT);
          }
        })
      }
    });
   
    MenuItem bugtracker_item = new MenuItem (submenu, SWT.PUSH);
    bugtracker_item.setText(Localizer._("mainwindow.mainmenu.help.bug_tracker"));
    bugtracker_item.setImage(SWTImageRepository.getMenuImage("world_link.png"));
    bugtracker_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        SWTThread.getDisplay().asyncExec(new JMRunnable() {
          public void JMRun() {
            Program.launch(JMConstants.JMULE_BUG_TRACKER);
          }
        })
      }
    });
   
    /*MenuItem help_contents_item = new MenuItem (submenu, SWT.PUSH);
    help_contents_item.setText(Localizer._("mainwindow.mainmenu.help.contents"));
    help_contents_item.setImage(SWTImageRepository.getMenuImage("world_link.png"));
    help_contents_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        SWTThread.getDisplay().asyncExec(new JMRunnable() {
          public void JMRun() {
            Program.launch(JMConstants.ONLINE_HELP_WEB_SITE);
          }
        }); 
      }
    });*/
   
    MenuItem forum_item = new MenuItem (submenu, SWT.PUSH);
    forum_item.setText(Localizer._("mainwindow.mainmenu.help.forum"));
    forum_item.setImage(SWTImageRepository.getMenuImage("world_link.png"));
    forum_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        SWTThread.getDisplay().asyncExec(new JMRunnable() {
          public void JMRun() {
            Program.launch(JMConstants.JMULE_FORUMS);
          }
        });
      }
    });
   
    new MenuItem (submenu, SWT.SEPARATOR);
   
    MenuItem update_check_item = new MenuItem (submenu, SWT.PUSH);
    update_check_item.setText(Localizer._("mainwindow.mainmenu.help.updatecheck"));
    update_check_item.setImage(SWTImageRepository.getMenuImage("updater.png"));
    update_check_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        UpdaterWindow window = new UpdaterWindow();
        window.getCoreComponents();
        window.initUIComponents();
      }
     
    });
   
    new MenuItem (submenu, SWT.SEPARATOR);
   
    MenuItem about_item = new MenuItem (submenu, SWT.PUSH);
    about_item.setText(Localizer._("mainwindow.mainmenu.help.about"));
    about_item.setImage(SWTImageRepository.getMenuImage("information.png"));
    about_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        AboutWindow window = new AboutWindow();
        window.getCoreComponents();
        window.initUIComponents();
      }
View Full Code Here

    servers_item.setData(DATA_KEY, JMULE_TABS.SERVERLIST);
    servers_item.setImage(SWTImageRepository.getImage("servers.png"));
   
    button_list.add(servers_item);
   
    servers_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.setTab(JMULE_TABS.SERVERLIST);
      }
    });
   
    ToolItem kad_item = new ToolItem(this, SWT.CHECK);
    kad_item.setText(Localizer._("mainwindow.toolbar.kad_item"));
    kad_item.setData(DATA_KEY, JMULE_TABS.KAD);
    kad_item.setImage(SWTImageRepository.getImage("kad.png"));
    button_list.add(kad_item);
    kad_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.setTab(JMULE_TABS.KAD);
      }
    });
   
    final ToolItem transfers_item = new ToolItem(this, SWT.CHECK);
    transfers_item.setText(Localizer._("mainwindow.toolbar.transfers_item"));
    transfers_item.setData(DATA_KEY, JMULE_TABS.TRANSFERS);
    transfers_item.setImage(SWTImageRepository.getImage("transfer.png"));   
    button_list.add(transfers_item);
   
    transfers_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.setTab(JMULE_TABS.TRANSFERS);
      }
    });
   
    final ToolItem search_item = new ToolItem(this, SWT.CHECK);
    search_item.setText(Localizer._("mainwindow.toolbar.search_item"));
    search_item.setData(DATA_KEY, JMULE_TABS.SEARCH);
    search_item.setImage(SWTImageRepository.getImage("search.png"));
    button_list.add(search_item);
   
    search_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.setTab(JMULE_TABS.SEARCH);
      }
    });
   
    final ToolItem shared_item = new ToolItem(this, SWT.CHECK);
    shared_item.setText(Localizer._("mainwindow.toolbar.shared_item"));
    shared_item.setData(DATA_KEY, JMULE_TABS.SHARED);
    shared_item.setImage(SWTImageRepository.getImage("shared_files.png"));
    button_list.add(shared_item);
   
    shared_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.setTab(JMULE_TABS.SHARED);
      }
    });
   
    final ToolItem statistics_item = new ToolItem(this, SWT.CHECK);
    statistics_item.setText(Localizer._("mainwindow.toolbar.statistics_item"));
    statistics_item.setData(DATA_KEY, JMULE_TABS.STATISTICS);
    statistics_item.setImage(SWTImageRepository.getImage("statistics.png"));
    button_list.add(statistics_item);
   
    statistics_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.setTab(JMULE_TABS.STATISTICS);
      }
    });
   
    final ToolItem logs_item = new ToolItem(this, SWT.CHECK);
    logs_item.setText(Localizer._("mainwindow.toolbar.logs_item"));
    logs_item.setData(DATA_KEY, JMULE_TABS.LOGS);
    logs_item.setImage(SWTImageRepository.getImage("logs.png"));
    button_list.add(logs_item);
   
    logs_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        main_window.setTab(JMULE_TABS.LOGS);
      }
    })
  }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.events.SelectionAdapter

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.