This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The StopBuilding action is unimplemented in org.netbeans.modules.project.ui.actions.stopBuilding(). I'm recording it so we do not forget about it.
Jesse, does this require some special API in Ant or not?
Yes, it would require a special API. However I am inclined to not implement it as spec'd - prefer to have a context menu item on the output tab to stop that build. (May be implemented in new output window.) If you have a global menu item, its behavior is unclear when there is more than one build running. Jano, any preference?
My preference would be to implement a left-edge toolbar in the new output window, similar to what Idea has, with a button for this. This would be quite trivial to do. Open question is to support some generic concept of actions for such a toolbar (this is more flexible for other output window users; for things with a concept of "pause", it could be useful; it could also possibly host some debugger actions, which would reduce clutter, if we knew the output window would be present when debugging. Proposed API, flexible version: public interface CallbackInputOutput extends InputOutput { public void setActions (Action[] actions); } (the actions can be wrapped in a weak reference wrapper and Action.isEnabled() can handle all the communication that would be needed). Less flexible version: public interface KillableInputOutput extends InputOutput { public void setKillAction (Action a); } same idea, but one action. Really inflexible version: public interface KillableInputOutput extends InputOutput { public void setKillable (Killable k); public interface Killable { public void kill(); } } I tend to prefer the multi-action version, since I have a feeling we'll end up doing it anyway later. The good news in all this is that it totally eliminates the need for the Execution window. This is all quite simple to do, and would not be hard or risky to implement at all. We've got enough time to do it.
Note that such a toolbar could also host a close-tab X button, which would be much more discoverable than right clicking output tabs.
Well you can think about such things for other OW users. All the Ant module needs (and all the current Execution View provides) is something to stop a given running process, which doesn't require anything special.
Was decided to defer this (until E I guess). Probably behavior: enabled iff >= 1 Ant process currently running; if invoked, stops the running process that was started most recently. (I think this would usually capture the user's intent.) Could either do a "hard stop" - i.e. send a ThreadDeath to the process - or a "soft stop" - i.e. throw BuildException("stopped") from the next event logger callback - or a combination - i.e. wait for up to five seconds for a soft stop opportunity, and if none comes, do a hard stop.
*** Issue 48062 has been marked as a duplicate of this issue. ***
The only way to Cancel a build before it completes is to Terminate the build process from the Runtime window. This is very unintuitive, difficult to find or guess, and does not display graceful exit text in the Output window. You cannot create a toolbar button or a menu item to cancel a build because there is no associated Action. We need an Action that we can assign to a toolbar button or menu item that will gracefully cancel a build and display the reason the build ended in the Output window after whatever text the build generated up to that point. The now massive memory footprint and the more common GC thrash can cause some builds to take a very long time to complete. The inability to gracefully cancel a build leaves you sitting there twiddling your bits. I realize that, unless a simple patch can be found, this will not be addressed for 4.0, but I upgraded this to P2 and brought it into the NetCat40 process to make it a priority for the next bug-fix release. It makes NetBeans unusable during an undesired build if the user hasn't figured out they can terminate the process. Howeveer, noting this in the application README file and help file would make users aware of this.
After some discussion with our UI guys and due to the dificulties with the implementation making it an enhancement. We agree that this is a desirable feature to have. But will not go into 4.0
Note a proto-API for this exists in the new output window and works. See org.netbeans.core.output2.CallbackInputOutput - allows an array of Action instances to be passed which will become left-edge toolbar buttons (and be included in the popup menu).
Should be possible to kill the Execution window as part of this, too. Could leave the Processes subnode in Runtime for non-Ant processes, just in case.
Tentatively scheduled for 4.1; expecting UI spec. Would probably be a menu item (or submenu when appropriate) to stop the current Ant process(es). Should be possible to remove the Execution window from the GUI (probably leaving the Runtime node as a backup, e.g. for hypothetical non-Ant processes).
The spec is in the URL field.
Note that we have the ability to display toolbar buttons on the left side of the output window (the actions will also show up in the output window's popup menu). It is implemented in 4.0 but not used by anything. I don't see anything in the spec about including this, but it would make sense to me to include a Stop button in the output window.
I think that's briliant idea (Tim's one). Why would user need to search for the stop button anywhere in the menu if there is a way how to put the button next to the output window. Clicking the stop button would stop just the process on actually active output tab. Moreover it would also look much better :-) IMHO.
For now, we don't go with the stop button in the output window because we plan to separate the build output and process output and it isn't clear yet how it would look like. In general there can be multiple outputs of the same process in the output window, e.g. "JavaApplication1 (debug)" and "Debugger Console" tabs represent the same process, later on we should have a separate process output. The question then is which of those should have a stop button. This have to be well thought out. I agree that the stop button would be good, but the menu item "Stop Building" is a must.
> For now, we don't go with the stop button in the output window because we plan to > separate the build output and process output and it isn't clear yet how it would look like. Easiest solution is for both to have stop buttons; you are never building at the same time as you are running (well, you can press F6 twice and get two processes, but each process will always be doing one or the other). I wonder if you actually need anything beyond a plain text divider to divide output between building & executing, i.e. EXECUTION OUTPUT ---------------- or text color to indicate execution output. That is - is the value of having the two separated actually worth the added complexity of having two tabs? I suspect it's relatively rare to actually care about the distinction between build output and process output - but wanting to be able to quickly stop a process is a relatively common need. Also, being able to stop the process there brings us closer to killing the Execution window, which would be a Good Thing[tm].
Tim: for now we're doing a menu item. A toolbar button in the OW is a possibility, but out of scope for now. We already plan to kill the Execution window, though I think we need to leave the Runtime node; see my comment of 2004-12-02. Any discussion of how process output appears is completely off-topic here; there are other open issues for that.
Working on it...
Adding Build | Stop Building menu item acc. to spec: committed 1.26 ant/src-bridge/org/apache/tools/ant/module/bridge/impl/BridgeImpl.java committed 1.7 ant/src-bridge/org/apache/tools/ant/module/bridge/impl/Bundle.properties committed 1.16 ant/src-bridge/org/apache/tools/ant/module/bridge/impl/NbBuildLogger.java committed 1.7 ant/src/org/apache/tools/ant/module/bridge/BridgeInterface.java committed 1.9 ant/src/org/apache/tools/ant/module/bridge/DummyBridgeImpl.java committed 1.31 ant/src/org/apache/tools/ant/module/resources/AntModuleLayer.xml committed 1.23 ant/src/org/apache/tools/ant/module/run/Bundle.properties added 1.1 ant/src/org/apache/tools/ant/module/run/StopBuildingAction.java added 1.1 ant/src/org/apache/tools/ant/module/run/StopBuildingAlert.form added 1.1 ant/src/org/apache/tools/ant/module/run/StopBuildingAlert.java committed 1.47 ant/src/org/apache/tools/ant/module/run/TargetExecutor.java Removing now-useless Execution Window (but leaving Processes node in Runtime tab): committed 1.11 core/execution/src/org/netbeans/core/execution/Bundle.properties removed 1.6 core/execution/src/org/netbeans/core/execution/ExecutionSettings.java removed 1.17 core/execution/src/org/netbeans/core/execution/ExecutionViewAction.java committed 1.20 core/execution/src/org/netbeans/core/execution/Install.java committed 1.4 core/execution/src/org/netbeans/core/execution/resources/Bundle.properties committed 1.22 core/execution/src/org/netbeans/core/execution/resources/layer.xml removed 1.4 core/execution/src/org/netbeans/core/execution/resources/components/execution.settings removed 1.2 core/execution/src/org/netbeans/core/execution/resources/groups/execution.wsgrp removed 1.3 core/execution/src/org/netbeans/core/execution/resources/groups/execution/execution.wstcgrp removed 1.3 core/execution/src/org/netbeans/core/execution/resources/windowmanager/debugger/execution.wstcref committed 1.9 core/output/src/org/netbeans/core/output/resources/layer.xml committed 1.11 core/output2/src/org/netbeans/core/output2/layer.xml committed 1.403 core/src/org/netbeans/core/Bundle.properties removed 1.5 core/src/org/netbeans/core/resources/actions/executionView.gif
*** Issue 69525 has been marked as a duplicate of this issue. ***