Author: dgolovin
Date: 2007-09-12 05:59:29 -0400 (Wed, 12 Sep 2007)
New Revision: 3580
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/build.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencePage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectSelectionDialog.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-825
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/build.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/build.properties 2007-09-12 09:59:21 UTC
(rev 3579)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/build.properties 2007-09-12 09:59:29 UTC
(rev 3580)
@@ -5,10 +5,12 @@
META-INF/,\
.,\
icons/,\
- resources/
+ resources/,\
+ about.html
src.includes = resources/,\
plugin.xml,\
src/,\
icons/,\
build.properties,\
- META-INF/
+ META-INF/,\
+ about.html
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-09-12 09:59:21 UTC (rev
3579)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-09-12 09:59:29 UTC (rev
3580)
@@ -11,9 +11,11 @@
<wizard
category="org.jboss.tools.seam.ui"
class="org.jboss.tools.seam.ui.wizard.SeamProjectWizard"
+ finalPerspective="org.jboss.tools.seam.ui.SeamPerspective"
icon="icons/view/seam_project_new.gif"
id="org.jboss.tools.seam.ui.wizards.SeamProjectWizard"
name="Seam Web Project"
+ preferredPerspectives="org.jboss.tools.seam.ui.SeamPerspective"
project="true">
<description>
Create a Seam Web Project
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-09-12
09:59:21 UTC (rev 3579)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-09-12
09:59:29 UTC (rev 3580)
@@ -88,7 +88,7 @@
DataModelValidatorDelegate validatorDelegate;
IFieldEditor jBossSeamHomeEditor = IFieldEditorFactory.INSTANCE
- .createComboWithButton(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME,
+ .createComboWithButton(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,
"Seam Runtime", getRuntimeNames(),
SeamRuntimeManager.getInstance().getDefaultRuntime().getName(), true, new
NewSeamRuntimeAction(), (IValidator)null);
// IFieldEditor jBossSeamHomeEditor = IFieldEditorFactory.INSTANCE
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencePage.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencePage.java 2007-09-12
09:59:21 UTC (rev 3579)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencePage.java 2007-09-12
09:59:29 UTC (rev 3580)
@@ -46,7 +46,7 @@
*
*/
SeamRuntimeListFieldEditor seamRuntimes
- = new SeamRuntimeListFieldEditor("rtlist","Runtime List",new
ArrayList<SeamRuntime>(Arrays.asList(SeamRuntimeManager.getInstance().getRuntimes())));
+ = new SeamRuntimeListFieldEditor("rtlist","Seam Runtimes",new
ArrayList<SeamRuntime>(Arrays.asList(SeamRuntimeManager.getInstance().getRuntimes())));
SeamRuntime initialDefault;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java 2007-09-12
09:59:21 UTC (rev 3579)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java 2007-09-12
09:59:29 UTC (rev 3580)
@@ -38,6 +38,9 @@
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.project.facet.SeamFacetPreference;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.ui.SeamUIMessages;
/**
@@ -62,15 +65,21 @@
try {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType launchConfigurationType =
launchManager.getLaunchConfigurationType("org.hibernate.eclipse.launch.CodeGenerationLaunchConfigurationType");
- ILaunchConfigurationWorkingCopy wc = launchConfigurationType.newInstance(null,
"GenerateEntities");
+ ILaunchConfigurationType launchConfigurationType =
+ launchManager.getLaunchConfigurationType(
+ "org.hibernate.eclipse.launch.CodeGenerationLaunchConfigurationType");
+ ILaunchConfigurationWorkingCopy wc =
+ launchConfigurationType.newInstance(project, project.getName() +
"generate-entities");
//Main
- wc.setAttribute(HibernateLaunchConstants.ATTR_CONSOLE_CONFIGURATION_NAME,
params.get(IParameter.HIBERNATE_CONFIGURATION_NAME));
+ wc.setAttribute(
+ HibernateLaunchConstants.ATTR_CONSOLE_CONFIGURATION_NAME,
+ params.get(IParameter.HIBERNATE_CONFIGURATION_NAME));
IPath src = getSourceFolder(project);
if(src == null) {
- throw new CoreException(new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID,
"Source folder not found in project " + project.getName()));
+ throw new CoreException(
+ new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID, "Source folder not found
in project " + project.getName()));
}
wc.setAttribute(HibernateLaunchConstants.ATTR_OUTPUT_DIR, src.toString());
@@ -85,20 +94,27 @@
}
wc.setAttribute(HibernateLaunchConstants.ATTR_USE_OWN_TEMPLATES, true);
- String template = "" +
SeamFacetPreference.getStringPreference(SeamFacetPreference.SEAM_HOME_FOLDER) +
"/seam-gen/view";
-// wc.setAttribute(HibernateLaunchConstants.ATTR_ENABLE_TEMPLATE_DIR, true);
+ SeamRuntime seamRt = SeamRuntimeManager.getInstance().getDefaultRuntime();
+
+ String runtimeName = SeamCorePlugin.getSeamFacetPreferences(project)
+ .get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,"");
+
+ if(!"".equals(runtimeName)) {
+ seamRt = SeamRuntimeManager.getInstance().findRuntimeByName(runtimeName);
+ }
+
+ String template = "" + seamRt.getHomeDir() + "/seam-gen/view";
wc.setAttribute(HibernateLaunchConstants.ATTR_TEMPLATE_DIR, template);
- //Exporters
wc.setAttribute(HibernateLaunchConstants.ATTR_ENABLE_JDK5, true);
wc.setAttribute(HibernateLaunchConstants.ATTR_ENABLE_EJB3_ANNOTATIONS, true);
ExporterDefinition[] ds = ExtensionManager.findExporterDefinitions();
- if(ds != null) for (int i = 0; i < ds.length; i++) {
- wc.setAttribute(ds[i].getId(), true);
- }
+ wc.setAttribute("org.hibernate.tools.hbm2java", true);
- wc.launch("run", new NullProgressMonitor());
+ wc.doSave();
+ launchManager.addLaunch(wc.launch(ILaunchManager.RUN_MODE, monitor));
+
} catch (CoreException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectSelectionDialog.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectSelectionDialog.java 2007-09-12
09:59:21 UTC (rev 3579)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectSelectionDialog.java 2007-09-12
09:59:29 UTC (rev 3580)
@@ -25,6 +25,7 @@
import org.eclipse.ui.dialogs.ListDialog;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.project.facet.SeamFacetPreference;
import org.jboss.tools.seam.internal.core.SeamProject;
/**
@@ -47,7 +48,7 @@
ArrayList<IProject> seamProjects = new ArrayList<IProject>();
for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
try {
- if(project.hasNature(SeamProject.NATURE_ID)) {
+ if(project.hasNature(SeamProject.NATURE_ID) &&
SeamCorePlugin.getSeamFacetPreferences(project)!=null) {
seamProjects.add(project);
}
} catch (CoreException e) {