Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.SelectionAdapter


    tab_list.add(new GeneralTab(settings_tab_panel));
    //tab_list.add(new ConnectionTab(settings_tab_panel));
 
    completeList(null, tab_list);
     
    tabs_tree.addSelectionListener(new SelectionAdapter() {

      public void widgetSelected(SelectionEvent e) {
        if (tabs_tree.getSelectionCount()==0) return ;
        TreeItem item = tabs_tree.getSelection()[0];
        AbstractTab selected_tab = (AbstractTab) item.getData(DATA_KEY);
        if (selectedTab != null) {
          if (!selectedTab.checkFields()) {
            e.doit = false;
            tabs_tree.setSelection(selectedItem);
            return;
          }
        }
        selectedTab = selected_tab;
        selectedItem = tabs_tree.getSelection()[0];
       
        settings_tab_panel.setContent(selected_tab.getTabContent());
      }
     
    });
   
    Composite button_bar = new Composite(shell,SWT.NONE);
    button_bar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    GridLayout layout = new GridLayout(3,false);
    button_bar.setLayout(layout);
   
    Button button_ok = new Button(button_bar,SWT.NONE);
    button_ok.setFont(skin.getButtonFont());
    button_ok.setText(_._("settingswindow.button.ok"));
    button_ok.setImage(SWTImageRepository.getImage("ok.png"));
    GridData grid_data = new GridData();
    grid_data.horizontalAlignment = GridData.END;
    grid_data.widthHint = 60;
    grid_data.grabExcessHorizontalSpace = true;
    button_ok.setLayoutData(grid_data);
    button_ok.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        if (apply())
          shell.close();
      }
    });
   
    Button button_cancel = new Button(button_bar,SWT.NONE);
    button_cancel.setFont(skin.getButtonFont());
    button_cancel.setText(_._("settingswindow.button.cancel"));
    button_cancel.setImage(SWTImageRepository.getImage("cancel.png"));
    grid_data = new GridData();
    grid_data.horizontalAlignment = GridData.END;
    grid_data.widthHint = 80;
    button_cancel.setLayoutData(grid_data);
    button_cancel.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        shell.close();
      }
    });
   
    Button button_apply = new Button(button_bar,SWT.NONE);
    button_apply.setFont(skin.getButtonFont());
    button_apply.setText(_._("settingswindow.button.apply"));
    button_apply.setImage(SWTImageRepository.getImage("accept.png"));
    grid_data = new GridData();
    grid_data.horizontalAlignment = GridData.END;
    grid_data.widthHint = 80;
    button_apply.setLayoutData(grid_data);
   
    button_apply.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        apply();
      }
    });
   
