1.1 --- a/suggestions_framework/src/org/netbeans/modules/tasklist/suggestions/SuggestionNode.java Sun Mar 02 09:36:45 2003 +0000
1.2 +++ b/suggestions_framework/src/org/netbeans/modules/tasklist/suggestions/SuggestionNode.java Sun Mar 02 10:19:16 2003 +0000
1.3 @@ -37,6 +37,7 @@
1.4 import org.openide.util.NbBundle;
1.5 import org.openide.util.actions.SystemAction;
1.6 import java.awt.datatransfer.Transferable;
1.7 +import org.netbeans.api.tasklist.SuggestionPriority;
1.8 import org.openide.text.Line;
1.9
1.10
1.11 @@ -166,8 +167,8 @@
1.12 ss.put(p);
1.13
1.14
1.15 - p = new Reflection(item, Integer.TYPE,
1.16 - "getPriorityNumber", null); // NOI18N
1.17 + p = new Reflection(item, SuggestionPriority.class,
1.18 + "getPriority", null); // NOI18N
1.19 p.setName(SuggestionsView.PROP_SUGG_PRIO);
1.20 p.setPropertyEditorClass(PriorityPropertyEditor.class);
1.21 p.setDisplayName(NbBundle.getMessage(SuggestionNode.class, "Priority")); // NOI18N
2.1 --- a/tasklist.core/src/org/netbeans/modules/tasklist/core/Bundle.properties Sun Mar 02 09:36:45 2003 +0000
2.2 +++ b/tasklist.core/src/org/netbeans/modules/tasklist/core/Bundle.properties Sun Mar 02 10:19:16 2003 +0000
2.3 @@ -103,9 +103,6 @@
2.4 MSG_AtLastError= At last error. One more to wrap.
2.5 MSG_AtFirstError=At first error. One more to wrap.
2.6
2.7 -#Undefined priority for a task
2.8 -PriorityUndefined=Undefined
2.9 -
2.10 #Low priority of a task
2.11 PriorityLow=Low
2.12
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/tasklist.core/src/org/netbeans/modules/tasklist/core/PriorityListCellRenderer.java Sun Mar 02 10:19:16 2003 +0000
3.3 @@ -0,0 +1,53 @@
3.4 +/*
3.5 + * Sun Public License Notice
3.6 + *
3.7 + * The contents of this file are subject to the Sun Public License
3.8 + * Version 1.0 (the "License"). You may not use this file except in
3.9 + * compliance with the License. A copy of the License is available at
3.10 + * http://www.sun.com/
3.11 + *
3.12 + * The Original Code is NetBeans. The Initial Developer of the Original
3.13 + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
3.14 + * Microsystems, Inc. All Rights Reserved.
3.15 + */
3.16 +
3.17 +package org.netbeans.modules.tasklist.core;
3.18 +
3.19 +import java.awt.Color;
3.20 +import java.awt.Component;
3.21 +import javax.swing.DefaultListCellRenderer;
3.22 +import javax.swing.JList;
3.23 +
3.24 +/**
3.25 + * ListCellRenderer for priorities
3.26 + *
3.27 + * @author Tim Lebedkov
3.28 + */
3.29 +public class PriorityListCellRenderer extends DefaultListCellRenderer {
3.30 + private static final String[] TAGS = Task.getPriorityNames();
3.31 +
3.32 + /**
3.33 + * Default colors for diferent priorities
3.34 + * [0] - high, [1] - medium-high, ...
3.35 + */
3.36 + public static final Color[] COLORS = {
3.37 + new Color(221, 0, 0),
3.38 + new Color(255, 128, 0),
3.39 + Color.black,
3.40 + new Color(0, 187, 0),
3.41 + new Color(0, 128, 0)
3.42 + };
3.43 +
3.44 + public Component getListCellRendererComponent(JList list, Object value,
3.45 + int index, boolean isSelected, boolean cellHasFocus) {
3.46 + super.getListCellRendererComponent(
3.47 + list, value, index, isSelected, cellHasFocus);
3.48 + if (index >= 0) {
3.49 + setText(TAGS[index]);
3.50 + setForeground(COLORS[index]);
3.51 + } else {
3.52 + setText((String) value);
3.53 + }
3.54 + return this;
3.55 + }
3.56 +}
4.1 --- a/tasklist.core/src/org/netbeans/modules/tasklist/core/Task.java Sun Mar 02 09:36:45 2003 +0000
4.2 +++ b/tasklist.core/src/org/netbeans/modules/tasklist/core/Task.java Sun Mar 02 10:19:16 2003 +0000
4.3 @@ -18,10 +18,12 @@
4.4 import java.io.IOException;
4.5 import java.io.Reader;
4.6 import java.io.Writer;
4.7 +import java.util.ArrayList;
4.8 import java.util.Iterator;
4.9 import java.util.LinkedList;
4.10 import java.util.List;
4.11 import java.util.ListIterator;
4.12 +import java.util.NoSuchElementException;
4.13 import java.util.ResourceBundle;
4.14 import org.netbeans.api.tasklist.Suggestion;
4.15 import org.netbeans.api.tasklist.SuggestionPriority;
4.16 @@ -40,7 +42,6 @@
4.17 public class Task extends Suggestion implements Cloneable {
4.18 /** Keys for the Bundle.properties */
4.19 private static final String[] PRIORITIES_KEYS = {
4.20 - "PriorityUndefined",
4.21 "PriorityHigh",
4.22 "PriorityMediumHigh",
4.23 "PriorityMedium",
4.24 @@ -62,12 +63,34 @@
4.25 /**
4.26 * Returns names for priorities
4.27 *
4.28 - * @return [0] - undefined, [1] - low, ...
4.29 + * @return [0] - high, [1] - medium-high, ...
4.30 */
4.31 public static String[] getPriorityNames() {
4.32 return PRIORITIES;
4.33 }
4.34
4.35 + /**
4.36 + * Finds a priority.
4.37 + * @param n integer representation of a priority
4.38 + * @return priority
4.39 + */
4.40 + public static SuggestionPriority getPriority(int n) {
4.41 + switch (n) {
4.42 + case 1:
4.43 + return SuggestionPriority.HIGH;
4.44 + case 2:
4.45 + return SuggestionPriority.MEDIUM_HIGH;
4.46 + case 3:
4.47 + return SuggestionPriority.MEDIUM;
4.48 + case 4:
4.49 + return SuggestionPriority.MEDIUM_LOW;
4.50 + case 5:
4.51 + return SuggestionPriority.LOW;
4.52 + default:
4.53 + return SuggestionPriority.MEDIUM;
4.54 + }
4.55 + }
4.56 +
4.57 /** The subtask list has changed */
4.58 public static final String PROP_CHILDREN_CHANGED = "children"; // NOI18N
4.59 /** Some of this items attributes (such as its description - anything
4.60 @@ -717,7 +740,4 @@
4.61 }
4.62 }
4.63 }
4.64 -}
4.65 -
4.66 -
4.67 -
4.68 +}
4.69 \ No newline at end of file
5.1 --- a/tasklist.core/src/org/netbeans/modules/tasklist/core/TaskListView.java Sun Mar 02 09:36:45 2003 +0000
5.2 +++ b/tasklist.core/src/org/netbeans/modules/tasklist/core/TaskListView.java Sun Mar 02 10:19:16 2003 +0000
5.3 @@ -287,7 +287,7 @@
5.4
5.5 // Select the root node, such that the empty tasklist has
5.6 // a context menu - but only if there are no items in the list
5.7 - if (!tasklist.getRoot().hasSubtasks()) {
5.8 + /*if (!tasklist.getRoot().hasSubtasks()) {
5.9 // See http://www.netbeans.org/issues/show_bug.cgi?id=27696
5.10 Node[] sel = new Node[] { getExplorerManager().getRootContext() };
5.11 try {
5.12 @@ -296,7 +296,7 @@
5.13 ErrorManager.getDefault().notify(
5.14 ErrorManager.INFORMATIONAL, e);
5.15 }
5.16 - }
5.17 + }*/
5.18 }
5.19
5.20 protected void hideList() {
6.1 --- a/tasklist.core/src/org/netbeans/modules/tasklist/core/TaskTransfer.java Sun Mar 02 09:36:45 2003 +0000
6.2 +++ b/tasklist.core/src/org/netbeans/modules/tasklist/core/TaskTransfer.java Sun Mar 02 10:19:16 2003 +0000
6.3 @@ -141,7 +141,10 @@
6.4 public Transferable paste() throws IOException {
6.5 try {
6.6 Task item = (Task)t.getTransferData(TODO_FLAVOR);
6.7 - after.getParent().addSubtask(item, after);
6.8 + if (after.getParent() == null)
6.9 + after.addSubtask(item);
6.10 + else
6.11 + after.getParent().addSubtask(item, after);
6.12 } catch (UnsupportedFlavorException ufe) {
6.13 // Should not happen.
6.14 IOException ioe = new IOException(ufe.toString());
7.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/EditTaskPanel.form Sun Mar 02 09:36:45 2003 +0000
7.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/EditTaskPanel.form Sun Mar 02 10:19:16 2003 +0000
7.3 @@ -116,7 +116,13 @@
7.4 <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
7.5 <Connection code="prioritiesModel" type="code"/>
7.6 </Property>
7.7 + <Property name="renderer" type="javax.swing.ListCellRenderer" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
7.8 + <Connection code="priorityRenderer" type="code"/>
7.9 + </Property>
7.10 </Properties>
7.11 + <Events>
7.12 + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="priorityComboBoxActionPerformed"/>
7.13 + </Events>
7.14 <Constraints>
7.15 <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
7.16 <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="11" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
7.17 @@ -275,9 +281,6 @@
7.18 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor" preCode="/*" postCode="*/">
7.19 <ResourceString bundle="org/netbeans/modules/tasklist/usertasks/Bundle.properties" key="BeginningList" replaceFormat="NbBundle.getMessage(EditTaskPanel.class, "{key}")); // NOI18N("/>
7.20 </Property>
7.21 - <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
7.22 - <ComponentRef name="addButtonGroup"/>
7.23 - </Property>
7.24 </Properties>
7.25 <Constraints>
7.26 <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
7.27 @@ -290,9 +293,6 @@
7.28 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor" preCode="/*" postCode="*/">
7.29 <ResourceString bundle="org/netbeans/modules/tasklist/usertasks/Bundle.properties" key="EndList" replaceFormat="NbBundle.getMessage(EditTaskPanel.class, "{key}")); // NOI18N("/>
7.30 </Property>
7.31 - <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
7.32 - <ComponentRef name="addButtonGroup"/>
7.33 - </Property>
7.34 </Properties>
7.35 <Constraints>
7.36 <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
8.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/EditTaskPanel.java Sun Mar 02 09:36:45 2003 +0000
8.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/EditTaskPanel.java Sun Mar 02 10:19:16 2003 +0000
8.3 @@ -33,6 +33,7 @@
8.4 import javax.swing.JList;
8.5 import javax.swing.Icon;
8.6 import javax.swing.ImageIcon;
8.7 +import org.netbeans.modules.tasklist.core.PriorityListCellRenderer;
8.8 import org.netbeans.modules.tasklist.core.Task;
8.9 import org.netbeans.modules.tasklist.core.TaskNode;
8.10 import org.openide.awt.Mnemonics;
8.11 @@ -51,6 +52,9 @@
8.12 * Panel used to enter/edit a user task.
8.13 * Please read comment at the beginning of initA11y before editing
8.14 * this file using the form builder.
8.15 + *
8.16 + * @author Tor Norbye
8.17 + * @author Tim Lebedkov
8.18 */
8.19
8.20 class EditTaskPanel extends JPanel implements ActionListener {
8.21 @@ -59,6 +63,7 @@
8.22 private ComboBoxModel prioritiesModel =
8.23 new DefaultComboBoxModel(Task.getPriorityNames());
8.24 private ComboBoxModel subtaskModel = null;
8.25 + private ListCellRenderer priorityRenderer = new PriorityListCellRenderer();
8.26
8.27 private static boolean appendDefault = Settings.getDefault().getAppend();
8.28
8.29 @@ -72,20 +77,15 @@
8.30 initComponents();
8.31 initA11y();
8.32
8.33 - priorityComboBox.setSelectedIndex(3);
8.34 + priorityComboBox.setSelectedIndex(2);
8.35
8.36 format = new SimpleDateFormat();
8.37
8.38 // Initialize the Categories list
8.39 - Set categories = tlv.getCategories();
8.40 - if ((categories != null) && (categories.size() > 0)) {
8.41 - DefaultComboBoxModel model = new DefaultComboBoxModel();
8.42 + String[] categories = tlv.getCategories();
8.43 + if (categories.length > 0) {
8.44 + DefaultComboBoxModel model = new DefaultComboBoxModel(categories);
8.45 model.addElement(""); // Default to "nothing" -- make an option for default category?
8.46 - Iterator it = categories.iterator();
8.47 - while (it.hasNext()) {
8.48 - String category = (String)it.next();
8.49 - model.addElement(category);
8.50 - }
8.51 categoryCombo.setModel(model);
8.52 }
8.53
8.54 @@ -106,11 +106,7 @@
8.55 if (item.getSummary() != null) {
8.56 descriptionTextField.setText(item.getSummary());
8.57 }
8.58 - int p = item.getPriorityNumber();
8.59 - if (p < 0)
8.60 - p = 0;
8.61 - if (p > 5)
8.62 - p = 5;
8.63 + int p = item.getPriority().intValue() - 1;
8.64 priorityComboBox.setSelectedIndex(p);
8.65 if (item.getFilename() != null) {
8.66 fileTextField.setText(item.getFilename());
8.67 @@ -191,8 +187,8 @@
8.68 descLabel.setText(NbBundle.getMessage(EditTaskPanel.class, "Brief_Description")); // NOI18N);
8.69 */
8.70 gridBagConstraints = new java.awt.GridBagConstraints();
8.71 + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
8.72 gridBagConstraints.insets = new java.awt.Insets(11, 0, 0, 12);
8.73 - gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
8.74 add(descLabel, gridBagConstraints);
8.75
8.76 gridBagConstraints = new java.awt.GridBagConstraints();
8.77 @@ -207,8 +203,8 @@
8.78 detailsLabel.setText(NbBundle.getMessage(EditTaskPanel.class, "DetailsLabel")); // NOI18N);
8.79 */
8.80 gridBagConstraints = new java.awt.GridBagConstraints();
8.81 + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
8.82 gridBagConstraints.insets = new java.awt.Insets(11, 0, 0, 12);
8.83 - gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
8.84 add(detailsLabel, gridBagConstraints);
8.85
8.86 detailsTextArea.setRows(5);
8.87 @@ -226,8 +222,8 @@
8.88 subtaskLabel.setText(NbBundle.getMessage(EditTaskPanel.class, "IsSubtaskOf")); // NOI18N);
8.89 */
8.90 gridBagConstraints = new java.awt.GridBagConstraints();
8.91 + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
8.92 gridBagConstraints.insets = new java.awt.Insets(11, 0, 0, 12);
8.93 - gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
8.94 add(subtaskLabel, gridBagConstraints);
8.95
8.96 gridBagConstraints = new java.awt.GridBagConstraints();
8.97 @@ -242,11 +238,18 @@
8.98 prioLabel.setText(NbBundle.getMessage(EditTaskPanel.class, "PriorityLabel")); // NOI18N);
8.99 */
8.100 gridBagConstraints = new java.awt.GridBagConstraints();
8.101 + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
8.102 gridBagConstraints.insets = new java.awt.Insets(11, 0, 0, 12);
8.103 - gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
8.104 add(prioLabel, gridBagConstraints);
8.105
8.106 priorityComboBox.setModel(prioritiesModel);
8.107 + priorityComboBox.setRenderer(priorityRenderer);
8.108 + priorityComboBox.addActionListener(new java.awt.event.ActionListener() {
8.109 + public void actionPerformed(java.awt.event.ActionEvent evt) {
8.110 + EditTaskPanel.this.priorityComboBoxActionPerformed(evt);
8.111 + }
8.112 + });
8.113 +
8.114 gridBagConstraints = new java.awt.GridBagConstraints();
8.115 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
8.116 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
8.117 @@ -266,8 +269,8 @@
8.118 categoryLabel.setText(NbBundle.getMessage(EditTaskPanel.class, "CategoryLabel")); // NOI18N);
8.119 */
8.120 gridBagConstraints = new java.awt.GridBagConstraints();
8.121 + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
8.122 gridBagConstraints.insets = new java.awt.Insets(11, 0, 0, 12);
8.123 - gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
8.124 add(categoryLabel, gridBagConstraints);
8.125
8.126 categoryCombo.setEditable(true);
8.127 @@ -363,14 +366,13 @@
8.128
8.129 addLabel.setText(NbBundle.getMessage(EditTaskPanel.class, "AddTo")); // NOI18N();
8.130 gridBagConstraints = new java.awt.GridBagConstraints();
8.131 + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
8.132 gridBagConstraints.insets = new java.awt.Insets(11, 0, 0, 12);
8.133 - gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
8.134 add(addLabel, gridBagConstraints);
8.135
8.136 /*
8.137 beginningToggle.setText(NbBundle.getMessage(EditTaskPanel.class, "BeginningList")); // NOI18N();
8.138 */
8.139 - addButtonGroup.add(beginningToggle);
8.140 gridBagConstraints = new java.awt.GridBagConstraints();
8.141 gridBagConstraints.insets = new java.awt.Insets(11, 0, 0, 12);
8.142 add(beginningToggle, gridBagConstraints);
8.143 @@ -378,7 +380,6 @@
8.144 /*
8.145 endToggle.setText(NbBundle.getMessage(EditTaskPanel.class, "EndList")); // NOI18N();
8.146 */
8.147 - addButtonGroup.add(endToggle);
8.148 gridBagConstraints = new java.awt.GridBagConstraints();
8.149 gridBagConstraints.insets = new java.awt.Insets(11, 0, 0, 12);
8.150 add(endToggle, gridBagConstraints);
8.151 @@ -395,6 +396,13 @@
8.152
8.153 }//GEN-END:initComponents
8.154
8.155 + private void priorityComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_priorityComboBoxActionPerformed
8.156 + // I don't know why JComboBox does not use my renderer to draw
8.157 + // selected value
8.158 + int sel = priorityComboBox.getSelectedIndex();
8.159 + priorityComboBox.setForeground(PriorityListCellRenderer.COLORS[sel]);
8.160 + }//GEN-LAST:event_priorityComboBoxActionPerformed
8.161 +
8.162 /** Initialize accessibility settings on the panel */
8.163 private void initA11y() {
8.164 /*
8.165 @@ -542,8 +550,8 @@
8.166 private javax.swing.JLabel lineLabel;
8.167 private javax.swing.JLabel opt1Label;
8.168 private javax.swing.JLabel subtaskLabel;
8.169 + private javax.swing.JLabel descLabel;
8.170 private javax.swing.ButtonGroup addButtonGroup;
8.171 - private javax.swing.JLabel descLabel;
8.172 private javax.swing.JComboBox subtaskCombo;
8.173 private javax.swing.JRadioButton beginningToggle;
8.174 private javax.swing.JRadioButton endToggle;
8.175 @@ -570,7 +578,7 @@
8.176 }
8.177
8.178 int getPrio() {
8.179 - return priorityComboBox.getSelectedIndex();
8.180 + return priorityComboBox.getSelectedIndex() + 1;
8.181 }
8.182
8.183 boolean hasAssociatedFilePos() {
9.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskNode.java Sun Mar 02 09:36:45 2003 +0000
9.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskNode.java Sun Mar 02 10:19:16 2003 +0000
9.3 @@ -16,6 +16,7 @@
9.4 import java.beans.PropertyEditorManager;
9.5 import java.util.Date;
9.6 import java.util.List;
9.7 +import org.netbeans.api.tasklist.SuggestionPriority;
9.8 import org.netbeans.modules.tasklist.core.ExpandAllAction;
9.9 import org.netbeans.modules.tasklist.core.ExportAction;
9.10 import org.netbeans.modules.tasklist.core.FilterAction;
9.11 @@ -129,13 +130,7 @@
9.12 if (item.getParent() == null) {
9.13 // Create actions shown on an empty tasklist (e.g. only root
9.14 // is there)
9.15 - return new SystemAction[] {
9.16 - SystemAction.get(NewTaskAction.class),
9.17 - null,
9.18 - SystemAction.get(PasteAction.class),
9.19 - null,
9.20 - SystemAction.get(ImportAction.class)
9.21 - };
9.22 + return new SystemAction[] {};
9.23 } else {
9.24 return new SystemAction[] {
9.25 SystemAction.get(NewTaskAction.class),
9.26 @@ -143,21 +138,12 @@
9.27 SystemAction.get(ShowTaskAction.class),
9.28 SystemAction.get(GoToTaskAction.class),
9.29 null,
9.30 - SystemAction.get(FilterAction.class),
9.31 - null,
9.32 - SystemAction.get(PurgeTasksAction.class),
9.33 - null,
9.34 - SystemAction.get(ExpandAllAction.class),
9.35 - null,
9.36 SystemAction.get(CutAction.class),
9.37 SystemAction.get(CopyAction.class),
9.38 SystemAction.get(PasteAction.class),
9.39 null,
9.40 SystemAction.get(DeleteAction.class),
9.41 null,
9.42 - SystemAction.get(ImportAction.class),
9.43 - SystemAction.get(ExportAction.class),
9.44 - null,
9.45 SystemAction.get(PropertiesAction.class),
9.46 };
9.47 }
9.48 @@ -168,6 +154,8 @@
9.49 protected Sheet createSheet() {
9.50 Sheet s = Sheet.createDefault();
9.51 Set ss = s.get(Sheet.PROPERTIES);
9.52 + if (item.getParent() == null)
9.53 + return s;
9.54
9.55 Set sse = Sheet.createExpertSet();
9.56 s.put(sse);
9.57 @@ -181,7 +169,7 @@
9.58 ss.put(p);
9.59
9.60
9.61 - p = new Reflection(item, Integer.TYPE, "getPriorityNumber", "setPriorityNumber"); // NOI18N
9.62 + p = new Reflection(item, SuggestionPriority.class, "getPriority", "setPriority"); // NOI18N
9.63 p.setName(UserTaskView.PROP_TASK_PRIO);
9.64 p.setPropertyEditorClass(PriorityPropertyEditor.class);
9.65 p.setDisplayName(NbBundle.getMessage(UserTaskNode.class, "Priority")); // NOI18N
9.66 @@ -243,6 +231,7 @@
9.67
9.68 p = new Reflection(item, String.class, "getCategory", "setCategory"); // NOI18N
9.69 p.setName(UserTaskView.PROP_TASK_CAT);
9.70 + p.setPropertyEditorClass(CategoryPropertyEditor.class);
9.71 p.setDisplayName(NbBundle.getMessage(UserTaskNode.class, "Category")); // NOI18N
9.72 p.setShortDescription(NbBundle.getMessage(UserTaskNode.class, "CategoryHint")); // NOI18N
9.73 ss.put(p);
10.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskView.java Sun Mar 02 09:36:45 2003 +0000
10.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskView.java Sun Mar 02 10:19:16 2003 +0000
10.3 @@ -20,6 +20,7 @@
10.4 import java.util.ArrayList;
10.5 import java.util.Date;
10.6 import java.util.Iterator;
10.7 +import org.netbeans.api.tasklist.SuggestionPriority;
10.8 import org.netbeans.modules.tasklist.core.ExpandAllAction;
10.9 import org.netbeans.modules.tasklist.core.ExportAction;
10.10 import org.netbeans.modules.tasklist.core.FilterAction;
10.11 @@ -32,6 +33,7 @@
10.12 import org.netbeans.modules.tasklist.core.TaskNode;
10.13 import org.netbeans.modules.tasklist.core.TaskListView.ColumnProperty;
10.14 import org.openide.TopManager;
10.15 +import org.openide.actions.PasteAction;
10.16 import org.openide.filesystems.FileObject;
10.17 import org.openide.filesystems.URLMapper;
10.18 import org.openide.util.HelpCtx;
10.19 @@ -100,15 +102,23 @@
10.20 */
10.21 public HelpCtx getHelpCtx() {
10.22 return getHelpCtx(
10.23 - getExplorerManager().getSelectedNodes(),
10.24 - getExplorerManager().getRootContext().getHelpCtx()
10.25 + getExplorerManager().getSelectedNodes(),
10.26 + getExplorerManager().getRootContext().getHelpCtx()
10.27 );
10.28 }
10.29
10.30 /** Overrides superclass method. Gets actions for this top component. */
10.31 public SystemAction[] getSystemActions() {
10.32 SystemAction[] todoActions = new SystemAction[] {
10.33 - SystemAction.get(NewTaskAction.class)
10.34 + null,
10.35 + SystemAction.get(PasteAction.class),
10.36 + null,
10.37 + SystemAction.get(FilterAction.class),
10.38 + SystemAction.get(PurgeTasksAction.class),
10.39 + SystemAction.get(ExpandAllAction.class),
10.40 + null,
10.41 + SystemAction.get(ImportAction.class),
10.42 + SystemAction.get(ExportAction.class)
10.43 };
10.44 SystemAction[] sa = super.getSystemActions ();
10.45 return SystemAction.linkActions (sa, todoActions);
10.46 @@ -200,9 +210,6 @@
10.47 static final String PROP_TASK_EDITED = "taskEdited"; // NOI18N
10.48 static final String PROP_TASK_PERCENT = "taskPercent"; // NOI18N
10.49
10.50 - /** Create the list of columns to be used in the view.
10.51 - NOTE: The first column SHOULD be a tree column.
10.52 - */
10.53 protected ColumnProperty[] createColumns() {
10.54 return new ColumnProperty[] {
10.55 getMainColumn(800),
10.56 @@ -229,7 +236,7 @@
10.57 return new ColumnProperty(
10.58 1, // UID -- never change (part of serialization
10.59 PROP_TASK_PRIO,
10.60 - Integer.TYPE,
10.61 + SuggestionPriority.class,
10.62 NbBundle.getMessage(UserTaskView.class, "Priority"), // NOI18N
10.63 NbBundle.getMessage(UserTaskView.class, "PriorityHint"), // NOI18N
10.64 true,
10.65 @@ -412,7 +419,6 @@
10.66 return null;
10.67 }
10.68
10.69 - /** Create the root node to be used in this view */
10.70 protected TaskNode createRootNode() {
10.71 UserTask root = (UserTask)tasklist.getRoot();
10.72 return new UserTaskNode(root, root.getSubtasks());