Package org.jamesii.gui.application.task

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


   * Helper method that is invoked when the restore button is clicked and it
   * delegates to {@link IPreferencesPage#applyPreferences(IProgressListener)}
   * of all registered pages.
   */
  private synchronized void apply() {
    ITask task = new AbstractTask("Applying") {

      @Override
      protected void task() {
        for (final IPreferencesPage p : pages) {
          if (p != null) {
View Full Code Here


      filteringTask.cancel();
      filteringTask = null;
    }

    // check if there is another recreation running
    filteringTask = new AbstractTask("Filtering...") {
      private boolean canceled = false;

      private final E filterValue = filter != null ? filter.getFilterValue()
          : null;
View Full Code Here

    // after a blocking task are executed after
    // the blocking task has finished
    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 (final 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 (final 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

        @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

    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

      @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

      @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

TOP

Related Classes of org.jamesii.gui.application.task.AbstractTask

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.