Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Menu


    setControl(content);
    content.setLayout(new GridLayout(1,true));
    peers_table =  new DownloadPeerList(content);
    peers_table.setLayoutData(new GridData(GridData.FILL_BOTH));
   
    popup_menu = new Menu(peers_table);
   
    MenuItem column_setup = new MenuItem(popup_menu,SWT.NONE);
    column_setup.setText(_._("downloadinfowindow.tab.peerlist.menu.column_setup"));
    column_setup.setImage(SWTImageRepository.getImage("columns_setup.png"));
    column_setup.addSelectionListener(new SelectionAdapter() {
View Full Code Here


    addColumn(SWT.RIGHT, SWTConstants.UPLOAD_LIST_UPLOADED_COLUMN_ID, Localizer._("mainwindow.transferstab.uploads.column.uploaded"), "", width);
   
    updateColumnOrder();
    updateColumnVisibility();
   
    no_uploads_menu = new Menu(this);
   
    MenuItem column_setup = new MenuItem(no_uploads_menu,SWT.PUSH);
    column_setup.setText(Localizer._("mainwindow.transferstab.uploads.popupmenu.columnsetup"));
    column_setup.setImage(SWTImageRepository.getImage("columns_setup.png"));
    column_setup.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        showColumnEditorWindow();
      }
    });
   
    upload_selected_menu = new Menu(this);
   
    open_shared_file = new MenuItem(upload_selected_menu,SWT.PUSH);
    open_shared_file.setText(_._("mainwindow.sharedtab.popupmenu.open"));
    open_shared_file.setImage(SWTImageRepository.getImage("open_file.png"));
    open_shared_file.addSelectionListener(new SelectionAdapter() {
View Full Code Here

        SWTConstants.SEARCH_FILE_ID_COLUMN_ID, _
            ._("mainwindow.searchtab.column.fileid"), "", width);

    search_results.updateColumnSettings();

    no_items_menu = new Menu(search_results);

    MenuItem no_items_close_tab = new MenuItem(no_items_menu, SWT.PUSH);
    no_items_close_tab.setText(_._("mainwindow.searchtab.popupmenu.close"));
    no_items_close_tab.setImage(SWTImageRepository.getImage("cancel.png"));
    no_items_close_tab.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        search_tab.dispose();
      }

    });

    MenuItem no_items_column_setup_item = new MenuItem(no_items_menu,
        SWT.PUSH);
    no_items_column_setup_item.setText(_
        ._("mainwindow.searchtab.popupmenu.column_setup"));
    no_items_column_setup_item.setImage(SWTImageRepository
        .getImage("columns_setup.png"));
    no_items_column_setup_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        search_results.showColumnEditorWindow();
      }
    });

    pop_up_menu = new Menu(search_results);

    download_item = new MenuItem(pop_up_menu, SWT.PUSH);
    download_item.setText(_._("mainwindow.searchtab.popupmenu.download"));
    download_item.setImage(SWTImageRepository
        .getImage("start_download.png"));
