Package org.eclipse.core.runtime.jobs

Examples of org.eclipse.core.runtime.jobs.Job


        // TODO: read, write

        Job[] jobs = Platform.getJobManager().find( null );
        for ( int i = 0; i < jobs.length; i++ )
        {
            Job job = jobs[i];

            // if(job instanceof AbstractEclipseJob) {
            if ( job.getClass() == this.getClass() && job != this )
            {

                AbstractEclipseJob otherJob = ( AbstractEclipseJob ) job;
                Object[] otherLockedObjects = otherJob.getLockedObjects();
                String[] otherLockedObjectIdentifiers = getLockIdentifiers( otherLockedObjects );
View Full Code Here


            IEditorInput input = editor.getEditorInput();
            final Display display = text.getDisplay();
            final URI uri = URIHelper.retrieveFileURI(input);

            if (uri != null) {
                displayJob = new Job("Load zip content") {
                    @Override
                    protected IStatus run(IProgressMonitor monitor) {
                        File ioFile = new File(uri);
                        ZipFile zipFile = null;
                        try {
View Full Code Here

        return;
      }
    }

    final IContainer root = ResourcesPlugin.getWorkspace().getRoot();
    Job job = new WorkspaceJob(IDEWorkbenchMessages.Workspace_refreshing) {
      public IStatus runInWorkspace(IProgressMonitor monitor)
          throws CoreException {
        root.refreshLocal(IResource.DEPTH_INFINITE, monitor);
        return Status.OK_STATUS;
      }
    };
    job.setRule(root);
    job.schedule();
  }
View Full Code Here

            } else {
                uri = null;
            }

            if (uri != null) {
                displayJob = new Job("Load zip content") {
                    @Override
                    protected IStatus run(IProgressMonitor monitor) {
                        File ioFile = new File(uri);
                        ZipFile zipFile = null;
                        try {
View Full Code Here

  /**
   * Creates the job that performs garbage collection
   */
  private void createGarbageCollectionJob() {
    gcJob = new Job(IDEWorkbenchMessages.IDEIdleHelper_backgroundGC) {
      protected IStatus run(IProgressMonitor monitor) {
        final Display display = configurer.getWorkbench().getDisplay();
        if (display != null && !display.isDisposed()) {
          final long start = System.currentTimeMillis();
          System.gc();
View Full Code Here

     */
    public void toggleLineBreakpoints(final IWorkbenchPart part, final ISelection selection)
        throws CoreException
    {
        // TODO: status bar messages
        Job job =
            new Job("Toggle Line Breakpoint (epic)")
        {
            protected IStatus run(IProgressMonitor monitor)
            {
                ITextEditor editor = getTextEditor(part);
                if ((editor == null) || ! (selection instanceof ITextSelection))
                {
                    return Status.OK_STATUS;
                }

                int lineNumber = ((TextSelection) selection).getStartLine() + 1;
                IResource resource = getResource(editor);

                try
                {
                    IBreakpoint breakpoint =
                        PerlDebugModel.lineBreakpointExists(resource, lineNumber);

                    if (breakpoint != null)
                    {
                        removeBreakpoint(breakpoint, true);
                    }
                    else
                    {
                        createLineBreakpoint(resource, lineNumber);
                    }

                    return Status.OK_STATUS;
                }
                catch (CoreException e)
                {
                    return e.getStatus();
                }
            }
        };

        job.setSystem(true);
        job.schedule();
    }
View Full Code Here

     * Starts an asynchronous, low-priority PerlBuilderJob which does
     * the actual validation work.
     */
    private void startPerlBuilderJob()
    {
        Job job = new PerlBuilderJob(
            getSortedDirtyResources(),
            validatedResources);
       
        job.setPriority(Job.DECORATE);
        job.schedule();
    }
View Full Code Here

  public String getJobName() {
    return JOBNAME;
  }

  protected Job getJob() {
    Job job = super.getJob();
    job.setUser(true);
    return job;
  }
View Full Code Here

            getProject(launch),
            getRemoteProjectDir(launch));
       
        if (shouldCreateDebugPackage(launch))
        {
            Job job = new CreateRemotePackageJob(this, launch, mapper);
            job.schedule();
        }
       
        int debugPortNo = Integer.parseInt(getEpicDebuggerPort(launch));
        RemotePort debugPort = new RemotePort(
            "DebugTarget.mDebugPort", debugPortNo, debugPortNo);
View Full Code Here

        exception[0] = null;

        final Synchroniser synchroniser = new Synchroniser();

        // fork thread as a Job
        Job job = new Job(jobName) {

          protected IStatus run(IProgressMonitor arg0) {

            try {
              CloudFoundryPlugin.getCloudFoundryClientFactory()
                  .getCloudFoundryOperations(url).getCloudInfo();
              shouldProceed[0] = new Boolean(true);

            }
            catch (Exception e) {
              exception[0] = e;
            }
            finally {
              synchroniser.completed();
            }

            return Status.OK_STATUS;
          }

        };
        job.setPriority(Job.INTERACTIVE);
        job.schedule();

        // FIXNS: Could also add timeout, although consideration needs
        // to be taken for long-running validations that do validate a
        // URL
        // rather than generate an error, in particular if the timeout
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.jobs.Job

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.