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 74325 - Fix action definitions
Summary: Fix action definitions
Status: CLOSED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
: 84359 (view as bug list)
Depends on: 82800
Blocks: 89617
  Show dependency tree
 
Reported: 2006-04-03 16:51 UTC by Martin Entlicher
Modified: 2010-04-29 09:28 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The textual diff of this fix. (33.97 KB, text/plain)
2006-11-06 15:19 UTC, Martin Entlicher
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Entlicher 2006-04-03 16:51:43 UTC
Currently debugger actions (like step, continue, ...) are defined in
debuggercore module, but registered into GUI in debuggerjpda/ui module.
Therefore after JPDA module is uninstalled, other debugger implementations loose
the GUI actions.
Comment 1 Martin Entlicher 2006-04-03 16:54:43 UTC
The whole management should likely be done by debuggercore module - it should
create GUI elements for all actions which have at least one provider. That could
not be done in a declarative way (therefore the impl. of that would be more
complex), but it would provide better service IMHO.
Comment 2 ivan 2006-06-29 01:02:13 UTC
Can we rely on this getting fixed for promo H (NB 6.0)?
SunStudio intends to ship with all java functionality turned off
and it would be odd to have the NewBreakpoint dialog to come up with
a debugger combo-box that offers java.
Comment 3 Martin Entlicher 2006-07-04 19:01:10 UTC
I see. It's scheduled for "Dev" so far, what means 6.0. I'll mark it as STARTED
so that I'll not forget to implement it.
Comment 4 Martin Entlicher 2006-08-16 11:14:44 UTC
IMHO the best solution is to declare the actions in the debuggercore's module
layer, but do not make them visible in the menu until there is at least one
provider for them.

I've tried to achieve this with org.openide.awt.DynamicMenuContent, but there is
a problem, which is described in issue #82800. I may try to use a workaround
with invisible menu items till issue #82800 is fixed...
Comment 5 Martin Entlicher 2006-09-07 08:51:41 UTC
*** Issue 84359 has been marked as a duplicate of this issue. ***
Comment 6 Antonin Nebuzelsky 2006-09-22 16:25:26 UTC
Martine, do you plan to fix this soon?
Comment 7 Martin Entlicher 2006-09-25 10:21:12 UTC
Yes, issue #82800 is already fixed, so I'll look at this soon.
Comment 8 Martin Entlicher 2006-10-05 15:55:58 UTC
After I've studied the code and learned how the actions management is
implemented, I've realized that this is not possible to fix. Every debugger
implementation must declare the GUI actions it needs in it's layer XML file.

The reason is, that the action providers are not known until the appropriate
DebuggerEngineProvider is created, which contains the actions in it's lookup.
Fixing this would cause that the appropriate menu items would be visible only
after their DebuggerEngineProvider becomes active. This is not acceptable from
the UI point of view - the actions must be there all the time and they should be
either enabled or disabled, depending on the action providers.
Since it's impossible to know which action providers are in the system before
the relevant DebuggerEngineProvider is instantiated, the only solution is that
every debugger module declares action it uses in it's module layer XML file.

I've fixed this for ANT debugger, others needs to do it in a similar way. Have a
look into
debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/resources/mf-layer.xml.

/cvs/ant/debugger/src/org/netbeans/modules/ant/debugger/Bundle.properties,v  <--
 Bundle.properties
new revision: 1.5; previous revision: 1.4

/cvs/ant/debugger/src/org/netbeans/modules/ant/debugger/resources/mf-layer.xml,v
 <--  mf-layer.xml
new revision: 1.9; previous revision: 1.8
Comment 9 Martin Entlicher 2006-10-05 17:13:50 UTC
The suggested solution has broken commit-validation. Even though it seems to
work fine, I had to rollback the change:

/cvs/ant/debugger/src/org/netbeans/modules/ant/debugger/resources/mf-layer.xml,v
 <--  mf-layer.xml
new revision: 1.10; previous revision: 1.9

/cvs/ant/debugger/src/org/netbeans/modules/ant/debugger/Bundle.properties,v  <--
 Bundle.properties
new revision: 1.6; previous revision: 1.5

I negotiate the correct solution with the core team...
Comment 10 ivan 2006-10-09 23:10:25 UTC
Gordon pointed out that the gdb ui implementation in CND gets around
this by registering the actions in the mf-layers file just as debuggerjpda
does, including "calls" to instanceCreate.
This seems to work for dbxgui as well.

Is this a good-enough solution?
Is there is a down-side to this?
Comment 11 Martin Entlicher 2006-10-11 11:09:41 UTC
Yes, this is what I'm trying to do as well. The problem is, that one test in
core prevents me from doing this. Now I've changed the test so that this is
permitted:

