Examples of ITask


Examples of org.eclipse.mylyn.tasks.core.ITask

      File file = new File(getStateLocation().toFile(), "incoming.xml.zip");
      try {
        FileOutputStream fos = new FileOutputStream(file);
        fos.write(data);
        List tasks = TasksUiPlugin.getTaskListManager().getTaskListWriter().readTasks(file);
        final ITask task = (ITask) tasks.get(0);
        Set repositories = TasksUiPlugin.getTaskListManager().getTaskListWriter().readRepositories(file);
        TasksUiPlugin.getRepositoryManager().insertRepositories(repositories, TasksUiPlugin.getDefault().getRepositoriesFilePath());
        IInteractionContext context = ContextCore.getContextStore().importContext(task.getHandleIdentifier(), file);
        CompoundContextActivationContributionItem.enqueue(task, context);

        IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
        Shell aShell = null;
        for (int i = 0; i < windows.length; i++) {
View Full Code Here

Examples of org.eclipse.mylyn.tasks.core.ITask

  }

  protected IContributionItem[] getContributionItems() {
    int count = 0;
    for (Iterator it = tasks.iterator(); it.hasNext() && count != 5;) {
      ITask task = (ITask) it.next();
      actions[count].setShell(shell);
      actions[count].setTask(task);
      count++;
    }
View Full Code Here

Examples of org.eclipse.mylyn.tasks.core.ITask

          if (channel == null) {
            return null;
          }
          Object element = ((IStructuredSelection) selection).getFirstElement();
          if (element instanceof ITask) {
            final ITask task = (ITask) element;
            Job job = new Job("Send Task") {
              protected IStatus run(IProgressMonitor monitor) {
                monitor.beginTask("Sending task...", 5);
                ByteArrayOutputStream stream = new ByteArrayOutputStream();
                TasksUiPlugin.getTaskListManager().getTaskListWriter().writeTask((AbstractTask) task, stream);
View Full Code Here

Examples of org.freeplane.plugin.workspace.io.ITask

      LogUtils.warn(e);
    }
  }

  private ITask getPostOperation(final AWorkspaceTreeNode targetNode, final AWorkspaceTreeNode node, final File srcFile, final File destFile) {
    return new ITask() {     
      public void exec(Properties properties) throws IOException {
        if(onSkipList(destFile.getParentFile(), properties)) {
          throw new SkipTaskException();
        }
        AWorkspaceTreeNode parent = node.getParent();
View Full Code Here

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

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

   * 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

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

   * 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

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

    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

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

            mainFrame.dispose();
          }
        }
      });

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

      new Thread(new Runnable() {
        @Override
        public void run() {
View Full Code Here

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

    // 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
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.