View Full Code Here


    udp_port.setIncrement(1);
    udp_port.setPageIncrement(100);
   
    enable_udp = new Button(container1,SWT.CHECK);
    enable_udp.setText(_._("settingswindow.tab.connection.button.enabled"));
    enable_udp.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        updateUDPControls();
      }
     
    });
    try {
      enable_udp.setSelection(config_manager.isUDPEnabled());
    } catch (ConfigurationManagerException e1) {
      e1.printStackTrace();
    }
   
    updateUDPControls();
   
    Group limits = new Group(content,SWT.NONE);
    limits.setText(_._("settingswindow.tab.general.group.limits"));
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    layout_data.horizontalSpan = 2;
    limits.setLayoutData(layout_data);
    limits.setLayout(new GridLayout(2,false));
   
    label = new Label(limits,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setForeground(skin.getDefaultColor());
    label.setText(_._("settingswindow.tab.connection.label.download_limit") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Composite container2 = new Composite(limits,SWT.NONE);
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    container2.setLayoutData(layout_data);
    layout = new GridLayout(3,false);
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    container2.setLayout(layout);
   
    download_limit = new Text(container2,SWT.BORDER );
    download_limit.addListener(SWT.Verify, number_filter);
    layout_data = new GridData();
    layout_data.widthHint = EDIT_FIELD_WIDTH;
    download_limit.setLayoutData(layout_data);
    try {
      download_limit.setText((config_manager.getDownloadLimit()/1024)+"");
    } catch (ConfigurationManagerException e1) {
      e1.printStackTrace();
    }
   
    new Label(container2,SWT.NONE).setText(_._("settingswindow.tab.connection.label.kb_s"));
   
    enable_download_limit = new Button(container2,SWT.CHECK);
    enable_download_limit.setText(_._("settingswindow.tab.connection.button.enabled"));
    enable_download_limit.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        updateDownloadLimitControls();
      }
    });
   
    label = new Label(limits,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setForeground(skin.getDefaultColor());
    label.setText(_._("settingswindow.tab.connection.label.upload_limit") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    Composite container3 = new Composite(limits,SWT.NONE);
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    container3.setLayoutData(layout_data);
    layout = new GridLayout(3,false);
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    container3.setLayout(layout);
   
    upload_limit = new Text(container3,SWT.BORDER );
    upload_limit.addListener(SWT.Verify, number_filter);
    layout_data = new GridData();
    layout_data.widthHint = EDIT_FIELD_WIDTH;
    upload_limit.setLayoutData(layout_data);
    try {
      upload_limit.setText((config_manager.getUploadLimit()/1024)+"");
    } catch (ConfigurationManagerException e1) {
      e1.printStackTrace();
    }
   
    new Label(container3,SWT.NONE).setText(_._("settingswindow.tab.connection.label.kb_s"));
   
    enable_upload_limit = new Button(container3,SWT.CHECK);
    enable_upload_limit.setText(_._("settingswindow.tab.connection.button.enabled"));
    enable_upload_limit.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        updateUploadLimitControls();
      }
    });
   
    boolean enable = false;
    try {
      enable = config_manager.getDownloadLimit()==0 ? false : true;
    } catch (ConfigurationManagerException e1) {
      e1.printStackTrace();
    }
    enable_download_limit.setSelection(enable);
   
    try {
      enable = config_manager.getUploadLimit() == 0 ? false : true;
    } catch (ConfigurationManagerException e1) {
      e1.printStackTrace();
    }
    enable_upload_limit.setSelection(enable);
   
    updateDownloadLimitControls();
    updateUploadLimitControls();
   
    Group capacities = new Group(content,SWT.NONE);
    capacities.setText(_._("settingswindow.tab.general.group.capacities"));
    layout_data = new GridData(GridData.FILL_HORIZONTAL);
    layout_data.horizontalSpan = 2;
    capacities.setLayoutData(layout_data);
    capacities.setLayout(new GridLayout(2,false));
   
    label = new Label(capacities,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setForeground(skin.getDefaultColor());
    label.setText(_._("settingswindow.tab.connection.label.download_capacity") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
   
    download_capacity = new Text(capacities,SWT.BORDER );
    download_capacity.addListener(SWT.Verify, number_filter);
    layout_data = new GridData();
    layout_data.widthHint = EDIT_FIELD_WIDTH;
    download_capacity.setLayoutData(layout_data);
   
    label = new Label(capacities,SWT.NONE);
    label.setFont(skin.getDefaultFont());
    label.setForeground(skin.getDefaultColor());
    label.setText(_._("settingswindow.tab.connection.label.upload_capacity") + " : ");
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
   
    upload_capacity = new Text(capacities,SWT.BORDER );
    upload_capacity.addListener(SWT.Verify, number_filter);
   
    layout_data = new GridData();
    layout_data.widthHint = EDIT_FIELD_WIDTH;
    upload_capacity.setLayoutData(layout_data);
   
    new Label(capacities,SWT.NONE);
   
    container = new Composite(capacities,SWT.NONE);
    layout_data = new GridData();

    container.setLayoutData(layout_data);
    layout = new GridLayout(2,false);
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    container.setLayout(layout);
   
    kbit_button = new Button(container,SWT.RADIO);
    kbit_button.setText(_._("settingswindow.tab.connection.button.k_bit"));
   
    kbit_button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        if (kbit_button.getSelection()) {
          if (!kbyte_selected) return ;
          kbyte_selected = false;
          long download = Long.parseLong(download_capacity.getText());
          long upload = Long.parseLong(upload_capacity.getText());
          download*=8;
          upload*=8;
         
          download_capacity.setText(download+"");
          upload_capacity.setText(upload+"");
        }
      }
    });
   
    kbyte_button = new Button(container,SWT.RADIO);
    kbyte_button.setText(_._("settingswindow.tab.connection.button.k_byte"));
    kbyte_button.setSelection(true);
   
    kbyte_button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        if (kbyte_button.getSelection()) {
          if (kbyte_selected) return ;
          kbyte_selected = true;
          long download = Long.parseLong(download_capacity.getText());
View Full Code Here

    Button button_paste_ed2k_link = new Button(buttons_composite,SWT.NONE);
    button_paste_ed2k_link.setFont(skin.getButtonFont());
    button_paste_ed2k_link.setText(_._("newwindow.button.paste_ed2k_link"));
    button_paste_ed2k_link.setImage(SWTImageRepository.getImage("ed2k_link_paste.png"));
    button_paste_ed2k_link.forceFocus();
    button_paste_ed2k_link.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        table.paste();
      }
    });
   
    Button button_clear = new Button(buttons_composite,SWT.NONE);
    button_clear.setFont(skin.getButtonFont());
    button_clear.setText(_._("newwindow.button.clear"));
    button_clear.setImage(SWTImageRepository.getImage("remove_all.png"));
    button_clear.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        table.clear();
      }
    });
   
    grid_data = new GridData();
    grid_data.widthHint = 70;
    grid_data.horizontalAlignment = GridData.END;
    grid_data.grabExcessHorizontalSpace = true;
   
    Button button_ok = new Button(buttons_composite,SWT.NONE);
    button_ok.setText(_._("newwindow.button.ok"));
    button_ok.setFont(skin.getButtonFont());
    button_ok.setImage(skin.getButtonImage(Skin.OK_BUTTON_IMAGE));
    button_ok.setLayoutData(grid_data);
    button_ok.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        table.save();
        shell.close();
      }
    });
   
    Button button_cancel = new Button(buttons_composite,SWT.NONE);
    button_cancel.setFont(skin.getButtonFont());
    button_cancel.setImage(skin.getButtonImage(Skin.CANCEL_BUTTON_IMAGE));
    button_cancel.setText(_._("newwindow.button.cancel"));
   
    button_cancel.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        shell.close();
      }
    });
   