/cvs/core/test/unit/src/org/netbeans/core/projects/ValidateLayerConsistencyTest.java,v
 <--  ValidateLayerConsistencyTest.java
new revision: 1.26; previous revision: 1.25

Also it's necessary to register all actions at one central place - debuggercore,
other modules will have just shadow links to them. This is because of
methodvalue attributes in XML, which generate different FileObject attributes.
The identity comparison works well for shadows.
Comment 12 Martin Entlicher 2006-10-11 11:28:17 UTC
So, another attempt to fix this is there:

/cvs/ant/debugger/src/org/netbeans/modules/ant/debugger/Bundle.properties,v  <--
 Bundle.properties
new revision: 1.7; previous revision: 1.6

/cvs/ant/debugger/src/org/netbeans/modules/ant/debugger/resources/mf-layer.xml,v
 <--  mf-layer.xml
new revision: 1.11; previous revision: 1.10

/cvs/debuggercore/src/org/netbeans/modules/debugger/resources/mf-layer.xml,v 
<--  mf-layer.xml
new revision: 1.76; previous revision: 1.75

/cvs/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/resources/mf-layer.xml,v
 <--  mf-layer.xml
new revision: 1.34; previous revision: 1.33

All debugger implementations are supposed to register appropriate shadow files
into Run menu and toolbar, which point only to actions they support.
Comment 13 Thomas Preisler 2006-10-25 17:58:35 UTC
Changing prioroty to p2 making it a candidate for backporting to release55_mars.
Comment 14 Martin Entlicher 2006-11-06 15:19:08 UTC
Created attachment 35799 [details]
The textual diff of this fix.
Comment 15 Martin Entlicher 2006-11-06 15:28:21 UTC
The fix is integrated in release55_mars branch:

/shared/data/ccvs/repository/ant/debugger/src/org/netbeans/modules/ant/debugger/Bundle.properties,v
 <--  Bundle.properties
new revision: 1.2.38.1.2.1.18.1; previous revision: 1.2.38.1.2.1

/shared/data/ccvs/repository/ant/debugger/src/org/netbeans/modules/ant/debugger/resources/mf-layer.xml,v
 <--  mf-layer.xml
new revision: 1.4.8.1.2.1.18.1; previous revision: 1.4.8.1.2.1

/shared/data/ccvs/repository/core/test/unit/src/org/netbeans/core/projects/ValidateLayerConsistencyTest.java,v
 <--  ValidateLayerConsistencyTest.java
new revision: 1.17.42.2.2.2.18.1; previous revision: 1.17.42.2.2.2

/shared/data/ccvs/repository/debuggercore/src/org/netbeans/modules/debugger/resources/mf-layer.xml,v
 <--  mf-layer.xml
new revision: 1.69.46.2.2.1.18.1; previous revision: 1.69.46.2.2.1

/shared/data/ccvs/repository/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/resources/mf-layer.xml,v
 <--  mf-layer.xml
new revision: 1.27.4.2.2.1.18.1; previous revision: 1.27.4.2.2.1
Comment 16 Martin Entlicher 2006-11-20 11:29:17 UTC
The fix is merged into release551:

/shared/data/ccvs/repository/ant/debugger/src/org/netbeans/modules/ant/debugger/Bundle.properties,v
 <--  Bundle.properties
new revision: 1.2.38.1.2.1.22.1; previous revision: 1.2.38.1.2.1

/shared/data/ccvs/repository/ant/debugger/src/org/netbeans/modules/ant/debugger/resources/mf-layer.xml,v
 <--  mf-layer.xml
new revision: 1.4.8.1.2.1.22.1; previous revision: 1.4.8.1.2.1

/shared/data/ccvs/repository/core/test/unit/src/org/netbeans/core/projects/ValidateLayerConsistencyTest.java,v
 <--  ValidateLayerConsistencyTest.java
new revision: 1.17.42.2.2.2.22.1; previous revision: 1.17.42.2.2.2

/shared/data/ccvs/repository/debuggercore/src/org/netbeans/modules/debugger/resources/mf-layer.xml,v
 <--  mf-layer.xml
new revision: 1.69.46.2.2.1.22.1; previous revision: 1.69.46.2.2.1

/shared/data/ccvs/repository/debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/resources/mf-layer.xml,v
 <--  mf-layer.xml
new revision: 1.27.4.2.2.1.22.1; previous revision: 1.27.4.2.2.1
Comment 17 Quality Engineering 2010-04-29 09:28:44 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.