1.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/TaskListDataObject.java Fri Oct 15 16:50:38 2004 +0000
1.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/TaskListDataObject.java Sun Oct 17 13:39:36 2004 +0000
1.3 @@ -13,6 +13,7 @@
1.4
1.5 package org.netbeans.modules.tasklist.usertasks;
1.6
1.7 +import javax.swing.SwingUtilities;
1.8 import org.openide.cookies.OpenCookie;
1.9 import org.openide.filesystems.FileObject;
1.10 import org.openide.loaders.DataObjectExistsException;
1.11 @@ -44,8 +45,18 @@
1.12
1.13 // Implements OpenCookie
1.14
1.15 - /** Invokes the open action. */
1.16 public void open() {
1.17 + SwingUtilities.invokeLater(new Runnable() {
1.18 + public void run() {
1.19 + open_();
1.20 + }
1.21 + });
1.22 + }
1.23 +
1.24 + /**
1.25 + * Opens the TC in the Swing thread
1.26 + */
1.27 + private void open_() {
1.28 UserTaskView view = UserTaskView.findView(getPrimaryEntry().getFile());
1.29 if (view == null) {
1.30 UserTaskList tl = new UserTaskList();
2.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskNode.java Fri Oct 15 16:50:38 2004 +0000
2.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskNode.java Sun Oct 17 13:39:36 2004 +0000
2.3 @@ -43,6 +43,7 @@
2.4 import org.netbeans.modules.tasklist.usertasks.actions.NewTaskListAction;
2.5 import org.netbeans.modules.tasklist.usertasks.actions.PauseAction;
2.6 import org.netbeans.modules.tasklist.usertasks.actions.PurgeTasksAction;
2.7 +import org.netbeans.modules.tasklist.usertasks.actions.ShowScheduleViewAction;
2.8 import org.netbeans.modules.tasklist.usertasks.actions.ShowTaskAction;
2.9 import org.netbeans.modules.tasklist.usertasks.actions.SingleLineCookie;
2.10 import org.netbeans.modules.tasklist.usertasks.actions.StartCookie;
2.11 @@ -73,7 +74,9 @@
2.12 import org.openide.util.datatransfer.MultiTransferObject;
2.13 import org.openide.util.datatransfer.PasteType;
2.14
2.15 -
2.16 +/**
2.17 + * Node for a user task
2.18 + */
2.19 public final class UserTaskNode extends AbstractNode {
2.20 private UserTask item;
2.21 private UserTaskList utl;
2.22 @@ -104,6 +107,12 @@
2.23 item.addPropertyChangeListener(new PropertyChangeListener() {
2.24 public void propertyChange(PropertyChangeEvent e) {
2.25 String n = e.getPropertyName();
2.26 + if (n == "progress") {
2.27 + int old = Math.round(((Float) e.getOldValue()).floatValue());
2.28 + int new_ = Math.round(((Float) e.getNewValue()).floatValue());
2.29 + UserTaskNode.this.firePropertyChange(
2.30 + "percentComplete", new Integer(old), new Integer(new_));
2.31 + }
2.32 if (n != "line" && n != "started") {
2.33 UserTaskNode.this.firePropertyChange(e.getPropertyName(),
2.34 e.getOldValue(), e.getNewValue());
2.35 @@ -135,6 +144,7 @@
2.36 return new SystemAction[] {
2.37 SystemAction.get(NewTaskAction.class),
2.38 SystemAction.get(NewTaskListAction.class),
2.39 + SystemAction.get(ShowScheduleViewAction.class),
2.40 null,
2.41 SystemAction.get(StartTaskAction.class),
2.42 SystemAction.get(PauseAction.class),
3.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskView.java Fri Oct 15 16:50:38 2004 +0000
3.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/UserTaskView.java Sun Oct 17 13:39:36 2004 +0000
3.3 @@ -253,7 +253,7 @@
3.4 " called at " + this;
3.5 ExplorerUtils.activateActions(manager, true);
3.6 RemoveFilterUserTaskAction removeFilter =
3.7 - (RemoveFilterUserTaskAction) SystemAction.get(RemoveFilterUserTaskAction.class);
3.8 + (RemoveFilterUserTaskAction) SystemAction.get(RemoveFilterUserTaskAction.class);
3.9 removeFilter.enable();
3.10 }
3.11
3.12 @@ -337,6 +337,13 @@
3.13 UserTaskList utl = new UserTaskList();
3.14 utl.readFile(fo);
3.15 setList(utl);
3.16 + } else {
3.17 + Runnable r = new Runnable() {
3.18 + public void run() {
3.19 + close();
3.20 + }
3.21 + };
3.22 + SwingUtilities.invokeLater(r);
3.23 }
3.24 } else {
3.25 setList(UserTaskList.getDefault());
3.26 @@ -727,14 +734,12 @@
3.27 * of getting opened.
3.28 */
3.29 protected void componentOpened() {
3.30 - // Register listeningViews, such as the editor support bridge module
3.31 - // TODO: Listeners from Lookup will not be collected
3.32 - // registerListeners();
3.33 -
3.34 if (initialized) {
3.35 return;
3.36 }
3.37 initialized = true;
3.38 + ExplorerUtils.activateActions(manager, false);
3.39 + ExplorerUtils.activateActions(manager, true);
3.40 }
3.41
3.42
3.43 @@ -762,6 +767,9 @@
3.44 storeColumnsConfiguration();
3.45 }
3.46
3.47 + /**
3.48 + * Shows the TC in the output mode and activates it.
3.49 + */
3.50 public void showInMode() {
3.51 if (!isOpened()) {
3.52 Mode mode = WindowManager.getDefault().findMode("output"); // NOI18N
4.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/Bundle.properties Fri Oct 15 16:50:38 2004 +0000
4.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/Bundle.properties Sun Oct 17 13:39:36 2004 +0000
4.3 @@ -55,3 +55,6 @@
4.4 ClearCompletedQuestion=Do you want to clear percent complete information of all subtasks?
4.5 ClearCompletedTitle=Question
4.6 ClearCompleted=Clear Percent Complete
4.7 +
4.8 +## ShowScheduleViewAction
4.9 +LBL_ViewScheduleWindow=Gantt Diagram
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/ShowScheduleViewAction.java Sun Oct 17 13:39:36 2004 +0000
5.3 @@ -0,0 +1,50 @@
5.4 +/*
5.5 + * Sun Public License Notice
5.6 + *
5.7 + * The contents of this file are subject to the Sun Public License
5.8 + * Version 1.0 (the "License"). You may not use this file except in
5.9 + * compliance with the License. A copy of the License is available at
5.10 + * http://www.sun.com/
5.11 + *
5.12 + * The Original Code is NetBeans. The Initial Developer of the Original
5.13 + * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
5.14 + * Microsystems, Inc. All Rights Reserved.
5.15 + */
5.16 +
5.17 +package org.netbeans.modules.tasklist.usertasks.actions;
5.18 +
5.19 +import org.netbeans.modules.tasklist.usertasks.ScheduleTopComponent;
5.20 +import org.netbeans.modules.tasklist.usertasks.UserTaskView;
5.21 +import org.openide.util.HelpCtx;
5.22 +import org.openide.util.NbBundle;
5.23 +import org.openide.util.actions.CallableSystemAction;
5.24 +
5.25 +/**
5.26 + * Show the Schedule TC
5.27 + */
5.28 +public class ShowScheduleViewAction extends CallableSystemAction {
5.29 + private static final long serialVersionUID = 1;
5.30 +
5.31 + public void performAction() {
5.32 + UserTaskView v = UserTaskView.getCurrent();
5.33 + ScheduleTopComponent tc = new ScheduleTopComponent(
5.34 + v.getName(), v.getList());
5.35 + tc.open();
5.36 + tc.requestActive();
5.37 + }
5.38 +
5.39 + protected boolean asynchronous() {
5.40 + return false;
5.41 + }
5.42 +
5.43 + public String getName() {
5.44 + return NbBundle.getMessage(ShowScheduleViewAction.class,
5.45 + "LBL_ViewScheduleWindow"); // NOI18N
5.46 + }
5.47 +
5.48 + public HelpCtx getHelpCtx() {
5.49 + return HelpCtx.DEFAULT_HELP;
5.50 + // If you will provide context help then use:
5.51 + // return new HelpCtx (MyAction.class);
5.52 + }
5.53 +}
6.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/ViewTasksAction.java Fri Oct 15 16:50:38 2004 +0000
6.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/actions/ViewTasksAction.java Sun Oct 17 13:39:36 2004 +0000
6.3 @@ -13,6 +13,7 @@
6.4
6.5 package org.netbeans.modules.tasklist.usertasks.actions;
6.6
6.7 +import org.netbeans.modules.tasklist.usertasks.ScheduleTopComponent;
6.8 import org.netbeans.modules.tasklist.usertasks.UserTaskView;
6.9 import org.openide.util.HelpCtx;
6.10 import org.openide.util.NbBundle;
7.1 --- a/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/mf-layer.xml Fri Oct 15 16:50:38 2004 +0000
7.2 +++ b/tasklist.usertasks/src/org/netbeans/modules/tasklist/usertasks/mf-layer.xml Sun Oct 17 13:39:36 2004 +0000
7.3 @@ -17,6 +17,7 @@
7.4 <folder name="Actions">
7.5 <folder name="View">
7.6 <file name="org-netbeans-modules-tasklist-usertasks-actions-ViewTasksAction.instance" />
7.7 + <file name="org-netbeans-modules-tasklist-usertasks-actions-ShowScheduleViewAction.instance" />
7.8 </folder>
7.9 <folder name="Edit">
7.10 <file name="org-netbeans-modules-tasklist-usertasks-actions-NewTaskAction.instance" />
7.11 @@ -32,8 +33,10 @@
7.12 <folder name="Menu">
7.13 <folder name="Window">
7.14 <file name="org-netbeans-modules-tasklist-usertasks-actions-ViewTasksAction.instance" />
7.15 + <file name="org-netbeans-modules-tasklist-usertasks-actions-ShowScheduleViewAction.instance" />
7.16 <attr name="org-netbeans-core-actions-EditorViewAction.instance/org-netbeans-modules-tasklist-usertasks-actions-ViewTasksAction.instance" boolvalue="true" />
7.17 <attr name="org-netbeans-modules-tasklist-usertasks-actions-ViewTasksAction.instance/org-netbeans-modules-scripting-ConsoleAction.instance" boolvalue="true" />
7.18 + <attr name="org-netbeans-modules-tasklist-usertasks-actions-ViewTasksAction.instance/org-netbeans-modules-tasklist-usertasks-actions-ShowScheduleViewAction.instance" boolvalue="true" />
7.19 </folder>
7.20 </folder>
7.21
7.22 @@ -89,7 +92,6 @@
7.23 <file name="filters.settings" url="filter/usertasks_filters.xml">
7.24 <attr name="instanceClass" stringvalue="org.netbeans.modules.tasklist.core.filter.FilterRepository"/>
7.25 </file>
7.26 -
7.27 </folder>
7.28 </folder>
7.29