Bug 178143 - Need a way to launch the Dali wizard using programmatically using API
Summary: Need a way to launch the Dali wizard using programmatically using API
Status: NEW
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Neil Hauge CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2007-03-19 16:56 EDT by Chris Jaun CLA
Modified: 2011-07-01 16:26 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Jaun CLA 2007-03-19 16:56:16 EDT
It would be nice to have something like the execute method in GenerateEntitiesAction be public. Could there be a method added that accepts a project and shell and then launches the Dali wizard?

GenerateEntitiesAction.launchWizard(IJpaProject project, Shell shell){}

I'm trying to find a good way to launch the wizard programmatically, but it seems most methods are currently protected and requires an IWorkbenchPart to launch.
Comment 1 Chris Jaun CLA 2007-04-30 17:58:29 EDT
To follow up on this a bit...

If the Dali wizard is launched programmatically then the field "currentSelection" in the class ProjectAction remains null because nothing was selected from the project explorer.

This doesn't cause too much of a problem except when there are multiple projects in the workspace. The currentSelection is used to help populate the Source folder field in the Generate Entities from Tables page.

IJavaElement jelem= getInitialJavaElement(selection);

This line in GenerateEntitiesWizardPage will return null if there are multiple projects in the workspace(it works when there is one because it picks that as a default)which leads to the source field not having a default value. If the user finishes while leaving this field blank (there is currently no validation https://bugs.eclipse.org/bugs/show_bug.cgi?id=184795) then the wizard fails and nothing is generated.

It'd be helpful if at some point we were able to pass the project we want to use into the wizard directly.
Comment 2 Neil Hauge CLA 2011-07-01 16:26:37 EDT
Moving JPA specific bugs to new JPA component in bugzilla.