better handling of annotations BLD200410031800
authorlebedkov@netbeans.org
Sat, 02 Oct 2004 14:03:48 +0000
changeset 528719f531da606c
parent 5286 8063794c37c7
child 5288 5271d632d75f
better handling of annotations
tasklist.core/src/org/netbeans/modules/tasklist/core/Bundle.properties
tasklist.editor/src/org/netbeans/modules/tasklist/editor/NewTaskEditorAction.java
tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/Bundle.properties
tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/EditTaskPanel.java
tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskNode.java
tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskView.java
tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTasksTreeTable.java
tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/ExpandAllUserTasksAction.java
tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/GoToUserTaskAction.java
tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/NewTaskAction.java
tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/ShowTaskAction.java
tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/filter/UserTaskProperties.java
tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/mf-layer.xml
tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/translators/ICalExportFormat.java
tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/translators/ICalImportFormat.java
tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/translators/XmlExportFormat.java
tasklist.usertasks/test/build-qa-functional.xml
tasklist.usertasks/test/qa-functional/data/SampleApp/build.xml
tasklist.usertasks/test/qa-functional/data/SampleApp/ics/test10.ics
tasklist.usertasks/test/qa-functional/data/SampleApp/manifest.mf
tasklist.usertasks/test/qa-functional/data/SampleApp/nbproject/build-impl.xml
tasklist.usertasks/test/qa-functional/data/SampleApp/nbproject/genfiles.properties
tasklist.usertasks/test/qa-functional/data/SampleApp/nbproject/project.properties
tasklist.usertasks/test/qa-functional/data/SampleApp/nbproject/project.xml
tasklist.usertasks/test/qa-functional/data/SampleApp/src/sampleapp/Main.java
tasklist.usertasks/test/qa-functional/src/org/netbeans/modules/tasklist/usertasks/test/IcsNode.java
tasklist.usertasks/test/qa-functional/src/org/netbeans/modules/tasklist/usertasks/test/TestTable.java
     1.1 --- a/tasklist.core/src/org/netbeans/modules/tasklist/core/Bundle.properties	Sat Oct 02 00:36:00 2004 +0000
     1.2 +++ b/tasklist.core/src/org/netbeans/modules/tasklist/core/Bundle.properties	Sat Oct 02 14:03:48 2004 +0000
     1.3 @@ -52,3 +52,4 @@
     1.4  # ---
     1.5  
     1.6  default-filter-name=Default Filter
     1.7 +
     2.1 --- a/tasklist.editor/src/org/netbeans/modules/tasklist/editor/NewTaskEditorAction.java	Sat Oct 02 00:36:00 2004 +0000
     2.2 +++ b/tasklist.editor/src/org/netbeans/modules/tasklist/editor/NewTaskEditorAction.java	Sat Oct 02 14:03:48 2004 +0000
     2.3 @@ -14,11 +14,10 @@
     2.4  package org.netbeans.modules.tasklist.editor;
     2.5  
     2.6  import java.awt.event.ActionEvent;
     2.7 -import java.io.File;
     2.8 +import java.net.URL;
     2.9  import javax.swing.text.BadLocationException;
    2.10  import javax.swing.text.Caret;
    2.11  import javax.swing.text.JTextComponent;
    2.12 -import javax.swing.*;
    2.13  
    2.14  import org.netbeans.editor.BaseAction;
    2.15  import org.netbeans.editor.BaseDocument;
    2.16 @@ -28,11 +27,12 @@
    2.17  import org.netbeans.modules.editor.NbEditorUtilities;
    2.18  import org.netbeans.modules.tasklist.usertasks.actions.NewTaskAction;
    2.19  import org.openide.filesystems.FileObject;
    2.20 -import org.openide.filesystems.FileUtil;
    2.21 +import org.openide.filesystems.URLMapper;
    2.22  import org.openide.loaders.DataObject;
    2.23 +import org.openide.text.DataEditorSupport;
    2.24  import org.openide.text.Line;
    2.25  import org.openide.util.NbBundle;
    2.26 -import org.openide.text.DataEditorSupport;
    2.27 +
    2.28  
    2.29  
    2.30  /**
    2.31 @@ -78,7 +78,6 @@
    2.32          int line = 0;
    2.33          try {
    2.34              line = Utilities.getLineOffset(doc, caret.getDot());
    2.35 -            line++; // It seems to be off-by-one (zero based)
    2.36          } catch (BadLocationException e) {
    2.37              target.getToolkit().beep();
    2.38              return;
    2.39 @@ -86,19 +85,15 @@
    2.40  
    2.41          Line lineObj = NbEditorUtilities.getLine(doc, caret.getDot(), false);
    2.42          DataObject dob = DataEditorSupport.findDataObject(lineObj);
    2.43 +        if (dob == null)
    2.44 +            return;
    2.45 +        
    2.46          FileObject fo = dob.getPrimaryFile();
    2.47 -        File file = FileUtil.toFile(fo);
    2.48 -        String filename;
    2.49 -        if (file == null) {
    2.50 -            filename = null;
    2.51 -        } else {
    2.52 -            filename = file.getPath();
    2.53 -        }
    2.54 +        URL url = URLMapper.findURL(fo, URLMapper.EXTERNAL);
    2.55 +        if (url == null)
    2.56 +            return;
    2.57  
    2.58 -        if (!((filename != null) && (filename.length() > 0))) {
    2.59 -            line = 0;
    2.60 -        }
    2.61 -        NewTaskAction.performAction(null, null, filename, line, true);
    2.62 +        NewTaskAction.performAction(null, null, url, line, true);
    2.63      }
    2.64  
    2.65      public String getString(String str) {
     3.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/Bundle.properties	Sat Oct 02 00:36:00 2004 +0000
     3.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/Bundle.properties	Sat Oct 02 14:03:48 2004 +0000
     3.3 @@ -143,8 +143,8 @@
     3.4  HNT_priorityProperty=Priority of the task
     3.5  LBL_dueDateProperty=Due
     3.6  HNT_dueDateProperty=Date & time when the task is due
     3.7 -LBL_filenameProperty=Filename
     3.8 -HNT_filenameProperty=Filename or URL associated with the task
     3.9 +LBL_urlProperty=URL
    3.10 +HNT_urlProperty=URL (Uniform Resource Locator) associated with the task
    3.11  LBL_lineProperty=Line
    3.12  HNT_lineProperty=Line associated with the task
    3.13  LBL_categoryProperty=Category
    3.14 @@ -196,4 +196,8 @@
    3.15  ColumnEdited=Edited
    3.16  ColumnDue=Due
    3.17  
    3.18 +## DoneTaskAnnotation.xml
    3.19 +HINT_TASK_doneTransparent=Done Tasks (without highlighting)
    3.20  
    3.21 +## DoneTaskNoHighlightAnnotation.xml
    3.22 +HINT_TASK_done=Done Tasks
     4.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/EditTaskPanel.java	Sat Oct 02 00:36:00 2004 +0000
     4.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/EditTaskPanel.java	Sat Oct 02 14:03:48 2004 +0000
     4.3 @@ -20,6 +20,8 @@
     4.4  import java.awt.event.ActionListener;
     4.5  import java.awt.event.ItemEvent;
     4.6  import java.lang.reflect.Method;
     4.7 +import java.net.MalformedURLException;
     4.8 +import java.net.URL;
     4.9  import java.text.DateFormat;
    4.10  import java.text.ParseException;
    4.11  import java.text.SimpleDateFormat;
    4.12 @@ -50,7 +52,6 @@
    4.13   * this file using the form builder.
    4.14   *
    4.15   * @author Tor Norbye
    4.16 - * @author Tim Lebedkov
    4.17   */
    4.18  public class EditTaskPanel extends JPanel implements ActionListener {
    4.19  
    4.20 @@ -176,13 +177,14 @@
    4.21          }
    4.22          int p = item.getPriority().intValue() - 1;
    4.23          priorityComboBox.setSelectedIndex(p);
    4.24 -        if (item.hasAssociatedFilePos()) {
    4.25 -            fileTextField.setText(item.getFilename());
    4.26 -            if (fileTextField.getText().length() > 0)
    4.27 -                fileTextField.setCaretPosition(fileTextField.getText().length()-1);
    4.28 -            fileCheckBox.setSelected(true);
    4.29 -            if (item.getLineNumber() > 0) {
    4.30 -                lineTextField.setText(Integer.toString(item.getLineNumber()));
    4.31 +        if (item.getLine() != null) {
    4.32 +            URL url = item.getUrl();
    4.33 +            if (url != null) {
    4.34 +                fileTextField.setText(url.toExternalForm());
    4.35 +                if (fileTextField.getText().length() > 0)
    4.36 +                    fileTextField.setCaretPosition(fileTextField.getText().length()-1);
    4.37 +                fileCheckBox.setSelected(true);
    4.38 +                lineTextField.setText(Integer.toString(item.getLineNumber() + 1));
    4.39              }
    4.40          } else {
    4.41              fileCheckBox.setSelected(false);
    4.42 @@ -239,15 +241,25 @@
    4.43              task.setCategory(categoryCombo.getSelectedItem().toString().trim());
    4.44          task.setPriority(SuggestionPriority.getPriority(priorityComboBox.getSelectedIndex() + 1));
    4.45          if (fileCheckBox.isSelected()) {
    4.46 -            task.setFilename(fileTextField.getText().trim());
    4.47              try {
    4.48 -                task.setLineNumber(Integer.parseInt(lineTextField.getText()));
    4.49 -            } catch (NumberFormatException e) {
    4.50 -                // TODO validation
    4.51 +                URL url = new URL(fileTextField.getText().trim());
    4.52 +                task.setUrl(url);
    4.53 +                try {
    4.54 +                    int lineno = Integer.parseInt(lineTextField.getText());
    4.55 +                    if (lineno > 0)
    4.56 +                        task.setLineNumber(lineno - 1);
    4.57 +                    else
    4.58 +                        ; // TODO: validation
    4.59 +                } catch (NumberFormatException e) {
    4.60 +                    // TODO validation
    4.61 +                    e.printStackTrace();
    4.62 +                }
    4.63 +            } catch (MalformedURLException e) {
    4.64 +                // TODO: validation
    4.65 +                e.printStackTrace();
    4.66              }
    4.67          } else {
    4.68 -            task.setFilename(null);
    4.69 -            task.setLineNumber(0);
    4.70 +            task.setLine(null);
    4.71          }
    4.72          
    4.73          task.setDueDate(getDueDate());
    4.74 @@ -328,12 +340,22 @@
    4.75      /**
    4.76       * Changes associated file position in the dialog
    4.77       *
    4.78 -     * @param file filename
    4.79 -     * @param line line number
    4.80 +     * @param n line number
    4.81       */
    4.82 -    public void setFilePosition(String file, int line) {
    4.83 -        fileTextField.setText(file);
    4.84 -        lineTextField.setText(String.valueOf(line));
    4.85 +    public void setLineNumber(int n) {
    4.86 +        lineTextField.setText(Integer.toString(n + 1));
    4.87 +    }
    4.88 +
    4.89 +    /**
    4.90 +     * Sets new URL.
    4.91 +     *
    4.92 +     * @param URL an URL or null
    4.93 +     */
    4.94 +    public void setUrl(URL url) {
    4.95 +        if (url != null)
    4.96 +            fileTextField.setText(url.toExternalForm());
    4.97 +        else
    4.98 +            fileTextField.setText(""); // NOI18N
    4.99      }
   4.100      
   4.101      public void setAssociatedFilePos(boolean set) {
     5.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskNode.java	Sat Oct 02 00:36:00 2004 +0000
     5.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskNode.java	Sat Oct 02 14:03:48 2004 +0000
     5.3 @@ -19,6 +19,9 @@
     5.4  import java.beans.PropertyChangeEvent;
     5.5  import java.beans.PropertyChangeListener;
     5.6  import java.io.IOException;
     5.7 +import java.lang.reflect.InvocationTargetException;
     5.8 +import java.net.MalformedURLException;
     5.9 +import java.net.URL;
    5.10  import java.util.Date;
    5.11  import java.util.List;
    5.12  
    5.13 @@ -41,6 +44,7 @@
    5.14  import org.netbeans.modules.tasklist.usertasks.actions.PauseAction;
    5.15  import org.netbeans.modules.tasklist.usertasks.actions.PurgeTasksAction;
    5.16  import org.netbeans.modules.tasklist.usertasks.actions.ShowTaskAction;
    5.17 +import org.netbeans.modules.tasklist.usertasks.actions.SingleLineCookie;
    5.18  import org.netbeans.modules.tasklist.usertasks.actions.StartCookie;
    5.19  import org.netbeans.modules.tasklist.usertasks.actions.StartTaskAction;
    5.20  import org.netbeans.modules.tasklist.usertasks.actions.StopCookie;
    5.21 @@ -61,6 +65,7 @@
    5.22  import org.openide.nodes.PropertySupport;
    5.23  import org.openide.nodes.Sheet;
    5.24  import org.openide.nodes.Sheet.Set;
    5.25 +import org.openide.text.Line;
    5.26  import org.openide.util.HelpCtx;
    5.27  import org.openide.util.NbBundle;
    5.28  import org.openide.util.actions.SystemAction;
    5.29 @@ -88,17 +93,22 @@
    5.30      UserTasksTreeTable tt) {
    5.31          super(Children.LEAF);
    5.32          assert item != null;
    5.33 +        
    5.34          this.utl = utl;
    5.35          this.item = item;
    5.36          this.node = node;
    5.37          this.tt = tt;
    5.38          
    5.39 +        setName(item.getSummary());
    5.40 +        
    5.41          item.addPropertyChangeListener(new PropertyChangeListener() {
    5.42              public void propertyChange(PropertyChangeEvent e) {
    5.43 -                UserTaskNode.this.firePropertyChange(e.getPropertyName(),
    5.44 -                    e.getOldValue(), e.getNewValue());
    5.45                  String n = e.getPropertyName();
    5.46 -                if (n == "started" || n == "spentTimeComputed") { // NOI18N
    5.47 +                if (n != "line" && n != "started") {
    5.48 +                    UserTaskNode.this.firePropertyChange(e.getPropertyName(),
    5.49 +                        e.getOldValue(), e.getNewValue());
    5.50 +                }
    5.51 +                if (n == "started" || n == "spentTimeComputed" || n == "line") { // NOI18N
    5.52                      fireCookieChange();
    5.53                  }
    5.54              }
    5.55 @@ -269,14 +279,56 @@
    5.56              p.setShortDescription(NbBundle.getMessage(UserTaskNode.class, "HNT_detailsProperty")); // NOI18N
    5.57              ss.put(p);
    5.58              
    5.59 -            p = new PropertySupport.Reflection(item, String.class, "getFileBaseName", "setFileBaseName"); // NOI18N
    5.60 -            p.setName(UserTaskView.PROP_TASK_FILE);
    5.61 -            p.setDisplayName(NbBundle.getMessage(UserTaskNode.class, "LBL_filenameProperty")); // NOI18N
    5.62 -            p.setShortDescription(NbBundle.getMessage(UserTaskNode.class, "HNT_filenameProperty")); // NOI18N
    5.63 -            p.setValue("suppressCustomEditor", Boolean.TRUE); // NOI18N
    5.64 +            p = new PropertySupport.Reflection(item, String.class, (String) null, null) { // NOI18N
    5.65 +                public boolean canRead() {
    5.66 +                    return true;
    5.67 +                }
    5.68 +                public boolean canWrite() {
    5.69 +                    return true;
    5.70 +                }
    5.71 +                public Object getValue () throws
    5.72 +                    IllegalAccessException, IllegalArgumentException, InvocationTargetException {
    5.73 +                    URL url = ((UserTask) instance).getUrl();
    5.74 +                    if (url == null)
    5.75 +                        return ""; // NOI18N
    5.76 +                    else
    5.77 +                        return url.toExternalForm();
    5.78 +                }
    5.79 +                public void setValue (Object val) throws
    5.80 +                    IllegalAccessException, IllegalArgumentException, InvocationTargetException {
    5.81 +                    try {
    5.82 +                        URL url = new URL((String) val);
    5.83 +                        ((UserTask) instance).setUrl(url);
    5.84 +                    } catch (MalformedURLException e) {
    5.85 +                        throw new IllegalArgumentException(e.getMessage());
    5.86 +                    }
    5.87 +                }
    5.88 +            };
    5.89 +            p.setName(UserTaskView.PROP_TASK_URL);
    5.90 +            p.setDisplayName(NbBundle.getMessage(UserTaskNode.class, "LBL_urlProperty")); // NOI18N
    5.91 +            p.setShortDescription(NbBundle.getMessage(UserTaskNode.class, "HNT_urlProperty")); // NOI18N
    5.92 +            //p.setValue("suppressCustomEditor", Boolean.TRUE); // NOI18N
    5.93              ss.put(p);
    5.94  
    5.95 -            p = new PropertySupport.Reflection(item, Integer.TYPE, "getLineNumber", "setLineNumber"); // NOI18N
    5.96 +            p = new PropertySupport.Reflection(item, Integer.TYPE, (String) null, null) { // NOI18N
    5.97 +                public boolean canRead() {
    5.98 +                    return true;
    5.99 +                }
   5.100 +                public boolean canWrite() {
   5.101 +                    return true;
   5.102 +                }
   5.103 +                public Object getValue () throws
   5.104 +                    IllegalAccessException, IllegalArgumentException, InvocationTargetException {
   5.105 +                    return new Integer(((UserTask) instance).getLineNumber() + 1);
   5.106 +                }
   5.107 +                public void setValue (Object val) throws
   5.108 +                    IllegalAccessException, IllegalArgumentException, InvocationTargetException {
   5.109 +                    int n = ((Integer) val).intValue();
   5.110 +                    if (n < 1)
   5.111 +                        throw new IllegalArgumentException(); 
   5.112 +                    ((UserTask) instance).setLineNumber(n - 1);
   5.113 +                }
   5.114 +            };
   5.115              p.setName(UserTaskView.PROP_TASK_LINE);
   5.116              p.setDisplayName(NbBundle.getMessage(UserTaskNode.class, "LBL_lineProperty")); // NOI18N
   5.117              p.setShortDescription(NbBundle.getMessage(UserTaskNode.class, "HNT_lineProperty")); // NOI18N
   5.118 @@ -401,6 +453,16 @@
   5.119              }
   5.120          } else if (type == UserTask.class) {
   5.121              return item;
   5.122 +        } else if (type == SingleLineCookie.class) {
   5.123 +            final Line l = uitem.getLine();
   5.124 +            if (l != null)
   5.125 +                return new SingleLineCookie() {
   5.126 +                    public Line getLine() {
   5.127 +                        return l;
   5.128 +                    }
   5.129 +                };
   5.130 +            else
   5.131 +                return null;
   5.132          } else {
   5.133              return super.getCookie(type);
   5.134          }
   5.135 @@ -432,6 +494,7 @@
   5.136          AdvancedTreeTableNode n = 
   5.137              (AdvancedTreeTableNode) this.node.findNextNodeAfterDelete();
   5.138          UTUtils.LOGGER.fine("selected node after delete:" + n); // NOI18N
   5.139 +        item.destroy();
   5.140          if (item.getParent() != null)
   5.141              item.getParent().getSubtasks().remove(item);
   5.142          else
     6.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskView.java	Sat Oct 02 00:36:00 2004 +0000
     6.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskView.java	Sat Oct 02 14:03:48 2004 +0000
     6.3 @@ -46,7 +46,6 @@
     6.4  import javax.swing.tree.TreePath;
     6.5  
     6.6  import org.netbeans.modules.tasklist.core.TLUtils;
     6.7 -import org.netbeans.modules.tasklist.core.TaskViewListener;
     6.8  import org.netbeans.modules.tasklist.core.columns.ColumnsConfiguration;
     6.9  import org.netbeans.modules.tasklist.core.export.ExportImportFormat;
    6.10  import org.netbeans.modules.tasklist.core.export.ExportImportProvider;
    6.11 @@ -76,6 +75,7 @@
    6.12  import org.openide.explorer.ExplorerUtils;
    6.13  import org.openide.filesystems.FileObject;
    6.14  import org.openide.filesystems.FileSystem;
    6.15 +import org.openide.filesystems.FileUtil;
    6.16  import org.openide.filesystems.Repository;
    6.17  import org.openide.filesystems.URLMapper;
    6.18  import org.openide.loaders.DataObject;
    6.19 @@ -102,8 +102,8 @@
    6.20      public static final String PROP_TASK_DUE = UserTaskProperties.PROPID_DUE_DATE;
    6.21      public static final String PROP_TASK_PRIO = "priority"; // NOI18N
    6.22      public static final String PROP_TASK_CAT = "category"; // NOI18N
    6.23 -    public static final String PROP_TASK_FILE = "filename"; // NOI18N
    6.24 -    public static final String PROP_TASK_LINE = "line"; // NOI18N
    6.25 +    public static final String PROP_TASK_URL = "url"; // NOI18N
    6.26 +    public static final String PROP_TASK_LINE = "lineNumber"; // NOI18N
    6.27      public static final String PROP_TASK_DETAILS = "details"; // NOI18N
    6.28      public static final String PROP_TASK_CREATED = "created"; // NOI18N
    6.29      public static final String PROP_TASK_EDITED = "edited"; // NOI18N
    6.30 @@ -114,6 +114,9 @@
    6.31      
    6.32      private static final long serialVersionUID = 1;
    6.33  
    6.34 +    private static final Image ICON = Utilities.loadImage(
    6.35 +        "org/netbeans/modules/tasklist/usertasks/actions/taskView.gif"); // NOI18N
    6.36 +    
    6.37      private static int nextViewId = 0;
    6.38      
    6.39      private static UserTaskView defview = null;
    6.40 @@ -149,7 +152,7 @@
    6.41      static boolean defaultViewCreated() {
    6.42          return defview != null;
    6.43      }
    6.44 -    
    6.45 +
    6.46      /** 
    6.47       * Return the currently active user task view, or null
    6.48       *
    6.49 @@ -175,6 +178,11 @@
    6.50          return null;
    6.51      }
    6.52      
    6.53 +    private boolean lookupAttempted = false;
    6.54 +
    6.55 +    /** When true, we've already warned about the need to wrap */
    6.56 +    private boolean wrapWarned = false;
    6.57 +
    6.58      private UserTasksTreeTable tt;
    6.59      
    6.60      private int viewId;
    6.61 @@ -209,7 +217,7 @@
    6.62          setIcon(icon);
    6.63  
    6.64          registerTaskListView(this);
    6.65 -        setModel(tasklist);
    6.66 +        setList(tasklist);
    6.67      }
    6.68  
    6.69      /** 
    6.70 @@ -266,7 +274,7 @@
    6.71      
    6.72      protected Component createCenterComponent() {
    6.73          tt = new UserTasksTreeTable(
    6.74 -            getExplorerManager(), (UserTaskList) getModel(),
    6.75 +            getExplorerManager(), (UserTaskList) getList(),
    6.76              getFilter());
    6.77          
    6.78          final JScrollPane sp = new JScrollPane(tt,
    6.79 @@ -287,13 +295,6 @@
    6.80                  (RemoveFilterUserTaskAction) SystemAction.get(RemoveFilterUserTaskAction.class);
    6.81          removeFilter.enable();
    6.82  
    6.83 -        // it's strange I'd expect live listener based solution
    6.84 -        Iterator it = getModel().getSubtasks().iterator();
    6.85 -        while (it.hasNext()) {
    6.86 -            UserTask next = (UserTask) it.next();
    6.87 -            next.updateLineNumberRecursively();
    6.88 -        }
    6.89 -
    6.90          /* debug Ctrl+C,V,X
    6.91           if (UTUtils.LOGGER.isLoggable(Level.FINE)) {
    6.92              ActionMap am = this.getActionMap();
    6.93 @@ -474,7 +475,7 @@
    6.94                      if (fo != null) {
    6.95                              UserTaskList utl = new UserTaskList();
    6.96                              utl.readFile(fo);
    6.97 -                        setModel(utl);
    6.98 +                        setList(utl);
    6.99                          SwingUtilities.invokeLater(new Runnable() {
   6.100                              public void run() {
   6.101                                  setName(fo.getNameExt());
   6.102 @@ -590,37 +591,7 @@
   6.103       * @return created node
   6.104       */
   6.105      protected Node createRootNode() {
   6.106 -        return new UserTaskListNode((UserTaskList) getModel(), null);
   6.107 -    }
   6.108 -
   6.109 -    /** Show the given task. "Showing" means getting the editor to
   6.110 -     * show the associated file position, and open up an area in the
   6.111 -     * tasklist view where the details of the task can be fully read.
   6.112 -     *
   6.113 -     * @param item selected task (or null for hiding last)
   6.114 -     * @param annotation annotation to use or null for
   6.115 -     *        default view provided annotation.
   6.116 -     */
   6.117 -    public void showTaskInEditor(UserTask item, UserTaskAnnotation annotation) {
   6.118 -        UserTask task = item;
   6.119 -        UserTask prevTask = null;
   6.120 -        if ((taskMarker != null) &&
   6.121 -            (taskMarker.getTask() instanceof UserTask)) {
   6.122 -            prevTask = (UserTask)taskMarker.getTask();
   6.123 -        }
   6.124 -        if (task.getAnnotation() != null) {
   6.125 -            task.getAnnotation().detach();
   6.126 -            task.setAnnotation(null);
   6.127 -        }
   6.128 -        if (annotation == null) annotation = getAnnotation(item);
   6.129 -        annotationManager.showTask(item, annotation);
   6.130 -        if (prevTask != null) {
   6.131 -            if ((prevTask.getLine() != null) && (task.getAnnotation() == null)) {
   6.132 -                UserTaskAnnotation anno = new UserTaskAnnotation(prevTask, false);
   6.133 -                anno.attach(prevTask.getLine());
   6.134 -                prevTask.setAnnotation(anno);                
   6.135 -            }
   6.136 -        }
   6.137 +        return new UserTaskListNode((UserTaskList) getList(), null);
   6.138      }
   6.139  
   6.140      /**
   6.141 @@ -628,28 +599,15 @@
   6.142       *
   6.143       * @param list new tree
   6.144       */
   6.145 -    protected void setModel(UserTaskList list) {
   6.146 -        hideList();
   6.147 +    public void setList(UserTaskList list) {
   6.148          tasklist = list;
   6.149 -        // TODO getModel().addTaskListener(this);
   6.150 -        UserTaskList utl = (UserTaskList) this.getList();
   6.151 -        utl.showAnnotations(utl.getSubtasks().iterator());
   6.152 +        UserTaskList utl = this.getList();
   6.153 +        if (list.getFile() != null)
   6.154 +            setToolTipText(FileUtil.getFileDisplayName(list.getFile()));
   6.155      }
   6.156      
   6.157 -    protected void hideList() {
   6.158 -        /*UserTaskList prev = getModel();
   6.159 -        if (prev != null) {
   6.160 -            prev.removeTaskListener(this);
   6.161 -        }
   6.162 -        UserTaskList utl = (UserTaskList) this.getModel();
   6.163 -        if (utl != null)
   6.164 -            utl.hideAnnotations(utl.getTasks().iterator());
   6.165 -         *
   6.166 -         * TODO */
   6.167 -    }
   6.168 -
   6.169      public String toString() { 
   6.170 -        return "UserTaskView(" + getName() + ", " + category + ", " + getModel() + ")"; // NOI18N
   6.171 +        return "UserTaskView(" + getName() + ", " + category + ", " + getList() + ")"; // NOI18N
   6.172      }
   6.173      
   6.174      /** 
   6.175 @@ -677,7 +635,7 @@
   6.176          if (ttm instanceof UserTasksTreeTableModel) {
   6.177              ((UserTasksTreeTableModel) ttm).destroy();
   6.178          }
   6.179 -        tt.setTreeTableModel(new UserTasksTreeTableModel((UserTaskList) getModel(), 
   6.180 +        tt.setTreeTableModel(new UserTasksTreeTableModel((UserTaskList) getList(), 
   6.181              tt.getSortingModel(), getFilter()));
   6.182      }
   6.183  
   6.184 @@ -976,22 +934,6 @@
   6.185      }
   6.186  
   6.187  
   6.188 -    // XXX probably new instance per view would be better
   6.189 -    // or explicit hideTaskInEditor should not hide foreign annotations
   6.190 -    // but showTaskInEditor's call to hideTaskInEditor should hide them
   6.191 -    private UserTaskEditorListener annotationManager = 
   6.192 -        UserTaskEditorListener.getDefault();
   6.193 -
   6.194 -    /**
   6.195 -     * Called to indicate that a particular task should be hidden.
   6.196 -     * This typically means that the task was deleted so it should
   6.197 -     * no longer have any visual cues. The task referred to is the
   6.198 -     * most recent task passed to showTaskInEditor.
   6.199 -     */
   6.200 -    public void hideTaskInEditor() {
   6.201 -        annotationManager.hideTask();
   6.202 -    }
   6.203 -
   6.204      /**
   6.205       * Could be overriden to change actions on second toolbar row.
   6.206       * @return
   6.207 @@ -1123,24 +1065,30 @@
   6.208          add(toolbars, BorderLayout.WEST);
   6.209  
   6.210          // Populate the view
   6.211 -        setModel(tasklist);
   6.212 +        setList(tasklist);
   6.213 +        
   6.214 +        tt.select(new TreePath(tt.getTreeTableModel().getRoot()));
   6.215      }
   6.216  
   6.217  
   6.218      /** Called when the window is closed. Cleans up. */
   6.219      protected void componentClosed() {
   6.220 -        hideTaskInEditor();
   6.221 -        hideList();
   6.222 -
   6.223 -        // Remove any task markers we've added to the editor
   6.224 -        if (unshowItem != null) {
   6.225 -            removedTask(null, unshowItem, 0); // TODO cannot find the parent of unshowItem
   6.226 -        }
   6.227 -
   6.228 +        getList().destroy();
   6.229 +        
   6.230          // Unregister listeningViews
   6.231          unregisterListeners();
   6.232          
   6.233          storeColumnsConfiguration();
   6.234 +
   6.235 + 	Iterator it = views.iterator();
   6.236 +        while (it.hasNext()) {
   6.237 +            WeakReference wr = (WeakReference) it.next();
   6.238 +	    UserTaskView tlv = (UserTaskView) wr.get();
   6.239 +            if (tlv == this) {
   6.240 +                it.remove();
   6.241 +                break;
   6.242 +            }
   6.243 +        }
   6.244      }
   6.245  
   6.246      protected void componentDeactivated() {
   6.247 @@ -1180,47 +1128,6 @@
   6.248              return def;
   6.249      }
   6.250  
   6.251 -    private UserTask unshowItem = null;
   6.252 -
   6.253 -    /** Show the given todolist item. "Showing" means getting the
   6.254 -     * editor to show the associated file position, and open up an
   6.255 -     * area in the todolist view where the details of the todolist
   6.256 -     * item can be fully read.
   6.257 -     */
   6.258 -    /*
   6.259 -    public void show(Task item, Annotation anno) {
   6.260 -	if (listeningViews != null) {
   6.261 -	    // Stash item so I can notify of deletion -- see TaskViewListener
   6.262 -	    // doc
   6.263 -	    unshowItem = item;
   6.264 -	    int n = listeningViews.size();
   6.265 -	    for (int i = 0; i < n; i++) {
   6.266 -		TaskViewListener tl = (TaskViewListener)listeningViews.get(i);
   6.267 -		tl.showTaskInEditor(item, anno);
   6.268 -	    }
   6.269 -	}
   6.270 -    }
   6.271 -    */
   6.272 -
   6.273 -    /** Unshow the given task, if it's the one currently showing */
   6.274 -    /*
   6.275 -    public void unshow(Task item) {
   6.276 -        if (item != unshowItem) {
   6.277 -            return;
   6.278 -        }
   6.279 -	if (listeningViews != null) {
   6.280 -	    // Stash item so I can notify of deletion -- see TaskViewListener
   6.281 -	    // doc
   6.282 -	    unshowItem = null;
   6.283 -	    int n = listeningViews.size();
   6.284 -	    for (int i = 0; i < n; i++) {
   6.285 -		TaskViewListener tl = (TaskViewListener)listeningViews.get(i);
   6.286 -		tl.hideTaskInEditor();
   6.287 -	    }
   6.288 -	}
   6.289 -    }
   6.290 -    */
   6.291 -
   6.292      /** List of TaskViewListener object listening on the tasklist view
   6.293       for visibility, selection, etc. */
   6.294      private List listeningViews = null;
   6.295 @@ -1277,80 +1184,13 @@
   6.296          requestActive();
   6.297      }
   6.298  
   6.299 -    /** 
   6.300 -     * Called to indicate that a particular task is made current.
   6.301 -     * Do what you can to "select" this task.
   6.302 -     *
   6.303 -     * <p>
   6.304 -     * Dispatches {@link TaskViewListener#showTask} to all registered views.
   6.305 -     */
   6.306 -    public void selectedTask(UserTask item) {
   6.307 -        if (listeningViews != null) {
   6.308 -            // Stash item so I can notify of deletion -- see TaskViewListener
   6.309 -            // doc
   6.310 -            unshowItem = item;
   6.311 -            int n = listeningViews.size();
   6.312 -            for (int i = 0; i < n; i++) {
   6.313 -                UserTaskViewListener tl = (UserTaskViewListener) listeningViews.get(i);
   6.314 -                tl.showTask(item, getAnnotation(item));
   6.315 -            }
   6.316 -        }
   6.317 -    }
   6.318 -
   6.319 -    /** 
   6.320 -     * Called to indicate that a particular task has been "warped to".
   6.321 -     * Do what you can to "warp to" this task. Typically means show
   6.322 -     * associated fileposition in the editor.
   6.323 -     */
   6.324 -    public void warpedTask(UserTask item) {
   6.325 -        // XXX currently identical to selectedTask above!
   6.326 -        if (listeningViews != null) {
   6.327 -            // Stash item so I can notify of deletion -- see TaskViewListener
   6.328 -            // doc
   6.329 -            unshowItem = item;
   6.330 -            int n = listeningViews.size();
   6.331 -            for (int i = 0; i < n; i++) {
   6.332 -                UserTaskViewListener tl = (UserTaskViewListener) listeningViews.get(i);
   6.333 -                tl.showTask(item, null);
   6.334 -            }
   6.335 -        }
   6.336 -    }
   6.337 -
   6.338 -    public void addedTask(UserTask t) {
   6.339 -        // Nothing to do?
   6.340 -    }
   6.341 -
   6.342 -    public void tasksReordered(UserTask parent) {
   6.343 -    }
   6.344 -    
   6.345 -    public void removedTask(UserTask pt, UserTask task, int index) {
   6.346 -        if ((task == unshowItem) && (listeningViews != null)) {
   6.347 -            unshowItem = null;
   6.348 -            int n = listeningViews.size();
   6.349 -            for (int i = 0; i < n; i++) {
   6.350 -                UserTaskViewListener tl = (UserTaskViewListener) listeningViews.get(i);
   6.351 -                tl.hideTask();
   6.352 -            }
   6.353 -        }
   6.354 -    }
   6.355 -
   6.356 -    public void structureChanged(UserTask t) {
   6.357 -    }
   6.358 -
   6.359      /**  
   6.360       * Return the tasklist shown in this view 
   6.361       */
   6.362      public UserTaskList getList() {
   6.363 -        UserTaskList model = getModel();
   6.364 -        return model;
   6.365 +        return this.tasklist;
   6.366      }
   6.367  
   6.368 -    public UserTaskList getModel() {
   6.369 -        return tasklist;
   6.370 -    }
   6.371 -
   6.372 -    // End of stuff taken from TreeTableView
   6.373 -
   6.374      /**
   6.375       * Get the toggle filter for this view. It's
   6.376       * applied if {@link #isFiltered} returns true.
   6.377 @@ -1358,8 +1198,7 @@
   6.378       * @return The toggle filter or <code>null</code> if not defined.
   6.379       */
   6.380      public final Filter getFilter() {
   6.381 -      //      return getFilters().getActive();
   6.382 -      return activeFilter;
   6.383 +        return activeFilter;
   6.384      }
   6.385  
   6.386      /** 
   6.387 @@ -1391,54 +1230,25 @@
   6.388          setFiltered();
   6.389      }
   6.390  
   6.391 -    private boolean lookupAttempted = false;
   6.392 -
   6.393 -    private static void invokeLater(Runnable runnable) {
   6.394 -        if (SwingUtilities.isEventDispatchThread()) {
   6.395 -            runnable.run();
   6.396 -        } else {
   6.397 -            SwingUtilities.invokeLater(runnable);
   6.398 -        }
   6.399 -    }
   6.400 -
   6.401 -    /** When true, we've already warned about the need to wrap */
   6.402 -    private boolean wrapWarned = false;
   6.403 -
   6.404 -    /**
   6.405 -     * @param tail if true take the last one from multiple selection
   6.406 -     *        othervise the first one
   6.407 -     * @return last selected or null
   6.408 -     */
   6.409 -    private Node currentlySelected(boolean tail) {
   6.410 -        Node[] selected = getExplorerManager().getSelectedNodes();
   6.411 -        if (selected != null && selected.length != 0) {
   6.412 -            if (tail) {
   6.413 -                return selected[selected.length -1];
   6.414 -            } else {
   6.415 -                return selected[0];
   6.416 -            }
   6.417 -        } else {
   6.418 -            return null;
   6.419 -        }
   6.420 -    }
   6.421 -
   6.422 -    /**
   6.423 -     * Return an editor annotation to use to show the given task
   6.424 -     *
   6.425 -     * @return created annotation or null
   6.426 -     */
   6.427 -    protected UserTaskAnnotation getAnnotation(UserTask task) {
   6.428 -        return new UserTaskAnnotation(task, this);
   6.429 -    }
   6.430 -
   6.431 -    protected void componentHidden() {
   6.432 -        hideTaskInEditor();
   6.433 -    }
   6.434 -
   6.435      public void requestActive() {
   6.436          super.requestActive();
   6.437          if (tt != null) {
   6.438              tt.requestFocus();
   6.439          }
   6.440      }
   6.441 +
   6.442 +    public Image getIcon() {
   6.443 +        return ICON;
   6.444 +    }
   6.445 +
   6.446 +    /* XXX check isSliding
   6.447 +    public void showTask(UserTask item, Annotation annotation) {
   6.448 +        // #35917 do not move focus if in sliding mode
   6.449 +        if (view.getClientProperty("isSliding") == Boolean.TRUE) {  // NOi18N
   6.450 +            l.show(Line.SHOW_SHOW);
   6.451 +        } else {
   6.452 +            l.show(Line.SHOW_GOTO);
   6.453 +        }
   6.454 +    }
   6.455 +     **/
   6.456  }
     7.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTasksTreeTable.java	Sat Oct 02 00:36:00 2004 +0000
     7.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTasksTreeTable.java	Sat Oct 02 14:03:48 2004 +0000
     7.3 @@ -46,6 +46,8 @@
     7.4   * TT for user tasks
     7.5   */
     7.6  public class UserTasksTreeTable extends NodesTreeTable {
     7.7 +    private UserTask selected;
     7.8 +    
     7.9      /**
    7.10       * Creates a new instance of UserTasksTreeTable
    7.11       * 
    7.12 @@ -84,6 +86,26 @@
    7.13                  }
    7.14              );
    7.15          }
    7.16 +        
    7.17 +        getSelectionModel().addListSelectionListener(
    7.18 +            new ListSelectionListener() {
    7.19 +                public void valueChanged(ListSelectionEvent e) {
    7.20 +                    int row = getSelectedRow();
    7.21 +                    UserTask ut = null;
    7.22 +                    if (row >= 0) {
    7.23 +                        Object node = getNodeForRow(row);
    7.24 +                        if (node instanceof UserTaskTreeTableNode) {
    7.25 +                            ut = ((UserTaskTreeTableNode) node).getUserTask();
    7.26 +                        }
    7.27 +                    }
    7.28 +                    if (selected != null && selected.getAnnotation() != null) 
    7.29 +                        selected.getAnnotation().setHighlight(false);
    7.30 +                    selected = ut;
    7.31 +                    if (selected != null && selected.getAnnotation() != null)
    7.32 +                        selected.getAnnotation().setHighlight(true);
    7.33 +                }
    7.34 +            }
    7.35 +        );
    7.36      }
    7.37  
    7.38      public Node createNode(Object obj) {
     8.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/ExpandAllUserTasksAction.java	Sat Oct 02 00:36:00 2004 +0000
     8.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/ExpandAllUserTasksAction.java	Sat Oct 02 14:03:48 2004 +0000
     8.3 @@ -24,7 +24,6 @@
     8.4   * @author Tor Norbye 
     8.5   */
     8.6  public final class ExpandAllUserTasksAction extends CallableSystemAction {
     8.7 -
     8.8      private static final long serialVersionUID = 1;
     8.9  
    8.10      /**
    8.11 @@ -47,4 +46,8 @@
    8.12          // If you will provide context help then use:
    8.13          // return new HelpCtx (MyAction.class);
    8.14      }
    8.15 +
    8.16 +    protected boolean asynchronous() {
    8.17 +        return false;
    8.18 +    }
    8.19  }
     9.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/GoToUserTaskAction.java	Sat Oct 02 00:36:00 2004 +0000
     9.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/GoToUserTaskAction.java	Sat Oct 02 14:03:48 2004 +0000
     9.3 @@ -13,15 +13,13 @@
     9.4  package org.netbeans.modules.tasklist.usertasks.actions;
     9.5  
     9.6  import org.openide.nodes.Node;
     9.7 +import org.openide.text.Line;
     9.8  import org.openide.util.HelpCtx;
     9.9  import org.openide.util.NbBundle;
    9.10 -import org.openide.util.actions.NodeAction;
    9.11 -
    9.12 -import javax.swing.*;
    9.13 -import java.awt.*;
    9.14  import org.netbeans.modules.tasklist.usertasks.UserTask;
    9.15  import org.netbeans.modules.tasklist.usertasks.UserTaskNode;
    9.16 -import org.netbeans.modules.tasklist.usertasks.UserTaskView;
    9.17 +
    9.18 +import org.openide.util.actions.CookieAction;
    9.19  
    9.20  
    9.21  /**
    9.22 @@ -30,7 +28,7 @@
    9.23   *
    9.24   * @author Tor Norbye
    9.25   */
    9.26 -public class GoToUserTaskAction extends NodeAction {
    9.27 +public class GoToUserTaskAction extends CookieAction {
    9.28  
    9.29      private static final long serialVersionUID = 1;
    9.30  
    9.31 @@ -44,33 +42,21 @@
    9.32       * node. 
    9.33       */    
    9.34      protected void performAction(Node[] nodes) {
    9.35 -        final UserTaskView tlv = UserTaskView.getCurrent();
    9.36 -        if (tlv != null) {
    9.37 -            final UserTask item = ((UserTaskNode) nodes[0]).getTask(); // safe - see enable check
    9.38 -            assert item != null;
    9.39 -            SwingUtilities.invokeLater(new Runnable() {  //#39904 eliminate problems with focus
    9.40 -                public void run() {
    9.41 -                    tlv.showTaskInEditor(item, null);
    9.42 -                }
    9.43 -            });
    9.44 -        } else {
    9.45 -            //XXX System.out.println("No current view!");
    9.46 -            Toolkit.getDefaultToolkit().beep();
    9.47 -        }
    9.48 +        SingleLineCookie c = 
    9.49 +            (SingleLineCookie) nodes[0].getCookie(SingleLineCookie.class);
    9.50 +        Line line = c.getLine();
    9.51 +        assert line != null;
    9.52 +        line.show(Line.SHOW_GOTO);
    9.53      }
    9.54      
    9.55 -    /** Enable the task iff you've selected exactly one node,
    9.56 -     * and that node is a tasknode. */    
    9.57 -    protected boolean enable(Node[] nodes) {
    9.58 -        if (nodes.length != 1)
    9.59 -            return false;
    9.60 -        if (!(nodes[0] instanceof UserTaskNode))
    9.61 -            return false;
    9.62 -        
    9.63 -        UserTask item = ((UserTaskNode) nodes[0]).getTask();
    9.64 -        return item.getLine() != null;
    9.65 +    protected Class[] cookieClasses() {
    9.66 +        return new Class[] {SingleLineCookie.class};
    9.67      }
    9.68      
    9.69 +    protected int mode() {
    9.70 +        return CookieAction.MODE_EXACTLY_ONE;
    9.71 +    }    
    9.72 +    
    9.73      public String getName() {
    9.74          return NbBundle.getMessage(GoToUserTaskAction.class, "LBL_Goto"); // NOI18N
    9.75      }
    10.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/NewTaskAction.java	Sat Oct 02 00:36:00 2004 +0000
    10.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/NewTaskAction.java	Sat Oct 02 14:03:48 2004 +0000
    10.3 @@ -17,6 +17,7 @@
    10.4  import java.awt.Dimension;
    10.5  import java.awt.event.ActionEvent;
    10.6  import java.awt.event.ActionListener;
    10.7 +import java.net.URL;
    10.8  import javax.swing.JButton;
    10.9  
   10.10  import org.netbeans.modules.tasklist.usertasks.EditTaskPanel;
   10.11 @@ -31,6 +32,7 @@
   10.12  import org.openide.NotifyDescriptor;
   10.13  import org.openide.awt.Mnemonics;
   10.14  import org.openide.nodes.Node;
   10.15 +import org.openide.text.Line;
   10.16  import org.openide.util.HelpCtx;
   10.17  import org.openide.util.NbBundle;
   10.18  import org.openide.util.actions.NodeAction;
   10.19 @@ -54,8 +56,8 @@
   10.20      private UserTaskView utv;
   10.21      private UserTask parent;
   10.22      private UserTaskList utl;
   10.23 -    private String filename;
   10.24 -    private int line;
   10.25 +    private URL url;
   10.26 +    private int lineNumber;
   10.27      private boolean associate;
   10.28      
   10.29      protected boolean enable(Node[] node) {
   10.30 @@ -140,19 +142,17 @@
   10.31          // See if the user wants to append or prepend
   10.32          boolean append = panel.getAppend();
   10.33          if (parent != null) {
   10.34 -        	if (append)
   10.35 -        		parent.getSubtasks().add(ut);
   10.36 -        	else
   10.37 -        		parent.getSubtasks().add(0, ut);
   10.38 +            if (append)
   10.39 +                parent.getSubtasks().add(ut);
   10.40 +            else
   10.41 +                parent.getSubtasks().add(0, ut);
   10.42          } else {
   10.43 -        	if (append)
   10.44 -        		utl.getSubtasks().add(ut);
   10.45 -        	else
   10.46 -        		utl.getSubtasks().add(0, ut);
   10.47 +            if (append)
   10.48 +                utl.getSubtasks().add(ut);
   10.49 +            else
   10.50 +                utl.getSubtasks().add(0, ut);
   10.51          }
   10.52  
   10.53 -        ut.updateAnnotation();
   10.54 -
   10.55          // After the add - view the todo list as well!
   10.56          utv.showInMode();
   10.57          utv.select(ut);
   10.58 @@ -176,18 +176,18 @@
   10.59          // ask for its nodes.
   10.60          
   10.61          // find cursor position
   10.62 -        Object[] cursor = UTUtils.findCursorPosition(nodes);
   10.63 +        Line cursor = UTUtils.findCursorPosition(nodes);
   10.64          if (cursor == null) {
   10.65              Node[] editorNodes = UTUtils.getEditorNodes();
   10.66              if (editorNodes != null)
   10.67                  cursor = UTUtils.findCursorPosition(editorNodes);
   10.68          }
   10.69          if (cursor != null) {
   10.70 -            filename = (String) cursor[0];
   10.71 -            line = ((Integer) cursor[1]).intValue();
   10.72 +            this.lineNumber = cursor.getLineNumber();
   10.73 +            this.url = UTUtils.getExternalURLForLine(cursor);
   10.74          } else {
   10.75 -            filename = null;
   10.76 -            line = 0;
   10.77 +            this.url = null;
   10.78 +            this.lineNumber = -1;
   10.79          }
   10.80          
   10.81          // find parent task
   10.82 @@ -212,43 +212,41 @@
   10.83       *
   10.84       * @param utl user task list. null = default task list
   10.85       * @param parentNode default parent; if null the root node will be used
   10.86 -     * @param filename suggested filename
   10.87 -     * @parem line suggested line number (1-based)
   10.88 +     * @param url associated URL
   10.89 +     * @parem lineNumber line number. 
   10.90       * @param associate if true, set the checkbox for the filename by default (only
   10.91       *         makes sense if filename != null)
   10.92       */
   10.93      public static void performAction(UserTaskList utl, UserTask parent, 
   10.94 -        String filename, int line,  boolean associate) {
   10.95 +        URL url, int lineNumber, boolean associate) {
   10.96          NewTaskAction nta = (NewTaskAction) NewTaskAction.get(NewTaskAction.class);
   10.97 -        nta.filename = filename;
   10.98 -        nta.line = line;
   10.99          nta.associate = associate;
  10.100          if (utl == null)
  10.101              utl = UserTaskList.getDefault();
  10.102          nta.utl = utl;
  10.103 +        nta.url = url;
  10.104 +        nta.lineNumber = lineNumber;
  10.105          nta.parent = parent;
  10.106 -        nta.performTheAction();
  10.107          
  10.108          // After the add - view the todo list as well!
  10.109          nta.utv = UserTaskView.getCurrent();
  10.110          if (nta.utv == null)
  10.111              nta.utv = UserTaskView.getDefault();
  10.112 +        
  10.113 +        nta.performTheAction();
  10.114      }
  10.115      
  10.116      /**
  10.117       * Performs the action
  10.118       */
  10.119      private void performTheAction() {
  10.120 -        // After the add - view the todo list as well!
  10.121 -        UserTaskView view = (UserTaskView) UserTaskView.getCurrent();
  10.122 -        if (view == null)
  10.123 -            view = UserTaskView.getDefault();
  10.124 -        
  10.125          UserTask ut = new UserTask("", utl); // NOI18N
  10.126  
  10.127          EditTaskPanel panel = getEditTaskPanel();
  10.128          panel.fillPanel(ut);
  10.129          panel.setAssociatedFilePos(associate);
  10.130 +        panel.setUrl(url);
  10.131 +        panel.setLineNumber(lineNumber);
  10.132          panel.focusSummary();
  10.133          
  10.134          getDialog().show();
  10.135 @@ -270,8 +268,6 @@
  10.136                      utl.getSubtasks().add(0, ut);
  10.137              }
  10.138  
  10.139 -            ut.updateAnnotation();
  10.140 -
  10.141              assert utv != null;
  10.142              
  10.143              utv.showInMode();
    11.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/ShowTaskAction.java	Sat Oct 02 00:36:00 2004 +0000
    11.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/ShowTaskAction.java	Sat Oct 02 14:03:48 2004 +0000
    11.3 @@ -24,6 +24,7 @@
    11.4  import org.openide.DialogDisplayer;
    11.5  import org.openide.NotifyDescriptor;
    11.6  import org.openide.nodes.Node;
    11.7 +import org.openide.text.Line;
    11.8  import org.openide.util.HelpCtx;
    11.9  import org.openide.util.NbBundle;
   11.10  import org.openide.util.actions.NodeAction;
   11.11 @@ -55,16 +56,20 @@
   11.12          panel.fillPanel(item);
   11.13          
   11.14          // find cursor position
   11.15 -        Object[] cursor = UTUtils.findCursorPosition(node);
   11.16 -        if (cursor == null) {
   11.17 -            Node[] editorNodes = UTUtils.getEditorNodes();
   11.18 -            if (editorNodes != null)
   11.19 -                cursor = UTUtils.findCursorPosition(editorNodes);
   11.20 -        }
   11.21 -        if (cursor != null) {
   11.22 -            String filename = (String) cursor[0];
   11.23 -            int line = ((Integer) cursor[1]).intValue();
   11.24 -            panel.setFilePosition(filename, line);
   11.25 +        if (item.getUrl() == null) {
   11.26 +            Line cursor = UTUtils.findCursorPosition(node);
   11.27 +            if (cursor == null) {
   11.28 +                Node[] editorNodes = UTUtils.getEditorNodes();
   11.29 +                if (editorNodes != null)
   11.30 +                    cursor = UTUtils.findCursorPosition(editorNodes);
   11.31 +            }
   11.32 +            if (cursor == null) {
   11.33 +                panel.setUrl(null);
   11.34 +                panel.setLineNumber(0);
   11.35 +            } else {
   11.36 +                panel.setUrl(UTUtils.getExternalURLForLine(cursor));
   11.37 +                panel.setLineNumber(cursor.getLineNumber());
   11.38 +            }
   11.39          }
   11.40          
   11.41          DialogDescriptor d = new DialogDescriptor(panel,
   11.42 @@ -78,11 +83,6 @@
   11.43  
   11.44          if (d.getValue() == NotifyDescriptor.OK_OPTION) {
   11.45              panel.fillObject(item);
   11.46 -            UTUtils.LOGGER.fine("file " + item.getFilename()); // NOI18N
   11.47 -            UTUtils.LOGGER.fine("line " + item.getLineNumber()); // NOI18N
   11.48 -            item.updateAnnotation();
   11.49 -            UTUtils.LOGGER.fine("file " + item.getFilename()); // NOI18N
   11.50 -            UTUtils.LOGGER.fine("line " + item.getLineNumber()); // NOI18N
   11.51          }
   11.52      }
   11.53  
    12.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/filter/UserTaskProperties.java	Sat Oct 02 00:36:00 2004 +0000
    12.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/filter/UserTaskProperties.java	Sat Oct 02 14:03:48 2004 +0000
    12.3 @@ -12,6 +12,7 @@
    12.4   */
    12.5  package org.netbeans.modules.tasklist.usertasks.filter;
    12.6  
    12.7 +import java.net.URL;
    12.8  import java.util.Date;
    12.9  
   12.10  import org.netbeans.modules.tasklist.client.SuggestionProperty;
   12.11 @@ -52,14 +53,18 @@
   12.12      public static final SuggestionProperty PROP_FILENAME =
   12.13          new SuggestionProperty(PROPID_FILENAME, String.class) {
   12.14              public Object getValue(Object obj) {
   12.15 -                return ((UserTask) obj).getFileBaseName();
   12.16 +                URL url = ((UserTask) obj).getUrl();
   12.17 +                if (url == null)
   12.18 +                    return "";
   12.19 +                else
   12.20 +                    return url.toExternalForm();
   12.21              }
   12.22          };
   12.23  
   12.24      public static final SuggestionProperty PROP_LINE_NUMBER =
   12.25          new SuggestionProperty(PROPID_LINE_NUMBER, Integer.class) {
   12.26              public Object getValue(Object obj) {
   12.27 -                return new Integer(((UserTask) obj).getLineNumber());
   12.28 +                return new Integer(((UserTask) obj).getLineNumber() + 1);
   12.29              }
   12.30          };
   12.31  
    13.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/mf-layer.xml	Sat Oct 02 00:36:00 2004 +0000
    13.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/mf-layer.xml	Sat Oct 02 14:03:48 2004 +0000
    13.3 @@ -54,13 +54,6 @@
    13.4              <attr name="org-netbeans-modules-tasklist-usertasks-helpsetref.xml/org-netbeans-modules-usersguide-below-regular.txt" boolvalue="true"/>
    13.5          </folder>
    13.6          
    13.7 -       <folder name="SuggestionProviders">
    13.8 -          <file name="org-netbeans-modules-tasklist-usertasks-DueTasksProvider.instance">
    13.9 -             <attr name="instanceOf" stringvalue="org.netbeans.modules.tasklist.providers.SuggestionProvider"/>
   13.10 -             <attr name="instanceClass" stringvalue="org.netbeans.modules.tasklist.usertasks.DueTasksProvider"/>
   13.11 -          </file>
   13.12 -       </folder>
   13.13 -
   13.14      <file name="org-netbeans-modules-tasklist-usertasks-Settings.settings" url="Settings.settings">
   13.15          <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.tasklist.usertasks.Bundle"/>
   13.16  	<attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/tasklist/core/task.gif"/>
   13.17 @@ -148,5 +141,13 @@
   13.18      </folder>
   13.19  
   13.20    </folder>
   13.21 +
   13.22 +    <folder name="Editors">
   13.23 +        <folder name="AnnotationTypes">
   13.24 +            <file name="DoneTaskAnnotation.xml" url="DoneTaskAnnotation.xml"/>
   13.25 +            <file name="DoneTaskNoHighlightAnnotation.xml" url="DoneTaskNoHighlightAnnotation.xml"/>
   13.26 +        </folder>
   13.27 +    </folder>
   13.28 +
   13.29  </filesystem>
   13.30  
    14.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/translators/ICalExportFormat.java	Sat Oct 02 00:36:00 2004 +0000
    14.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/translators/ICalExportFormat.java	Sat Oct 02 14:03:48 2004 +0000
    14.3 @@ -19,6 +19,7 @@
    14.4  import java.io.OutputStream;
    14.5  import java.io.OutputStreamWriter;
    14.6  import java.io.Writer;
    14.7 +import java.net.URL;
    14.8  import java.text.SimpleDateFormat;
    14.9  import java.util.Date;
   14.10  import java.util.Iterator;
   14.11 @@ -313,25 +314,22 @@
   14.12          }
   14.13  
   14.14  
   14.15 -        // Filename
   14.16 -        String filename = task.getFilename();
   14.17 -        if (filename != null && filename.length() > 0) {
   14.18 -            writeEscaped(writer, "X-NETBEANS-FILENAME",  // NOI18N
   14.19 -                         null, filename);
   14.20 +        // URL
   14.21 +        URL url = task.getUrl();
   14.22 +        if (url != null) {
   14.23 +            writeEscaped(writer, "URL",  // NOI18N
   14.24 +                null, url.toExternalForm());
   14.25              writer.write("\r\n"); // NOI18N
   14.26          }
   14.27 -
   14.28 +        
   14.29          // Line number
   14.30          int lineno = task.getLineNumber();
   14.31 -        if (lineno != 0) {
   14.32 +        if (lineno >= 0) {
   14.33              writer.write("X-NETBEANS-LINE:"); // NOI18N
   14.34 -            writer.write(Integer.toString(lineno));
   14.35 +            writer.write(Integer.toString(lineno + 1));
   14.36              writer.write("\r\n"); // NOI18N
   14.37          }
   14.38  
   14.39 -        // URL -- not yet implemented
   14.40 -        // <url uri="url://here"/>
   14.41 -
   14.42          // Parent item
   14.43          // attribute reltype for related-to defaults to "PARENT" so we
   14.44          // don't need to specify it
    15.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/translators/ICalImportFormat.java	Sat Oct 02 00:36:00 2004 +0000
    15.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/translators/ICalImportFormat.java	Sat Oct 02 14:03:48 2004 +0000
    15.3 @@ -21,6 +21,8 @@
    15.4  import java.io.Reader;
    15.5  import java.io.StringWriter;
    15.6  import java.io.Writer;
    15.7 +import java.net.MalformedURLException;
    15.8 +import java.net.URL;
    15.9  import java.text.ParseException;
   15.10  import java.text.SimpleDateFormat;
   15.11  import java.util.Date;
   15.12 @@ -36,6 +38,7 @@
   15.13  import org.netbeans.modules.tasklist.core.export.OpenFilePanel;
   15.14  import org.netbeans.modules.tasklist.core.util.ExtensionFileFilter;
   15.15  import org.netbeans.modules.tasklist.core.util.SimpleWizardPanel;
   15.16 +import org.netbeans.modules.tasklist.usertasks.UTUtils;
   15.17  import org.netbeans.modules.tasklist.usertasks.UserTask;
   15.18  import org.netbeans.modules.tasklist.usertasks.UserTaskList;
   15.19  import org.netbeans.modules.tasklist.usertasks.UserTaskView;
   15.20 @@ -43,6 +46,9 @@
   15.21  import org.openide.ErrorManager;
   15.22  import org.openide.NotifyDescriptor;
   15.23  import org.openide.WizardDescriptor;
   15.24 +import org.openide.filesystems.FileObject;
   15.25 +import org.openide.filesystems.URLMapper;
   15.26 +import org.openide.text.Line;
   15.27  import org.openide.util.NbBundle;
   15.28  
   15.29  /**
   15.30 @@ -417,6 +423,10 @@
   15.31          StringWriter writer = null;
   15.32          String related = null;
   15.33          
   15.34 +        String filename = null;
   15.35 +        String url = null;
   15.36 +        String lineNumber = null;
   15.37 +        
   15.38          while (true) {
   15.39              processContentLine();
   15.40              String name = getParamName();
   15.41 @@ -506,15 +516,11 @@
   15.42              } else if ("SUMMARY".equals(name)) { // NOI18N
   15.43                  task.setSummary(value);
   15.44              } else if ("X-NETBEANS-FILENAME".equals(name)) { // NOI18N
   15.45 -                task.setFilename(value);
   15.46 +                filename = value;
   15.47              } else if ("X-NETBEANS-LINE".equals(name)) { // NOI18N
   15.48 -                int lineno = 0;
   15.49 -                try {
   15.50 -                    lineno = Integer.parseInt(value);
   15.51 -                } catch (NumberFormatException e) {
   15.52 -                    ErrorManager.getDefault().notify(e);
   15.53 -                }
   15.54 -                task.setLineNumber(lineno);
   15.55 +                lineNumber = value;
   15.56 +            } else if ("URL".equals(name)) {
   15.57 +                url = value;
   15.58              } else if ("RELATED-TO".equals(name)) { // NOI18N
   15.59                  related = value;
   15.60  //            } else if ("X-NETBEANS-STARTTIME".equals(name)) { // NOI18N  
   15.61 @@ -604,6 +610,48 @@
   15.62              }
   15.63          }
   15.64          
   15.65 +        int lineno = 1;
   15.66 +        if (lineNumber != null) {
   15.67 +            try {
   15.68 +                lineno = Integer.parseInt(lineNumber);
   15.69 +            } catch (NumberFormatException e) {
   15.70 +                // ignore
   15.71 +            }
   15.72 +        }
   15.73 +        
   15.74 +        if (lineno < 1)
   15.75 +            lineno = 1;
   15.76 +        
   15.77 +        FileObject fo = null;
   15.78 +        if (url != null) {
   15.79 +            try {
   15.80 +                fo = URLMapper.findFileObject(new URL(url));
   15.81 +            } catch (MalformedURLException e) {
   15.82 +                // ignore
   15.83 +            }
   15.84 +        }
   15.85 +        
   15.86 +        if (fo == null && filename != null) {
   15.87 +            fo = UTUtils.getFileObjectForFile(filename);
   15.88 +        }
   15.89 +        
   15.90 +        if (fo != null) {
   15.91 +            Line line = UTUtils.getLineByFile(fo, lineno - 1);
   15.92 +            if (line == null)
   15.93 +                line = UTUtils.getLineByFile(fo, 0);
   15.94 +            
   15.95 +            if (line != null) {
   15.96 +                task.setLine(line);
   15.97 +            }
   15.98 +        } else if (url != null) {
   15.99 +            try {
  15.100 +                task.setUrl(new URL(url));
  15.101 +                task.setLineNumber(lineno - 1);
  15.102 +            } catch (MalformedURLException e) {
  15.103 +                // ignore
  15.104 +            }
  15.105 +        }
  15.106 +        
  15.107  //        if (associatedTime != null) {
  15.108  //            task.setAssociatedTime(associatedTime);
  15.109  //        }
    16.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/translators/XmlExportFormat.java	Sat Oct 02 00:36:00 2004 +0000
    16.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/translators/XmlExportFormat.java	Sat Oct 02 14:03:48 2004 +0000
    16.3 @@ -14,7 +14,7 @@
    16.4  package org.netbeans.modules.tasklist.usertasks.translators;
    16.5  
    16.6  import java.io.File;
    16.7 -import java.net.MalformedURLException;
    16.8 +import java.net.URL;
    16.9  import java.text.DateFormat;
   16.10  import java.text.SimpleDateFormat;
   16.11  import java.util.Date;
   16.12 @@ -210,16 +210,12 @@
   16.13              node.setAttribute("due", dateToString(task.getDueDate())); // NOI18N
   16.14          }
   16.15          
   16.16 -        if (task.getFilename().length() != 0) {
   16.17 -            File f = new File(task.getFilename());
   16.18 -            try {
   16.19 -                node.setAttribute("file", // NOI18N
   16.20 -                    f.toURI().toURL().toExternalForm());
   16.21 -            } catch (MalformedURLException e) {
   16.22 -                // ignore
   16.23 -            }
   16.24 +        URL url = task.getUrl();
   16.25 +        if (url != null) {
   16.26 +            node.setAttribute("file", // NOI18N
   16.27 +                url.toExternalForm());
   16.28              node.setAttribute("line", // NOI18N
   16.29 -                String.valueOf(task.getLineNumber()));
   16.30 +                String.valueOf(task.getLineNumber() + 1));
   16.31          }
   16.32          
   16.33          node.setAttribute("created", // NOI18N
    17.1 --- a/tasklist.usertasks/test/build-qa-functional.xml	Sat Oct 02 00:36:00 2004 +0000
    17.2 +++ b/tasklist.usertasks/test/build-qa-functional.xml	Sat Oct 02 14:03:48 2004 +0000
    17.3 @@ -18,6 +18,10 @@
    17.4        ==================================================== -->
    17.5  
    17.6  <project name="User Tasks QA functional tests" basedir="." default="all">
    17.7 +    <!-- Creates an empty Java project in IDE -->
    17.8 +    <!-- <property name="xtest.ide.create.project" value="true"/> -->
    17.9 +    <!-- Opens project at specified location -->
   17.10 +    <property name="xtest.ide.open.project" location="${xtest.data}/SampleApp"/>
   17.11  
   17.12      <!-- =================== -->
   17.13      <!-- Setting classpathes -->
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/tasklist.usertasks/test/qa-functional/data/SampleApp/build.xml	Sat Oct 02 14:03:48 2004 +0000
    18.3 @@ -0,0 +1,69 @@
    18.4 +<?xml version="1.0" encoding="UTF-8"?>
    18.5 +<!-- You may freely edit this file. See commented blocks below for -->
    18.6 +<!-- some examples of how to customize the build. -->
    18.7 +<!-- (If you delete it and reopen the project it will be recreated.) -->
    18.8 +<project name="SampleApp" default="default" basedir=".">
    18.9 +    <description>Builds, tests, and runs the project SampleApp.</description>
   18.10 +    <import file="nbproject/build-impl.xml"/>
   18.11 +    <!--
   18.12 +
   18.13 +    There exist several targets which are by default empty and which can be 
   18.14 +    used for execution of your tasks. These targets are usually executed 
   18.15 +    before and after some main targets. They are: 
   18.16 +
   18.17 +      -pre-init:                 called before initialization of project properties
   18.18 +      -post-init:                called after initialization of project properties
   18.19 +      -pre-compile:              called before javac compilation
   18.20 +      -post-compile:             called after javac compilation
   18.21 +      -pre-compile-single:       called before javac compilation of single file
   18.22 +      -post-compile-single:      called after javac compilation of single file
   18.23 +      -pre-compile-test:         called before javac compilation of JUnit tests
   18.24 +      -post-compile-test:        called after javac compilation of JUnit tests
   18.25 +      -pre-compile-test-single:  called before javac compilation of single JUnit test
   18.26 +      -post-compile-test-single: called after javac compilation of single JUunit test
   18.27 +      -pre-jar:                  called before JAR building
   18.28 +      -post-jar:                 called after JAR building
   18.29 +      -post-clean:               called after cleaning build products
   18.30 +
   18.31 +    (Targets beginning with '-' are not intended to be called on their own.)
   18.32 +
   18.33 +    Example of inserting an obfuscator after compilation could look like this:
   18.34 +
   18.35 +        <target name="-post-compile">
   18.36 +            <obfuscate>
   18.37 +                <fileset dir="${build.classes.dir}"/>
   18.38 +            </obfuscate>
   18.39 +        </target>
   18.40 +
   18.41 +    For list of available properties check the imported 
   18.42 +    nbproject/build-impl.xml file. 
   18.43 +
   18.44 +
   18.45 +    Another way to customize the build is by overriding existing main targets.
   18.46 +    The targets of interest are: 
   18.47 +
   18.48 +      -init-macrodef-javac:     defines macro for javac compilation
   18.49 +      -init-macrodef-junit:     defines macro for junit execution
   18.50 +      -init-macrodef-debug:     defines macro for class debugging
   18.51 +      -init-macrodef-java:      defines macro for class execution
   18.52 +      -do-jar-with-manifest:    JAR building (if you are using a manifest)
   18.53 +      -do-jar-without-manifest: JAR building (if you are not using a manifest)
   18.54 +      run:                      execution of project 
   18.55 +      -javadoc-build:           Javadoc generation
   18.56 +      test-report:              JUnit report generation
   18.57 +
   18.58 +    An example of overriding the target for project execution could look like this:
   18.59 +
   18.60 +        <target name="run" depends="SampleApp-impl.jar">
   18.61 +            <exec dir="bin" executable="launcher.exe">
   18.62 +                <arg file="${dist.jar}"/>
   18.63 +            </exec>
   18.64 +        </target>
   18.65 +
   18.66 +    Notice that the overridden target depends on the jar target and not only on 
   18.67 +    the compile target as the regular run target does. Again, for a list of available 
   18.68 +    properties which you can use, check the target you are overriding in the
   18.69 +    nbproject/build-impl.xml file. 
   18.70 +
   18.71 +    -->
   18.72 +</project>
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/tasklist.usertasks/test/qa-functional/data/SampleApp/ics/test10.ics	Sat Oct 02 14:03:48 2004 +0000
    19.3 @@ -0,0 +1,145 @@
    19.4 +BEGIN:VCALENDAR
    19.5 +PRODID:-//NetBeans tasklist//NONSGML 1.0//EN
    19.6 +VERSION:2.0
    19.7 +
    19.8 +BEGIN:VTODO
    19.9 +UID:nb1096053304335.216@timpc/127.0.0.1
   19.10 +CREATED:20040924T191504Z
   19.11 +SUMMARY:Music
   19.12 +PERCENT-COMPLETE:0
   19.13 +X-NETBEANS-PROGRESS-COMPUTED:yes
   19.14 +X-NETBEANS-EFFORT:180
   19.15 +X-NETBEANS-EFFORT-COMPUTED:yes
   19.16 +X-NETBEANS-SPENT-TIME:0
   19.17 +X-NETBEANS-SPENT-TIME-COMPUTED:yes
   19.18 +LAST-MODIFIED:20040924T191607Z
   19.19 +END:VTODO
   19.20 +
   19.21 +BEGIN:VTODO
   19.22 +UID:nb1096053321790.219@timpc/127.0.0.1
   19.23 +CREATED:20040924T191521Z
   19.24 +SUMMARY:techno
   19.25 +PERCENT-COMPLETE:0
   19.26 +X-NETBEANS-EFFORT:60
   19.27 +X-NETBEANS-SPENT-TIME:0
   19.28 +LAST-MODIFIED:20040924T191523Z
   19.29 +RELATED-TO:nb1096053304335.216@timpc/127.0.0.1
   19.30 +END:VTODO
   19.31 +
   19.32 +BEGIN:VTODO
   19.33 +UID:nb1096053317845.218@timpc/127.0.0.1
   19.34 +CREATED:20040924T191517Z
   19.35 +SUMMARY:pop
   19.36 +PERCENT-COMPLETE:0
   19.37 +X-NETBEANS-EFFORT:60
   19.38 +X-NETBEANS-SPENT-TIME:0
   19.39 +LAST-MODIFIED:20040924T191519Z
   19.40 +RELATED-TO:nb1096053304335.216@timpc/127.0.0.1
   19.41 +END:VTODO
   19.42 +
   19.43 +BEGIN:VTODO
   19.44 +UID:nb1096053313639.217@timpc/127.0.0.1
   19.45 +CREATED:20040924T191513Z
   19.46 +SUMMARY:rock
   19.47 +PERCENT-COMPLETE:0
   19.48 +X-NETBEANS-EFFORT:60
   19.49 +X-NETBEANS-SPENT-TIME:0
   19.50 +LAST-MODIFIED:20040924T191515Z
   19.51 +RELATED-TO:nb1096053304335.216@timpc/127.0.0.1
   19.52 +END:VTODO
   19.53 +
   19.54 +BEGIN:VTODO
   19.55 +UID:nb1096053295202.215@timpc/127.0.0.1
   19.56 +CREATED:20040924T191455Z
   19.57 +SUMMARY:Lights
   19.58 +PERCENT-COMPLETE:0
   19.59 +X-NETBEANS-PROGRESS-COMPUTED:yes
   19.60 +X-NETBEANS-EFFORT:180
   19.61 +X-NETBEANS-EFFORT-COMPUTED:yes
   19.62 +X-NETBEANS-SPENT-TIME:0
   19.63 +X-NETBEANS-SPENT-TIME-COMPUTED:yes
   19.64 +LAST-MODIFIED:20040924T191601Z
   19.65 +END:VTODO
   19.66 +
   19.67 +BEGIN:VTODO
   19.68 +UID:nb1096053335250.222@timpc/127.0.0.1
   19.69 +CREATED:20040924T191535Z
   19.70 +SUMMARY:yellow
   19.71 +PERCENT-COMPLETE:0
   19.72 +X-NETBEANS-EFFORT:60
   19.73 +X-NETBEANS-SPENT-TIME:0
   19.74 +LAST-MODIFIED:20040924T191537Z
   19.75 +RELATED-TO:nb1096053295202.215@timpc/127.0.0.1
   19.76 +END:VTODO
   19.77 +
   19.78 +BEGIN:VTODO
   19.79 +UID:nb1096053331444.221@timpc/127.0.0.1
   19.80 +CREATED:20040924T191531Z
   19.81 +SUMMARY:green
   19.82 +PERCENT-COMPLETE:0
   19.83 +X-NETBEANS-EFFORT:60
   19.84 +X-NETBEANS-SPENT-TIME:0
   19.85 +LAST-MODIFIED:20040924T191533Z
   19.86 +RELATED-TO:nb1096053295202.215@timpc/127.0.0.1
   19.87 +END:VTODO
   19.88 +
   19.89 +BEGIN:VTODO
   19.90 +UID:nb1096053327519.220@timpc/127.0.0.1
   19.91 +CREATED:20040924T191527Z
   19.92 +SUMMARY:red
   19.93 +PERCENT-COMPLETE:0
   19.94 +X-NETBEANS-EFFORT:60
   19.95 +X-NETBEANS-SPENT-TIME:0
   19.96 +LAST-MODIFIED:20040924T191529Z
   19.97 +RELATED-TO:nb1096053295202.215@timpc/127.0.0.1
   19.98 +END:VTODO
   19.99 +
  19.100 +BEGIN:VTODO
  19.101 +UID:nb1095505683514.163@timpc/127.0.0.1
  19.102 +CREATED:20040918T110803Z
  19.103 +SUMMARY:Colors
  19.104 +PERCENT-COMPLETE:18
  19.105 +X-NETBEANS-PROGRESS-COMPUTED:yes
  19.106 +X-NETBEANS-EFFORT:180
  19.107 +X-NETBEANS-EFFORT-COMPUTED:yes
  19.108 +X-NETBEANS-SPENT-TIME:15
  19.109 +X-NETBEANS-SPENT-TIME-COMPUTED:yes
  19.110 +LAST-MODIFIED:20040924T191557Z
  19.111 +END:VTODO
  19.112 +
  19.113 +BEGIN:VTODO
  19.114 +UID:nb1095766343623.138@timpc/127.0.0.1
  19.115 +CREATED:20040921T113223Z
  19.116 +SUMMARY:G
  19.117 +PERCENT-COMPLETE:25
  19.118 +X-NETBEANS-PROGRESS-COMPUTED:yes
  19.119 +X-NETBEANS-EFFORT:60
  19.120 +X-NETBEANS-SPENT-TIME:15
  19.121 +LAST-MODIFIED:20040921T113714Z
  19.122 +RELATED-TO:nb1095505683514.163@timpc/127.0.0.1
  19.123 +END:VTODO
  19.124 +
  19.125 +BEGIN:VTODO
  19.126 +UID:nb1095766338986.137@timpc/127.0.0.1
  19.127 +CREATED:20040921T113218Z
  19.128 +SUMMARY:R
  19.129 +PERCENT-COMPLETE:30
  19.130 +X-NETBEANS-EFFORT:60
  19.131 +X-NETBEANS-SPENT-TIME:0
  19.132 +LAST-MODIFIED:20040921T113649Z
  19.133 +RELATED-TO:nb1095505683514.163@timpc/127.0.0.1
  19.134 +END:VTODO
  19.135 +
  19.136 +BEGIN:VTODO
  19.137 +UID:nb1095505689522.164@timpc/127.0.0.1
  19.138 +CREATED:20040918T110809Z
  19.139 +SUMMARY:B
  19.140 +PERCENT-COMPLETE:0
  19.141 +X-NETBEANS-EFFORT:60
  19.142 +X-NETBEANS-SPENT-TIME:0
  19.143 +LAST-MODIFIED:20040924T191557Z
  19.144 +X-NETBEANS-LINE:173
  19.145 +RELATED-TO:nb1095505683514.163@timpc/127.0.0.1
  19.146 +END:VTODO
  19.147 +
  19.148 +END:VCALENDAR
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/tasklist.usertasks/test/qa-functional/data/SampleApp/manifest.mf	Sat Oct 02 14:03:48 2004 +0000
    20.3 @@ -0,0 +1,3 @@
    20.4 +Manifest-Version: 1.0
    20.5 +X-COMMENT: Main-Class will be added automatically by build
    20.6 +
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/tasklist.usertasks/test/qa-functional/data/SampleApp/nbproject/build-impl.xml	Sat Oct 02 14:03:48 2004 +0000
    21.3 @@ -0,0 +1,475 @@
    21.4 +<?xml version="1.0" encoding="UTF-8"?>
    21.5 +<!--
    21.6 +*** GENERATED FROM project.xml - DO NOT EDIT  ***
    21.7 +***         EDIT ../build.xml INSTEAD         ***
    21.8 +
    21.9 +For the purpose of easier reading the script
   21.10 +is divided into following sections:
   21.11 +
   21.12 +  - initialization
   21.13 +  - compilation
   21.14 +  - jar
   21.15 +  - execution
   21.16 +  - debugging
   21.17 +  - javadoc
   21.18 +  - junit compilation
   21.19 +  - junit execution
   21.20 +  - junit debugging
   21.21 +  - applet
   21.22 +  - cleanup
   21.23 +
   21.24 +-->
   21.25 +<project name="SampleApp-impl" default="build" basedir="..">
   21.26 +    <target name="default" depends="test,jar,javadoc" description="Build and test whole project."/>
   21.27 +    <!-- 
   21.28 +    ======================
   21.29 +    INITIALIZATION SECTION 
   21.30 +    ======================
   21.31 +    -->
   21.32 +    <target name="-pre-init">
   21.33 +        <!-- Empty placeholder for easier customization. -->
   21.34 +        <!-- You can override this target in the ../build.xml file. -->
   21.35 +    </target>
   21.36 +    <target name="-init-private" depends="-pre-init">
   21.37 +        <property file="nbproject/private/private.properties"/>
   21.38 +    </target>
   21.39 +    <target name="-init-user" depends="-pre-init,-init-private">
   21.40 +        <property file="${user.properties.file}"/>
   21.41 +        <!-- The two properties below are usually overridden -->
   21.42 +        <!-- by the active platform. Just a fallback. -->
   21.43 +        <property value="1.4" name="default.javac.source"/>
   21.44 +        <property value="1.4" name="default.javac.target"/>
   21.45 +    </target>
   21.46 +    <target name="-init-project" depends="-pre-init,-init-private,-init-user">
   21.47 +        <property file="nbproject/project.properties"/>
   21.48 +    </target>
   21.49 +    <target name="-do-init" depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property">
   21.50 +        <available property="manifest.available" file="${manifest.file}"/>
   21.51 +        <condition property="manifest.available+main.class">
   21.52 +            <and>
   21.53 +                <isset property="manifest.available"/>
   21.54 +                <isset property="main.class"/>
   21.55 +                <not>
   21.56 +                    <equals trim="true" arg2="" arg1="${main.class}"/>
   21.57 +                </not>
   21.58 +            </and>
   21.59 +        </condition>
   21.60 +        <available file="${test.src.dir}" property="have.tests"/>
   21.61 +        <condition property="netbeans.home+have.tests">
   21.62 +            <and>
   21.63 +                <isset property="netbeans.home"/>
   21.64 +                <isset property="have.tests"/>
   21.65 +            </and>
   21.66 +        </condition>
   21.67 +        <condition property="no.javadoc.preview">
   21.68 +            <isfalse value="${javadoc.preview}"/>
   21.69 +        </condition>
   21.70 +        <property value="" name="run.jvmargs"/>
   21.71 +        <property value="" name="javac.compilerargs"/>
   21.72 +        <property value="${basedir}" name="work.dir"/>
   21.73 +        <condition property="no.deps">
   21.74 +            <and>
   21.75 +                <istrue value="${no.dependencies}"/>
   21.76 +            </and>
   21.77 +        </condition>
   21.78 +    </target>
   21.79 +    <target name="-post-init">
   21.80 +        <!-- Empty placeholder for easier customization. -->
   21.81 +        <!-- You can override this target in the ../build.xml file. -->
   21.82 +    </target>
   21.83 +    <target name="-init-check" depends="-pre-init,-init-private,-init-user,-init-project,-do-init">
   21.84 +        <fail unless="src.dir">Must set src.dir</fail>
   21.85 +        <fail unless="test.src.dir">Must set test.src.dir</fail>
   21.86 +        <fail unless="build.dir">Must set build.dir</fail>
   21.87 +        <fail unless="dist.dir">Must set dist.dir</fail>
   21.88 +        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
   21.89 +        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
   21.90 +        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
   21.91 +        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
   21.92 +        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
   21.93 +        <fail unless="dist.jar">Must set dist.jar</fail>
   21.94 +    </target>
   21.95 +    <target name="-init-macrodef-property">
   21.96 +        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
   21.97 +            <attribute name="name"/>
   21.98 +            <attribute name="value"/>
   21.99 +            <sequential>
  21.100 +                <property name="@{name}" value="${@{value}}"/>
  21.101 +            </sequential>
  21.102 +        </macrodef>
  21.103 +    </target>
  21.104 +    <target name="-init-macrodef-javac">
  21.105 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/1">
  21.106 +            <attribute name="srcdir" default="${src.dir}"/>
  21.107 +            <attribute name="destdir" default="${build.classes.dir}"/>
  21.108 +            <attribute name="classpath" default="${javac.classpath}"/>
  21.109 +            <attribute name="debug" default="${javac.debug}"/>
  21.110 +            <element name="customize" optional="true"/>
  21.111 +            <sequential>
  21.112 +                <javac srcdir="@{srcdir}" destdir="@{destdir}" debug="@{debug}" deprecation="${javac.deprecation}" source="${javac.source}" target="${javac.target}" includeantruntime="false">
  21.113 +                    <classpath>
  21.114 +                        <path path="@{classpath}"/>
  21.115 +                    </classpath>
  21.116 +                    <compilerarg line="${javac.compilerargs}"/>
  21.117 +                    <customize/>
  21.118 +                </javac>
  21.119 +            </sequential>
  21.120 +        </macrodef>
  21.121 +    </target>
  21.122 +    <target name="-init-macrodef-junit">
  21.123 +        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/1">
  21.124 +            <attribute name="includes" default="**/*Test.java"/>
  21.125 +            <sequential>
  21.126 +                <junit showoutput="true" fork="true" dir="${basedir}" failureproperty="tests.failed" errorproperty="tests.failed">
  21.127 +                    <batchtest todir="${build.test.results.dir}">
  21.128 +                        <fileset includes="@{includes}" dir="${test.src.dir}"/>
  21.129 +                    </batchtest>
  21.130 +                    <classpath>
  21.131 +                        <path path="${run.test.classpath}"/>
  21.132 +                    </classpath>
  21.133 +                    <syspropertyset>
  21.134 +                        <propertyref prefix="test-sys-prop."/>
  21.135 +                        <mapper to="*" from="test-sys-prop.*" type="glob"/>
  21.136 +                    </syspropertyset>
  21.137 +                    <formatter usefile="false" type="brief"/>
  21.138 +                </junit>
  21.139 +            </sequential>
  21.140 +        </macrodef>
  21.141 +    </target>
  21.142 +    <target name="-init-macrodef-nbjpda">
  21.143 +        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
  21.144 +            <attribute name="name" default="${main.class}"/>
  21.145 +            <attribute name="classpath" default="${debug.classpath}"/>
  21.146 +            <attribute name="stopclassname" default=""/>
  21.147 +            <sequential>
  21.148 +                <nbjpdastart stopclassname="@{stopclassname}" name="@{name}" addressproperty="jpda.address" transport="dt_socket">
  21.149 +                    <classpath>
  21.150 +                        <path path="@{classpath}"/>
  21.151 +                    </classpath>
  21.152 +                </nbjpdastart>
  21.153 +            </sequential>
  21.154 +        </macrodef>
  21.155 +        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
  21.156 +            <attribute name="dir" default="${build.classes.dir}"/>
  21.157 +            <sequential>
  21.158 +                <nbjpdareload>
  21.159 +                    <fileset dir="@{dir}" includes="${fix.includes}*.class"/>
  21.160 +                </nbjpdareload>
  21.161 +            </sequential>
  21.162 +        </macrodef>
  21.163 +    </target>
  21.164 +    <target name="-init-macrodef-debug">
  21.165 +        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/1">
  21.166 +            <attribute name="classname" default="${main.class}"/>
  21.167 +            <attribute name="classpath" default="${debug.classpath}"/>
  21.168 +            <attribute name="args" default="${application.args}"/>
  21.169 +            <sequential>
  21.170 +                <java classname="@{classname}" fork="true" dir="${work.dir}">
  21.171 +                    <jvmarg value="-Xdebug"/>
  21.172 +                    <jvmarg value="-Xnoagent"/>
  21.173 +                    <jvmarg value="-Djava.compiler=none"/>
  21.174 +                    <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
  21.175 +                    <jvmarg line="${run.jvmargs}"/>
  21.176 +                    <classpath>
  21.177 +                        <path path="@{classpath}"/>
  21.178 +                    </classpath>
  21.179 +                    <syspropertyset>
  21.180 +                        <propertyref prefix="run-sys-prop."/>
  21.181 +                        <mapper to="*" from="run-sys-prop.*" type="glob"/>
  21.182 +                    </syspropertyset>
  21.183 +                    <arg line="@{args}"/>
  21.184 +                </java>
  21.185 +            </sequential>
  21.186 +        </macrodef>
  21.187 +    </target>
  21.188 +    <target name="-init-macrodef-java">
  21.189 +        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
  21.190 +            <attribute name="classname" default="${main.class}"/>
  21.191 +            <element name="customize" optional="true"/>
  21.192 +            <sequential>
  21.193 +                <java classname="@{classname}" fork="true" dir="${work.dir}">
  21.194 +                    <jvmarg line="${run.jvmargs}"/>
  21.195 +                    <classpath>
  21.196 +                        <path path="${run.classpath}"/>
  21.197 +                    </classpath>
  21.198 +                    <syspropertyset>
  21.199 +                        <propertyref prefix="run-sys-prop."/>
  21.200 +                        <mapper to="*" from="run-sys-prop.*" type="glob"/>
  21.201 +                    </syspropertyset>
  21.202 +                    <customize/>
  21.203 +                </java>
  21.204 +            </sequential>
  21.205 +        </macrodef>
  21.206 +    </target>
  21.207 +    <target name="-init-presetdef-jar">
  21.208 +        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
  21.209 +            <jar compress="${jar.compress}" jarfile="${dist.jar}">
  21.210 +                <fileset xmlns="http://www.netbeans.org/ns/j2se-project/1" dir="${build.classes.dir}"/>
  21.211 +            </jar>
  21.212 +        </presetdef>
  21.213 +    </target>
  21.214 +    <target name="init" depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar"/>
  21.215 +    <!--
  21.216 +    ===================
  21.217 +    COMPILATION SECTION
  21.218 +    ===================
  21.219 +    -->
  21.220 +    <target name="deps-jar" depends="init" unless="no.deps"/>
  21.221 +    <target name="-pre-pre-compile" depends="init,deps-jar">
  21.222 +        <mkdir dir="${build.classes.dir}"/>
  21.223 +    </target>
  21.224 +    <target name="-pre-compile">
  21.225 +        <!-- Empty placeholder for easier customization. -->
  21.226 +        <!-- You can override this target in the ../build.xml file. -->
  21.227 +    </target>
  21.228 +    <target name="-do-compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile">
  21.229 +        <j2seproject:javac xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
  21.230 +        <copy todir="${build.classes.dir}">
  21.231 +            <fileset excludes="${build.classes.excludes}" dir="${src.dir}"/>
  21.232 +        </copy>
  21.233 +    </target>
  21.234 +    <target name="-post-compile">
  21.235 +        <!-- Empty placeholder for easier customization. -->
  21.236 +        <!-- You can override this target in the ../build.xml file. -->
  21.237 +    </target>
  21.238 +    <target name="compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project."/>
  21.239 +    <target name="-pre-compile-single">
  21.240 +        <!-- Empty placeholder for easier customization. -->
  21.241 +        <!-- You can override this target in the ../build.xml file. -->
  21.242 +    </target>
  21.243 +    <target name="-do-compile-single" depends="init,deps-jar,-pre-pre-compile">
  21.244 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  21.245 +        <j2seproject:javac xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1">
  21.246 +            <customize>
  21.247 +                <patternset includes="${javac.includes}"/>
  21.248 +            </customize>
  21.249 +        </j2seproject:javac>
  21.250 +    </target>
  21.251 +    <target name="-post-compile-single">
  21.252 +        <!-- Empty placeholder for easier customization. -->
  21.253 +        <!-- You can override this target in the ../build.xml file. -->
  21.254 +    </target>
  21.255 +    <target name="compile-single" depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single"/>
  21.256 +    <!--
  21.257 +    ====================
  21.258 +    JAR BUILDING SECTION
  21.259 +    ====================
  21.260 +    -->
  21.261 +    <target name="-pre-pre-jar" depends="init">
  21.262 +        <dirname file="${dist.jar}" property="dist.jar.dir"/>
  21.263 +        <mkdir dir="${dist.jar.dir}"/>
  21.264 +    </target>
  21.265 +    <target name="-pre-jar">
  21.266 +        <!-- Empty placeholder for easier customization. -->
  21.267 +        <!-- You can override this target in the ../build.xml file. -->
  21.268 +    </target>
  21.269 +    <target name="-do-jar-without-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" unless="manifest.available">
  21.270 +        <j2seproject:jar xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
  21.271 +    </target>
  21.272 +    <target name="-do-jar-with-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" unless="manifest.available+main.class">
  21.273 +        <j2seproject:jar xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1" manifest="${manifest.file}"/>
  21.274 +    </target>
  21.275 +    <target name="-do-jar-with-mainclass" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class">
  21.276 +        <j2seproject:jar xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1" manifest="${manifest.file}">
  21.277 +            <manifest xmlns="http://www.netbeans.org/ns/j2se-project/1">
  21.278 +                <attribute value="${main.class}" name="Main-Class"/>
  21.279 +            </manifest>
  21.280 +        </j2seproject:jar>
  21.281 +    </target>
  21.282 +    <target name="-post-jar">
  21.283 +        <!-- Empty placeholder for easier customization. -->
  21.284 +        <!-- You can override this target in the ../build.xml file. -->
  21.285 +    </target>
  21.286 +    <target name="jar" depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-post-jar" description="Build JAR."/>
  21.287 +    <!--
  21.288 +    =================
  21.289 +    EXECUTION SECTION
  21.290 +    =================
  21.291 +    -->
  21.292 +    <target name="run" depends="init,compile" description="Run a main class.">
  21.293 +        <j2seproject:java xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1">
  21.294 +            <customize>
  21.295 +                <arg line="${application.args}"/>
  21.296 +            </customize>
  21.297 +        </j2seproject:java>
  21.298 +    </target>
  21.299 +    <target name="run-single" depends="init,compile-single">
  21.300 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  21.301 +        <j2seproject:java xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1" classname="${run.class}"/>
  21.302 +    </target>
  21.303 +    <!--
  21.304 +    =================
  21.305 +    DEBUGGING SECTION
  21.306 +    =================
  21.307 +    -->
  21.308 +    <target name="-debug-start-debugger" if="netbeans.home" depends="init">
  21.309 +        <j2seproject:nbjpdastart xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1" name="${debug.class}"/>
  21.310 +    </target>
  21.311 +    <target name="-debug-start-debuggee" depends="init,compile">
  21.312 +        <j2seproject:debug xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
  21.313 +    </target>
  21.314 +    <target name="debug" if="netbeans.home" depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE."/>
  21.315 +    <target name="-debug-start-debugger-stepinto" if="netbeans.home" depends="init">
  21.316 +        <j2seproject:nbjpdastart xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1" stopclassname="${main.class}"/>
  21.317 +    </target>
  21.318 +    <target name="debug-stepinto" if="netbeans.home" depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee"/>
  21.319 +    <target name="-debug-start-debuggee-single" if="netbeans.home" depends="init,compile-single">
  21.320 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  21.321 +        <j2seproject:debug xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1" classname="${debug.class}"/>
  21.322 +    </target>
  21.323 +    <target name="debug-single" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single"/>
  21.324 +    <target name="-pre-debug-fix" depends="init">
  21.325 +        <fail unless="fix.includes">Must set fix.includes</fail>
  21.326 +        <property value="${fix.includes}.java" name="javac.includes"/>
  21.327 +    </target>
  21.328 +    <target name="-do-debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,compile-single">
  21.329 +        <j2seproject:nbjpdareload xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
  21.330 +    </target>
  21.331 +    <target name="debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix"/>
  21.332 +    <!--
  21.333 +    ===============
  21.334 +    JAVADOC SECTION
  21.335 +    ===============
  21.336 +    -->
  21.337 +    <target name="-javadoc-build" depends="init">
  21.338 +        <mkdir dir="${dist.javadoc.dir}"/>
  21.339 +        <javadoc destdir="${dist.javadoc.dir}" source="${javac.source}" notree="${javadoc.notree}" use="${javadoc.use}" nonavbar="${javadoc.nonavbar}" noindex="${javadoc.noindex}" splitindex="${javadoc.splitindex}" author="${javadoc.author}" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}" private="${javadoc.private}" failonerror="true">
  21.340 +            <classpath>
  21.341 +                <path path="${javac.classpath}"/>
  21.342 +            </classpath>
  21.343 +            <sourcepath>
  21.344 +                <pathelement location="${src.dir}"/>
  21.345 +            </sourcepath>
  21.346 +            <fileset dir="${src.dir}"/>
  21.347 +        </javadoc>
  21.348 +    </target>
  21.349 +    <target name="-javadoc-browse" if="netbeans.home" unless="no.javadoc.preview" depends="init,-javadoc-build">
  21.350 +        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
  21.351 +    </target>
  21.352 +    <target name="javadoc" depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc."/>
  21.353 +    <!--
  21.354 +    =========================
  21.355 +    JUNIT COMPILATION SECTION
  21.356 +    =========================
  21.357 +    -->
  21.358 +    <target name="-pre-pre-compile-test" if="have.tests" depends="init,compile">
  21.359 +        <mkdir dir="${build.test.classes.dir}"/>
  21.360 +    </target>
  21.361 +    <target name="-pre-compile-test">
  21.362 +        <!-- Empty placeholder for easier customization. -->
  21.363 +        <!-- You can override this target in the ../build.xml file. -->
  21.364 +    </target>
  21.365 +    <target name="-do-compile-test" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test">
  21.366 +        <j2seproject:javac xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  21.367 +        <copy todir="${build.test.classes.dir}">
  21.368 +            <fileset dir="${test.src.dir}">
  21.369 +                <exclude name="**/*.java"/>
  21.370 +            </fileset>
  21.371 +        </copy>
  21.372 +    </target>
  21.373 +    <target name="-post-compile-test">
  21.374 +        <!-- Empty placeholder for easier customization. -->
  21.375 +        <!-- You can override this target in the ../build.xml file. -->
  21.376 +    </target>
  21.377 +    <target name="compile-test" depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test"/>
  21.378 +    <target name="-pre-compile-test-single">
  21.379 +        <!-- Empty placeholder for easier customization. -->
  21.380 +        <!-- You can override this target in the ../build.xml file. -->
  21.381 +    </target>
  21.382 +    <target name="-do-compile-test-single" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single">
  21.383 +        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  21.384 +        <j2seproject:javac xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}">
  21.385 +            <customize>
  21.386 +                <patternset includes="${javac.includes}"/>
  21.387 +            </customize>
  21.388 +        </j2seproject:javac>
  21.389 +    </target>
  21.390 +    <target name="-post-compile-test-single">
  21.391 +        <!-- Empty placeholder for easier customization. -->
  21.392 +        <!-- You can override this target in the ../build.xml file. -->
  21.393 +    </target>
  21.394 +    <target name="compile-test-single" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single"/>
  21.395 +    <!--
  21.396 +    =======================
  21.397 +    JUNIT EXECUTION SECTION
  21.398 +    =======================
  21.399 +    -->
  21.400 +    <target name="-pre-test-run" if="have.tests" depends="init">
  21.401 +        <mkdir dir="${build.test.results.dir}"/>
  21.402 +    </target>
  21.403 +    <target name="-do-test-run" if="have.tests" depends="init,compile-test,-pre-test-run">
  21.404 +        <j2seproject:junit xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1"/>
  21.405 +    </target>
  21.406 +    <target name="-post-test-run" if="have.tests" depends="init,compile-test,-pre-test-run,-do-test-run">
  21.407 +        <fail if="tests.failed">Some tests failed; see details above.</fail>
  21.408 +    </target>
  21.409 +    <target name="test-report" if="have.tests" depends="init"/>
  21.410 +    <target name="-test-browse" if="netbeans.home+have.tests" depends="init"/>
  21.411 +    <target name="test" depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests."/>
  21.412 +    <target name="-pre-test-run-single" if="have.tests" depends="init">
  21.413 +        <mkdir dir="${build.test.results.dir}"/>
  21.414 +    </target>
  21.415 +    <target name="-do-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single">
  21.416 +        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  21.417 +        <j2seproject:junit xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1" includes="${test.includes}"/>
  21.418 +    </target>
  21.419 +    <target name="-post-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single">
  21.420 +        <fail if="tests.failed">Some tests failed; see details above.</fail>
  21.421 +    </target>
  21.422 +    <target name="test-single" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test."/>
  21.423 +    <!--
  21.424 +    =======================
  21.425 +    JUNIT DEBUGGING SECTION
  21.426 +    =======================
  21.427 +    -->
  21.428 +    <target name="-debug-start-debuggee-test" if="have.tests" depends="init,compile-test">
  21.429 +        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  21.430 +        <j2seproject:debug xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1" args="${test.class}" classpath="${debug.test.classpath}" classname="junit.textui.TestRunner"/>
  21.431 +    </target>
  21.432 +    <target name="-debug-start-debugger-test" if="netbeans.home+have.tests" depends="init,compile-test">
  21.433 +        <j2seproject:nbjpdastart xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1" classpath="${debug.test.classpath}" name="${test.class}"/>
  21.434 +    </target>
  21.435 +    <target name="debug-test" depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test"/>
  21.436 +    <target name="-do-debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,compile-test-single">
  21.437 +        <j2seproject:nbjpdareload xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1" dir="${build.test.classes.dir}"/>
  21.438 +    </target>
  21.439 +    <target name="debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix-test"/>
  21.440 +    <!--
  21.441 +    =========================
  21.442 +    APPLET EXECUTION SECTION
  21.443 +    =========================
  21.444 +    -->
  21.445 +    <target name="run-applet" depends="init,compile-single">
  21.446 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  21.447 +        <j2seproject:java xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1" classname="sun.applet.AppletViewer">
  21.448 +            <customize>
  21.449 +                <arg line="${applet.url}"/>
  21.450 +            </customize>
  21.451 +        </j2seproject:java>
  21.452 +    </target>
  21.453 +    <!--
  21.454 +    =========================
  21.455 +    APPLET DEBUGGING  SECTION
  21.456 +    =========================
  21.457 +    -->
  21.458 +    <target name="-debug-start-debuggee-applet" if="netbeans.home" depends="init,compile-single">
  21.459 +        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  21.460 +        <j2seproject:debug xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/1" args="${applet.url}" classname="sun.applet.AppletViewer"/>
  21.461 +    </target>
  21.462 +    <target name="debug-applet" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet"/>
  21.463 +    <!--
  21.464 +    ===============
  21.465 +    CLEANUP SECTION
  21.466 +    ===============
  21.467 +    -->
  21.468 +    <target name="deps-clean" depends="init" unless="no.deps"/>
  21.469 +    <target name="-do-clean" depends="init">
  21.470 +        <delete dir="${build.dir}"/>
  21.471 +        <delete dir="${dist.dir}"/>
  21.472 +    </target>
  21.473 +    <target name="-post-clean">
  21.474 +        <!-- Empty placeholder for easier customization. -->
  21.475 +        <!-- You can override this target in the ../build.xml file. -->
  21.476 +    </target>
  21.477 +    <target name="clean" depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products."/>
  21.478 +</project>
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/tasklist.usertasks/test/qa-functional/data/SampleApp/nbproject/genfiles.properties	Sat Oct 02 14:03:48 2004 +0000
    22.3 @@ -0,0 +1,6 @@
    22.4 +build.xml.data.CRC32=70be1bd9
    22.5 +build.xml.script.CRC32=b4ae681d
    22.6 +build.xml.stylesheet.CRC32=ba5d3624
    22.7 +nbproject/build-impl.xml.data.CRC32=70be1bd9
    22.8 +nbproject/build-impl.xml.script.CRC32=90b86d03
    22.9 +nbproject/build-impl.xml.stylesheet.CRC32=2a130c99
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/tasklist.usertasks/test/qa-functional/data/SampleApp/nbproject/project.properties	Sat Oct 02 14:03:48 2004 +0000
    23.3 @@ -0,0 +1,50 @@
    23.4 +application.args=
    23.5 +build.classes.dir=${build.dir}/classes
    23.6 +build.classes.excludes=**/*.java,**/*.form
    23.7 +# This directory is removed when the project is cleaned:
    23.8 +build.dir=build
    23.9 +# Only compile against the classpath explicitly listed here:
   23.10 +build.sysclasspath=ignore
   23.11 +build.test.classes.dir=${build.dir}/test/classes
   23.12 +build.test.results.dir=${build.dir}/test/results
   23.13 +debug.classpath=\
   23.14 +    ${run.classpath}
   23.15 +debug.test.classpath=\
   23.16 +    ${run.test.classpath}
   23.17 +# This directory is removed when the project is cleaned:
   23.18 +dist.dir=dist
   23.19 +dist.jar=${dist.dir}/SampleApp.jar
   23.20 +dist.javadoc.dir=${dist.dir}/javadoc
   23.21 +jar.compress=false
   23.22 +javac.classpath=\
   23.23 +
   23.24 +javac.deprecation=false
   23.25 +javac.source=${default.javac.source}
   23.26 +javac.target=${default.javac.target}
   23.27 +javac.test.classpath=\
   23.28 +    ${javac.classpath}:\
   23.29 +    ${build.classes.dir}:\
   23.30 +    ${libs.junit.classpath}
   23.31 +javadoc.author=false
   23.32 +javadoc.encoding=
   23.33 +javadoc.noindex=false
   23.34 +javadoc.nonavbar=false
   23.35 +javadoc.notree=false
   23.36 +javadoc.private=false
   23.37 +javadoc.splitindex=true
   23.38 +javadoc.use=true
   23.39 +javadoc.version=false
   23.40 +javadoc.windowtitle=
   23.41 +main.class=sampleapp.Main
   23.42 +manifest.file=manifest.mf
   23.43 +platform.active=default_platform
   23.44 +run.classpath=\
   23.45 +    ${javac.classpath}:\
   23.46 +    ${build.classes.dir}
   23.47 +# Space-separated list of JVM arguments used when running the project:
   23.48 +run.jvmargs=
   23.49 +run.test.classpath=\
   23.50 +    ${javac.test.classpath}:\
   23.51 +    ${build.test.classes.dir}
   23.52 +src.dir=src
   23.53 +test.src.dir=test
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/tasklist.usertasks/test/qa-functional/data/SampleApp/nbproject/project.xml	Sat Oct 02 14:03:48 2004 +0000
    24.3 @@ -0,0 +1,10 @@
    24.4 +<?xml version="1.0" encoding="UTF-8"?>
    24.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
    24.6 +    <type>org.netbeans.modules.java.j2seproject</type>
    24.7 +    <configuration>
    24.8 +        <data xmlns="http://www.netbeans.org/ns/j2se-project/1">
    24.9 +            <name>SampleApp</name>
   24.10 +            <minimum-ant-version>1.6</minimum-ant-version>
   24.11 +        </data>
   24.12 +    </configuration>
   24.13 +</project>
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/tasklist.usertasks/test/qa-functional/data/SampleApp/src/sampleapp/Main.java	Sat Oct 02 14:03:48 2004 +0000
    25.3 @@ -0,0 +1,26 @@
    25.4 +/*
    25.5 + * Main.java
    25.6 + *
    25.7 + * Created on 26. September 2004, 17:42
    25.8 + */
    25.9 +
   25.10 +package sampleapp;
   25.11 +
   25.12 +/**
   25.13 + *
   25.14 + * @author  tim
   25.15 + */
   25.16 +public class Main {
   25.17 +    
   25.18 +    /** Creates a new instance of Main */
   25.19 +    public Main() {
   25.20 +    }
   25.21 +    
   25.22 +    /**
   25.23 +     * @param args the command line arguments
   25.24 +     */
   25.25 +    public static void main(String[] args) {
   25.26 +        // TODO code application logic here
   25.27 +    }
   25.28 +    
   25.29 +}
    26.1 --- a/tasklist.usertasks/test/qa-functional/src/org/netbeans/modules/tasklist/usertasks/test/IcsNode.java	Sat Oct 02 00:36:00 2004 +0000
    26.2 +++ b/tasklist.usertasks/test/qa-functional/src/org/netbeans/modules/tasklist/usertasks/test/IcsNode.java	Sat Oct 02 14:03:48 2004 +0000
    26.3 @@ -14,7 +14,7 @@
    26.4  package org.netbeans.modules.tasklist.usertasks.test;
    26.5  
    26.6  import org.netbeans.jellytools.FilesTabOperator;
    26.7 -import org.netbeans.jellytools.actions.ExecuteAction;
    26.8 +import org.netbeans.jellytools.actions.OpenAction;
    26.9  import org.netbeans.jellytools.nodes.Node;
   26.10  import org.netbeans.jemmy.operators.JTreeOperator;
   26.11  
   26.12 @@ -22,8 +22,6 @@
   26.13   * Ics file.
   26.14   */
   26.15  public class IcsNode extends Node {
   26.16 -    static final ExecuteAction executeAction = new ExecuteAction();
   26.17 -    
   26.18      /** Creates a new instance of AntTargetNode */
   26.19      public IcsNode(String treePath) {
   26.20          super(new FilesTabOperator().tree(), treePath);
   26.21 @@ -39,11 +37,7 @@
   26.22          super(parent, trg);
   26.23      }
   26.24      
   26.25 -    /** performs ExecuteAction with this node */    
   26.26 -    public void execute() {
   26.27 -        executeAction.perform(this);
   26.28 -    }
   26.29 -    
   26.30 -    public void addTask(String tsk) {
   26.31 +    public void open() {
   26.32 +        new OpenAction().perform(this);
   26.33      }
   26.34  }
    27.1 --- a/tasklist.usertasks/test/qa-functional/src/org/netbeans/modules/tasklist/usertasks/test/TestTable.java	Sat Oct 02 00:36:00 2004 +0000
    27.2 +++ b/tasklist.usertasks/test/qa-functional/src/org/netbeans/modules/tasklist/usertasks/test/TestTable.java	Sat Oct 02 14:03:48 2004 +0000
    27.3 @@ -16,7 +16,20 @@
    27.4  import junit.framework.Test;
    27.5  import junit.framework.TestSuite;
    27.6  
    27.7 +import org.netbeans.jellytools.FilesTabOperator;
    27.8  import org.netbeans.jellytools.JellyTestCase;
    27.9 +import org.netbeans.jellytools.NbDialogOperator;
   27.10 +import org.netbeans.jellytools.TopComponentOperator;
   27.11 +import org.netbeans.jellytools.actions.Action;
   27.12 +import org.netbeans.jellytools.actions.CopyAction;
   27.13 +import org.netbeans.jellytools.actions.DeleteAction;
   27.14 +import org.netbeans.jellytools.actions.OpenAction;
   27.15 +import org.netbeans.jellytools.actions.PasteAction;
   27.16 +import org.netbeans.jellytools.nodes.Node;
   27.17 +import org.netbeans.jemmy.EventTool;
   27.18 +import org.netbeans.jemmy.operators.JButtonOperator;
   27.19 +import org.netbeans.jemmy.operators.JPopupMenuOperator;
   27.20 +import org.netbeans.jemmy.operators.JTableOperator;
   27.21  import org.netbeans.junit.NbTestSuite;
   27.22  
   27.23  /**
   27.24 @@ -41,9 +54,76 @@
   27.25      public static void main(java.lang.String[] args) {
   27.26          junit.textui.TestRunner.run(suite());
   27.27      }
   27.28 +
   27.29 +    /**
   27.30 +     * Test
   27.31 +     */
   27.32 +    public void testIt() {
   27.33 +        Node n = FilesTabOperator.invoke().getProjectNode("SampleApp");
   27.34 +
   27.35 +        Node buildXml = new Node(n, "build.xml"); 
   27.36 +        buildXml.select(); 
   27.37 +        new OpenAction().perform(buildXml);
   27.38 +        
   27.39 +        TopComponentOperator tc = openCopy("test10.ics");
   27.40 +        
   27.41 +        JTableOperator t = new JTableOperator(tc, 0);
   27.42 +        t.waitHasFocus();
   27.43 +        assertEquals(0, t.getSelectedRow());
   27.44 +        t.selectCell(1, 0);
   27.45 +        
   27.46 +        Action ea = new Action(null, "Expand All");
   27.47 +        ea.performPopup(t);
   27.48 +        t.selectCell(1, 0);
   27.49 +        
   27.50 +        t.clickForPopup();
   27.51 +        
   27.52 +        new EventTool().waitNoEvent(1500);
   27.53 +
   27.54 +        JPopupMenuOperator pm = new JPopupMenuOperator();
   27.55 +        pm.pushMenuNoBlock("Show Task");
   27.56 +        
   27.57 +        new NbDialogOperator("Show Task").close();
   27.58 +        
   27.59 +        deleteCopy("test10.ics");
   27.60 +    }
   27.61 +
   27.62 +    /**
   27.63 +     * Copies a file with the specified name from the folder ics 
   27.64 +     * to the folder test and opens it
   27.65 +     *
   27.66 +     * @param name file name under /ics
   27.67 +     * @return opened TC
   27.68 +     */
   27.69 +    private TopComponentOperator openCopy(String name) {
   27.70 +        Node n = FilesTabOperator.invoke().getProjectNode("SampleApp");
   27.71 +
   27.72 +        Node data = new Node(n, "ics|" + name); 
   27.73 +        data.select(); 
   27.74 +        new CopyAction().perform(data);
   27.75 +        
   27.76 +        Node dir = new Node(n, "test");
   27.77 +        dir.select(); 
   27.78 +        new PasteAction().perform(dir);
   27.79 +        
   27.80 +        data = new Node(n, "test|" + name); 
   27.81 +        data.select(); 
   27.82 +        new OpenAction().perform(data);
   27.83 +        
   27.84 +        TopComponentOperator op = new TopComponentOperator(name);
   27.85 +
   27.86 +        return op;
   27.87 +    }
   27.88      
   27.89 -    public void testIt() {
   27.90 -        assertTrue(true);
   27.91 -        assertEquals(1, 1);
   27.92 +    private void deleteCopy(String name) {
   27.93 +        Node n = FilesTabOperator.invoke().getProjectNode("SampleApp");
   27.94 +
   27.95 +        Node data = new Node(n, "test|" + name); 
   27.96 +        data.select(); 
   27.97 +        new DeleteAction().perform(data);
   27.98 +        
   27.99 +        NbDialogOperator op = new NbDialogOperator("Confirm Object Deletion");
  27.100 +        JButtonOperator b = new JButtonOperator(op, "Yes");
  27.101 +        b.push();
  27.102      }
  27.103  }