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 60499 - Viewmodel: Enhance ModelEvent
Summary: Viewmodel: Enhance ModelEvent
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Entlicher
Depends on:
Blocks: 57835 61082
  Show dependency tree
Reported: 2005-06-24 18:24 UTC by Martin Entlicher
Modified: 2010-04-29 09:23 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:

The proposed API change (3.51 KB, text/plain)
2005-07-14 16:28 UTC, Martin Entlicher
The changes in the implementation. Just FYI. (14.30 KB, text/plain)
2005-07-14 16:31 UTC, Martin Entlicher
The API change with updated Javadoc. (5.86 KB, text/plain)
2005-07-18 16:53 UTC, Martin Entlicher

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Entlicher 2005-06-24 18:24:40 UTC
It's necessary to improve the ModelEvent subclasses to allow more fine-grained

Currently one can refresh the whole tree (TreeChanged), one node (NodeChanged),
or specific node property (TableValueChanged).

It's not possible to fire just change of node's display name, icon, short
description or children, specifically. There was introduced a hack with
javax.naming.ldap.ExtendedResponse - because of fix of issues #59945 and #60022.
But it should be implemented properly by enhancing ModelEvent in viewmodel API.
Comment 1 Martin Entlicher 2005-06-24 18:33:46 UTC
I suggest to add a new constructor to ModelEvent.NodeChanged:
NodeChanged(Object source, Object node, int change)
and method: public int getChange()

The change can be a combination of constants:
The default change will be -1 (all above changes)

Comment 2 Martin Entlicher 2005-07-14 16:28:16 UTC
Created attachment 23106 [details]
The proposed API change
Comment 3 Martin Entlicher 2005-07-14 16:30:04 UTC
I'm asking for the review - it should be non-controversial, only simple API
Comment 4 Martin Entlicher 2005-07-14 16:31:08 UTC
Created attachment 23107 [details]
The changes in the implementation. Just FYI.
Comment 5 Jaroslav Tulach 2005-07-15 07:05:17 UTC
What it isjavax.naming.ldap.ExtendedResponse? How and when that interface got 
into the APIs? 
I have not actually found the API change!? Should not there be new constructor 
in the ModelEvent.NodeChanged? I have not found that in the diff. 
There are debug messages in your code. 
There is no update to the apichanges, no increment of module version and no 
change in other module dependencies. 
And I am really sorry for repeating myself, there is no test. Write one. 
Comment 6 _ rkubacki 2005-07-15 08:07:29 UTC
Yarda, you probably missed the first attachment. The change is going to remove
an ugly hack from debugger code. The event needs additional information that was
passed using hidden contract: if the event is actually instanceof
ExtendedResponse than you can call a method getID to obtain this value. 

OK - javadoc for new constructor is missing and there is some debug message but
I agree with it. (Is it second round of refining events in debuger now?)

Tests? these will be silly unit test just to get coverage in this case unless
you start to test that certain parts of debugger UI fire just neceseary change.
However this issue probably does not solve how much functionality in debuger
will be covered by tests.
Comment 7 Martin Entlicher 2005-07-18 16:53:45 UTC
Created attachment 23143 [details]
The API change with updated Javadoc.
Comment 8 Martin Entlicher 2005-07-18 17:02:59 UTC
Thanks Radim for you comments.
I've added the missing Javadoc. The debug message in the impl. will not be
committed, of course...

There are not many tests for the viewmodel. :-( This change does not contain
tests, because there is no existing test for event firing that could be extended...
Comment 9 Martin Entlicher 2005-07-26 17:07:25 UTC
I'll commit this change shortly. There will be also a simple test for it. Other
tests that are in viewmodel module do not pass, since the event listeners are
attached multiple times. This needs to be solved separately.
Comment 10 Martin Entlicher 2005-07-26 17:36:49 UTC
Committed into trunk:

new revision: 1.10; previous revision: 1.9

new revision: 1.20; previous revision: 1.19

new revision: 1.7; previous revision: 1.6

/cvs/debuggercore/viewmodel/apichanges.xml,v  <--  apichanges.xml
new revision: 1.14; previous revision: 1.13

/cvs/debuggercore/viewmodel/,v  <--
new revision: 1.12; previous revision: 1.11

/cvs/debuggerjpda/nbproject/project.xml,v  <--  project.xml
new revision: 1.11; previous revision: 1.10

new revision: 1.37; previous revision: 1.36

new revision: 1.13; previous revision: 1.12

new revision: 1.21; previous revision: 1.20

new revision: 1.8; previous revision: 1.7

RCS file:
Checking in
initial revision: 1.1

new revision: 1.3; previous revision: 1.2

/cvs/debuggercore/viewmodel/src/org/netbeans/spi/viewmodel/,v  <--
new revision: 1.23; previous revision: 1.22
Comment 11 Quality Engineering 2010-04-29 09:23:22 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.