Examples of ITask


Examples of org.jamesii.gui.application.task.ITask

        @Override
        public void run() {
          final Semaphore s = new Semaphore(0);
          final Semaphore blocking = new Semaphore(0);

          ITask basicTaskBeforeBlocking = new AbstractTask() {

            @Override
            public void task() {
              try {
                Thread.sleep(RUNTIME);
              } catch (InterruptedException e) {
                assertQueue.add(new FailRunnable(e));
              }
            }

            @Override
            protected void cancelTask() {
            }

          };

          ITask blockingTask = new AbstractTask() {

            @Override
            public void task() {
              try {
                Thread.sleep(RUNTIME);
                blocking.release();
              } catch (InterruptedException e) {
                assertQueue.add(new FailRunnable(e));
              }
            }

            @Override
            public boolean isBlocking() {
              return true;
            }

            @Override
            protected void cancelTask() {
            }

          };

          ITask basicTaskAfterBlocking = new AbstractTask() {

            @Override
            public void task() {
              // check whether blocking task already finished
              try {
View Full Code Here

Examples of org.jamesii.gui.application.task.ITask

    for (int i = 0; i < count; i++) {
      final int j = i;
      semaphores.add(new Semaphore(0));

      final ITask task = new AbstractTask() {
        private final int index = j;

        private final boolean blocking = Math.random() < 0.3;

        @Override
View Full Code Here

Examples of org.jamesii.gui.application.task.ITask

    });

    // now get all the autotasks and execute their applicationStarted
    // methods
    ITask autoTaskTask = new RunningAutoTasks("Running Autotasks");

    TaskManager.addTask(autoTaskTask);
  }
View Full Code Here

Examples of org.jamesii.gui.application.task.ITask

      @Override
      public void execute() {
        // simply activate and deactive perspectives according to the preset
        // show progress window
        // put this into ITask and let the TaskManager take care of execution
        ITask task = new AbstractTask("Applying perspective changes") {

          @Override
          protected void task() {
            setTaskInfo(getName() + "...");
            PerspectivePresetManager.setPreset(p);
View Full Code Here

Examples of org.jamesii.gui.application.task.ITask

      @Override
      public void propertyChange(PropertyChangeEvent evt) {
        final String laf =
            lafComboModel.getSelectedLookAndFeelInfo().getClassName();
        ITask task = new AbstractTask("Preview Look and Feel") {

          @Override
          protected void task() {
            BasicUtilities.invokeLaterOnEDT(new Runnable() {
View Full Code Here

Examples of org.rssowl.core.model.util.ITask

    /* Start a new Job for each free Slot */
    for (int i = fRunningJobs.get(); i < fMaxConcurrentJobs && tasks.peek() != null; i++) {
      Job job = new Job("") { //$NON-NLS-1$
        @Override
        protected IStatus run(IProgressMonitor monitor) {
          final ITask task = tasks.poll();

          /* Perform the Operation if not yet Canceld */
          try {
            task.run(monitor);
          } catch (Exception e) {
            /* Ignore */
          }

          /* Inform about cancelation if present */
 
View Full Code Here

Examples of org.rssowl.core.util.ITask

    /* Save some Feeds first */
    saveFeedsHelper();

    /* Query 1: News is *new*, *unread*, *updated*, *read* */
    ITask task = new TaskAdapter() {
      public IStatus run(IProgressMonitor monitor) {
        List<ISearchCondition> conditions = new ArrayList<ISearchCondition>();

        ISearchField field1 = factory.createSearchField(INews.STATE, INews.class.getName());
        conditions.add(factory.createSearchCondition(field1, SearchSpecifier.IS, EnumSet.of(INews.State.NEW, State.UNREAD, State.UPDATED, State.READ)));
View Full Code Here

Examples of org.rssowl.core.util.ITask

    Job job = new Job("") { //$NON-NLS-1$
      @Override
      protected IStatus run(final IProgressMonitor monitor) {

        /* Poll the next Task */
        final ITask task = fOpenTasksQueue.poll();

        /* Queue is empty - so all work is done */
        if (task == null)
          return Status.OK_STATUS;

        /* Perform the Operation if not yet Cancelled */
        if (!monitor.isCanceled()) {
          SafeRunner.run(new LoggingSafeRunnable() {
            public void run() throws Exception {
              IStatus status = task.run(monitor);

              /* Log anything that is an Error or Warning */
              if (status.getSeverity() == IStatus.ERROR || status.getSeverity() == IStatus.WARNING)
                Activator.getDefault().getLog().log(status);
            }
View Full Code Here

Examples of org.rssowl.core.util.ITask

    /* Save some Feeds first */
    saveFeedsHelper();

    /* Query 1: News is *new*, *unread*, *updated*, *read* */
    ITask task = new TaskAdapter() {
      public IStatus run(IProgressMonitor monitor) {
        List<ISearchCondition> conditions = new ArrayList<ISearchCondition>();

        ISearchField field1 = factory.createSearchField(INews.STATE, INews.class.getName());
        conditions.add(factory.createSearchCondition(field1, SearchSpecifier.IS, EnumSet.of(INews.State.NEW, State.UNREAD, State.UPDATED, State.READ)));
View Full Code Here

Examples of org.rssowl.core.util.ITask

    Job job = new Job("") { //$NON-NLS-1$
      @Override
      protected IStatus run(final IProgressMonitor monitor) {

        /* Poll the next Task */
        final ITask task = fOpenTasksQueue.poll();

        /* Queue is empty - so all work is done */
        if (task == null)
          return Status.OK_STATUS;

        /* Perform the Operation if not yet Cancelled */
        if (!monitor.isCanceled()) {
          SafeRunner.run(new LoggingSafeRunnable() {
            public void run() throws Exception {
              IStatus status = task.run(monitor);

              /* Log anything that is an Error or Warning */
              if (status.getSeverity() == IStatus.ERROR || status.getSeverity() == IStatus.WARNING)
                Activator.getDefault().getLog().log(status);
            }
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.