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 53918 - Make an API for creating and opening projects
Summary: Make an API for creating and opening projects
Status: RESOLVED WORKSFORME
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Petr Hrebejk
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2005-01-24 23:43 UTC by Peter Zavadsky
Modified: 2005-02-07 16:12 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Zavadsky 2005-01-24 23:43:01 UTC
Could you make packages
"org.netbeans.modules.project.ui" and
"org.netbeans.modules.project.ui.actions" public?
We use some classes to manipulate opening projects
from welcome window, or is it possible to provide
an API for that kind of task?
Comment 1 Jesse Glick 2005-01-28 02:21:37 UTC
These packages will certainly not be made public. Please reopen with
details of what it is you want, in precise terms; preferably one issue
per distinct item. Also please compare to the manipulations already
done by NB's welcome window and describe how your needs differ.
Comment 2 Peter Zavadsky 2005-01-28 18:48:35 UTC
OK, I am changing the summary too. Here are try to put the details.

What we do currently:

There are used following methods:
OpenProjectList#fileToProject,
OpenProjectList#open,
OpenProjectList#setMainProject,

also we call this:
actions.NewProject.performAction,
actions.OpenProject.performAction,
this action usage is a clear hack, but we'd need some API to get what
the open and new project actions do.


In sum:

We'd need to have an API, whic allows to create and open projects
programatically, not only via UI.
In our case we need to put this kind of functionality in our welcome
screen.
Comment 3 Petr Hrebejk 2005-02-07 16:12:08 UTC
For OpenProjectList#open use: 
org.netbeans.api.project.ui.OpenProjects.open(...) 

For OpenProjectList#fileToProject use:
ProjectManager.getDefault().findProject(fo);

For opening the new project wizard with preselected template:
see the hack in the ide/welcome screen e.g.
org.netbeans.modules.welcome.ui.TitlePanel.performAction( String key )

OpenProjectList#setMainProject:
Not supported API. We may or may not add it (unlikely for 4.1). If we
do not add it the reccomended hack would be: call
org.netbeans.spi.project.ui.support.CommonProjectActions.setAsMainProjectAction()
cast the action to NodeAction, and call performAction( Node[]) with a
node which has the future main project in it's lookup. 

Closing this issue as works for me. Creating new issue #54637 for set
main project API.