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 58489 - Define contract to pass hints to new project wizard panels
Summary: Define contract to pass hints to new project wizard panels
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Projects UI (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Petr Hrebejk
Depends on:
Blocks: 58486 54150
  Show dependency tree
Reported: 2005-05-02 15:16 UTC by _ pkuzel
Modified: 2005-09-05 10:10 UTC (History)
3 users (show)

See Also:
Exception Reporter:

Proposed solution (907 bytes, patch)
2005-05-02 15:19 UTC, _ pkuzel
Details | Diff
Proposed CommonProjectActions API change (1.27 KB, patch)
2005-05-02 16:40 UTC, _ pkuzel
Details | Diff
To be commited soon... (8.02 KB, patch)
2005-05-16 16:05 UTC, _ pkuzel
Details | Diff
Consistency: FileObject and Templates utilized. (9.86 KB, patch)
2005-05-16 16:36 UTC, _ pkuzel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ pkuzel 2005-05-02 15:16:38 UTC
I have a case where I need to pass default directory to wizard panel choosers
for unknown project types (see issue #58486). 

Initiator (Checkout wizard) holds Swing Action (it's NewProject but it does not
know it).

Target (all relevant project type panels) that have access to WizadrDecriptor.

My prototype implementation simply joins initiator and target via action
(get/setValue carry hints).
Comment 1 _ pkuzel 2005-05-02 15:18:09 UTC
It needs to be addressed till 4.2. 
Comment 2 _ pkuzel 2005-05-02 15:19:32 UTC
Created attachment 21935 [details]
Proposed solution
Comment 3 _ pkuzel 2005-05-02 15:25:27 UTC
See issue #58486 that contains example J2SE target panel patch.
"EXISTING_SOURCES_CURRENT_DIRECTORY" keyed value is passed to the panel.

"EXISTING_SOURCES_CURRENT_DIRECTORY" key must be defined sepately from CVS and
project types.
Comment 4 _ pkuzel 2005-05-02 16:02:47 UTC
Well there ia another missing contract. It's not possible to invoke New Project
wizard without using refrection. There are also undocumented PRESELECT_* action
Comment 5 _ pkuzel 2005-05-02 16:21:41 UTC
Finally I'd appreciate CommonProjectActions.selectProject(Project). Currenly 
have copy&paste impl from project/ui/
Comment 6 _ pkuzel 2005-05-02 16:40:09 UTC
Created attachment 21939 [details]
Proposed CommonProjectActions API change
Comment 7 Jaroslav Tulach 2005-05-09 12:31:19 UTC
Does the currently proposed solution rely on the newProjectAction method to 
return always the same instance? And where is the change in the code to honor 
that property? Is there any test to verify that it really works? Moreover the 
name of the property shall probably reflect its content... 
Imho there could be better solution (also from UI point of view) if there was 
a new query: FileObject RecentlLocationsQuery.getSourceDirectory() that would 
delegate to all implementation registered in lookup. Every wizard could then 
use it to find its initial directory. [but this is just an idea anyway]. 
Comment 8 _ pkuzel 2005-05-16 15:49:39 UTC
Yarda thank you for review, there was one interesting point. The
newProjectAction() method must always return new instance to avoid action
properties sharing among independent callers. It's covered by new test.

Otherwise I'll follow original property based idea suggested by phrebejk. It's
simpler than Templates, ContextAwareAtcion, ... approach.
Comment 9 _ pkuzel 2005-05-16 16:05:30 UTC
Created attachment 22149 [details]
To be commited soon...
Comment 10 _ pkuzel 2005-05-16 16:36:42 UTC
Created attachment 22151 [details]
Consistency: FileObject and Templates utilized.
Comment 11 _ pkuzel 2005-05-17 11:06:28 UTC
Checking in projectui/src/org/netbeans/modules/project/ui/actions/;
new revision: 1.20; previous revision: 1.19
Checking in projectui/src/org/netbeans/modules/project/ui/actions/;
new revision: 1.21; previous revision: 1.20
Checking in projectuiapi/apichanges.xml;
/cvs/projects/projectuiapi/apichanges.xml,v  <--  apichanges.xml
new revision: 1.10; previous revision: 1.9
Checking in projectuiapi/src/org/netbeans/modules/project/uiapi/;
new revision: 1.7; previous revision: 1.6
Checking in
new revision: 1.13; previous revision: 1.12
Checking in
new revision: 1.7; previous revision: 1.6
Checking in projectuiapi/nbproject/;
/cvs/projects/projectuiapi/nbproject/,v  <--
new revision: 1.9; previous revision: 1.8
RCS file:
Checking in
initial revision: 1.1
Comment 12 Jesse Glick 2005-05-17 14:47:59 UTC
I also sent some comments to the CVS list after the commit. In particular, one
method name is broken in the last patch.