View Full Code Here

    width = SWTPreferences.getInstance().getColumnWidth(SWTConstants.SHARED_LIST_COMPLETED_COLUMN_ID);
    shared_files_table.addColumn(SWT.RIGHT,  SWTConstants.SHARED_LIST_COMPLETED_COLUMN_ID, _._("mainwindow.sharedtab.column.completed"), "", width);
   
    shared_files_table.updateColumnSettings();
   
    no_items_menu = new Menu(shared_files_table);
   
    MenuItem column_setup_menu_item = new MenuItem(no_items_menu,SWT.PUSH);
    column_setup_menu_item.setText(_._("mainwindow.sharedtab.popupmenu.column_setup"));
    column_setup_menu_item.setImage(SWTImageRepository.getImage("columns_setup.png"));
    column_setup_menu_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        shared_files_table.showColumnEditorWindow();
    }});
   
    select_completed_file_menu = new Menu(shared_files_table);
   
    open_selected_menu_item = new MenuItem(select_completed_file_menu,SWT.PUSH);
    open_selected_menu_item.setText(_._("mainwindow.sharedtab.popupmenu.open"));
    open_selected_menu_item.setImage(SWTImageRepository.getImage("open_file.png"));
    open_selected_menu_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        openSelected();
    }});
   
    copy_ed2k_link_menu_item = new MenuItem(select_completed_file_menu,SWT.PUSH);
    copy_ed2k_link_menu_item.setText(_._("mainwindow.sharedtab.popupmenu.copy_ed2k_link"));
    copy_ed2k_link_menu_item.setImage(SWTImageRepository.getImage("ed2k_link.png"));
    copy_ed2k_link_menu_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        copyED2KLink();
    }});

    remove_from_disk_menu_item = new MenuItem(select_completed_file_menu,SWT.PUSH);
    remove_from_disk_menu_item.setText(_._("mainwindow.sharedtab.popupmenu.remove_from_disk"));
    remove_from_disk_menu_item.setImage(SWTImageRepository.getImage("cancel.png"));
    remove_from_disk_menu_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        removeFromDisk();
    }});
   
    MenuItem selected_column_setup_menu_item = new MenuItem(select_completed_file_menu,SWT.PUSH);
    selected_column_setup_menu_item.setText(_._("mainwindow.sharedtab.popupmenu.column_setup"));
    selected_column_setup_menu_item.setImage(SWTImageRepository.getImage("columns_setup.png"));
    selected_column_setup_menu_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        shared_files_table.showColumnEditorWindow();
    }});

   
    rating_menu_item = new MenuItem(select_completed_file_menu, SWT.CASCADE);
    rating_menu_item.setText(_._("mainwindow.searchtab.popupmenu.rating_submenu"));
    rating_menu = new Menu(select_completed_file_menu);
    rating_menu_item.setMenu(rating_menu);
   
    file_not_rated = new MenuItem(rating_menu, SWT.RADIO);
    file_not_rated.setText(_._("mainwindow.searchtab.popupmenu.rating_submenu.not_rated"));
    file_not_rated.addSelectionListener(new SelectionAdapter() {
View Full Code Here

    setControl(content);
    content.setLayout(new GridLayout(1,true));
    peers_table =  new UploadPeerList(content);
    peers_table.setLayoutData(new GridData(GridData.FILL_BOTH));
   
    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() {
View Full Code Here

    addColumn(SWT.RIGHT, SWTConstants.DOWNLOAD_LIST_PARTIAL_SOURCES_COLUMN_ID, _._("mainwindow.transferstab.downloads.column.partial_src"), "", width);
   
    updateColumnOrder();
    updateColumnVisibility();
   
    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() {
View Full Code Here

   
    log_content = new StyledText(this,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.READ_ONLY);
    log_content.setEditable(false);
    log_content.setBackground(SWTThread.getDisplay().getSystemColor(SWT.COLOR_WHITE));
   
    popup_menu = new Menu(log_content);
   
   
    final MenuItem copy_item = new MenuItem(popup_menu,SWT.PUSH);
    copy_item.setText(_._("mainwindow.logtab.popupmenu.copy"));
    copy_item.setImage(SWTImageRepository.getImage("copy.png"));
View Full Code Here

   
    // File menu
    MenuItem fileItem = new MenuItem (this, SWT.CASCADE);
    fileItem.setText (Localizer._("mainwindow.mainmenu.file"));
   
    Menu submenu = new Menu (shell, SWT.DROP_DOWN);
    fileItem.setMenu (submenu);

    MenuItem new_item = new MenuItem(submenu,SWT.CASCADE);
    new_item.setText(_._("mainwindow.mainmenu.file.new"));
   
    Menu new_submenu = new Menu(shell,SWT.DROP_DOWN);
    new_item.setMenu(new_submenu);
   
    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"));
View Full Code Here

            to_set_list.remove((Integer)index);
          item.setChecked(true);
        }
      });
     
      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) {
View Full Code Here

            to_set_list.remove((Integer)index);
          item.setChecked(true);
        }
      });
     
      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) {
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.Menu

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.