Examples of MenuItem


Examples of org.eclipse.swt.widgets.MenuItem

   * @param menu
   * @param mainWindow
   * @return
   */
  public static Menu createDebugMenuItem(final Menu menu) {
    MenuItem item;

    final UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
    if (null == uiFunctions) {
      throw new IllegalStateException(
          "UIFunctionsManagerSWT.getUIFunctionsSWT() is returning null");
    }

    item = new MenuItem(menu, SWT.CASCADE);
    item.setText("&Debug");
    Menu menuDebug = new Menu(menu.getParent(), SWT.DROP_DOWN);
    item.setMenu(menuDebug);

    item = new MenuItem(menuDebug, SWT.CASCADE);
    item.setText("ScreenSize");
    Menu menuSS = new Menu(menu.getParent(), SWT.DROP_DOWN);
    item.setMenu(menuSS);

    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("640x400");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(640, 400);
      }
    });

    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("800x560");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(850, 560);
      }
    });

    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("1024x700");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(1024, 700);
      }
    });

    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("1024x768");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(1024, 768);
      }
    });
   
    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("1152x784");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(1152, 784);
      }
    });

    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("1280x720");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(1280, 720);
      }
    });

    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("1280x1024");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(1280, 1024);
      }
    });
    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("1440x820");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(1440, 820);
      }
    });

    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("1600x970");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(1600, 970);
      }
    });

    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("1920x1200");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(1920, 1200);
      }
    });
   
    item = new MenuItem(menuSS, SWT.NONE);
    item.setText("2560x1520");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        uiFunctions.getMainShell().setSize(2560, 1520);
      }
    });

    item = new MenuItem(menuDebug, SWT.NONE);
    item.setText("Reload messagebundle");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        MessageText.loadBundle(true);
        DisplayFormatters.setUnits();
        DisplayFormatters.loadMessages();
        UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
        if (uiFunctions != null) {
          uiFunctions.refreshLanguage();
        }
      }
    });
   
    item = new MenuItem(menuDebug, SWT.CHECK);
    item.setText("SR ChangeFlagChecker Paused");
    item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        StartStopRulesDefaultPlugin.pauseChangeFlagChecker = !StartStopRulesDefaultPlugin.pauseChangeFlagChecker;
        ((MenuItem)e.widget).setSelection(StartStopRulesDefaultPlugin.pauseChangeFlagChecker);
      }
    });
View Full Code Here

