Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbench


import org.opengis.referencing.crs.CoordinateReferenceSystem;

public class RasterTutorialHandler extends AbstractHandler {

    public Object execute( ExecutionEvent event ) throws ExecutionException {
        IWorkbench workbench = PlatformUI.getWorkbench();
       
        Shell shell = workbench.getActiveWorkbenchWindow().getShell();
        FileDialog dialog = new FileDialog( shell, SWT.OPEN );
        dialog.setFilterExtensions(new String[]{"*.jpeg;*.jpg","*.png"});
        String filename = dialog.open();
        if( filename == null ) {
            return null;
View Full Code Here


    /**
     * Gets the Area of Interest workbench service
     * @return
     */
    public static IAOIService getAOIService() {
        IWorkbench workbench = PlatformUI.getWorkbench();
        return (IAOIService) workbench.getService(IAOIService.class);
    }
View Full Code Here

     * Note: This method is called by the platform; it is not intended to be called directly by
     * clients.
     * </p>
     */
    public void stop() {
        final IWorkbench workbench = PlatformUI.getWorkbench();
        if (workbench == null) {
            return;
        }
        final Display display = workbench.getDisplay();
        display.syncExec(new Runnable(){
            public void run() {
                if (!display.isDisposed()) {
                    workbench.close();
                }
            }
        });
    };
View Full Code Here

        }
    }

    /** Access the IBookmarkService for the current workbench */
    public static IBookmarkService getBookmarkService() {
        IWorkbench workbench = PlatformUI.getWorkbench();
        IBookmarkService bookmarkService = (IBookmarkService) workbench
                .getService(IBookmarkService.class);
        return bookmarkService;
    }
View Full Code Here

     *
     * @see org.eclipse.ui.IStartup#earlyStartup()
     */
    @Override
    public void earlyStartup() {
        IWorkbench wb = PlatformUI.getWorkbench();
        // IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
        IWorkbenchWindow[] winArray = wb.getWorkbenchWindows();
        final IWorkbenchPage page = winArray[0].getActivePage();
        // IWorkbenchPage page = win.getActivePage();
        final IViewReference viewRef = page.findViewReference(MergeView.ID);
        // If there is an opened MergeView then close it!
        if (viewRef != null) {
View Full Code Here

   * @see org.eclipse.equinox.app.IApplication#stop()
   */
  public void stop() {
    if (!PlatformUI.isWorkbenchRunning())
      return;
    final IWorkbench workbench = PlatformUI.getWorkbench();
    final Display display = workbench.getDisplay();
    display.syncExec(new Runnable() {
      public void run() {
        if (!display.isDisposed())
          workbench.close();
      }
    });
  }
View Full Code Here

//        if (!(unit==null || SI.METER.equals(unit) || SI.RADIAN.equals(unit.getStandardUnit()))) { // $NON-NLS-1$
            graticule.setStatus(ILayer.ERROR);
            graticule.setStatusMessage(Messages.GraticuleGraphic_Illegal_CRS);
            return;
        }
        final IWorkbench workbench = PlatformUI.getWorkbench();
        if (workbench == null)
            return;

        // Start working on layer
        graticule.setStatus(ILayer.WORKING);
        graticule.setStatusMessage(null);

        // Get display to work on
        final Display display = workbench.getDisplay();

        // Set styles
        Font plain = GraticuleStyle.getFontStyle(context).getFont();
        Font bold = plain.deriveFont(Font.BOLD);
View Full Code Here

          }     
            navigateMenu.add(new GroupMarker(IWorkbenchActionConstants.NAV_START));
            navigateMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));           
            navigateMenu.add(new GroupMarker(IWorkbenchActionConstants.NAV_END));
        }
        IWorkbench workbench = PlatformUI.getWorkbench();
        IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
        // we are using the global BACK and FORWARD actions here
        // and will register "handlers" for these commands
        navigateMenu.appendToGroup(IWorkbenchActionConstants.NAV_END,
            ActionFactory.BACK.create(window));
        navigateMenu.appendToGroup(IWorkbenchActionConstants.NAV_END,
View Full Code Here

        final StyleEditorDialog dialog;

        Shell parentShell = shell;
        if (parentShell == null) {
            // Determine a decent parent shell.
            final IWorkbench workbench = PlatformUI.getWorkbench();
            final IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
            if (workbenchWindow != null) {
                parentShell = workbenchWindow.getShell();
            } else {
                parentShell = null;
            }
View Full Code Here

        if (part == null)
            return null;
        return (IEditorSite) part.getSite();
    }
    private IWorkbenchWindow getWindow() {
        IWorkbench bench=PlatformUI.getWorkbench();
        if( bench==null)
            return null;
        IWorkbenchWindow window = bench.getActiveWorkbenchWindow();
        if( window==null ){
            if( bench.getWorkbenchWindowCount()>0 )
                window=bench.getWorkbenchWindows()[0];
        }
        return window;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IWorkbench

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.