View Full Code Here

     
      popup_menu = new Menu(this);
      MenuItem paste_ed2k = new MenuItem(popup_menu,SWT.PUSH);
      paste_ed2k.setText(_._("newwindow.menu.paste_ed2k_link"));
      paste_ed2k.setImage(SWTImageRepository.getImage("ed2k_link_paste.png"));
      paste_ed2k.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
          paste();
        }
      });
    }
View Full Code Here

     
      popup_menu = new Menu(this);
      MenuItem paste_ed2k = new MenuItem(popup_menu,SWT.PUSH);
      paste_ed2k.setText(_._("newwindow.menu.paste_ed2k_link"));
      paste_ed2k.setImage(SWTImageRepository.getImage("ed2k_link_paste.png"));
      paste_ed2k.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
          paste();
        }
      })
    }
View Full Code Here

    grid_data.horizontalAlignment = GridData.END;
    button.setLayoutData(grid_data);
    button.forceFocus();
    button.setText(_._("nightlybuildwarningwindow.button.ok"));
    button.setImage(skin.getButtonImage(SWTSkin.OK_BUTTON_IMAGE));
    button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        SWTPreferences.getInstance().setNightlyBuildWarning(button_check.getSelection());
        shell.close();
      }
    });
View Full Code Here

   
    browse_button = new Button(group,SWT.NONE);
    browse_button.setFont(skin.getButtonFont());
    browse_button.setText(_._("serverlistimportwindow.button.browse"));
   
    browse_button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        FileDialog dialog = new FileDialog (shell, SWT.OPEN);
        dialog.setFilterNames (new String [] {"Server.met(*.met)", "All Files (*.*)"});
        dialog.setFilterExtensions (new String [] {"*.met", "*.*"});
        String result = dialog.open();
        if (result != null)
          file_path.setText(result);
    } });
   
   
    Composite button_bar = new Composite(shell,SWT.NONE);
    button_bar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    GridLayout layout = new GridLayout(2,false);
    button_bar.setLayout(layout);
   
    ok_button = new Button(button_bar,SWT.NONE);
    ok_button.setFont(skin.getButtonFont());
    ok_button.setText(_._("serverlistimportwindow.button.ok"));
    ok_button.setImage(SWTImageRepository.getImage("accept.png"));
    GridData grid_data = new GridData();
    grid_data.horizontalAlignment = GridData.END;
    grid_data.widthHint = 60;
    grid_data.grabExcessHorizontalSpace = true;
    ok_button.setLayoutData(grid_data);
    ok_button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        importServerList();
    } });
   
   
    cancel_button = new Button(button_bar,SWT.NONE);
    cancel_button.setFont(skin.getButtonFont());
    cancel_button.setText(_._("serverlistimportwindow.button.cancel"));
    cancel_button.setImage(SWTImageRepository.getImage("cancel2.png"));
    grid_data = new GridData();
    grid_data.widthHint = 80;
    cancel_button.setLayoutData(grid_data);
   
    cancel_button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        shell.close();
    } });
   
    shell.addListener(SWT.Close, new Listener() {
View Full Code Here

    Menu popup_menu = new Menu(this);
   
    final MenuItem copy_selected = new MenuItem(popup_menu,SWT.PUSH);
    copy_selected.setText(_._("mainwindow.serverlisttab.servermesasges.popupmenu.copy"));
    copy_selected.setImage(SWTImageRepository.getImage("copy.png"));
    copy_selected.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        String text = getSelectionText();
        if (text.length()!=0)
          Utils.setClipBoardText(text);
      }
    });
   
    final MenuItem select_all = new MenuItem(popup_menu,SWT.PUSH);
    select_all.setText(_._("mainwindow.serverlisttab.servermesasges.popupmenu.select_all"));
    select_all.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        selectAll();
      }
    });
   
    new MenuItem(popup_menu,SWT.SEPARATOR);
   
    final MenuItem clear = new MenuItem(popup_menu,SWT.PUSH);
    clear.setText(_._("mainwindow.serverlisttab.servermesasges.popupmenu.clear"));
    clear.setImage(SWTImageRepository.getImage("remove_all.png"));
    clear.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        setText("");
      }
    });
   
