Bug 58489 - Define contract to pass hints to new project wizard panels
Define contract to pass hints to new project wizard panels
Status: RESOLVED FIXED
Product: projects
Classification: Unclassified
Component: Generic Projects UI
5.x
All All
: P2 (vote)
: 5.x
Assigned To: Petr Hrebejk
issues@projects
jihlava
: API, API_REVIEW
Depends on:
Blocks: 58486 54150
  Show dependency treegraph
 
Reported: 2005-05-02 15:16 UTC by _ pkuzel
Modified: 2005-09-05 10:10 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments
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
values.
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/ProjectUtilities.java#selectAndExpandProject
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/NewProject.java;
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/actions/NewProject.java,v
 <--  NewProject.java
new revision: 1.20; previous revision: 1.19
done
Checking in projectui/src/org/netbeans/modules/project/ui/actions/Actions.java;
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/actions/Actions.java,v
 <--  Actions.java
new revision: 1.21; previous revision: 1.20
done
Checking in projectuiapi/apichanges.xml;
/cvs/projects/projectuiapi/apichanges.xml,v  <--  apichanges.xml
new revision: 1.10; previous revision: 1.9
done
Checking in projectuiapi/src/org/netbeans/modules/project/uiapi/ActionsFactory.java;
/cvs/projects/projectuiapi/src/org/netbeans/modules/project/uiapi/ActionsFactory.java,v
 <--  ActionsFactory.java
new revision: 1.7; previous revision: 1.6
done
Checking in
projectuiapi/src/org/netbeans/spi/project/ui/templates/support/Templates.java;
/cvs/projects/projectuiapi/src/org/netbeans/spi/project/ui/templates/support/Templates.java,v
 <--  Templates.java
new revision: 1.13; previous revision: 1.12
done
Checking in
projectuiapi/src/org/netbeans/spi/project/ui/support/CommonProjectActions.java;
/cvs/projects/projectuiapi/src/org/netbeans/spi/project/ui/support/CommonProjectActions.java,v
 <--  CommonProjectActions.java
new revision: 1.7; previous revision: 1.6
done
Checking in projectuiapi/nbproject/project.properties;
/cvs/projects/projectuiapi/nbproject/project.properties,v  <--  project.properties
new revision: 1.9; previous revision: 1.8
done
RCS file:
/cvs/projects/projectuiapi/test/unit/src/org/netbeans/spi/project/ui/support/CommonProjectActionsTest.java,v
done
Checking in
projectuiapi/test/unit/src/org/netbeans/spi/project/ui/support/CommonProjectActionsTest.java;
/cvs/projects/projectuiapi/test/unit/src/org/netbeans/spi/project/ui/support/CommonProjectActionsTest.java,v
 <--  CommonProjectActionsTest.java
initial revision: 1.1
done
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.


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