This is follow-up of enh 97325, quoting:
"After discussion with David we have find a conclusion that for NetBeans Mobility
Pack it would be enough to have ability to disable searching for
NavigatorPanels in data-objects."
Actually, situation is as follows:
In Mobility several top components define their activated node as node
representing java data object -> so Navigator panels for java will appear in
Navigator -> but this is not desired, java navigation panels shouldn't be
visible. Moreover model used by Mobility top components is not propagated into
java data object model, resulting in incorrect (old) data shown in java
I propose following solution:
- add SPI interface NavigatorLookupContentType
- with method getContentType()
- and constants LOOKUP_HINTS_ONLY, DEFAULT
When instance of NavigatorLookupContentType is found in TopComponent's lookup
and method getContentType returns LOOKUP_HINTS_ONLY, then navigator panels
resulting from current activated node (and data object) will not appear in
navigator panel list.
I'll start API review soon when I'll have the materials ready.
I'm adding promised materials and starting API review. I just changed name of
new interface to NavigatorLookupPanelsPolicy to better reflect its purpose and
only constant LOOKUP_HINTS_ONLY, others are not needed now.
I'm filing this as fast track API review, but I must integrate on Monday next
week, there is business reason. So I'm going to break week's time rule, please
would you review today or tomorrow, change is trivial, thank you very much.
Created attachment 40825 [details]
diff of implementation and API documentation
The patch exactly covers requirements of Mobility Pack.
Small comment: the patch does not cover a situation when there are more
NavigatorLookupPanelsPolicy instances in the lookup. It should take the hardest
restriction of them all. It is ok in current implementation, since there is a
single restriction level only.
OK, that's for comment. I decided to not cover situation that david described,
it's edge case which is not needed AFAIK now. Javadoc says that this case is not
supported now, we can always add it later if there will be a need.
integrated into main trunk with all the tests and stuff around new API:
Checking in src/org/netbeans/modules/navigator/NavigatorController.java;
new revision: 1.19; previous revision: 1.18
Checking in src/org/netbeans/spi/navigator/NavigatorLookupPanelsPolicy.java;
initial revision: 1.1
Checking in apichanges.xml;
/cvs/core/navigator/apichanges.xml,v <-- apichanges.xml
new revision: 1.6; previous revision: 1.5
Checking in arch.xml;
/cvs/core/navigator/arch.xml,v <-- arch.xml
new revision: 1.13; previous revision: 1.12
new revision: 1.4; previous revision: 1.3
Checking in test/unit/src/org/netbeans/modules/navigator/NavigatorTCTest.java;
new revision: 1.9; previous revision: 1.8
new revision: 1.3; previous revision: 1.2