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 210840 - Navigator GUI View Switches to Source Member View if Triple Click on Container
Summary: Navigator GUI View Switches to Source Member View if Triple Click on Container
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Navigator (show other bugs)
Version: 7.2
Hardware: PC Windows Vista
: P3 normal (vote)
Assignee: Jan Peska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-06 22:05 UTC by MackSix
Modified: 2012-04-12 09:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MackSix 2012-04-06 22:05:04 UTC
If a Form is open in GUI Editor and I triple click (double click with 1 extra click) on a component in the Navigator on a Container, it causes the Navigator to switch to Source Member View. 

Expected Result: GUI Editor View stays in Navigator.

Workaround: Click on Container in Design View and Navigator switches back to GUI view.

Product Version: NetBeans IDE Dev (Build 201204060400)
Java: 1.7.0_03; Java HotSpot(TM) Client VM 22.1-b02
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
Comment 1 Jan Stola 2012-04-10 16:55:01 UTC
The root of this problem seems to be in an asynchronous update of Navigator:

Double-click on the node in Navigator invokes Design This Container action that results in an activation of GUI Designer's window. Change of the active window starts update process of Navigator. The update of Navigator is not immediate, it is postponed to coalesce events. See, NavigatorController.resultChanged().

Unfortunately, when the postponed update is performed then GUI Builder's window is no longer active because the third click of the triple-click activates back the Navigator. Hence, the correct NavigatorPanel is not found in the actionsGlobalContext and NavigatorPanel that corresponds to MIME type of the primary file of the selected node is used. See, NavigatorController.obtainProviders().

Note that you can experiment easily with this behaviour if you increase NavigatorController.COALESCE_TIME. If you set it to 1000 then you obtain an incorrect content in Navigator just using the following steps:

0. Create a new JFrame and have [JFrame] node selected in Navigator.
1. Click into GUI Designer.
2. Click back on [JFrame] node in Navigator
   => Navigator shows incorrect content if you were fast enough.

I am reassigning this issue to Navigator for evaluation.
Comment 2 Jan Peska 2012-04-11 12:31:37 UTC
fix: http://hg.netbeans.org/core-main/rev/95bc4de94170
Comment 3 Quality Engineering 2012-04-12 09:59:48 UTC
Integrated into 'main-golden', will be available in build *201204120400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/95bc4de94170
User: Jan Peska <JPESKA@netbeans.org>
Log: Issue #210840 - Navigator GUI View Switches to Source Member View if Triple Click on Container
Save action global context before release AWT in resultChanged method. It could be changed during COALESCE_TIME (waiting time) and it affects obtained providers. So it is needed to work with action global context from time when the event appered, not when the navigator was updated.