View Full Code Here

    no_servers_menu = new Menu(this);
   
    MenuItem no_servers_server_add = new MenuItem (no_servers_menu, SWT.PUSH);
    no_servers_server_add.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.add_server"));
    no_servers_server_add.setImage(SWTImageRepository.getImage("server_add.png"));
    no_servers_server_add.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        showServerAddWindow();
      }
    });
   
    new MenuItem (no_servers_menu, SWT.SEPARATOR);
   
    MenuItem no_server_paste_ed2k_links = new MenuItem (no_servers_menu, SWT.PUSH);
    no_server_paste_ed2k_links.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.paste_ed2k_links"));
    no_server_paste_ed2k_links.setImage(SWTImageRepository.getImage("ed2k_link_paste.png"));
    no_server_paste_ed2k_links.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        pasteED2KLinks();
      }
    });
   
    new MenuItem (no_servers_menu, SWT.SEPARATOR);
    MenuItem no_server_column_setup = new MenuItem (no_servers_menu, SWT.PUSH);
    no_server_column_setup.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.column_setup"));
    no_server_column_setup.setImage(SWTImageRepository.getImage("columns_setup.png"));
    no_server_column_setup.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        showColumnEditorWindow();
      }
    });
   
    no_selected_servers_menu = new Menu(this);
    MenuItem no_selection_menu_add = new MenuItem(no_selected_servers_menu,SWT.PUSH);
    no_selection_menu_add.setText(Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.add_server"));
    no_selection_menu_add.setImage(SWTImageRepository.getImage("server_add.png"));
    no_selection_menu_add.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        showServerAddWindow();
      }
    });
   
    new MenuItem(no_selected_servers_menu,SWT.SEPARATOR);
   
    no_selection_menu_disconnect = new MenuItem(no_selected_servers_menu,SWT.PUSH);
    no_selection_menu_disconnect.setText(Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.disconnect_from"));
    no_selection_menu_disconnect.setImage(SWTImageRepository.getImage("server_disconnect.png"));
    no_selection_menu_disconnect.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        wrapper.disconnect();
      }
    });
   
    new MenuItem(no_selected_servers_menu,SWT.SEPARATOR);
   
    MenuItem no_selection_menu_remove_all = new MenuItem(no_selected_servers_menu,SWT.PUSH);
    no_selection_menu_remove_all.setText(Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.remove_all"));
    no_selection_menu_remove_all.setImage(SWTImageRepository.getImage("remove_all.png"));
    no_selection_menu_remove_all.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        clearServerList();
      }
    });
   
    new MenuItem(no_selected_servers_menu,SWT.SEPARATOR)
   
    MenuItem no_selection_menu_paste_ed2k = new MenuItem(no_selected_servers_menu,SWT.PUSH);
    no_selection_menu_paste_ed2k.setText(Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.paste_ed2k_links"));
    no_selection_menu_paste_ed2k.setImage(SWTImageRepository.getImage("ed2k_link_paste.png"));
    no_selection_menu_paste_ed2k.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        pasteED2KLinks();
      }
    });
   
    new MenuItem(no_selected_servers_menu,SWT.SEPARATOR);
   
    MenuItem no_selection_menu_column_setup = new MenuItem(no_selected_servers_menu,SWT.PUSH);
    no_selection_menu_column_setup.setText(Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.column_setup"));
    no_selection_menu_column_setup.setImage(SWTImageRepository.getImage("columns_setup.png"));
    no_selection_menu_column_setup.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        showColumnEditorWindow();
      }
    });
   
    selected_server_menu =  new Menu(this);
   
    selected_server_connect = new MenuItem (selected_server_menu, SWT.PUSH);
    selected_server_connect.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.connect_to"));
    selected_server_connect.setImage(SWTImageRepository.getImage("server_connect.png"));
    selected_server_connect.addSelectionListener(new SelectionAdapter() {
    public void widgetSelected(final SelectionEvent e) {
      Server selected_server = (Server) getSelectedObject();
      wrapper.connectTo(selected_server);
    }} );
   
    selected_server_disconnect = new MenuItem (selected_server_menu, SWT.PUSH);
    selected_server_disconnect.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.disconnect_from"));
    selected_server_disconnect.setImage(SWTImageRepository.getImage("server_disconnect.png"));
    selected_server_disconnect.addSelectionListener(new SelectionAdapter() {
    public void widgetSelected(final SelectionEvent e) {
      if (wrapper.isAutoconnecting())
        wrapper.stopConnecting();
      else
        wrapper.disconnect();
    }} );
   
    new MenuItem (selected_server_menu, SWT.SEPARATOR);
    MenuItem server_add = new MenuItem (selected_server_menu, SWT.PUSH);
    server_add.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.add_server"));
    server_add.setImage(SWTImageRepository.getImage("server_add.png"));
    server_add.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        showServerAddWindow();
      }
    });
    final MenuItem server_remove = new MenuItem (selected_server_menu, SWT.PUSH);
    server_remove.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.remove_server"));
    server_remove.setImage(SWTImageRepository.getImage("server_delete.png"));
    server_remove.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        removeSelectedServers();
      }
    });
    server_remove_all = new MenuItem (selected_server_menu, SWT.PUSH);
    server_remove_all.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.remove_all"));
    server_remove_all.setImage(SWTImageRepository.getImage("remove_all.png"));
    server_remove_all.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        clearServerList();
      }
    });
    new MenuItem (selected_server_menu, SWT.SEPARATOR);
    final MenuItem server_copy_ed2k_link = new MenuItem (selected_server_menu, SWT.PUSH);
    server_copy_ed2k_link.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.copy_ed2k_link"));
    server_copy_ed2k_link.setImage(SWTImageRepository.getImage("ed2k_link.png"));
    server_copy_ed2k_link.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        copyED2KLinks();
      }
    });
   
    MenuItem server_paste_ed2k_links = new MenuItem (selected_server_menu, SWT.PUSH);
    server_paste_ed2k_links.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.paste_ed2k_links"));
    server_paste_ed2k_links.setImage(SWTImageRepository.getImage("ed2k_link_paste.png"));
    server_paste_ed2k_links.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
          pasteED2KLinks();
      }
     
    });
   
    new MenuItem (selected_server_menu, SWT.SEPARATOR);
   
    add_to_static_list = new MenuItem (selected_server_menu, SWT.PUSH);
    add_to_static_list.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.add_to_static_list"));
    add_to_static_list.setImage(SWTImageRepository.getImage("list_add.png"));
    add_to_static_list.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        addToStaticList();
      }
     
    });
   
    remove_from_static_list = new MenuItem (selected_server_menu, SWT.PUSH);
    remove_from_static_list.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.remove_from_static_list"));
    remove_from_static_list.setImage(SWTImageRepository.getImage("list_remove.png"));
    remove_from_static_list.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        removeFromStaticList();
      }
     
    });
   
    new MenuItem (selected_server_menu, SWT.SEPARATOR);
    MenuItem column_setup = new MenuItem (selected_server_menu, SWT.PUSH);
    column_setup.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.column_setup"));
    column_setup.setImage(SWTImageRepository.getImage("columns_setup.png"));
    column_setup.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        showColumnEditorWindow();
      }
    });
   
    new MenuItem (selected_server_menu, SWT.SEPARATOR);
    final MenuItem server_properties = new MenuItem (selected_server_menu, SWT.PUSH);
    server_properties.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.server_properties"));
    server_properties.setImage(SWTImageRepository.getImage("server_properties.png"));
    server_properties.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        ServerPropertiesWindow properties_window = new ServerPropertiesWindow(getSelectedObject());
        properties_window.getCoreComponents();
        properties_window.initUIComponents();
      }
    });
   
    // Multiple servers selected
    selected_multiple_servers_menu = new Menu (this);
       
    MenuItem server_remove_selected = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
    server_remove_selected.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.remove_selected"));
    server_remove_selected.setImage(SWTImageRepository.getImage("server_delete.png"));
    server_remove_selected.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        removeSelectedServers();
      }
    });
   
    new MenuItem (selected_multiple_servers_menu, SWT.SEPARATOR);
   
    server_remove_all_multiselect = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
    server_remove_all_multiselect.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.remove_all"));
    server_remove_all_multiselect.setImage(SWTImageRepository.getImage("remove_all.png"));
    server_remove_all_multiselect.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        clearServerList();
      }
     
    });
    new MenuItem (selected_multiple_servers_menu, SWT.SEPARATOR);
   
    server_connect_multiselect = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
    server_connect_multiselect.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.connect"));
    server_connect_multiselect.setImage(SWTImageRepository.getImage("server_connect.png"));
    server_connect_multiselect.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        wrapper.startAutoConnect();
      }
    });
   
    server_disconnect_multiselect = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
    server_disconnect_multiselect.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.disconnect_from"));
    server_disconnect_multiselect.setImage(SWTImageRepository.getImage("server_disconnect.png"));
    server_disconnect_multiselect.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        if (wrapper.isAutoconnecting())
          wrapper.stopConnecting();
        else
          wrapper.disconnect();
      }
    });
   
    new MenuItem (selected_multiple_servers_menu, SWT.SEPARATOR);
   
    MenuItem multi_select_menu_copy_ed2k_links = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
    multi_select_menu_copy_ed2k_links.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.copy_ed2k_links"));
    multi_select_menu_copy_ed2k_links.setImage(SWTImageRepository.getImage("ed2k_link.png"));
    multi_select_menu_copy_ed2k_links.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        copyED2KLinks();
      }
     
    });
   
    MenuItem multi_select_menu_paste_ed2k_links = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
    multi_select_menu_paste_ed2k_links.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.paste_ed2k_links"));
    multi_select_menu_paste_ed2k_links.setImage(SWTImageRepository.getImage("ed2k_link_paste.png"));
    multi_select_menu_paste_ed2k_links.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        pasteED2KLinks();
      }
    });
   
    new MenuItem (selected_multiple_servers_menu, SWT.SEPARATOR);
   
    multisel_add_to_static_list = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
    multisel_add_to_static_list.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.add_to_static_list"));
    multisel_add_to_static_list.setImage(SWTImageRepository.getImage("list_add.png"));
    multisel_add_to_static_list.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        addToStaticList();
      }
     
    });
   
    multisel_remove_from_static_list = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
    multisel_remove_from_static_list.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.remove_from_static_list"));
    multisel_remove_from_static_list.setImage(SWTImageRepository.getImage("list_remove.png"));
    multisel_remove_from_static_list.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        removeFromStaticList();
      }
     
    });
   
    new MenuItem (selected_multiple_servers_menu, SWT.SEPARATOR);
   
    column_setup = new MenuItem (selected_multiple_servers_menu, SWT.PUSH);
    column_setup.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.column_setup"));
    column_setup.setImage(SWTImageRepository.getImage("columns_setup.png"));
    column_setup.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        showColumnEditorWindow();
      }
    });
   
View Full Code Here

    label_desc.setText(server.getDesc());
    label_name.setText(server.getName());
   
    final Refreshable refreshable = this;
   
    button.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        GUIUpdater.getInstance().removeRefreshable(refreshable);
        shell.close();
      }
    });
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.