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 203308 - no DataObject in lookup of MVCTC
Summary: no DataObject in lookup of MVCTC
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 7.0
Hardware: Macintosh Mac OS X
: P2 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-07 14:26 UTC by Tomas Stupka
Modified: 2011-11-14 15:44 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
test (7.11 KB, text/plain)
2011-10-31 18:01 UTC, Tomas Stupka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Stupka 2011-10-07 14:26:22 UTC
Product Version = NetBeans IDE Dev (Build 20111007-b3664ef5103c)
Operating System = Mac OS X version 10.6.8 running on x86_64
Java; VM; Vendor = 1.6.0_26
Runtime = Java HotSpot(TM) 64-Bit Server VM 20.1-b02-384

1.) register a listener via TopComponent.getRegistry().addPCL() and listen for TopComponent.Registry.PROP_TC_OPENED 

2.) open a file with a MV editor in the IDE (e.g. .java) - the event will be fired, and there will be a DataObject in the TCs lookup 

3.) open another file with a MV editor in the IDE - the event will be fired, but:
- there _won't_ be a DataObject in the TCs lookup
- calls like e.g. TC.getDisplayName() return null
- applies also for all following MV files being opened.

4.) close all files, open another (not yet opened) MV file - DO will be present in the lookup

with other words -  a MVCTC lookup contains a DataObject in it's lookup on PROP_TC_OPENED only if it there is no file opened in the moment.
Comment 1 Jaroslav Tulach 2011-10-25 05:53:50 UTC
Don't you want to turn your instructions to unit test?
Comment 2 Tomas Stupka 2011-10-31 18:01:01 UTC
Created attachment 112617 [details]
test
Comment 3 Tomas Stupka 2011-10-31 18:01:11 UTC
see testNoDOInLookup in attached file. While i wasn't able to reproduce the reported scenario, the test consistently behaves like: 
- first opened TC - no DO in lookup
- next opened TC 
      - DO in lookup in case the previous TC was closed
      - or DO not in lookup in case the previous TC wasn't closed


anyway - the question here is if it is ok, that a there is no usefull data in a TC lookup in the moment the PROP_TC_OPENED is fired. feel free to close in case you think it is.
Comment 4 Jaroslav Tulach 2011-11-10 22:45:36 UTC
ergonomics#bce2273f2168
Comment 5 Quality Engineering 2011-11-14 15:44:33 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/bce2273f2168
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #203308: Make sure MultiView component lookup is always populated with one of the elements.