1.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/Bundle.properties Fri Oct 29 17:59:55 2004 +0000
1.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/Bundle.properties Sat Oct 30 11:04:31 2004 +0000
1.3 @@ -129,6 +129,7 @@
1.4 Brief_Description=&Summary:
1.5 AssociatedFile=Associated &File:
1.6 ComputeSpentTkme=Compute automatically as a sum of the subtask values
1.7 +LBL_DependenciesTab=Dependencies
1.8
1.9 ## DurationPanel
1.10 Minutes=Minutes
2.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/DurationPanel.java Fri Oct 29 17:59:55 2004 +0000
2.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/DurationPanel.java Sat Oct 30 11:04:31 2004 +0000
2.3 @@ -59,12 +59,12 @@
2.4 * @param minutes new duration in minutes
2.5 */
2.6 public void setDuration(int minutes) {
2.7 - int d[] = UserTask.splitDuration(minutes,
2.8 + UserTask.Duration d = UserTask.splitDuration(minutes,
2.9 Settings.getDefault().getHoursPerDay());
2.10
2.11 - jSpinnerDays.setValue(new Integer(d[2]));
2.12 - jSpinnerHours.setValue(new Integer(d[1]));
2.13 - jSpinnerMinutes.setValue(new Integer(d[0]));
2.14 + jSpinnerDays.setValue(new Integer(d.days));
2.15 + jSpinnerHours.setValue(new Integer(d.hours));
2.16 + jSpinnerMinutes.setValue(new Integer(d.minutes));
2.17 }
2.18
2.19 /**
3.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/EditTaskPanel.form Fri Oct 29 17:59:55 2004 +0000
3.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/EditTaskPanel.form Sat Oct 30 11:04:31 2004 +0000
3.3 @@ -106,12 +106,12 @@
3.4 </Component>
3.5 <Component class="javax.swing.JRadioButton" name="beginningToggle">
3.6 <Properties>
3.7 + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
3.8 + <ComponentRef name="addButtonGroup"/>
3.9 + </Property>
3.10 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor" preCode="/*" postCode="*/">
3.11 <ResourceString bundle="org/netbeans/modules/tasklist/usertasks/Bundle.properties" key="BeginningList" replaceFormat="NbBundle.getMessage(EditTaskPanel.class, "{key}")); // NOI18N("/>
3.12 </Property>
3.13 - <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
3.14 - <ComponentRef name="addButtonGroup"/>
3.15 - </Property>
3.16 </Properties>
3.17 <AuxValues>
3.18 <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
3.19 @@ -139,12 +139,12 @@
3.20 </Component>
3.21 <Component class="javax.swing.JRadioButton" name="endToggle">
3.22 <Properties>
3.23 + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
3.24 + <ComponentRef name="addButtonGroup"/>
3.25 + </Property>
3.26 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor" preCode="/*" postCode="*/">
3.27 <ResourceString bundle="org/netbeans/modules/tasklist/usertasks/Bundle.properties" key="EndList" replaceFormat="NbBundle.getMessage(EditTaskPanel.class, "{key}")); // NOI18N("/>
3.28 </Property>
3.29 - <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
3.30 - <ComponentRef name="addButtonGroup"/>
3.31 - </Property>
3.32 </Properties>
3.33 <AuxValues>
3.34 <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
3.35 @@ -423,13 +423,13 @@
3.36 <SubComponents>
3.37 <Component class="javax.swing.JRadioButton" name="jRadioButtonComputeEffort">
3.38 <Properties>
3.39 + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
3.40 + <ComponentRef name="effortButtonGroup"/>
3.41 + </Property>
3.42 <Property name="selected" type="boolean" value="true"/>
3.43 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
3.44 <ResourceString bundle="org/netbeans/modules/tasklist/usertasks/Bundle.properties" key="ComputeEffortAutomatically" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
3.45 </Property>
3.46 - <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
3.47 - <ComponentRef name="effortButtonGroup"/>
3.48 - </Property>
3.49 </Properties>
3.50 <AuxValues>
3.51 <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
3.52 @@ -442,12 +442,12 @@
3.53 </Component>
3.54 <Component class="javax.swing.JRadioButton" name="jRadioButtonEffort">
3.55 <Properties>
3.56 + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
3.57 + <ComponentRef name="effortButtonGroup"/>
3.58 + </Property>
3.59 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
3.60 <ResourceString bundle="org/netbeans/modules/tasklist/usertasks/Bundle.properties" key="UseThisValue" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
3.61 </Property>
3.62 - <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
3.63 - <ComponentRef name="effortButtonGroup"/>
3.64 - </Property>
3.65 </Properties>
3.66 <Events>
3.67 <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="jRadioButtonEffortItemStateChanged"/>
3.68 @@ -508,13 +508,13 @@
3.69 </Component>
3.70 <Component class="javax.swing.JRadioButton" name="jRadioButtonComputeProgress">
3.71 <Properties>
3.72 + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
3.73 + <ComponentRef name="buttonGroupProgress"/>
3.74 + </Property>
3.75 <Property name="selected" type="boolean" value="true"/>
3.76 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
3.77 <ResourceString bundle="org/netbeans/modules/tasklist/usertasks/Bundle.properties" key="ComputeProgressAutomatically" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
3.78 </Property>
3.79 - <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
3.80 - <ComponentRef name="buttonGroupProgress"/>
3.81 - </Property>
3.82 </Properties>
3.83 <AuxValues>
3.84 <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
3.85 @@ -527,12 +527,12 @@
3.86 </Component>
3.87 <Component class="javax.swing.JRadioButton" name="jRadioButtonProgress">
3.88 <Properties>
3.89 + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
3.90 + <ComponentRef name="buttonGroupProgress"/>
3.91 + </Property>
3.92 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
3.93 <ResourceString bundle="org/netbeans/modules/tasklist/usertasks/Bundle.properties" key="UseThisValue" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
3.94 </Property>
3.95 - <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
3.96 - <ComponentRef name="buttonGroupProgress"/>
3.97 - </Property>
3.98 </Properties>
3.99 <Events>
3.100 <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="jRadioButtonProgressItemStateChanged"/>
3.101 @@ -580,13 +580,13 @@
3.102 <SubComponents>
3.103 <Component class="javax.swing.JRadioButton" name="jRadioButtonComputeSpent">
3.104 <Properties>
3.105 + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
3.106 + <ComponentRef name="buttonGroupSpent"/>
3.107 + </Property>
3.108 <Property name="selected" type="boolean" value="true"/>
3.109 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
3.110 <ResourceString bundle="org/netbeans/modules/tasklist/usertasks/Bundle.properties" key="ComputeSpentTkme" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
3.111 </Property>
3.112 - <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
3.113 - <ComponentRef name="buttonGroupSpent"/>
3.114 - </Property>
3.115 </Properties>
3.116 <AuxValues>
3.117 <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
3.118 @@ -599,12 +599,12 @@
3.119 </Component>
3.120 <Component class="javax.swing.JRadioButton" name="jRadioButtonSpent">
3.121 <Properties>
3.122 + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
3.123 + <ComponentRef name="buttonGroupSpent"/>
3.124 + </Property>
3.125 <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
3.126 <ResourceString bundle="org/netbeans/modules/tasklist/usertasks/Bundle.properties" key="UseThisValue" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
3.127 </Property>
3.128 - <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
3.129 - <ComponentRef name="buttonGroupSpent"/>
3.130 - </Property>
3.131 </Properties>
3.132 <Events>
3.133 <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="jRadioButtonSpentItemStateChanged"/>
3.134 @@ -632,6 +632,19 @@
3.135 </Container>
3.136 </SubComponents>
3.137 </Container>
3.138 + <Container class="javax.swing.JPanel" name="jPanelDependencies">
3.139 + <Constraints>
3.140 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
3.141 + <JTabbedPaneConstraints tabName="Dependencies">
3.142 + <Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
3.143 + <ResourceString bundle="org/netbeans/modules/tasklist/usertasks/Bundle.properties" key="LBL_DependenciesTab" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString("{key}")"/>
3.144 + </Property>
3.145 + </JTabbedPaneConstraints>
3.146 + </Constraint>
3.147 + </Constraints>
3.148 +
3.149 + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
3.150 + </Container>
3.151 </SubComponents>
3.152 </Container>
3.153 </SubComponents>
4.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/EditTaskPanel.java Fri Oct 29 17:59:55 2004 +0000
4.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/EditTaskPanel.java Sat Oct 30 11:04:31 2004 +0000
4.3 @@ -33,10 +33,12 @@
4.4 import javax.swing.JComponent;
4.5 import javax.swing.JPanel;
4.6 import javax.swing.ListCellRenderer;
4.7 +import javax.swing.border.EmptyBorder;
4.8 import javax.swing.text.JTextComponent;
4.9
4.10 import org.netbeans.modules.tasklist.client.SuggestionPriority;
4.11 import org.netbeans.modules.tasklist.core.PriorityListCellRenderer;
4.12 +import org.netbeans.modules.tasklist.usertasks.dependencies.DependenciesPanel;
4.13 import org.openide.DialogDescriptor;
4.14 import org.openide.DialogDisplayer;
4.15 import org.openide.ErrorManager;
4.16 @@ -116,6 +118,7 @@
4.17 new DefaultComboBoxModel(SuggestionPriority.getPriorityNames());
4.18 private ListCellRenderer priorityRenderer = new PriorityListCellRenderer();
4.19 private DurationPanel durationPanel = new DurationPanel();
4.20 + private DependenciesPanel dp;
4.21
4.22 /**
4.23 * Creates new form NewTodoItemPanel.
4.24 @@ -151,6 +154,10 @@
4.25 setInputVerifier(new EditTaskPanel.PercentsInputVerifier());
4.26
4.27 jPanelEffort.add(durationPanel, BorderLayout.CENTER);
4.28 +
4.29 + dp = new DependenciesPanel();
4.30 + dp.setBorder(new EmptyBorder(11, 11, 12, 12));
4.31 + jPanelDependencies.add(dp, BorderLayout.CENTER);
4.32 }
4.33
4.34 public void addNotify() {
4.35 @@ -225,6 +232,8 @@
4.36 jRadioButtonComputeSpent.setSelected(true);
4.37 else
4.38 jRadioButtonSpent.setSelected(true);
4.39 +
4.40 + dp.fillPanel(item);
4.41 }
4.42
4.43 /**
4.44 @@ -278,6 +287,8 @@
4.45 if (!task.isSpentTimeComputed()) {
4.46 task.setSpentTime(durationPanelSpent.getDuration());
4.47 }
4.48 +
4.49 + dp.fillObject();
4.50 }
4.51
4.52 /**
4.53 @@ -451,6 +462,7 @@
4.54 jRadioButtonComputeSpent = new javax.swing.JRadioButton();
4.55 jRadioButtonSpent = new javax.swing.JRadioButton();
4.56 durationPanelSpent = new org.netbeans.modules.tasklist.usertasks.DurationPanel();
4.57 + jPanelDependencies = new javax.swing.JPanel();
4.58
4.59 setLayout(new java.awt.BorderLayout());
4.60
4.61 @@ -497,10 +509,10 @@
4.62 gridBagConstraints.insets = new java.awt.Insets(11, 0, 0, 12);
4.63 jPanelGeneral.add(addLabel, gridBagConstraints);
4.64
4.65 + addButtonGroup.add(beginningToggle);
4.66 /*
4.67 org.openide.awt.Mnemonics.setLocalizedText(beginningToggle, NbBundle.getMessage(EditTaskPanel.class, "BeginningList")); // NOI18N();
4.68 */
4.69 - addButtonGroup.add(beginningToggle);
4.70 gridBagConstraints = new java.awt.GridBagConstraints();
4.71 gridBagConstraints.gridx = 1;
4.72 gridBagConstraints.gridy = 6;
4.73 @@ -519,10 +531,10 @@
4.74 gridBagConstraints.insets = new java.awt.Insets(11, 0, 0, 12);
4.75 jPanelGeneral.add(detailsLabel, gridBagConstraints);
4.76
4.77 + addButtonGroup.add(endToggle);
4.78 /*
4.79 org.openide.awt.Mnemonics.setLocalizedText(endToggle, NbBundle.getMessage(EditTaskPanel.class, "EndList")); // NOI18N();
4.80 */
4.81 - addButtonGroup.add(endToggle);
4.82 gridBagConstraints = new java.awt.GridBagConstraints();
4.83 gridBagConstraints.gridx = 1;
4.84 gridBagConstraints.gridy = 7;
4.85 @@ -740,16 +752,16 @@
4.86 jPanel4.setLayout(new java.awt.GridBagLayout());
4.87
4.88 jPanel4.setBorder(new javax.swing.border.TitledBorder(org.openide.util.NbBundle.getMessage(EditTaskPanel.class, "Effort")));
4.89 + effortButtonGroup.add(jRadioButtonComputeEffort);
4.90 jRadioButtonComputeEffort.setSelected(true);
4.91 org.openide.awt.Mnemonics.setLocalizedText(jRadioButtonComputeEffort, org.openide.util.NbBundle.getMessage(EditTaskPanel.class, "ComputeEffortAutomatically"));
4.92 - effortButtonGroup.add(jRadioButtonComputeEffort);
4.93 gridBagConstraints = new java.awt.GridBagConstraints();
4.94 gridBagConstraints.gridwidth = 2;
4.95 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
4.96 jPanel4.add(jRadioButtonComputeEffort, gridBagConstraints);
4.97
4.98 + effortButtonGroup.add(jRadioButtonEffort);
4.99 org.openide.awt.Mnemonics.setLocalizedText(jRadioButtonEffort, org.openide.util.NbBundle.getMessage(EditTaskPanel.class, "UseThisValue"));
4.100 - effortButtonGroup.add(jRadioButtonEffort);
4.101 jRadioButtonEffort.addItemListener(new java.awt.event.ItemListener() {
4.102 public void itemStateChanged(java.awt.event.ItemEvent evt) {
4.103 jRadioButtonEffortItemStateChanged(evt);
4.104 @@ -795,16 +807,16 @@
4.105 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
4.106 jPanel5.add(jComboBoxProgress, gridBagConstraints);
4.107
4.108 + buttonGroupProgress.add(jRadioButtonComputeProgress);
4.109 jRadioButtonComputeProgress.setSelected(true);
4.110 org.openide.awt.Mnemonics.setLocalizedText(jRadioButtonComputeProgress, org.openide.util.NbBundle.getMessage(EditTaskPanel.class, "ComputeProgressAutomatically"));
4.111 - buttonGroupProgress.add(jRadioButtonComputeProgress);
4.112 gridBagConstraints = new java.awt.GridBagConstraints();
4.113 gridBagConstraints.gridwidth = 2;
4.114 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
4.115 jPanel5.add(jRadioButtonComputeProgress, gridBagConstraints);
4.116
4.117 + buttonGroupProgress.add(jRadioButtonProgress);
4.118 org.openide.awt.Mnemonics.setLocalizedText(jRadioButtonProgress, org.openide.util.NbBundle.getMessage(EditTaskPanel.class, "UseThisValue"));
4.119 - buttonGroupProgress.add(jRadioButtonProgress);
4.120 jRadioButtonProgress.addItemListener(new java.awt.event.ItemListener() {
4.121 public void itemStateChanged(java.awt.event.ItemEvent evt) {
4.122 jRadioButtonProgressItemStateChanged(evt);
4.123 @@ -839,16 +851,16 @@
4.124 jPanel7.setLayout(new java.awt.GridBagLayout());
4.125
4.126 jPanel7.setBorder(new javax.swing.border.TitledBorder("Spent time"));
4.127 + buttonGroupSpent.add(jRadioButtonComputeSpent);
4.128 jRadioButtonComputeSpent.setSelected(true);
4.129 org.openide.awt.Mnemonics.setLocalizedText(jRadioButtonComputeSpent, org.openide.util.NbBundle.getMessage(EditTaskPanel.class, "ComputeSpentTkme"));
4.130 - buttonGroupSpent.add(jRadioButtonComputeSpent);
4.131 gridBagConstraints = new java.awt.GridBagConstraints();
4.132 gridBagConstraints.gridwidth = 2;
4.133 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
4.134 jPanel7.add(jRadioButtonComputeSpent, gridBagConstraints);
4.135
4.136 + buttonGroupSpent.add(jRadioButtonSpent);
4.137 org.openide.awt.Mnemonics.setLocalizedText(jRadioButtonSpent, org.openide.util.NbBundle.getMessage(EditTaskPanel.class, "UseThisValue"));
4.138 - buttonGroupSpent.add(jRadioButtonSpent);
4.139 jRadioButtonSpent.addItemListener(new java.awt.event.ItemListener() {
4.140 public void itemStateChanged(java.awt.event.ItemEvent evt) {
4.141 jRadioButtonSpentItemStateChanged(evt);
4.142 @@ -880,6 +892,10 @@
4.143
4.144 jTabbedPane.addTab(org.openide.util.NbBundle.getMessage(EditTaskPanel.class, "TimeRelated"), jPanel3);
4.145
4.146 + jPanelDependencies.setLayout(new java.awt.BorderLayout());
4.147 +
4.148 + jTabbedPane.addTab(org.openide.util.NbBundle.getBundle(EditTaskPanel.class).getString("LBL_DependenciesTab"), jPanelDependencies);
4.149 +
4.150 add(jTabbedPane, java.awt.BorderLayout.CENTER);
4.151
4.152 }//GEN-END:initComponents
4.153 @@ -1063,6 +1079,7 @@
4.154 private javax.swing.JPanel jPanel5;
4.155 private javax.swing.JPanel jPanel6;
4.156 private javax.swing.JPanel jPanel7;
4.157 + private javax.swing.JPanel jPanelDependencies;
4.158 private javax.swing.JPanel jPanelEffort;
4.159 private javax.swing.JPanel jPanelGeneral;
4.160 private javax.swing.JRadioButton jRadioButtonComputeEffort;
5.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskNode.java Fri Oct 29 17:59:55 2004 +0000
5.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskNode.java Sat Oct 30 11:04:31 2004 +0000
5.3 @@ -144,7 +144,7 @@
5.4 return new SystemAction[] {
5.5 SystemAction.get(NewTaskAction.class),
5.6 SystemAction.get(NewTaskListAction.class),
5.7 - SystemAction.get(ShowScheduleViewAction.class),
5.8 + //SystemAction.get(ShowScheduleViewAction.class),
5.9 null,
5.10 SystemAction.get(StartTaskAction.class),
5.11 SystemAction.get(PauseAction.class),
6.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskView.java Fri Oct 29 17:59:55 2004 +0000
6.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskView.java Sat Oct 30 11:04:31 2004 +0000
6.3 @@ -14,38 +14,26 @@
6.4 package org.netbeans.modules.tasklist.usertasks;
6.5
6.6 import java.awt.BorderLayout;
6.7 -import java.awt.Component;
6.8 -import java.awt.Dimension;
6.9 import java.awt.FlowLayout;
6.10 -import java.awt.Font;
6.11 -import java.awt.FontMetrics;
6.12 -import java.awt.Graphics2D;
6.13 import java.awt.Image;
6.14 -import java.awt.image.BufferedImage;
6.15 +import java.beans.PropertyChangeEvent;
6.16 +import java.beans.PropertyChangeListener;
6.17 import java.io.IOException;
6.18 import java.io.ObjectInput;
6.19 import java.io.ObjectOutput;
6.20 import java.lang.ref.WeakReference;
6.21 import java.net.URL;
6.22 import java.util.ArrayList;
6.23 -import java.util.Collections;
6.24 -import java.util.HashMap;
6.25 import java.util.Iterator;
6.26 import java.util.List;
6.27 -import java.util.Map;
6.28 import java.util.logging.Level;
6.29
6.30 import javax.swing.ActionMap;
6.31 -import javax.swing.JLabel;
6.32 import javax.swing.JPanel;
6.33 import javax.swing.JScrollPane;
6.34 import javax.swing.JToolBar;
6.35 import javax.swing.SwingUtilities;
6.36 -import javax.swing.UIDefaults;
6.37 -import javax.swing.UIManager;
6.38 import javax.swing.tree.TreePath;
6.39 -
6.40 -import org.netbeans.modules.tasklist.core.TLUtils;
6.41 import org.netbeans.modules.tasklist.core.columns.ColumnsConfiguration;
6.42 import org.netbeans.modules.tasklist.core.export.ExportImportFormat;
6.43 import org.netbeans.modules.tasklist.core.export.ExportImportProvider;
6.44 @@ -60,7 +48,6 @@
6.45 import org.netbeans.modules.tasklist.usertasks.filter.FilterUserTaskAction;
6.46 import org.netbeans.modules.tasklist.usertasks.filter.RemoveFilterUserTaskAction;
6.47 import org.netbeans.modules.tasklist.usertasks.filter.UserTaskFilter;
6.48 -import org.netbeans.modules.tasklist.usertasks.filter.UserTaskProperties;
6.49 import org.netbeans.modules.tasklist.usertasks.translators.HtmlExportFormat;
6.50 import org.netbeans.modules.tasklist.usertasks.translators.ICalExportFormat;
6.51 import org.netbeans.modules.tasklist.usertasks.translators.ICalImportFormat;
6.52 @@ -80,9 +67,7 @@
6.53 import org.openide.filesystems.URLMapper;
6.54 import org.openide.loaders.DataObject;
6.55 import org.openide.loaders.DataObjectNotFoundException;
6.56 -import org.openide.nodes.Node;
6.57 import org.openide.util.HelpCtx;
6.58 -import org.openide.util.Lookup;
6.59 import org.openide.util.NbBundle;
6.60 import org.openide.util.Utilities;
6.61 import org.openide.util.actions.SystemAction;
6.62 @@ -116,9 +101,35 @@
6.63
6.64 private static UserTaskView defview = null;
6.65
6.66 - /** Keeps track of all UserTaskViews */
6.67 + /**
6.68 + * Keeps track of all UserTaskViews. Access should be synchronized on
6.69 + * UserTaskView.class
6.70 + */
6.71 private transient static List views = new ArrayList();
6.72
6.73 + static {
6.74 + // repaint the view if the number of working hours per day has
6.75 + // changed (spent time, rem. effort and effort columns should be
6.76 + // repainted
6.77 + Settings.getDefault().addPropertyChangeListener(
6.78 + new PropertyChangeListener() {
6.79 + public void propertyChange(PropertyChangeEvent e) {
6.80 + if (e.getPropertyName() != Settings.PROP_HOURS_PER_DAY)
6.81 + return;
6.82 +
6.83 + synchronized(UserTaskView.class) {
6.84 + Iterator it = views.iterator();
6.85 + while (it.hasNext()) {
6.86 + WeakReference wr = (WeakReference) it.next();
6.87 + UserTaskView utv = (UserTaskView) wr.get();
6.88 + utv.repaint();
6.89 + }
6.90 + }
6.91 + }
6.92 + }
6.93 + );
6.94 + }
6.95 +
6.96 /**
6.97 * Returns the view with the default task list. The view will be opened if
6.98 * it was not.
6.99 @@ -465,7 +476,7 @@
6.100 setName(tasklist.getFile().getNameExt());
6.101 setToolTipText(FileUtil.getFileDisplayName(tasklist.getFile()));
6.102 } else {
6.103 - setName(UTUtils.getString("TaskViewName")); // NOI18N
6.104 + setName(NbBundle.getMessage(UserTaskView.class, "TaskViewName")); // NOI18N
6.105 }
6.106 }
6.107 });
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/dependencies/Bundle.properties Sat Oct 30 11:04:31 2004 +0000
7.3 @@ -0,0 +1,25 @@
7.4 +# Sun Public License Notice
7.5 +#
7.6 +# The contents of this file are subject to the Sun Public License
7.7 +# Version 1.0 (the "License"). You may not use this file except in
7.8 +# compliance with the License. A copy of the License is available at
7.9 +# http://www.sun.com/
7.10 +#
7.11 +# The Original Code is NetBeans. The Initial Developer of the Original
7.12 +# Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
7.13 +# Microsystems, Inc. All Rights Reserved.
7.14 +
7.15 +## DependencyPanel
7.16 +LBL_EndBegin=&End-Begin
7.17 +LBL_BeginBegin=&Begin-Begin
7.18 +
7.19 +## DependenciesPanel
7.20 +LBL_AddDependency=&Add...
7.21 +LBL_RemoveDependency=&Remove...
7.22 +DeleteDepConf=Do You really want to delete this dependency?
7.23 +AddDependency=Add Dependency
7.24 +BeginBeginDep=Begin-Begin
7.25 +EndBeginDep=End-Begin
7.26 +
7.27 +
7.28 +
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/dependencies/DependenciesPanel.form Sat Oct 30 11:04:31 2004 +0000
8.3 @@ -0,0 +1,58 @@
8.4 +<?xml version="1.0" encoding="UTF-8" ?>
8.5 +
8.6 +<Form version="1.0" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
8.7 +
8.8 + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
8.9 + <SubComponents>
8.10 + <Container class="javax.swing.JScrollPane" name="jScrollPane1">
8.11 + <Constraints>
8.12 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
8.13 + <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="2" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="12" anchor="10" weightX="1.0" weightY="1.0"/>
8.14 + </Constraint>
8.15 + </Constraints>
8.16 +
8.17 + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
8.18 + <SubComponents>
8.19 + <Component class="javax.swing.JList" name="jList">
8.20 + </Component>
8.21 + </SubComponents>
8.22 + </Container>
8.23 + <Component class="javax.swing.JButton" name="jButtonRemove">
8.24 + <Properties>
8.25 + <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
8.26 + <ResourceString bundle="org/netbeans/modules/tasklist/usertasks/dependencies/Bundle.properties" key="LBL_RemoveDependency" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString("{key}")"/>
8.27 + </Property>
8.28 + <Property name="enabled" type="boolean" value="false"/>
8.29 + </Properties>
8.30 + <Events>
8.31 + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonRemoveActionPerformed"/>
8.32 + </Events>
8.33 + <AuxValues>
8.34 + <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
8.35 + </AuxValues>
8.36 + <Constraints>
8.37 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
8.38 + <GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
8.39 + </Constraint>
8.40 + </Constraints>
8.41 + </Component>
8.42 + <Component class="javax.swing.JButton" name="jButtonAdd">
8.43 + <Properties>
8.44 + <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
8.45 + <ResourceString bundle="org/netbeans/modules/tasklist/usertasks/dependencies/Bundle.properties" key="LBL_AddDependency" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString("{key}")"/>
8.46 + </Property>
8.47 + </Properties>
8.48 + <Events>
8.49 + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonAddActionPerformed"/>
8.50 + </Events>
8.51 + <AuxValues>
8.52 + <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
8.53 + </AuxValues>
8.54 + <Constraints>
8.55 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
8.56 + <GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="11" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
8.57 + </Constraint>
8.58 + </Constraints>
8.59 + </Component>
8.60 + </SubComponents>
8.61 +</Form>
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/dependencies/DependenciesPanel.java Sat Oct 30 11:04:31 2004 +0000
9.3 @@ -0,0 +1,198 @@
9.4 +package org.netbeans.modules.tasklist.usertasks.dependencies;
9.5 +
9.6 +import java.awt.Dialog;
9.7 +import java.awt.Dimension;
9.8 +import java.util.ArrayList;
9.9 +import java.util.Iterator;
9.10 +import java.util.List;
9.11 +import javax.swing.DefaultListModel;
9.12 +import javax.swing.border.EmptyBorder;
9.13 +import javax.swing.event.ListSelectionEvent;
9.14 +import javax.swing.event.ListSelectionListener;
9.15 +import org.netbeans.modules.tasklist.usertasks.UserTask;
9.16 +import org.openide.DialogDescriptor;
9.17 +import org.openide.DialogDisplayer;
9.18 +import org.openide.util.NbBundle;
9.19 +import org.openide.util.Utilities;
9.20 +
9.21 +/**
9.22 + * Dependencies for a task
9.23 + */
9.24 +public class DependenciesPanel extends javax.swing.JPanel {
9.25 + private static final String BEGIN_BEGIN_MSG =
9.26 + NbBundle.getMessage(DependenciesPanel.class, "BeginBeginDep"); // NOI18N
9.27 + private static final String END_BEGIN_MSG =
9.28 + NbBundle.getMessage(DependenciesPanel.class, "EndBeginDep"); // NOI18N
9.29 +
9.30 + private UserTask ut;
9.31 + private List dependencies = new ArrayList();
9.32 +
9.33 + /**
9.34 + * Creates a panel
9.35 + */
9.36 + public DependenciesPanel() {
9.37 + initComponents();
9.38 + jList.getSelectionModel().addListSelectionListener(
9.39 + new ListSelectionListener() {
9.40 + public void valueChanged(ListSelectionEvent e) {
9.41 + jButtonRemove.setEnabled(jList.getSelectedIndex() >= 0);
9.42 + }
9.43 + }
9.44 + );
9.45 + }
9.46 +
9.47 + /**
9.48 + * Fills the panel with the data.
9.49 + *
9.50 + * @param ut a user task
9.51 + */
9.52 + public void fillPanel(UserTask ut) {
9.53 + this.ut = ut;
9.54 + DefaultListModel dlm = new DefaultListModel();
9.55 + Iterator it = ut.getDependencies().iterator();
9.56 + while (it.hasNext()) {
9.57 + Dependency d = (Dependency) it.next();
9.58 + dependencies.add(d);
9.59 + dlm.addElement(createTaskDescription(d.getDependsOn(), d.getType()));
9.60 + }
9.61 + jList.setModel(dlm);
9.62 + if (jList.getModel().getSize() > 0)
9.63 + jList.setSelectedIndex(0);
9.64 + }
9.65 +
9.66 + /**
9.67 + * Creates a description for a task.
9.68 + *
9.69 + * @param ut a task
9.70 + * @param type dependency type. Dependency.BEGIN_BEGIN or END_BEGIN
9.71 + * @return path to the task. e.g. "A/B/C"
9.72 + */
9.73 + private String createTaskDescription(UserTask ut, int type) {
9.74 + StringBuffer sb = new StringBuffer();
9.75 + while (ut != null) {
9.76 + if (sb.length() != 0)
9.77 + sb.insert(0, '/');
9.78 + sb.insert(0, ut.getSummary());
9.79 + ut = ut.getParent();
9.80 + }
9.81 + sb.append(" - "); // NOI18N
9.82 + if (type == Dependency.BEGIN_BEGIN)
9.83 + sb.append(BEGIN_BEGIN_MSG);
9.84 + else
9.85 + sb.append(END_BEGIN_MSG);
9.86 + return sb.toString();
9.87 + }
9.88 +
9.89 + /**
9.90 + * Fills in the fillPanel specified user task with the data from this panel
9.91 + */
9.92 + public void fillObject() {
9.93 + this.ut.getDependencies().clear();
9.94 + this.ut.getDependencies().addAll(dependencies);
9.95 + }
9.96 +
9.97 + /** This method is called from within the constructor to
9.98 + * initialize the form.
9.99 + * WARNING: Do NOT modify this code. The content of this method is
9.100 + * always regenerated by the Form Editor.
9.101 + */
9.102 + private void initComponents() {//GEN-BEGIN:initComponents
9.103 + java.awt.GridBagConstraints gridBagConstraints;
9.104 +
9.105 + jScrollPane1 = new javax.swing.JScrollPane();
9.106 + jList = new javax.swing.JList();
9.107 + jButtonRemove = new javax.swing.JButton();
9.108 + jButtonAdd = new javax.swing.JButton();
9.109 +
9.110 + setLayout(new java.awt.GridBagLayout());
9.111 +
9.112 + jScrollPane1.setViewportView(jList);
9.113 +
9.114 + gridBagConstraints = new java.awt.GridBagConstraints();
9.115 + gridBagConstraints.gridx = 0;
9.116 + gridBagConstraints.gridy = 0;
9.117 + gridBagConstraints.gridheight = 2;
9.118 + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
9.119 + gridBagConstraints.weightx = 1.0;
9.120 + gridBagConstraints.weighty = 1.0;
9.121 + gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12);
9.122 + add(jScrollPane1, gridBagConstraints);
9.123 +
9.124 + org.openide.awt.Mnemonics.setLocalizedText(jButtonRemove, org.openide.util.NbBundle.getBundle(DependenciesPanel.class).getString("LBL_RemoveDependency"));
9.125 + jButtonRemove.setEnabled(false);
9.126 + jButtonRemove.addActionListener(new java.awt.event.ActionListener() {
9.127 + public void actionPerformed(java.awt.event.ActionEvent evt) {
9.128 + jButtonRemoveActionPerformed(evt);
9.129 + }
9.130 + });
9.131 +
9.132 + gridBagConstraints = new java.awt.GridBagConstraints();
9.133 + gridBagConstraints.gridx = 1;
9.134 + gridBagConstraints.gridy = 1;
9.135 + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
9.136 + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
9.137 + add(jButtonRemove, gridBagConstraints);
9.138 +
9.139 + org.openide.awt.Mnemonics.setLocalizedText(jButtonAdd, org.openide.util.NbBundle.getBundle(DependenciesPanel.class).getString("LBL_AddDependency"));
9.140 + jButtonAdd.addActionListener(new java.awt.event.ActionListener() {
9.141 + public void actionPerformed(java.awt.event.ActionEvent evt) {
9.142 + jButtonAddActionPerformed(evt);
9.143 + }
9.144 + });
9.145 +
9.146 + gridBagConstraints = new java.awt.GridBagConstraints();
9.147 + gridBagConstraints.gridx = 1;
9.148 + gridBagConstraints.gridy = 0;
9.149 + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
9.150 + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
9.151 + gridBagConstraints.insets = new java.awt.Insets(0, 0, 11, 0);
9.152 + add(jButtonAdd, gridBagConstraints);
9.153 +
9.154 + }//GEN-END:initComponents
9.155 +
9.156 + private void jButtonRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRemoveActionPerformed
9.157 + DialogDescriptor.Confirmation conf = new DialogDescriptor.Confirmation(
9.158 + NbBundle.getMessage(DependenciesPanel.class, "DeleteDepConf"), // NOI18N
9.159 + DialogDescriptor.YES_NO_OPTION, DialogDescriptor.QUESTION_MESSAGE
9.160 + );
9.161 + Object ret = DialogDisplayer.getDefault().notify(conf);
9.162 + if (ret == DialogDescriptor.YES_OPTION) {
9.163 + int index = jList.getSelectedIndex();
9.164 + ((DefaultListModel) jList.getModel()).remove(index);
9.165 + dependencies.remove(index);
9.166 + if (jList.getModel().getSize() > index)
9.167 + jList.setSelectedIndex(index);
9.168 + else if (jList.getModel().getSize() > index - 1)
9.169 + jList.setSelectedIndex(index - 1);
9.170 + }
9.171 + }//GEN-LAST:event_jButtonRemoveActionPerformed
9.172 +
9.173 + private void jButtonAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddActionPerformed
9.174 + DependencyPanel dp = new DependencyPanel(ut);
9.175 + dp.setBorder(new EmptyBorder(11, 11, 12, 12));
9.176 + DialogDescriptor dd = new DialogDescriptor(dp,
9.177 + NbBundle.getMessage(
9.178 + DependenciesPanel.class, "AddDependency")); // NOI18N
9.179 + dp.setDialogDescriptor(dd);
9.180 + Dialog d = DialogDisplayer.getDefault().createDialog(dd);
9.181 + d.setBounds(Utilities.findCenterBounds(new Dimension(400, 400)));
9.182 + d.show();
9.183 + if (dd.getValue() == DialogDescriptor.OK_OPTION) {
9.184 + UserTask sel = dp.getSelectedTask();
9.185 + int type = dp.getDependencyType();
9.186 + dependencies.add(new Dependency(sel, type));
9.187 + ((DefaultListModel) jList.getModel()).addElement(
9.188 + createTaskDescription(sel, type));
9.189 + jList.setSelectedIndex(jList.getModel().getSize() - 1);
9.190 + }
9.191 + }//GEN-LAST:event_jButtonAddActionPerformed
9.192 +
9.193 +
9.194 + // Variables declaration - do not modify//GEN-BEGIN:variables
9.195 + private javax.swing.JButton jButtonAdd;
9.196 + private javax.swing.JButton jButtonRemove;
9.197 + private javax.swing.JList jList;
9.198 + private javax.swing.JScrollPane jScrollPane1;
9.199 + // End of variables declaration//GEN-END:variables
9.200 +
9.201 +}
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/dependencies/DependencyPanel.form Sat Oct 30 11:04:31 2004 +0000
10.3 @@ -0,0 +1,81 @@
10.4 +<?xml version="1.0" encoding="UTF-8" ?>
10.5 +
10.6 +<Form version="1.0" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
10.7 + <NonVisualComponents>
10.8 + <Component class="javax.swing.ButtonGroup" name="buttonGroup">
10.9 + </Component>
10.10 + </NonVisualComponents>
10.11 +
10.12 + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
10.13 + <SubComponents>
10.14 + <Container class="javax.swing.JScrollPane" name="jScrollPane1">
10.15 + <Constraints>
10.16 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
10.17 + <GridBagConstraints gridX="0" gridY="1" gridWidth="3" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="11" insetsRight="0" anchor="10" weightX="1.0" weightY="1.0"/>
10.18 + </Constraint>
10.19 + </Constraints>
10.20 +
10.21 + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
10.22 + <SubComponents>
10.23 + <Component class="javax.swing.JTree" name="jTree">
10.24 + <Properties>
10.25 + <Property name="rootVisible" type="boolean" value="false"/>
10.26 + <Property name="showsRootHandles" type="boolean" value="true"/>
10.27 + </Properties>
10.28 + <Events>
10.29 + <EventHandler event="valueChanged" listener="javax.swing.event.TreeSelectionListener" parameters="javax.swing.event.TreeSelectionEvent" handler="jTreeValueChanged"/>
10.30 + </Events>
10.31 + </Component>
10.32 + </SubComponents>
10.33 + </Container>
10.34 + <Component class="javax.swing.JRadioButton" name="jRadioButtonEndBegin">
10.35 + <Properties>
10.36 + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
10.37 + <ComponentRef name="buttonGroup"/>
10.38 + </Property>
10.39 + <Property name="selected" type="boolean" value="true"/>
10.40 + <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
10.41 + <ResourceString bundle="org/netbeans/modules/tasklist/usertasks/dependencies/Bundle.properties" key="LBL_EndBegin" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString("{key}")"/>
10.42 + </Property>
10.43 + </Properties>
10.44 + <AuxValues>
10.45 + <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
10.46 + </AuxValues>
10.47 + <Constraints>
10.48 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
10.49 + <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="11" insetsRight="12" anchor="10" weightX="0.0" weightY="0.0"/>
10.50 + </Constraint>
10.51 + </Constraints>
10.52 + </Component>
10.53 + <Component class="javax.swing.JRadioButton" name="jRadioButtonBeginBegin">
10.54 + <Properties>
10.55 + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
10.56 + <ComponentRef name="buttonGroup"/>
10.57 + </Property>
10.58 + <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
10.59 + <ResourceString bundle="org/netbeans/modules/tasklist/usertasks/dependencies/Bundle.properties" key="LBL_BeginBegin" replaceFormat="org.openide.util.NbBundle.getBundle({sourceFileName}.class).getString("{key}")"/>
10.60 + </Property>
10.61 + </Properties>
10.62 + <AuxValues>
10.63 + <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
10.64 + </AuxValues>
10.65 + <Constraints>
10.66 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
10.67 + <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="11" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
10.68 + </Constraint>
10.69 + </Constraints>
10.70 + </Component>
10.71 + <Component class="javax.swing.JLabel" name="jLabelError">
10.72 + <Properties>
10.73 + <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
10.74 + <Dimension value="[0, 15]"/>
10.75 + </Property>
10.76 + </Properties>
10.77 + <Constraints>
10.78 + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
10.79 + <GridBagConstraints gridX="0" gridY="2" gridWidth="3" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
10.80 + </Constraint>
10.81 + </Constraints>
10.82 + </Component>
10.83 + </SubComponents>
10.84 +</Form>
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/dependencies/DependencyPanel.java Sat Oct 30 11:04:31 2004 +0000
11.3 @@ -0,0 +1,228 @@
11.4 +/*
11.5 + * Sun Public License Notice
11.6 + *
11.7 + * The contents of this file are subject to the Sun Public License
11.8 + * Version 1.0 (the "License"). You may not use this file except in
11.9 + * compliance with the License. A copy of the License is available at
11.10 + * http://www.sun.com/
11.11 + *
11.12 + * The Original Code is NetBeans. The Initial Developer of the Original
11.13 + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
11.14 + * Microsystems, Inc. All Rights Reserved.
11.15 + */
11.16 +
11.17 +package org.netbeans.modules.tasklist.usertasks.dependencies;
11.18 +
11.19 +import java.awt.Image;
11.20 +import javax.swing.ImageIcon;
11.21 +import javax.swing.tree.DefaultTreeCellRenderer;
11.22 +import javax.swing.tree.TreePath;
11.23 +import org.netbeans.modules.tasklist.usertasks.UserTask;
11.24 +import org.openide.DialogDescriptor;
11.25 +
11.26 +import org.openide.util.Utilities;
11.27 +
11.28 +/**
11.29 + * Panel for editing a dependency
11.30 + */
11.31 +public class DependencyPanel extends javax.swing.JPanel {
11.32 + /**
11.33 + * Tree cell renderer for user tasks
11.34 + */
11.35 + private static class UserTaskTreeCellRenderer extends DefaultTreeCellRenderer {
11.36 + private static final Image IMAGE =
11.37 + Utilities.loadImage("org/netbeans/modules/tasklist/core/task.gif"); // NOI18N
11.38 + private static final Image DONE =
11.39 + Utilities.loadImage("org/netbeans/modules/tasklist/core/doneItem.gif"); // NOI18N
11.40 + private ImageIcon icon = new ImageIcon();
11.41 +
11.42 + public java.awt.Component getTreeCellRendererComponent(
11.43 + javax.swing.JTree tree, Object value, boolean sel, boolean expanded,
11.44 + boolean leaf, int row, boolean hasFocus) {
11.45 +
11.46 + super.getTreeCellRendererComponent(
11.47 + tree, value, sel, expanded, leaf, row, hasFocus);
11.48 + if (value instanceof UserTask) {
11.49 + UserTask ut = (UserTask) value;
11.50 + this.setText(ut.getSummary());
11.51 + this.setIcon(icon);
11.52 +
11.53 + if (ut.isDone())
11.54 + icon.setImage(DONE);
11.55 + else
11.56 + icon.setImage(IMAGE);
11.57 + }
11.58 +
11.59 + return this;
11.60 + }
11.61 + }
11.62 +
11.63 + private UserTask ut;
11.64 + private DialogDescriptor dd;
11.65 +
11.66 + /**
11.67 + * Constructor
11.68 + *
11.69 + * @param ut user task that will have a new dependency on another task
11.70 + */
11.71 + public DependencyPanel(UserTask ut) {
11.72 + this.ut = ut;
11.73 + initComponents();
11.74 + jTree.setModel(new UserTaskTreeModel(ut.getList()));
11.75 + jTree.setCellRenderer(new UserTaskTreeCellRenderer());
11.76 + jTreeValueChanged(null);
11.77 + }
11.78 +
11.79 + /**
11.80 + * Sets a dialog descriptor
11.81 + *
11.82 + * @param dd a dialog descriptor
11.83 + */
11.84 + public void setDialogDescriptor(DialogDescriptor dd) {
11.85 + this.dd = dd;
11.86 + jTreeValueChanged(null);
11.87 + }
11.88 +
11.89 + /**
11.90 + * Selects another task in the tree.
11.91 + *
11.92 + * @param ut the task or null
11.93 + */
11.94 + public void setSelectedTask(UserTask ut) {
11.95 + if (ut != null)
11.96 + jTree.setSelectionPath(ut.getPathTo());
11.97 + else
11.98 + jTree.setSelectionPath(null);
11.99 + }
11.100 +
11.101 + /**
11.102 + * Returns selected task.
11.103 + *
11.104 + * @return selected task or null
11.105 + */
11.106 + public UserTask getSelectedTask() {
11.107 + TreePath tp = jTree.getSelectionPath();
11.108 + if (tp == null)
11.109 + return null;
11.110 + return (UserTask) tp.getLastPathComponent();
11.111 + }
11.112 +
11.113 + /**
11.114 + * Sets another dependency type
11.115 + *
11.116 + * @param type one of Dependency.BEGIN_BEGIN and Dependency.END_BEGIN
11.117 + */
11.118 + public void setDependencyType(int type) {
11.119 + if (type == Dependency.BEGIN_BEGIN)
11.120 + jRadioButtonBeginBegin.setSelected(true);
11.121 + else
11.122 + jRadioButtonEndBegin.setSelected(true);
11.123 + }
11.124 +
11.125 + /**
11.126 + * Returns selected dependency type
11.127 + *
11.128 + * @return one of Dependency.BEGIN_BEGIN and Dependency.END_BEGIN
11.129 + */
11.130 + public int getDependencyType() {
11.131 + if (jRadioButtonBeginBegin.isSelected())
11.132 + return Dependency.BEGIN_BEGIN;
11.133 + else
11.134 + return Dependency.END_BEGIN;
11.135 + }
11.136 +
11.137 + /** This method is called from within the constructor to
11.138 + * initialize the form.
11.139 + * WARNING: Do NOT modify this code. The content of this method is
11.140 + * always regenerated by the Form Editor.
11.141 + */
11.142 + private void initComponents() {//GEN-BEGIN:initComponents
11.143 + java.awt.GridBagConstraints gridBagConstraints;
11.144 +
11.145 + buttonGroup = new javax.swing.ButtonGroup();
11.146 + jScrollPane1 = new javax.swing.JScrollPane();
11.147 + jTree = new javax.swing.JTree();
11.148 + jRadioButtonEndBegin = new javax.swing.JRadioButton();
11.149 + jRadioButtonBeginBegin = new javax.swing.JRadioButton();
11.150 + jLabelError = new javax.swing.JLabel();
11.151 +
11.152 + setLayout(new java.awt.GridBagLayout());
11.153 +
11.154 + jTree.setRootVisible(false);
11.155 + jTree.setShowsRootHandles(true);
11.156 + jTree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
11.157 + public void valueChanged(javax.swing.event.TreeSelectionEvent evt) {
11.158 + jTreeValueChanged(evt);
11.159 + }
11.160 + });
11.161 +
11.162 + jScrollPane1.setViewportView(jTree);
11.163 +
11.164 + gridBagConstraints = new java.awt.GridBagConstraints();
11.165 + gridBagConstraints.gridx = 0;
11.166 + gridBagConstraints.gridy = 1;
11.167 + gridBagConstraints.gridwidth = 3;
11.168 + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
11.169 + gridBagConstraints.weightx = 1.0;
11.170 + gridBagConstraints.weighty = 1.0;
11.171 + gridBagConstraints.insets = new java.awt.Insets(0, 0, 11, 0);
11.172 + add(jScrollPane1, gridBagConstraints);
11.173 +
11.174 + buttonGroup.add(jRadioButtonEndBegin);
11.175 + jRadioButtonEndBegin.setSelected(true);
11.176 + org.openide.awt.Mnemonics.setLocalizedText(jRadioButtonEndBegin, org.openide.util.NbBundle.getBundle(DependencyPanel.class).getString("LBL_EndBegin"));
11.177 + gridBagConstraints = new java.awt.GridBagConstraints();
11.178 + gridBagConstraints.insets = new java.awt.Insets(0, 0, 11, 12);
11.179 + add(jRadioButtonEndBegin, gridBagConstraints);
11.180 +
11.181 + buttonGroup.add(jRadioButtonBeginBegin);
11.182 + org.openide.awt.Mnemonics.setLocalizedText(jRadioButtonBeginBegin, org.openide.util.NbBundle.getBundle(DependencyPanel.class).getString("LBL_BeginBegin"));
11.183 + gridBagConstraints = new java.awt.GridBagConstraints();
11.184 + gridBagConstraints.insets = new java.awt.Insets(0, 0, 11, 0);
11.185 + add(jRadioButtonBeginBegin, gridBagConstraints);
11.186 +
11.187 + jLabelError.setMinimumSize(new java.awt.Dimension(0, 15));
11.188 + gridBagConstraints = new java.awt.GridBagConstraints();
11.189 + gridBagConstraints.gridx = 0;
11.190 + gridBagConstraints.gridy = 2;
11.191 + gridBagConstraints.gridwidth = 3;
11.192 + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
11.193 + add(jLabelError, gridBagConstraints);
11.194 +
11.195 + }//GEN-END:initComponents
11.196 +
11.197 + private void jTreeValueChanged(javax.swing.event.TreeSelectionEvent evt) {//GEN-FIRST:event_jTreeValueChanged
11.198 + String err = null;
11.199 +
11.200 + TreePath tp = jTree.getSelectionPath();
11.201 + if (tp == null || !(tp.getLastPathComponent() instanceof UserTask)) {
11.202 + err = "Nothing selected.";
11.203 + } else {
11.204 + UserTask task = (UserTask) tp.getLastPathComponent();
11.205 +
11.206 + if (task == ut)
11.207 + err = "A task cannot depend on itself.";
11.208 + else if (task == ut.getParent())
11.209 + err = "A task cannot depend on it's parent.";
11.210 + else if (task.isAncestorOf(ut))
11.211 + err = "A task cannot depend on one of it's parent nodes.";
11.212 + else if (ut.isAncestorOf(task))
11.213 + err = "A task cannot depend on one of it's subtasks.";
11.214 + }
11.215 +
11.216 + jLabelError.setText(err == null ? "" : err); // NOI18N
11.217 + if (dd != null)
11.218 + dd.setValid(err == null);
11.219 + }//GEN-LAST:event_jTreeValueChanged
11.220 +
11.221 +
11.222 + // Variables declaration - do not modify//GEN-BEGIN:variables
11.223 + private javax.swing.ButtonGroup buttonGroup;
11.224 + private javax.swing.JLabel jLabelError;
11.225 + private javax.swing.JRadioButton jRadioButtonBeginBegin;
11.226 + private javax.swing.JRadioButton jRadioButtonEndBegin;
11.227 + private javax.swing.JScrollPane jScrollPane1;
11.228 + private javax.swing.JTree jTree;
11.229 + // End of variables declaration//GEN-END:variables
11.230 +
11.231 +}
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
12.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/dependencies/UserTaskTreeModel.java Sat Oct 30 11:04:31 2004 +0000
12.3 @@ -0,0 +1,63 @@
12.4 +/*
12.5 + * Sun Public License Notice
12.6 + *
12.7 + * The contents of this file are subject to the Sun Public License
12.8 + * Version 1.0 (the "License"). You may not use this file except in
12.9 + * compliance with the License. A copy of the License is available at
12.10 + * http://www.sun.com/
12.11 + *
12.12 + * The Original Code is NetBeans. The Initial Developer of the Original
12.13 + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
12.14 + * Microsystems, Inc. All Rights Reserved.
12.15 + */
12.16 +
12.17 +package org.netbeans.modules.tasklist.usertasks.dependencies;
12.18 +
12.19 +import javax.swing.tree.TreeModel;
12.20 +import org.netbeans.modules.tasklist.usertasks.ObjectList;
12.21 +import org.netbeans.modules.tasklist.usertasks.UserTaskList;
12.22 +
12.23 +/**
12.24 + * TreeModel for user tasks
12.25 + */
12.26 +public class UserTaskTreeModel implements TreeModel {
12.27 + private UserTaskList utl;
12.28 +
12.29 + /**
12.30 + * Creates a new model for a task list.
12.31 + *
12.32 + * @param utl a task list
12.33 + */
12.34 + public UserTaskTreeModel(UserTaskList utl) {
12.35 + this.utl = utl;
12.36 + }
12.37 +
12.38 + public boolean isLeaf(Object node) {
12.39 + return ((ObjectList.Owner) node).getObjectList().size() == 0;
12.40 + }
12.41 +
12.42 + public int getChildCount(Object parent) {
12.43 + return ((ObjectList.Owner) parent).getObjectList().size();
12.44 + }
12.45 +
12.46 + public void valueForPathChanged(javax.swing.tree.TreePath path, Object newValue) {
12.47 + }
12.48 +
12.49 + public void removeTreeModelListener(javax.swing.event.TreeModelListener l) {
12.50 + }
12.51 +
12.52 + public void addTreeModelListener(javax.swing.event.TreeModelListener l) {
12.53 + }
12.54 +
12.55 + public Object getChild(Object parent, int index) {
12.56 + return ((ObjectList.Owner) parent).getObjectList().get(index);
12.57 + }
12.58 +
12.59 + public Object getRoot() {
12.60 + return utl;
12.61 + }
12.62 +
12.63 + public int getIndexOfChild(Object parent, Object child) {
12.64 + return -1;
12.65 + }
12.66 +}
13.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/editors/DurationPropertyEditor.java Fri Oct 29 17:59:55 2004 +0000
13.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/editors/DurationPropertyEditor.java Sat Oct 30 11:04:31 2004 +0000
13.3 @@ -32,11 +32,11 @@
13.4
13.5 public String getAsText() {
13.6 int duration = ((Integer) getValue()).intValue();
13.7 - int[] d = UserTask.splitDuration(duration,
13.8 + UserTask.Duration d = UserTask.splitDuration(duration,
13.9 Settings.getDefault().getHoursPerDay());
13.10
13.11 String s = EFFORT_FORMAT.format(new Object[] {
13.12 - new Integer(d[2]), new Integer(d[1]), new Integer(d[0])
13.13 + new Integer(d.days), new Integer(d.hours), new Integer(d.minutes)
13.14 }).trim();
13.15 return s;
13.16 }
14.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/mf-layer.xml Fri Oct 29 17:59:55 2004 +0000
14.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/mf-layer.xml Sat Oct 30 11:04:31 2004 +0000
14.3 @@ -17,7 +17,7 @@
14.4 <folder name="Actions">
14.5 <folder name="View">
14.6 <file name="org-netbeans-modules-tasklist-usertasks-actions-ViewTasksAction.instance" />
14.7 - <file name="org-netbeans-modules-tasklist-usertasks-actions-ShowScheduleViewAction.instance" />
14.8 + <!--<file name="org-netbeans-modules-tasklist-usertasks-actions-ShowScheduleViewAction.instance" />-->
14.9 </folder>
14.10 <folder name="Edit">
14.11 <file name="org-netbeans-modules-tasklist-usertasks-actions-NewTaskAction.instance" />
14.12 @@ -33,10 +33,10 @@
14.13 <folder name="Menu">
14.14 <folder name="Window">
14.15 <file name="org-netbeans-modules-tasklist-usertasks-actions-ViewTasksAction.instance" />
14.16 - <file name="org-netbeans-modules-tasklist-usertasks-actions-ShowScheduleViewAction.instance" />
14.17 + <!--<file name="org-netbeans-modules-tasklist-usertasks-actions-ShowScheduleViewAction.instance" />-->
14.18 <attr name="org-netbeans-core-actions-EditorViewAction.instance/org-netbeans-modules-tasklist-usertasks-actions-ViewTasksAction.instance" boolvalue="true" />
14.19 <attr name="org-netbeans-modules-tasklist-usertasks-actions-ViewTasksAction.instance/org-netbeans-modules-scripting-ConsoleAction.instance" boolvalue="true" />
14.20 - <attr name="org-netbeans-modules-tasklist-usertasks-actions-ViewTasksAction.instance/org-netbeans-modules-tasklist-usertasks-actions-ShowScheduleViewAction.instance" boolvalue="true" />
14.21 + <!--<attr name="org-netbeans-modules-tasklist-usertasks-actions-ViewTasksAction.instance/org-netbeans-modules-tasklist-usertasks-actions-ShowScheduleViewAction.instance" boolvalue="true" />-->
14.22 </folder>
14.23 </folder>
14.24
14.25 @@ -47,6 +47,9 @@
14.26 </folder>
14.27
14.28 <folder name="Services">
14.29 + <folder name="Hidden">
14.30 + <file name="org-netbeans-modules-tasklist-usertasks-UserTaskTransfer.instance"/>
14.31 + </folder>
14.32 <folder name="JavaHelp">
14.33 <!-- Merge after Core IDE Help: -->
14.34 <attr name="org-netbeans-modules-usersguide-above-regular.txt/org-netbeans-modules-tasklist-usertasks-helpsetref.xml" boolvalue="true"/>
15.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/renderers/DurationTableCellRenderer.java Fri Oct 29 17:59:55 2004 +0000
15.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/renderers/DurationTableCellRenderer.java Sat Oct 30 11:04:31 2004 +0000
15.3 @@ -21,7 +21,7 @@
15.4 private static final MessageFormat SHORT_EFFORT_FORMAT =
15.5 new MessageFormat(NbBundle.getMessage(DurationTableCellRenderer.class,
15.6 "ShortEffortFormat")); // NOI18N
15.7 - private int[] duration;
15.8 + private UserTask.Duration duration;
15.9
15.10 /**
15.11 * Creates a new instance of DurationTableCellRenderer
15.12 @@ -47,9 +47,9 @@
15.13 return "";
15.14
15.15 String s = EFFORT_FORMAT.format(new Object[] {
15.16 - new Integer(duration[2]),
15.17 - new Integer(duration[1]),
15.18 - new Integer(duration[0])
15.19 + new Integer(duration.days),
15.20 + new Integer(duration.hours),
15.21 + new Integer(duration.minutes)
15.22 }).trim();
15.23 FontMetrics fm = getFontMetrics(getFont());
15.24 int w = getWidth();
15.25 @@ -58,9 +58,9 @@
15.26 if (w >= fm.stringWidth(s))
15.27 return s;
15.28 return SHORT_EFFORT_FORMAT.format(new Object[] {
15.29 - new Integer(duration[2]),
15.30 - new Integer(duration[1]),
15.31 - new Integer(duration[0])
15.32 + new Integer(duration.days),
15.33 + new Integer(duration.hours),
15.34 + new Integer(duration.minutes)
15.35 }).trim();
15.36 }
15.37 }
16.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/translators/ICalExportFormat.java Fri Oct 29 17:59:55 2004 +0000
16.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/translators/ICalExportFormat.java Sat Oct 30 11:04:31 2004 +0000
16.3 @@ -23,6 +23,7 @@
16.4 import java.text.SimpleDateFormat;
16.5 import java.util.Date;
16.6 import java.util.Iterator;
16.7 +import java.util.List;
16.8 import java.util.SimpleTimeZone;
16.9
16.10 import javax.swing.filechooser.FileSystemView;
16.11 @@ -36,6 +37,7 @@
16.12 import org.netbeans.modules.tasklist.usertasks.UserTask;
16.13 import org.netbeans.modules.tasklist.usertasks.UserTaskList;
16.14 import org.netbeans.modules.tasklist.usertasks.UserTaskView;
16.15 +import org.netbeans.modules.tasklist.usertasks.dependencies.Dependency;
16.16 import org.openide.ErrorManager;
16.17 import org.openide.WizardDescriptor;
16.18 import org.openide.util.NbBundle;
16.19 @@ -341,6 +343,20 @@
16.20 writer.write(parentuid);
16.21 writer.write("\r\n"); // NOI18N
16.22 }
16.23 +
16.24 + List dep = task.getDependencies();
16.25 + for (int i = 0; i < dep.size(); i++) {
16.26 + Dependency d = (Dependency) dep.get(i);
16.27 + writer.write("X-NETBEANS-DEPENDENCY;");
16.28 + writer.write("TYPE=");
16.29 + if (d.getType() == Dependency.BEGIN_BEGIN)
16.30 + writer.write("BEGIN_BEGIN");
16.31 + else
16.32 + writer.write("END_BEGIN");
16.33 + writer.write(":"); // NOI18N
16.34 + writer.write(d.getDependsOn().getUID());
16.35 + writer.write("\r\n"); // NOI18N
16.36 + }
16.37
16.38 Date d = task.getDueDate();
16.39 if (d != null) {
17.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/translators/ICalImportFormat.java Fri Oct 29 17:59:55 2004 +0000
17.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/translators/ICalImportFormat.java Sat Oct 30 11:04:31 2004 +0000
17.3 @@ -25,8 +25,10 @@
17.4 import java.net.URL;
17.5 import java.text.ParseException;
17.6 import java.text.SimpleDateFormat;
17.7 +import java.util.ArrayList;
17.8 import java.util.Date;
17.9 import java.util.Iterator;
17.10 +import java.util.List;
17.11 import java.util.SimpleTimeZone;
17.12 import java.util.TimeZone;
17.13
17.14 @@ -42,6 +44,7 @@
17.15 import org.netbeans.modules.tasklist.usertasks.UserTask;
17.16 import org.netbeans.modules.tasklist.usertasks.UserTaskList;
17.17 import org.netbeans.modules.tasklist.usertasks.UserTaskView;
17.18 +import org.netbeans.modules.tasklist.usertasks.dependencies.Dependency;
17.19 import org.openide.DialogDisplayer;
17.20 import org.openide.ErrorManager;
17.21 import org.openide.NotifyDescriptor;
17.22 @@ -82,6 +85,21 @@
17.23 // Format used when the timezone is specified separetly, e.g. with TZ:PST
17.24 private static final String DATEFORMAT = "yyyyMMdd'T'HHmmss"; // NOI18N
17.25
17.26 + /** Used to read in dependencies */
17.27 + private static class Dep {
17.28 + /** Dependency type. */
17.29 + public int type;
17.30 +
17.31 + /** this task depends on another one */
17.32 + public UserTask ut;
17.33 +
17.34 + /** ut depends on the task with this UID */
17.35 + public String dependsOn;
17.36 + }
17.37 +
17.38 + /** <Dep> used for reading dependencies */
17.39 + private List dependencies = new ArrayList();
17.40 +
17.41 private Reader reader = null;
17.42 private int lineno = 0;
17.43 private int prevChar = -1;
17.44 @@ -433,9 +451,14 @@
17.45 // but what happens to the stream????
17.46 return null;
17.47 }
17.48 +
17.49 String value = getValue();
17.50 String param = getParam();
17.51
17.52 + UTUtils.LOGGER.fine(name);
17.53 + UTUtils.LOGGER.fine(value);
17.54 + UTUtils.LOGGER.fine(param);
17.55 +
17.56 if (name.equals("BEGIN")) { // NOI18N
17.57 if (writer == null) {
17.58 writer = new StringWriter();
17.59 @@ -521,6 +544,18 @@
17.60 url = value;
17.61 } else if ("RELATED-TO".equals(name)) { // NOI18N
17.62 related = value;
17.63 + } else if ("X-NETBEANS-DEPENDENCY".equals(name)) { // NOI18N
17.64 + Dep d = new Dep();
17.65 + d.type = Dependency.END_BEGIN;
17.66 + d.ut = task;
17.67 + d.dependsOn = value;
17.68 + int pos = param.indexOf('=');
17.69 + if (pos >= 0) {
17.70 + String t = param.substring(pos + 1);
17.71 + if (t.equals("BEGIN_BEGIN"))
17.72 + d.type = Dependency.BEGIN_BEGIN;
17.73 + }
17.74 + dependencies.add(d);
17.75 // } else if ("X-NETBEANS-STARTTIME".equals(name)) { // NOI18N
17.76 // long start = Long.MAX_VALUE;
17.77 // try {
17.78 @@ -811,6 +846,21 @@
17.79 }
17.80 } while (true);
17.81
17.82 + // Dependencies
17.83 + UTUtils.LOGGER.fine("processing dependencies: " + dependencies.size());
17.84 + for (int i = 0; i < dependencies.size(); i++) {
17.85 + Dep d = (Dep) dependencies.get(i);
17.86 + UserTask ut = list.findItem(
17.87 + list.getSubtasks().iterator(), d.dependsOn);
17.88 + UTUtils.LOGGER.fine("found task " + ut);
17.89 + if (ut != null) {
17.90 + d.ut.getDependencies().add(new Dependency(ut, d.type));
17.91 + }
17.92 + }
17.93 +
17.94 + dependencies.clear();
17.95 +
17.96 +
17.97 String otherItems = writer.getBuffer().toString();
17.98 if (otherItems.length() == 0) {
17.99 otherItems = null;
18.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/treetable/TreeTable.java Fri Oct 29 17:59:55 2004 +0000
18.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/treetable/TreeTable.java Sat Oct 30 11:04:31 2004 +0000
18.3 @@ -36,6 +36,7 @@
18.4 import java.util.Enumeration;
18.5 import java.util.EventObject;
18.6 import java.util.List;
18.7 +import java.util.logging.Level;
18.8 import javax.swing.ActionMap;
18.9 import javax.swing.Icon;
18.10 import javax.swing.InputMap;
18.11 @@ -61,10 +62,7 @@
18.12 import javax.swing.tree.TreeModel;
18.13 import javax.swing.tree.TreePath;
18.14 import org.netbeans.modules.tasklist.usertasks.UTUtils;
18.15 -import org.netbeans.modules.tasklist.usertasks.UserTask;
18.16 -import org.netbeans.modules.tasklist.usertasks.UserTaskList;
18.17 -import org.netbeans.modules.tasklist.usertasks.UserTaskNode;
18.18 -import org.netbeans.modules.tasklist.usertasks.UserTasksTreeTableModel;
18.19 +
18.20
18.21 /**
18.22 * This example shows how to create a simple JTreeTable component,
18.23 @@ -101,6 +99,7 @@
18.24
18.25 public TreeTable(TreeTableModel treeTableModel) {
18.26 super();
18.27 + putClientProperty("JTable.autoStartsEdit", Boolean.FALSE);
18.28
18.29 // Create the tree. It will be used as a renderer and editor.
18.30 // First we create a dummy model for the tree and set later the
18.31 @@ -446,6 +445,8 @@
18.32 * the tree in the background, and then draw the editor over it.
18.33 */
18.34 public boolean editCellAt(int row, int column, EventObject e){
18.35 + if (e == null && UTUtils.LOGGER.isLoggable(Level.FINE))
18.36 + Thread.dumpStack();
18.37 if (cellEditor != null && !cellEditor.stopCellEditing()) {
18.38 return false;
18.39 }