Examples of org.eclipse.swt.widgets.MenuItem

        Tree tree = toolkit.createTree(schemaSection, SWT.NONE);
        tree.setLayoutData(new GridData(GridData.FILL_BOTH));
        schemaSection.setClient(tree);
       
        final Menu menu = new Menu(Display.getCurrent().getActiveShell(), SWT.POP_UP);
        MenuItem itemNewContentTypeDefinition = new MenuItem(menu, SWT.PUSH);
        itemNewContentTypeDefinition.setText("Content Type Definition");
        itemNewContentTypeDefinition.addSelectionListener(new SelectionListener() {
           
            public void widgetSelected(SelectionEvent e) {
                WGContentTypeDefinition cType = _model.createContentTypeDefinition();
                _treeViewer.expandToLevel(cType, 1);
                _treeViewer.setSelection(new SingleStructuredSelection(cType));               
            }
           
            public void widgetDefaultSelected(SelectionEvent e) {
            }
        });
        MenuItem itemNewAreaDefinition = new MenuItem(menu, SWT.PUSH);
        itemNewAreaDefinition.setText("Area Definition");
        itemNewAreaDefinition.addSelectionListener(new SelectionListener() {
           
            public void widgetSelected(SelectionEvent e) {
                WGAreaDefinition area = _model.createAreaDefinition();
                _treeViewer.expandToLevel(area, 1);
                _treeViewer.setSelection(new SingleStructuredSelection(area));               
            }
           
            public void widgetDefaultSelected(SelectionEvent e) {
            }
        });
        MenuItem itemNewLanguageDefinition = new MenuItem(menu, SWT.PUSH);
        itemNewLanguageDefinition.setText("Language Definition");
        itemNewLanguageDefinition.addSelectionListener(new SelectionListener() {
           
            public void widgetSelected(SelectionEvent e) {
                WGLanguageDefinition lang = _model.createLanguageDefinition();
                _treeViewer.expandToLevel(lang, 1);
                _treeViewer.setSelection(new SingleStructuredSelection(lang));               
View Full Code Here

Examples of org.eclipse.swt.widgets.MenuItem

    Collections.sort(runtimeList, new WGARuntimeSortByName());
    Iterator<WGARuntime> runtimes = runtimeList.iterator();
    while (runtimes.hasNext()) {
      WGARuntime runtime = runtimes.next();
     
      MenuItem runtimeItem = new MenuItem(menu, SWT.CASCADE);
      runtimeItem.setText(runtime.getName());
      runtimeItem.setData(runtime);
     
      Menu runtimeMenu = new Menu(parent.getShell(), SWT.DROP_DOWN);
      runtimeItem.setMenu(runtimeMenu);
     
      MenuItem startItem = new MenuItem(runtimeMenu, SWT.DROP_DOWN);
      startItem.setText("start");
      startItem.setImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_SERVER_START));
      startItem.setData(runtime);
      startItem.setData(ATTRIB_COMMAND, COMMAND_START);
      startItem.addSelectionListener(this);
      if (TomcatUtils.getInstance().isRunning(runtime)) {
        startItem.setEnabled(false);
      }
     
      MenuItem stopItem = new MenuItem(runtimeMenu, SWT.DROP_DOWN);
      stopItem.setText("stop");
      stopItem.setImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_SERVER_STOP));
      stopItem.setData(runtime);
      stopItem.setData(ATTRIB_COMMAND, COMMAND_STOP);
      stopItem.addSelectionListener(this);
      if (!TomcatUtils.getInstance().isRunning(runtime)) {
        stopItem.setEnabled(false);
      }
     
      MenuItem configureItem = new MenuItem(runtimeMenu, SWT.DROP_DOWN);
      configureItem.setText("configure");
      configureItem.setImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_RUNTIME_EDIT));
      configureItem.setData(runtime);
      configureItem.setData(ATTRIB_COMMAND, COMMAND_EDIT);
      configureItem.addSelectionListener(this);
    }
   
   
    return menu;
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.MenuItem

  public void widgetDefaultSelected(SelectionEvent e) {   
  }

  public void widgetSelected(SelectionEvent e) {
    if (e.getSource() instanceof MenuItem) {
      MenuItem item = (MenuItem) e.getSource();
      WGARuntime runtime = (WGARuntime) item.getData();
      String command = (String) item.getData(ATTRIB_COMMAND);
      if (COMMAND_START.equals(command)) {
        StartWGARuntime.call(runtime);
      } else if (COMMAND_STOP.equals(command)){
        StopWGARuntime.call();
      } else if (COMMAND_EDIT.equals(command)) {       
View Full Code Here

Examples of org.eclipse.swt.widgets.MenuItem

  }
 
  public void buildMenu(Menu menu, MenuEvent menuEvent) {

    // Start All
    MenuItem start_all = new MenuItem(menu, SWT.PUSH);
    Messages.setLanguageText(start_all, "MainWindow.menu.transfers.startalltransfers");
    Utils.setMenuItemImage(start_all, "start");
    start_all.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        ManagerUtils.asyncStartAll();
      }
    });
    start_all.setEnabled(true);

    // Stop All
    MenuItem stop_all = new MenuItem(menu, SWT.PUSH);
    Messages.setLanguageText(stop_all, "MainWindow.menu.transfers.stopalltransfers");
    Utils.setMenuItemImage(stop_all, "stop");
    stop_all.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        ManagerUtils.asyncStopAll();
      }
    });
    stop_all.setEnabled(true);
   
    // Pause All
    MenuItem pause_all = new MenuItem(menu, SWT.PUSH);
    Messages.setLanguageText(pause_all, "MainWindow.menu.transfers.pausetransfers");
    Utils.setMenuItemImage(pause_all, "pause");
    pause_all.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        ManagerUtils.asyncPause();
      }
    });
    pause_all.setEnabled(g_manager.canPauseDownloads());
   
    // Resume All
    MenuItem resume_all = new MenuItem(menu, SWT.PUSH);
    Messages.setLanguageText(resume_all, "MainWindow.menu.transfers.resumetransfers");
    Utils.setMenuItemImage(resume_all, "resume");
    resume_all.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        ManagerUtils.asyncResume();
      }
    });
    resume_all.setEnabled(g_manager.canResumeDownloads());
   
    new MenuItem(menu, SWT.SEPARATOR);
    super.buildMenu(menu);
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.MenuItem

  }
 
  public void buildMenu(Menu menu, MenuEvent menuEvent) {
   
    // Queue
    final MenuItem itemQueue = new MenuItem(menu, SWT.PUSH);
    Messages.setLanguageText(itemQueue, "MyTorrentsView.menu.queue");
    Utils.setMenuItemImage(itemQueue, "start");
    itemQueue.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        ManagerUtils.queue(download, splash);
      }
    });
    itemQueue.setEnabled(ManagerUtils.isStartable(download));


    // Stop
    final MenuItem itemStop = new MenuItem(menu, SWT.PUSH);
    Messages.setLanguageText(itemStop, "MyTorrentsView.menu.stop");
    Utils.setMenuItemImage(itemStop, "stop");
    itemStop.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event e) {
        ManagerUtils.stop(download, splash);
      }
    });
    itemStop.setEnabled(ManagerUtils.isStopable(download));
   
    new MenuItem(menu, SWT.SEPARATOR);
    super.buildMenu(menu);
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.MenuItem

      return;
    }
    try {
      Utils.execSWTThread(new AERunnable() {
        public void runSupport() {
          final MenuItem torrentItem = MenuFactory.findMenuItem(
              mainWindow.getMainMenu().getMenu(IMenuConstants.MENU_ID_MENU_BAR),
              MenuFactory.MENU_ID_TORRENT, false);

          if (null != torrentItem) {

            DownloadManager[] dms = SelectedContentManager.getDMSFromSelectedContent();

            final DownloadManager[] dm_final = dms;
            final boolean detailed_view_final = false;
            if (null == dm_final) {
              torrentItem.setEnabled(false);
            } else {
              TableView<?> tv = SelectedContentManager.getCurrentlySelectedTableView();

              torrentItem.getMenu().setData("TableView", tv);
              torrentItem.getMenu().setData("downloads", dm_final);
              torrentItem.getMenu().setData("is_detailed_view",
                  Boolean.valueOf(detailed_view_final));
              torrentItem.setEnabled(true);
            }
          }
        }
      });
View Full Code Here

Examples of org.eclipse.swt.widgets.MenuItem

    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() {
      public void widgetSelected(SelectionEvent event) {
        peers_table.showColumnEditorWindow();
      }
    });
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.MenuItem

    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() {
      public void widgetSelected( SelectionEvent e ) {
        SharedFile shared_file = getSelectedObject().getSharedFile();
        String extension = FileFormatter.getFileExtension(shared_file.getSharingName());
        Program program = Program.findProgram(extension);
        if (program == null) return;
        program.execute(shared_file.getAbsolutePath());
      }
    });
   
    new MenuItem(upload_selected_menu,SWT.SEPARATOR);
   
    MenuItem upload_details = new MenuItem(upload_selected_menu,SWT.PUSH);
    upload_details.setText(Localizer._("mainwindow.transferstab.uploads.popupmenu.details"));
    upload_details.setImage(SWTImageRepository.getImage("info.png"));
    upload_details.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected( SelectionEvent e ) {
        UploadInfoWindow window = new UploadInfoWindow(getSelectedObject());
        window.getCoreComponents();
        window.initUIComponents();
      }
    });
   
    new MenuItem(upload_selected_menu,SWT.SEPARATOR);
    column_setup = new MenuItem(upload_selected_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();
View Full Code Here

Examples of org.eclipse.swt.widgets.MenuItem

    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"));
    download_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        start_download();
      }
    });

    MenuItem try_again = new MenuItem(pop_up_menu, SWT.PUSH);
    try_again.setText(_._("mainwindow.searchtab.popupmenu.try_again"));
    try_again.setImage(SWTImageRepository.getImage("refresh.png"));
    try_again.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        retry();
      }
    });

    MenuItem copy_ed2k_item = new MenuItem(pop_up_menu, SWT.PUSH);
    copy_ed2k_item.setText(_
        ._("mainwindow.searchtab.popupmenu.copy_ed2k_link"));
    copy_ed2k_item.setImage(SWTImageRepository.getImage("ed2k_link.png"));
    copy_ed2k_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
        copyED2KLinks();
      }
    });

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

    });

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

    });

    new MenuItem(pop_up_menu, SWT.SEPARATOR);

    properties_item = new MenuItem(pop_up_menu, SWT.PUSH);
    properties_item.setText(_
        ._("mainwindow.searchtab.popupmenu.properties"));
    properties_item.setImage(SWTImageRepository.getImage("info.png"));
    properties_item.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent arg0) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.