Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.ContributionItem


    fTrayItem.addListener(SWT.MenuDetect, new Listener() {
      public void handleEvent(Event event) {
        MenuManager trayMenu = new MenuManager();

        /* Restore */
        trayMenu.add(new ContributionItem() {
          @Override
          public void fill(Menu menu, int index) {
            MenuItem restoreItem = new MenuItem(menu, SWT.PUSH);
            restoreItem.setText("Restore");
            restoreItem.addSelectionListener(new SelectionAdapter() {
View Full Code Here


    fTrayItem.addListener(SWT.MenuDetect, new Listener() {
      public void handleEvent(Event event) {
        MenuManager trayMenu = new MenuManager();

        /* Restore */
        trayMenu.add(new ContributionItem() {
          @Override
          public void fill(Menu menu, int index) {
            MenuItem restoreItem = new MenuItem(menu, SWT.PUSH);
            restoreItem.setText("Restore");
            restoreItem.addSelectionListener(new SelectionAdapter() {
View Full Code Here

  private void showTrayMenu(final Shell shell) {
    MenuManager trayMenuManager = new MenuManager();

    /* Restore */
    trayMenuManager.add(new ContributionItem() {
      @Override
      public void fill(Menu menu, int index) {
        MenuItem restoreItem = new MenuItem(menu, SWT.PUSH);
        restoreItem.setText(Messages.ApplicationWorkbenchWindowAdvisor_RESTORE);
        restoreItem.addSelectionListener(new SelectionAdapter() {
View Full Code Here

      }
    }

    // remove items from this action set that are in other action bars
    for (int i = 0; i < adjunctContributions.size(); i++) {
      ContributionItem item = (ContributionItem) adjunctContributions
          .get(i);
      IContributionManager parent = item.getParent();
      if (parent != null) {
        parent.remove(item);
        item.dispose();
      }
    }
    toolBarContributionItem = null;
    coolItemToolBarMgr = null;
    adjunctContributions = new ArrayList();
View Full Code Here

    curStack.setMinimized(false);
  }

  public void initToolBarManager(final ToolBarManager mgr) {
    // Set up the ToolBar with a restore button
    IContributionItem restoreContrib = new ContributionItem() {
      public void fill(ToolBar parent, int index) {
            ToolItem restoreItem = new  ToolItem(mgr.getControl(), SWT.PUSH, index);       
            Image tbImage = WorkbenchImages.getImage(IWorkbenchGraphicConstants.IMG_ETOOL_RESTORE_TRIMPART);
            restoreItem.setImage(tbImage);      
            String menuTip = WorkbenchMessages.StandardSystemToolbar_Restore;
            restoreItem.setToolTipText(menuTip);
            restoreItem.addSelectionListener(new SelectionListener() {
          public void widgetDefaultSelected(SelectionEvent e) {
            restoreToPresentation();
          }
          public void widgetSelected(SelectionEvent e) {
            restoreToPresentation();
          }
            });
      }
    };
    mgr.add(restoreContrib);

    // Set up the ToolBar with a button represing the Editor Area
    IContributionItem eaContrib = new ContributionItem() {
      public void fill(ToolBar parent, int index) {
            ToolItem editorAreaItem = new  ToolItem(mgr.getControl(), SWT.PUSH, index);       
            Image tbImage = WorkbenchImages.getImage(IWorkbenchGraphicConstants.IMG_ETOOL_EDITOR_TRIMPART);
            editorAreaItem.setImage(tbImage);      
            String menuTip = WorkbenchMessages.EditorArea_Tooltip;
View Full Code Here

                                if(toolElement.getAttribute("class") != null){
                                    try {
                                        String contributionId = toolElement.getAttribute("id");
                                       
                                        Object optionsContribution = toolElement.createExecutableExtension("class");
                                        ContributionItem contributionItem = (ContributionItem) optionsContribution;
                                        contributionItem.setId(contributionId);
                                       
                                        addOptionsContribution((ContributionItem) optionsContribution);
                                    } catch (CoreException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
View Full Code Here

   *
   * @return The contribution item for the handle's context menu.
   */
  public ContributionItem getDockingContribution() {
      if (dockContributionItem == null) {
        dockContributionItem = new ContributionItem() {
          public void fill(Menu menu, int index) {
            // populate from superclass
            super.fill(menu, index);
           
            // Add a 'Close' menu entry if the trim supports the operation
View Full Code Here

    for (int i = 0; i < fActions.length; i++) {
     
      final int j = i;

      //We create the menu
      viewMenu.add(new ContributionItem() {//Contribution item in a menu is a button or a separator. A contribution item in a menu bar is a menu
       
        public void fill(Menu menu, int index) {
          // System.err.println("Filling the menu");
          int style = SWT.CHECK;
         
View Full Code Here

      if ((fInitial != null) && fInitial[j]) {
        fActions[j].run();
      }

      viewMenu.add(new ContributionItem() {
        public void fill(Menu menu, int index) {
          // System.err.println("Filling the menu");
          int style = SWT.CHECK;

          MenuItem mi = new MenuItem(menu, style, index);
View Full Code Here

   *
   * @return The contribution item for the handle's context menu.
   */
  private ContributionItem getDockingContribution() {
      if (dockContributionItem == null) {
        dockContributionItem = new ContributionItem() {
          public void fill(Menu menu, int index) {
            // populate from superclass
            super.fill(menu, index);
           
            // Add a 'Close' menu entry if the trim supports the operation
View Full Code Here

TOP

Related Classes of org.eclipse.jface.action.ContributionItem

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.