Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 198705 - Duplicated nodes in NavigatorTC's lookup
Duplicated nodes in NavigatorTC's lookup
Product: platform
Classification: Unclassified
Component: Navigator
All All
: P2 (vote)
: 7.1
Assigned To: Tomas Stupka
Depends on:
  Show dependency treegraph
Reported: 2011-05-18 13:53 UTC by Jan Stola
Modified: 2011-06-02 15:12 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Jan Stola 2011-05-18 13:53:11 UTC
Component Inspector of GUI Builder was removed/rewritten to use Navigator. Unfortunately, several actions don't work correctly now because of duplicated nodes in NavigatorTC's lookup. Consider, for example, the following test-case:

1. Create new JFrame form.
2. Insert JButton into the form.
3. Right-click on jButton1 in Navigator. Context menu is displayed.
   => some actions (Edit Text, Change Variable Name ...) are disabled,
   but should be enabled
   => some actions (Align, Same Size) are enabled, but should be disabled

Try to right-click on jButton1 in the designer area to see actions enabled/disabled correctly.

The root of the problem seems to be in lookup of NavigatorTC. It overrides getLookup() incorrectly. When you try to lookup Node.class in this lookup then you obtain the activated nodes two times (once from the default lookup and once from the navigator's panel lookup). This corrupts the logic of GUI Builder's actions that are enabled for single (or multiple) node selection only.

Suggested fix: Do not override getLookup() in NavigatorTC. Use TopComponent.associateLookup() instead, i.e., put something like the following code into the constructor of NavigatorTC:

    ProxyLookup lookup = new ProxyLookup(
Comment 1 Tomas Stupka 2011-05-18 14:02:40 UTC
a bug report just the way i like it!
Comment 2 Tomas Stupka 2011-05-19 13:41:59 UTC
Changeset: 41a61a4cf736
Author:    Tomas Stupka <>
Date:      2011-05-19 15:32
Issue #198705 - Duplicated nodes in NavigatorTC's lookup
Comment 3 Quality Engineering 2011-05-20 08:56:36 UTC
Integrated into 'main-golden', will be available in build *201105200400* on (upload may still be in progress)
User: Tomas Stupka <>
Log: Issue #198705 - Duplicated nodes in NavigatorTC's lookup

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo