public HoldInstance (DataObject source, InstanceCookie cookie) { this.cookie = cookie; this.source = source; if (cookie instanceof Task) { // for example FolderInstance ;-) attach itself for changes // in the cookie Task t = (Task)cookie; t.addTaskListener ( (TaskListener)org.openide.util.WeakListeners.create (TaskListener.class, this, t) ); } }
public static void redefineLayout(Project p, JButton toEnable) { try { AtomicReference<FileObject> userDir = new AtomicReference<FileObject>(); Task task = invokeDesignMode(p, userDir); if (task == null) { toEnable.setEnabled(true); } task.addTaskListener(new DesignSupport(p, toEnable, userDir)); } catch (IOException ex) { Exceptions.printStackTrace(ex); } }
@Override public void run() { if (evalTask != null) { evalTask.removeTaskListener(QuickSearchPopup.this); } evalTask = CommandEvaluator.evaluate(searchedText, rModel); evalTask.addTaskListener(QuickSearchPopup.this); // start waiting on all providers execution RP.post(evalTask); } });
task.addTaskListener(new PostProcess()); } catch (IOException e) { NotifyDescriptor.Message msg = new NotifyDescriptor.Message(e.getMessage(),
/** Creates new form CustomizerFrameworks */ public CustomizerFrameworks(ProjectCustomizer.Category category, WebProjectProperties uiProperties) { this.category = category; this.uiProperties = uiProperties; initComponents(); project = uiProperties.getProject(); jListFrameworks.setModel(new DefaultListModel()); ((DefaultListModel) jListFrameworks.getModel()).addElement(NbBundle.getMessage(CustomizerFrameworks.class, "LBL_CustomizerFrameworks_Loading")); // do not load frameworks again but use list from uiProperties; list is being loaded in background thread: uiProperties.getLoadingFrameworksTask().addTaskListener(new TaskListener() { public void taskFinished(Task task) { SwingUtilities.invokeLater(new Runnable() { public void run() { initFrameworksList(project.getAPIWebModule()); } }); } }); if (uiProperties.getLoadingFrameworksTask().isFinished()) { initFrameworksList(project.getAPIWebModule()); } }
t.addTaskListener (new Selector ()); return e;
t.addTaskListener (new Selector ()); return e;
prepareTask = t; t.addTaskListener(new TaskListener() { public void taskFinished(Task task) { counterPrepareDocument--;
t.addTaskListener(new Selector());