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 47925 - [40cat] Add re-run function shortcut and execution toolbar icon
Summary: [40cat] Add re-run function shortcut and execution toolbar icon
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: UI
: 69464 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-25 15:52 UTC by dynamite
Modified: 2006-11-28 16:50 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dynamite 2004-08-25 15:52:26 UTC
[ BUILD # : 200408191352 ]
[ JDK VERSION : J2SE 1.5.0 ]

What would be nice is if there a keyboard shortcut and a toolbar icon for re-running the last thing that was run.

I execute unit tests far more often then I do my main project. I find it hard to think how it could be otherwise. And yet the execution toolbar will
only let the main project be run and not the unit tests. Running the unit tests suite and individual tests are easily 2 of the most used pieces of
functionality in NB for me.

What I am finding is that I know that I have a
failing unit test. I go to a file to make a change that may or may not make it pass. I then switch back to the test file so that I can do the run test keyboard shortcut. This I may well have to repeat several times. Going through several levels of menus is no quicker.
Comment 1 dynamite 2004-08-25 16:23:13 UTC
I know that no menus currently dangle off of a toolbar, but there are
plenty of applications that do. It be an icon to run the last executed
thing with an icon next to it suggesting that it has a menu. That menu
could have the recently run list. Selecting from that menu would run
the selected item.
Comment 2 Jan Chalupa 2004-08-31 09:12:05 UTC
Might be a useful feature. Not a bug by any means though. DEFECT ->
ENHANCEMENT.
Comment 3 jrojcek 2004-09-01 20:16:57 UTC
Why do you always have to switch into the test file? Using the Run | Run Other | Test File 
action (using its shortcut) doesn't help you? (I guess not because you don't make a change 
in the file that has the test file associated). Just asking to clarify the issue.
Comment 4 dynamite 2004-09-02 08:54:56 UTC
Doesn't always work but it assumes 1 TestCase in Test Packages for 1
class in Source Packages.

There are 2 scenarios:

1) I have a class that I create to help testing such as a
MockInputStream. It needs tailoring because thew Mock frameworks don't
give me quite what I will need. Several tests will need it, but the
final product won't. Therefore it goes into Test Packages. Ctrl-F6
will try to run MockInputStream in this case rather than its TestCase.

2) I have fairly often more than 1 TestCase per class because setUp()
then may be different for different groups of tests. Ctrl-F6 won't
necessarily run the desired TestCase. (Ideally it would run all of the
classes TestCases and this is possible, but harder to achieve.)
Comment 5 Jesse Glick 2006-01-11 20:21:44 UTC
Re. reporter's original problem - maybe you missed Alt-F6? That runs all tests
in the project, not just one. Not clear from description what was needed.

Anyway, I am working on an action to run the last build for 5.1. For now I will
just make the action available for those who want to add a keyboard shortcut,
menu item, and/or toolbar button. Probably it should go into a standard place,
though - Jano should comment on this, but I think in the Build menu right above
"Stop Build/Run" would make sense.

UI is quite simple: enabled if and only if there was some Ant build already in
this IDE session (no persistence across restarts currently). Menu item looks
like e.g.

  _R_epeat Build/Run: SomeProject (run)

and the icon is the usual Ant icon (but could be improved probably).

The part after the colon is the same as the Output Window tab name for that Ant
process.

The toolbar button just shows the icon; the tooltip shows e.g.

  Repeat Build/Run: SomeProject (run)

i.e. same as the menu item, minus mnemonic.

Both the menu item and toolbar button display any associated keyboard shortcut
in the usual way. (You can use Tools > Options > Keymap to add one.)

Currently there is no history kept beyond the last build. Given the number of
other ways that Ant builds can be run already it seems like overkill, but TBD.
Comment 6 Jesse Glick 2006-01-11 22:50:40 UTC
Added but hidden except for those who look for it. Jano, your feedback would be
appreciated on whether this should be added to the Build menu directly above
"Stop Build/Run".

committed   * Up-To-Date  1.40       
ant/src/org/apache/tools/ant/module/resources/AntModuleLayer.xml
committed   * Up-To-Date  1.25       
ant/src/org/apache/tools/ant/module/run/Bundle.properties
added       * Up-To-Date  1.1        
ant/src/org/apache/tools/ant/module/run/LastTargetExecuted.java
added       * Up-To-Date  1.1        
ant/src/org/apache/tools/ant/module/run/RunLastTargetAction.java
committed   * Up-To-Date  1.52       
ant/src/org/apache/tools/ant/module/run/TargetExecutor.java
Comment 7 Jesse Glick 2006-01-25 15:00:36 UTC
*** Issue 69464 has been marked as a duplicate of this issue. ***
Comment 8 Jesse Glick 2006-03-27 23:16:44 UTC
Registering in default Build menu:

Checking in AntModuleLayer.xml;
/shared/data/ccvs/repository/ant/src/org/apache/tools/ant/module/resources/AntModuleLayer.xml,v
 <--  AntModuleLayer.xml
new revision: 1.43; previous revision: 1.42
done