Package q_impress.pmi.lib.tasks

Examples of q_impress.pmi.lib.tasks.AbstractTask


    removeTaskButton.setEnabled(false);
    removeTaskButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        IStructuredSelection selection = (IStructuredSelection) tasksListViewer.getSelection();
        AbstractTask task = (AbstractTask) selection.getFirstElement();
        try {
          getInputProject().removeResource(task.getId());
          tasksListSectionPart.markStale();
          tasksListSectionPart.markDirty();
        } catch (ResourceException e1) {
          //TODO add exception handling here
        }
      }
    });
   
    executeTaskButton = toolkit.createButton(buttonComposite, "Execute", SWT.PUSH);
    executeTaskButton.setLayoutData(gd);
    executeTaskButton.setEnabled(false);
    executeTaskButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        // check that the editor is not dirty
        if (!getEditor().isDirty()) {
          IStructuredSelection selection = (IStructuredSelection) tasksListViewer.getSelection();
          AbstractTask task = (AbstractTask) selection.getFirstElement();
          if (task.canExecute()) {
            try {
              task.execute();
              tasksListSectionPart.markStale();
              tasksListSectionPart.markDirty();
            } catch (TaskException e1) {
              ErrorDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(),
                  "Task Execution", "Task execution failed", new Status(IStatus.ERROR, "q_impress", e1.getMessage(), e1));
View Full Code Here

TOP

Related Classes of q_impress.pmi.lib.tasks.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.