Package org.jamesii.gui.application.task

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


   * Helper method that is invoked when the preferences dialog is to be closed.
   * It delegates to the {@link IPreferencesPage#closed()} method of all
   * preference pages.
   */
  private void close() {
    ITask task = new ClosePrefPagesTask("Closing Preferences Pages");

    TaskManager.addTask(task);

    setVisible(false);
    dispose();
View Full Code Here


   * Helper method that is invoked when the restore button is clicked and it
   * delegates to {@link IPreferencesPage#restoreDefaults()} of all registering
   * pages
   */
  private synchronized void restoreDefaults() {
    ITask task = new RestoreDefaultsTask("Restoring Defaults");

    ProgressDialog.runTask(task);
  }
View Full Code Here

   * 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

    gcButton.setToolTipText("Run Garbage Collector");
    gcButton.addActionListener(new ActionListener() {

      @Override
      public void actionPerformed(ActionEvent e) {
        ITask task = new RunGCTask("Running GC");
        TaskManager.addTask(task);
      }

    });
View Full Code Here

            mainFrame.dispose();
          }
        }
      });

      final ITask task =
          new ExitApplicationTask("Exiting Application", emergency);

      new Thread(new Runnable() {
        @Override
        public void run() {
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

    });

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

    TaskManager.addTask(autoTaskTask);
  }
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

TOP

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

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.