Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.Action


       
    }   
   
    private void makeActions (){

    _startWGARuntime = new Action() {
        public void run() {
            if (_table.getTable().getItemCount() > 0) {
                if (TomcatUtils.getInstance().isRunning(_selectedRuntime)) {
                    RestartWGARuntime.call();
                }
                else {
                    StartWGARuntime.call(_selectedRuntime);
                }               
            }
        }
    };

    _startWGARuntime.setText("Start/ restart WGA Runtime");
    _startWGARuntime.setImageDescriptor(ImageDescriptor.createFromImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_SERVER_START)));
    _startWGARuntime.setDisabledImageDescriptor(ImageDescriptor.createFromImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_INAKTIV_WGA_SERVER_START)));

    _refreshAction = new Action() {
        public void run() {
            updateWorkingSetList();
            _table.refresh()
         }
    };
    _refreshAction.setText("Refresh view");
    _refreshAction.setImageDescriptor(ImageDescriptor.createFromImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_REFRESH)));

    // _refreshAction.setEnabled(enabled);
    _stopWGARuntime = new Action() {
        public void run() {
            StopWGARuntime.call();
        }
    };

    _stopWGARuntime.setText("Stop WGA Runtime");
    // stopWGARuntime.setToolTipText("Action 2 tooltip");
    _stopWGARuntime.setImageDescriptor(ImageDescriptor.createFromImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_SERVER_STOP)));
    _stopWGARuntime.setDisabledImageDescriptor(ImageDescriptor.createFromImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_INAKTIV_WGA_SERVER_STOP)));
    _stopWGARuntime.setEnabled(false);
   
    _doubleClickAction = new Action() {
        public void run() {
            ISelection selection = _table.getSelection();
            Object obj = ((IStructuredSelection) selection).getFirstElement();
            if (obj instanceof WGARuntime) {
                WGARuntime runtime  = (WGARuntime)obj;
View Full Code Here


    super(parentShell, new ToolBarManager());
    _width = intialWidth;
    _height = initialHeight;
    _shell = parentShell;

    _openInExternalBrowser = new Action("Open documentation", ImageDescriptor.createFromImage(Plugin.getDefault().getImageRegistry().get(Plugin.IMAGE_TML_LINK_TO_DOC))) {
      public void run() {   
          WorkbenchUtils.openBrowser(_input.getDocLocation(), _shell.getDisplay(), "OpenWGA Documentation");
      }
    };
View Full Code Here

        sectionClient.setLayout(sectionLayout);

        ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
        ToolBar toolbar = toolBarManager.createControl(section);

        Action action1 = new Action("refresh", Plugin.getDefault().getImageRegistry().getDescriptor(Plugin.IMAGE_REFRESH)) {
            public void run() {
                try {
                    refresh();
                }
                catch (IOException e) {
View Full Code Here

   
    if (snippetsAdded) {
      addSeparatorToMenu(menu);
    }
   
    addActionToMenu(menu, new Action("configure snippets ...") {
      @Override
      public void run() {
        PreferenceDialog pref = PreferencesUtil.createPreferenceDialogOn(new Shell(), ResourceIDs.PREFERENCES_PAGE_CODE_SNIPPETS, null, null);
        if (pref != null) {     
          pref.open();   
View Full Code Here

    _model.getWgaRuntime().addListener(this);
   
    ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
    ToolBar toolbar = toolBarManager.createControl(_webAppSection);
  
    Action action1 = new Action("refresh", WGADesignerPlugin.getDefault().getImageRegistry().getDescriptor(WGADesignerPlugin.IMAGE_REFRESH)) {
      public void run() {
        refreshWebApplications();       
      }

View Full Code Here

  }

  private void createGlobalActions() {

    /* Select All */
    fSelectAllAction = new Action() {
      @Override
      public void run() {
        Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();

        /* Select All in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).selectAll();
      }
    };

    /* Cut */
    fCutAction = new Action() {
      @Override
      public void run() {
        Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();

        /* Cut in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).cut();
      }
    };

    /* Copy */
    fCopyAction = new Action() {
      @Override
      public void run() {
        Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();

        /* Copy in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).copy();
      }
    };

    /* Paste */
    fPasteAction = new Action() {
      @Override
      public void run() {
        Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();

        /* Paste in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).paste();
      }
    };

    /* Print */
    fPrintAction = new Action() {
      @Override
      public void run() {
        fBrowser.print();
      }
    };
View Full Code Here

  private void createNavigationToolBar(Composite parent) {
    fNavigationToolBarManager = new ToolBarManager(SWT.FLAT);

    /* Navigate Backward */
    IAction navBackward = new Action("Back") {
      @Override
      public void run() {
        fBrowser.back();
      }

      @Override
      public boolean isEnabled() {
        return fBrowser != null && fBrowser.getControl().isBackEnabled();
      }
    };
    navBackward.setId(BACK_ACTION);
    navBackward.setImageDescriptor(OwlUI.getImageDescriptor("icons/etool16/backward.gif")); //$NON-NLS-1$
    navBackward.setDisabledImageDescriptor(OwlUI.getImageDescriptor("icons/dtool16/backward.gif")); //$NON-NLS-1$
    fNavigationToolBarManager.add(navBackward);

    /* Navigate Forward */
    IAction navForward = new Action("Forward") {
      @Override
      public void run() {
        fBrowser.forward();
      }

      @Override
      public boolean isEnabled() {
        return fBrowser != null && fBrowser.getControl().isForwardEnabled();
      }
    };
    navForward.setId(FORWARD_ACTION);
    navForward.setImageDescriptor(OwlUI.getImageDescriptor("icons/etool16/forward.gif")); //$NON-NLS-1$
    navForward.setDisabledImageDescriptor(OwlUI.getImageDescriptor("icons/dtool16/forward.gif")); //$NON-NLS-1$
    fNavigationToolBarManager.add(navForward);

    /* Stop */
    IAction stopNav = new Action("Stop") {
      @Override
      public void run() {
        fBrowser.getControl().stop();
      }
    };
    stopNav.setImageDescriptor(OwlUI.getImageDescriptor("icons/etool16/cancel.gif")); //$NON-NLS-1$
    fNavigationToolBarManager.add(stopNav);

    /* Reload */
    IAction reload = new Action("Reload") {
      @Override
      public void run() {
        fBrowser.getControl().refresh();
      }
    };
    reload.setImageDescriptor(OwlUI.getImageDescriptor("icons/elcl16/reload.gif")); //$NON-NLS-1$
    fNavigationToolBarManager.add(reload);

    /* Home */
    IAction navHome = new Action("Home") {
      @Override
      public void run() {
        fBrowser.setUrl(fInput.getUrl());
      }
    };
    navHome.setImageDescriptor(OwlUI.getImageDescriptor("icons/etool16/home.gif")); //$NON-NLS-1$
    fNavigationToolBarManager.add(navHome);

    fNavigationToolBarManager.createControl(parent);
  }
View Full Code Here

  }

  private void createGlobalActions() {

    /* Hook into Reload */
    fReloadAction = new Action() {
      @Override
      public void run() {
        new ReloadTypesAction(new StructuredSelection(fInput.getMark()), getEditorSite().getShell()).run();
      }
    };

    /* Mark All Read */
    fMarkAllReadAction = new Action("Mark all News as Read") {
      @Override
      public void run() {
        new MarkReadAction(new StructuredSelection(fInput.getMark())).run();
      }
    };

    /* Select All */
    fSelectAllAction = new Action() {
      @Override
      public void run() {
        Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();

        /* Select All in Text Widget */
        if (focusControl instanceof Text) {
          ((Text) focusControl).selectAll();
        }

        /* Select All in Viewer Tree */
        else {
          ((Tree) fNewsTableControl.getViewer().getControl()).selectAll();
          fNewsTableControl.getViewer().setSelection(fNewsTableControl.getViewer().getSelection());
        }
      }
    };

    /* Delete */
    fDeleteAction = new Action() {
      @Override
      public void run() {
        new DeleteTypesAction(fParent.getShell(), (IStructuredSelection) fNewsTableControl.getViewer().getSelection()).run();
      }
    };

    /* Cut */
    fCutAction = new Action() {
      @Override
      public void run() {
        Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();

        /* Cut in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).cut();
      }
    };

    /* Copy */
    fCopyAction = new Action() {
      @Override
      public void run() {
        Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();

        /* Copy in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).copy();
      }
    };

    /* Paste */
    fPasteAction = new Action() {
      @Override
      public void run() {
        Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();

        /* Paste in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).paste();
      }
    };

    /* Find */
    fFindAction = new Action() {
      @Override
      public void run() {
        if (fFilterBar != null)
          fFilterBar.focusQuickSearch();
      }
    };

    /* Print */
    fPrintAction = new Action() {
      @Override
      public void run() {
        if (fNewsBrowserControl != null)
          fNewsBrowserControl.getViewer().getBrowser().print();
      }
View Full Code Here

    fFolderViewer.setSelection(new StructuredSelection(fSelectedFolder));
    fFolderViewer.setExpandedState(fSelectedFolder, true);

    /* Add Menu: "New Folder" */
    MenuManager menuManager = new MenuManager();
    menuManager.add(new Action("New Folder...") {
      @Override
      public void run() {
        onNewFolder();
      }
    });
View Full Code Here

  }

  private void createGlobalActions() {

    /* Select All */
    fSelectAllAction = new Action() {
      @Override
      public void run() {
        Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();

        /* Select All in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).selectAll();
      }
    };

    /* Cut */
    fCutAction = new Action() {
      @Override
      public void run() {
        Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();

        /* Cut in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).cut();
      }
    };

    /* Copy */
    fCopyAction = new Action() {
      @Override
      public void run() {
        Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();

        /* Copy in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).copy();
      }
    };

    /* Paste */
    fPasteAction = new Action() {
      @Override
      public void run() {
        Control focusControl = fEditorSite.getShell().getDisplay().getFocusControl();

        /* Paste in Text Widget */
        if (focusControl instanceof Text)
          ((Text) focusControl).paste();
      }
    };

    /* Print */
    fPrintAction = new Action() {
      @Override
      public void run() {
        fBrowser.print();
      }
    };
View Full Code Here

TOP

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

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.