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 95049 - create API to allow customizer categories to communicate among themselves and share data structures
Summary: create API to allow customizer categories to communicate among themselves and...
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 6.x
Hardware: All Linux
: P3 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on: 90562
Blocks:
  Show dependency tree
 
Reported: 2007-02-09 10:06 UTC by Milos Kleint
Modified: 2008-10-20 08:51 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milos Kleint 2007-02-09 10:06:18 UTC
see #90562 for details.

Y01 I'd like to eliminate the TODO that is part of following change:
+            InstanceContent ic = new InstanceContent();
+            Lookup context = new AbstractLookup(ic);
+            ic.add(project);
+            ic.add(project.getLookup().lookup(ProjectAccessor.class));
+            ic.add(project.getLookup().lookup(AuxiliaryConfiguration.class));
+            //TODO replace with generic apis..
+            ic.add(ic);
+            
+            OptionListener listener = new OptionListener( project );
+            dialog = 
ProjectCustomizer.createCustomizerDialog(CUSTOMIZER_FOLDER_PATH, context, 
null, listener, null );

I really do not like the reuse of InstanceContent as an API. It was never 
meant to be an API - it is just a helper support class. The API is Lookup, the 
SPI (and support) is Lookups, ProxyLookup, AbstractLookup, 
AbstractLookup.Content, InstanceContent, etc. That is why I'd like to find 
another way how to share data among individual panels. 

Imho, having such API would potentially be useful everywhere, not just in 
freefrom friend API and that is why I'd like to propose following changes:
#1: allow a Category to have associated lookup - that means adding new factory 
method in the Category class. The lookup might or might not be used, depending 
on the usage of the Category.
#2: However is the Category is used from 
ProjectCustomizer.createCustomizerDialog, it would be guaranteed that the 
content of the lookup is going to be added to the lookup passed back to the 
ProjectCustomizer.CompositeCategoryProvider.createComponent's lookup.
Imho this is similar pattern used in Tools/Options where each panel can donate 
a context and gets context merged from all others back.
Comment 1 Milos Kleint 2007-03-13 16:01:18 UTC
-> M9 I guess
Comment 2 Jiri Prox 2007-09-17 21:28:51 UTC
Obsolete milestone, please reevaluate
Comment 3 Milos Kleint 2008-10-20 08:51:55 UTC
the project type shall be primarily responsible for ensuring a proper environment where all panels can coexist and
communicate. No generic API is needed as far as I'm concerned.