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.
Summary: | Define contract to pass hints to new project wizard panels | ||
---|---|---|---|
Product: | projects | Reporter: | _ pkuzel <pkuzel> |
Component: | Generic Projects UI | Assignee: | Petr Hrebejk <phrebejk> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | jchalupa, jrechtacek, jtulach |
Priority: | P2 | Keywords: | API, API_REVIEW |
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 58486, 54150 | ||
Attachments: |
Proposed solution
Proposed CommonProjectActions API change To be commited soon... Consistency: FileObject and Templates utilized. |
Description
_ pkuzel
2005-05-02 15:16:38 UTC
It needs to be addressed till 4.2. Created attachment 21935 [details]
Proposed solution
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. 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. Finally I'd appreciate CommonProjectActions.selectProject(Project). Currenly have copy&paste impl from project/ui/ProjectUtilities.java#selectAndExpandProject Created attachment 21939 [details]
Proposed CommonProjectActions API change
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]. 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. Created attachment 22149 [details]
To be commited soon...
Created attachment 22151 [details]
Consistency: FileObject and Templates utilized.
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 I also sent some comments to the CVS list after the commit. In particular, one method name is broken in the last patch. |