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.

Bug 43143

Summary: [40cat] Implement Build -> Stop Building
Product: projects Reporter: David Konecny <dkonecny>
Component: AntAssignee: Jesse Glick <jglick>
Severity: blocker CC: jrojcek, jtulach, lleland, tboudreau, zikmund
Priority: P2 Keywords: UI
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 41535, 83313    

Description David Konecny 2004-05-12 11:03:30 UTC
The StopBuilding action is unimplemented in
I'm recording it so we do not forget about it.
Comment 1 David Konecny 2004-05-12 11:06:22 UTC
Jesse, does this require some special API in Ant or not?
Comment 2 Jesse Glick 2004-05-12 21:01:41 UTC
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?
Comment 3 _ tboudreau 2004-05-13 01:12:54 UTC
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 

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.
Comment 4 _ tboudreau 2004-05-13 01:16:14 UTC
Note that such a toolbar could also host a close-tab X button, which would be much more 
discoverable than right clicking output tabs.
Comment 5 Jesse Glick 2004-05-13 05:33:48 UTC
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.
Comment 6 Jesse Glick 2004-06-14 15:49:12 UTC
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
Comment 7 Jesse Glick 2004-08-27 19:55:13 UTC
*** Issue 48062 has been marked as a duplicate of this issue. ***
Comment 8 lleland 2004-08-27 23:08:45 UTC
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.
Comment 9 Petr Hrebejk 2004-09-01 16:26:13 UTC
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 
Comment 10 _ tboudreau 2004-09-01 17:07:37 UTC
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).
Comment 11 Jesse Glick 2004-09-28 16:06:51 UTC
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.
Comment 12 Jesse Glick 2004-12-02 20:55:43 UTC
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).
Comment 13 jrojcek 2004-12-08 17:25:47 UTC
The spec is in the URL field.
Comment 14 _ tboudreau 2004-12-08 18:57:17 UTC
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 
Comment 15 Milan Kubec 2004-12-09 09:11:28 UTC
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.
Comment 16 jrojcek 2004-12-09 12:44:51 UTC
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.
Comment 17 _ tboudreau 2004-12-09 17:35:25 UTC
> 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.


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].
Comment 18 Jesse Glick 2004-12-10 22:16:00 UTC
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
Comment 19 Jesse Glick 2004-12-25 22:54:37 UTC
Working on it...
Comment 20 Jesse Glick 2004-12-27 00:06:00 UTC
Adding Build | Stop Building menu item acc. to spec:

committed 1.26 
committed 1.7  
committed 1.16 
committed 1.7  
committed 1.9  
committed 1.31 
committed 1.23  ant/src/org/apache/tools/ant/module/run/
added     1.1  
added     1.1  
added     1.1  
committed 1.47 

Removing now-useless Execution Window (but leaving Processes node in
Runtime tab):

committed 1.11 
removed   1.6  
removed   1.17 
committed 1.20 
committed 1.4  
committed 1.22 
removed   1.4  
removed   1.2  
removed   1.3  
removed   1.3  
committed 1.9  
committed 1.11  core/output2/src/org/netbeans/core/output2/layer.xml
committed 1.403 core/src/org/netbeans/core/
removed   1.5  
Comment 21 Jesse Glick 2006-02-03 20:59:51 UTC
*** Issue 69525 has been marked as a duplicate of this issue. ***