Package org.eclipse.jface.operation

Examples of org.eclipse.jface.operation.IRunnableWithProgress.run()


        Job job = new Job("validation") {

          @Override
          protected IStatus run(IProgressMonitor monitor) {
            try {
              runnable.run(monitor);
              return Status.OK_STATUS;
            } catch (Exception e) {
              return new Status(Status.ERROR, Plugin.PLUGIN_ID, "Validation failed", e);
            }
          }
View Full Code Here


        try {
            IRunnableContext runContext = searchContext.getRunContext();
            if (runContext != null) {
                runContext.run(false, false, runnable);
            } else {
                runnable.run(new NullProgressMonitor());
            }
            return result;
        } catch (InvocationTargetException e) {
            logger.logError("Error searching for packages.", e);
            return Collections.emptyList();
View Full Code Here

                    }
                };
                if (Display.getCurrent() != null)
                    PlatformGIS.runBlockingOperation(object, monitor);
                else {
                    object.run(monitor);
                }
            } catch (Exception e) {
                ProjectPlugin.log("Error getting layer resources", e); //$NON-NLS-1$
            }
View Full Code Here

        // disposing of services could take a long time so do it in a non-UI thread
        if( Display.getCurrent()!=null ){
            PlatformGIS.run(runnable);
        }else{
            try {
                runnable.run(new NullProgressMonitor());
            } catch (InvocationTargetException e) {
                throw (RuntimeException) new RuntimeException( ).initCause( e );
            } catch (InterruptedException e) {
                throw (RuntimeException) new RuntimeException( ).initCause( e );
            }
View Full Code Here

            }
        };

        if (Display.getCurrent()!=null ){
            try {
                runnable.run(ProgressManager.instance().get());
            } catch (Exception e) {
                throw (RuntimeException) new RuntimeException( ).initCause( e );
            }
        }else{
            PlatformGIS.syncInDisplayThread(new Runnable(){
View Full Code Here

                };
                if (fork) {
                    getContainer().run(false, true, runnable);
                } else {
                    runnable.run(new NullProgressMonitor());
                }
            } catch (Exception e) {
                CatalogUIPlugin.log("", e); //$NON-NLS-1$
            }
            resolveMap.put(resolve, list);
View Full Code Here

        //if toggling lots of lines then use progress monitor else just run the operation
        if((selectionEndLine - selectionStartLine) > TOGGLE_LINES_MAX_NO_BUSY_INDICATOR && display != null) {
          ProgressMonitorDialog dialog = new ProgressMonitorDialog(display.getActiveShell());
          dialog.run(false, true, toggleCommentsRunnable);
        } else {
          toggleCommentsRunnable.run(new NullProgressMonitor());
        }
      }
    } catch (InvocationTargetException e) {
      Logger.logException("Problem running toggle comment progess dialog.", e)//$NON-NLS-1$
    } catch (InterruptedException e) {
View Full Code Here

      };
     
     
      try {
       
        runnable.run(monitor);       
       
        if(fContentProvider.getTotalElementCount() == 0) {             
          Display.getDefault().syncExec(new Runnable() {
            public void run() {
              setContentDescription("Error creating a slice");
View Full Code Here

        }       
      };
     
      try {
        try {
          runnable.run(monitor);
        } catch ( RuntimeException e) {         
          return Status.CANCEL_STATUS;
        }
       
        if(fContentProvider.getTotalElementCount() == 0) {             
View Full Code Here

        }
      }
    };
   
    try {
      op.run(null);
    } catch (InvocationTargetException e) {
      e.printStackTrace();
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
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.