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 193872 - Need to have history for Run-Debug and re-implement history support for Attach-Debug
Summary: Need to have history for Run-Debug and re-implement history support for Attac...
Status: VERIFIED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: API, API_REVIEW_FAST, UI
Depends on: 245350
Blocks:
  Show dependency tree
 
Reported: 2010-12-28 10:49 UTC by igor_nikiforov
Modified: 2014-07-25 17:05 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Implementation with the use of BuildExecutionSupportImplementation (8.93 KB, patch)
2014-07-01 16:39 UTC, Martin Entlicher
Details | Diff
This is how it will look like - two sections of the menu will grow with past debugging sessions. (18.43 KB, image/png)
2014-07-01 16:40 UTC, Martin Entlicher
Details
The proposed API change to get rid of reflection calls. (15.26 KB, patch)
2014-07-04 12:07 UTC, Martin Entlicher
Details | Diff
After issue #245350 is integrated, this patch adds the history into the menu. (8.10 KB, patch)
2014-07-08 16:03 UTC, Martin Entlicher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description igor_nikiforov 2010-12-28 10:49:54 UTC
NetBeans infrastructure allows to have Attach-Debug history. The history items appears in the menu associated with debug button on the main toolbar.

Currently it's implemented the following way. The class implementing Controller interface should have  3 additional  methods: save, load and getDisplayName. All of them are called via reflection from the general attach debugging infrastructure. See the following changeset as an example of implementation:
http://hg.netbeans.org/cnd-main/rev/7058d7f362d8

The better approach would be to extend Controller interface and add these three methods into it. And the general infrastructure can check if the Controller object is an instance of this new interface and call the methods without reflection.

It would be great to have a history for the Run-Debug also. It should work exactly the same as for Attach-Debug.
Comment 1 igor_nikiforov 2013-05-23 12:49:13 UTC
Some nice API was introduced in for run history
  https://netbeans.org/bugzilla/show_bug.cgi?id=193873

It would be great to have the same API for Run-Debug and Attach-Debug actions as well.
Comment 2 Martin Entlicher 2013-06-03 06:49:23 UTC
O.K., scheduling for the next release, we're after feature freeze of 7.4 already.
Comment 3 Martin Entlicher 2014-06-30 16:25:09 UTC
It looks like we can reuse BuildExecutionSupport for the debugger action.
Comment 4 Martin Entlicher 2014-07-01 16:39:29 UTC
Created attachment 147842 [details]
Implementation with the use of BuildExecutionSupportImplementation

I managed to implement this with the help of org.netbeans.modules.project.uiapi.BuildExecutionSupportImplementation, which is not public API, unfortunately. I do not think that adding implementation dependency just because of that is nice, therefore I'll request some public API for this...
Comment 5 Martin Entlicher 2014-07-01 16:40:45 UTC
Created attachment 147843 [details]
This is how it will look like - two sections of the menu will grow with past debugging sessions.
Comment 6 Martin Entlicher 2014-07-04 12:07:39 UTC
Created attachment 147881 [details]
The proposed API change to get rid of reflection calls.
Comment 7 Martin Entlicher 2014-07-04 12:09:03 UTC
Please review the last attachment - introduction of PersistentController.
Comment 8 Martin Entlicher 2014-07-08 16:03:38 UTC
Created attachment 147942 [details]
After issue #245350 is integrated, this patch adds the history into the menu.
Comment 9 Tomas Stupka 2014-07-14 14:20:20 UTC
in case nobody objects i will integrate tomomorrow
Comment 10 Tomas Stupka 2014-07-15 11:05:32 UTC
integrated core-main #d90620216dec
Comment 11 Quality Engineering 2014-07-19 10:18:35 UTC
Integrated into 'main-silver', will be available in build *201407190718* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/d90620216dec
User: Tomas Stupka <tstupka@netbeans.org>
Log: Issue #193872 - Need to have history for Run-Debug and re-implement history support for Attach-Debug
Comment 12 Martin Entlicher 2014-07-21 13:45:39 UTC
Thanks Tomas for the push of menu history.
The API change that introduces PersistentController is pushed in
changeset:   276327:3cbf958d5326
http://hg.netbeans.org/core-main/rev/3cbf958d5326
Comment 13 Quality Engineering 2014-07-23 02:07:11 UTC
Integrated into 'main-silver', will be available in build *201407230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3cbf958d5326
User: mentlicher@netbeans.org
Log: #193872: PersistentController introduced.
Comment 14 Jiri Kovalsky 2014-07-23 09:09:00 UTC
Product Version: NetBeans IDE Dev (Build 201407230001)
Java: 1.8.0_11; Java HotSpot(TM) Client VM 25.11-b03
Runtime: Java(TM) SE Runtime Environment 1.8.0_11-b12
System: Linux version 3.13.0-24-generic running on i386; UTF-8; en_US (nb)

Verified. However, is there a chance to remove some items from the archive? I used wrong host name which caused the attach to fail but it now occupies space in the pull down menu uselessly.
Comment 15 Martin Entlicher 2014-07-23 09:21:16 UTC
I can imagine a small [x] button on the menu item, like on tabs in Firefox.
But this is not currently in any NetBeans menu AFAIK and I was not sure how sever the inability to remove menu items is.
Feel free to submit an enhancement for that.
Comment 16 Jiri Kovalsky 2014-07-23 15:48:00 UTC
OK, [x] button would be satisfactory. I filed it as #245920. Thanks.
Comment 17 Vladimir Voskresensky 2014-07-25 17:05:43 UTC
Thanks Martin,
Works like a charm!