JBoss Tools SVN: r21463 - in trunk/seam/plugins: org.jboss.tools.seam.core/templates/ear and 12 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-04-14 07:17:42 -0400 (Wed, 14 Apr 2010)
New Revision: 21463
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/.project
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/.settings/org.eclipse.wst.common.component
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/EarContent/META-INF/application.xml
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.project
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.settings/org.eclipse.wst.common.component
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/EarContent/META-INF/application.xml
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/org.eclipse.wst.common.component
trunk/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2/.project
trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.project
trunk/seam/plugins/org.jboss.tools.seam.core/templates/war/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
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/messages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-2809
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java 2010-04-14 10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java 2010-04-14 11:17:42 UTC (rev 21463)
@@ -114,6 +114,10 @@
//File jbossBeansFile = new File(seamGenResFolder ,"META-INF/jboss-beans.xml"); //$NON-NLS-1$
FilterSet filterSet = new FilterSet();
filterSet.addFilter("projectName", seamWebProject.getName()); //$NON-NLS-1$
+ filterSet.addFilter("earProjectName", earProjectName); //$NON-NLS-1$
+ filterSet.addFilter("ejbProjectName", ejbProjectName); //$NON-NLS-1$
+ filterSet.addFilter("testProjectName", testProjectName); //$NON-NLS-1$
+
filterSet.addFilter("runtimeName", WtpUtils.getServerRuntimeName(seamWebProject)); //$NON-NLS-1$
filterSet.addFilter("webRootFolder",webRootVirtFolder.getUnderlyingFolder().getFullPath().removeFirstSegments(1).toString()); //$NON-NLS-1$
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2010-04-14 10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2010-04-14 11:17:42 UTC (rev 21463)
@@ -30,7 +30,6 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.jst.common.project.facet.JavaFacetUtils;
import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
@@ -120,11 +119,10 @@
this.model = model;
this.seamWebProject = seamWebProject;
- // Set default project names
- earProjectName = seamWebProject.getName() + "-ear";
- ejbProjectName = seamWebProject.getName() + "-ejb";
- testProjectName = seamWebProject.getName() + "-test";
-
+ earProjectName = model.getStringProperty(ISeamFacetDataModelProperties.SEAM_EAR_PROJECT);
+ ejbProjectName = model.getStringProperty(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT);
+ testProjectName = model.getStringProperty(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT);
+
seamRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME).toString());
if(seamRuntime==null) {
throw new RuntimeException("Can't get seam runtime " + model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME).toString());
@@ -180,6 +178,10 @@
ejbFilterSet = new FilterSet();
ejbFilterSet.addFilter("projectName", seamWebProject.getName()); //$NON-NLS-1$
+ ejbFilterSet.addFilter("earProjectName", earProjectName); //$NON-NLS-1$
+ ejbFilterSet.addFilter("ejbProjectName", ejbProjectName); //$NON-NLS-1$
+ ejbFilterSet.addFilter("testProjectName", testProjectName); //$NON-NLS-1$
+
ejbFilterSet.addFilter("runtimeName", WtpUtils.getServerRuntimeName(seamWebProject)); //$NON-NLS-1$
if (model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH) != null) {
File driver = new File(((String[]) model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH))[0]);
@@ -310,8 +312,6 @@
* Creates test project for given seam web project.
*/
protected boolean createTestProject() {
- model.setProperty(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT, testProjectName);
-
if(!(Boolean)model.getProperty(ISeamFacetDataModelProperties.TEST_PROJECT_CREATING))
return false;
@@ -326,6 +326,10 @@
File testSrcDir = new File(testProjectDir, "test-src"); //$NON-NLS-1$
FilterSet filterSet = new FilterSet();
filterSet.addFilter("projectName", seamWebProject.getName()); //$NON-NLS-1$
+ filterSet.addFilter("earProjectName", earProjectName); //$NON-NLS-1$
+ filterSet.addFilter("ejbProjectName", ejbProjectName); //$NON-NLS-1$
+ filterSet.addFilter("testProjectName", testProjectName); //$NON-NLS-1$
+
filterSet.addFilter("runtimeName", WtpUtils.getServerRuntimeName(seamWebProject)); //$NON-NLS-1$
filterSet.addFilter("webRootFolder", webRootVirtFolder.getUnderlyingFolder().getFullPath().removeFirstSegments(1).toString()); //$NON-NLS-1$
@@ -400,8 +404,6 @@
}
protected void createEjbProject() {
- model.setProperty(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT, ejbProjectName);
-
ejbProjectFolder.mkdir();
AntCopyUtils.copyFilesAndFolders(
@@ -439,6 +441,10 @@
FilterSet ejbFilterSet = new FilterSet();
ejbFilterSet.addFilter("projectName", ejbProjectFolder.getName()); //$NON-NLS-1$
+ ejbFilterSet.addFilter("earProjectName", earProjectName); //$NON-NLS-1$
+ ejbFilterSet.addFilter("ejbProjectName", ejbProjectName); //$NON-NLS-1$
+ ejbFilterSet.addFilter("testProjectName", testProjectName); //$NON-NLS-1$
+
ejbFilterSet.addFilter("connectionProfile", model.getStringProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE));//$NON-NLS-1$
@@ -459,14 +465,15 @@
}
protected void createEarProject() {
- model.setProperty(ISeamFacetDataModelProperties.SEAM_EAR_PROJECT, earProjectName);
-
earProjectFolder.mkdir();
File earContentsFolder = new File(earProjectFolder, "EarContent"); //$NON-NLS-1$
FilterSet earFilterSet = new FilterSet();
earFilterSet.addFilter("projectName", earProjectFolder.getName() + ".ear"); //$NON-NLS-1$ //$NON-NLS-2$
+ earFilterSet.addFilter("earProjectName", earProjectName); //$NON-NLS-1$
+ earFilterSet.addFilter("ejbProjectName", ejbProjectName); //$NON-NLS-1$
+ earFilterSet.addFilter("testProjectName", testProjectName); //$NON-NLS-1$
AntCopyUtils.copyFileToFolder(
new File(seamGenResFolder, "META-INF/jboss-app.xml"), //$NON-NLS-1$
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.project 2010-04-14 10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.project 2010-04-14 11:17:42 UTC (rev 21463)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>@projectName@-ear</name>
+ <name>@earProjectName@</name>
<comment></comment>
<projects>
- <project>@projectName@-ejb</project>
+ <project>@ejbProjectName@</project>
<project>@projectName@</project>
</projects>
<buildSpec>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.settings/org.eclipse.wst.common.component 2010-04-14 10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.settings/org.eclipse.wst.common.component 2010-04-14 11:17:42 UTC (rev 21463)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
-<wb-module deploy-name="@projectName@-ear">
+<wb-module deploy-name="@earProjectName@">
<wb-resource deploy-path="/" source-path="/EarContent"/>
-<dependent-module deploy-path="/" handle="module:/resource/@projectName@-ejb/@projectName@-ejb">
+<dependent-module deploy-path="/" handle="module:/resource/@ejbProjectName@/@ejbProjectName@">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module deploy-path="/" handle="module:/resource/@projectName@/@projectName@">
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/EarContent/META-INF/application.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/EarContent/META-INF/application.xml 2010-04-14 10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/EarContent/META-INF/application.xml 2010-04-14 11:17:42 UTC (rev 21463)
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
version="5">
- <display-name>@projectName@-ear</display-name>
+ <display-name>@earProjectName@</display-name>
<!-- JBIDE-4166 Workaround - Make sure we deploy this first, since this is referenced in xxx-ejb.jar-->
<module>
@@ -19,7 +19,7 @@
</module>
<module>
- <ejb>@projectName(a)-ejb.jar</ejb>
+ <ejb>@ejbProjectName@.jar</ejb>
</module>
</application>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/.project 2010-04-14 10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/.project 2010-04-14 11:17:42 UTC (rev 21463)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>@projectName@-ear</name>
+ <name>@earProjectName@</name>
<comment></comment>
<projects>
- <project>@projectName@-ejb</project>
+ <project>@ejbProjectName@</project>
<project>@projectName@</project>
</projects>
<buildSpec>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/.settings/org.eclipse.wst.common.component 2010-04-14 10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/.settings/org.eclipse.wst.common.component 2010-04-14 11:17:42 UTC (rev 21463)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
-<wb-module deploy-name="@projectName@-ear">
+<wb-module deploy-name="@earProjectName@">
<wb-resource deploy-path="/" source-path="/EarContent"/>
-<dependent-module deploy-path="/" handle="module:/resource/@projectName@-ejb/@projectName@-ejb">
+<dependent-module deploy-path="/" handle="module:/resource/@ejbProjectName@/@ejbProjectName@">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module deploy-path="/" handle="module:/resource/@projectName@/@projectName@">
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/EarContent/META-INF/application.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/EarContent/META-INF/application.xml 2010-04-14 10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear-seam2/EarContent/META-INF/application.xml 2010-04-14 11:17:42 UTC (rev 21463)
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
version="5">
- <display-name>@projectName@-ear</display-name>
+ <display-name>@earProjectName@</display-name>
<!-- JBIDE-4166 Workaround - Make sure we deploy this first, since this is referenced in xxx-ejb.jar-->
<module>
@@ -19,7 +19,7 @@
</module>
<module>
- <ejb>@projectName(a)-ejb.jar</ejb>
+ <ejb>@ejbProjectName@.jar</ejb>
</module>
</application>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project 2010-04-14 10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project 2010-04-14 11:17:42 UTC (rev 21463)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>@projectName@-ejb</name>
+ <name>@ejbProjectName@</name>
<comment></comment>
<projects>
</projects>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/org.eclipse.wst.common.component 2010-04-14 10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.settings/org.eclipse.wst.common.component 2010-04-14 11:17:42 UTC (rev 21463)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
-<wb-module deploy-name="@projectName@-ejb">
+<wb-module deploy-name="@ejbProjectName@">
<wb-resource deploy-path="/" source-path="/ejbModule"/>
<property name="java-output-path" value="build/classes"/>
</wb-module>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.project 2010-04-14 10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/test/.project 2010-04-14 11:17:42 UTC (rev 21463)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>@projectName@-test</name>
+ <name>@testProjectName@</name>
<comment></comment>
<projects>
</projects>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2/.project 2010-04-14 10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/test-seam2/.project 2010-04-14 11:17:42 UTC (rev 21463)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>@projectName@-test</name>
+ <name>@testProjectName@</name>
<comment></comment>
<projects>
</projects>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/war/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/war/META-INF/MANIFEST.MF 2010-04-14 10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/war/META-INF/MANIFEST.MF 2010-04-14 11:17:42 UTC (rev 21463)
@@ -1,3 +1,3 @@
Manifest-Version: 1.0
-Class-Path: @projectName(a)-ejb.jar
+Class-Path: @ejbProjectName@.jar
@earLibs@
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2010-04-14 10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2010-04-14 11:17:42 UTC (rev 21463)
@@ -108,6 +108,12 @@
public static String SEAM_INSTALL_WIZARD_PAGE_DB_TABLES_ALREADY_EXISTS;
public static String SEAM_INSTALL_WIZARD_PAGE_DEPLOY_AS;
+
+ public static String SEAM_INSTALL_WIZARD_PAGE_EJB_PROJECT_NAME;
+
+ public static String SEAM_INSTALL_WIZARD_PAGE_EAR_PROJECT_NAME;
+
+ public static String SEAM_INSTALL_WIZARD_PAGE_TEST_PROJECT_NAME;
public static String SEAM_INSTALL_WIZARD_PAGE_EDIT;
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 2010-04-14 10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2010-04-14 11:17:42 UTC (rev 21463)
@@ -97,7 +97,19 @@
private DataModelValidatorDelegate validatorDelegate;
private IFieldEditor jBossSeamHomeEditor;
+
+ private IFieldEditor ejbProjectNameditor = IFieldEditorFactory.INSTANCE
+ .createTextEditor(
+ ISeamFacetDataModelProperties.SEAM_EJB_PROJECT,
+ SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_EJB_PROJECT_NAME,
+ ""); //$NON-NLS-1$
+ private IFieldEditor earProjectNameditor = IFieldEditorFactory.INSTANCE
+ .createTextEditor(
+ ISeamFacetDataModelProperties.SEAM_EAR_PROJECT,
+ SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_EAR_PROJECT_NAME,
+ ""); //$NON-NLS-1$
+
private IFieldEditor jBossAsDeployAsEditor = IFieldEditorFactory.INSTANCE
.createRadioEditor(
ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS,
@@ -142,6 +154,12 @@
ISeamFacetDataModelProperties.TEST_PROJECT_CREATING,
SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_CREATE_TEST_PROJECT,
true);
+
+ private IFieldEditor testProjectNameditor = IFieldEditorFactory.INSTANCE
+ .createTextEditor(
+ ISeamFacetDataModelProperties.SEAM_TEST_PROJECT,
+ SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_TEST_PROJECT_NAME,
+ ""); //$NON-NLS-1$
private IFieldEditor testsPkgNameditor = IFieldEditorFactory.INSTANCE
.createTextEditor(
@@ -292,7 +310,7 @@
SeamCorePlugin.getDefault().getPluginPreferences().setValue(
SeamProjectPreferences.JBOSS_AS_DEFAULT_DEPLOY_AS,
- this.jBossAsDeployAsEditor.getValueAsString());
+ this.jBossAsDeployAsEditor.getValueAsString());
}
/*
@@ -387,6 +405,18 @@
generalGroup.setLayout(gridLayout);
registerEditor(jBossSeamHomeEditor, generalGroup, 3);
registerEditor(jBossAsDeployAsEditor, generalGroup, 3);
+ registerEditor(ejbProjectNameditor, generalGroup, 3);
+ ejbProjectNameditor.setEnabled(getDeployAsDefaultValue().equals(ISeamFacetDataModelProperties.DEPLOY_AS_EAR));
+ registerEditor(earProjectNameditor, generalGroup, 3);
+ earProjectNameditor.setEnabled(getDeployAsDefaultValue().equals(ISeamFacetDataModelProperties.DEPLOY_AS_EAR));
+
+ jBossAsDeployAsEditor.addPropertyChangeListener(new PropertyChangeListener(){
+ public void propertyChange(PropertyChangeEvent arg0) {
+ Boolean value = jBossAsDeployAsEditor.getValue() == ISeamFacetDataModelProperties.DEPLOY_AS_EAR;
+ ejbProjectNameditor.setEnabled(value.booleanValue());
+ earProjectNameditor.setEnabled(value.booleanValue());
+ }
+ });
gd = new GridData();
gd.horizontalSpan = 1;
@@ -429,11 +459,13 @@
public void propertyChange(PropertyChangeEvent arg0) {
Boolean value = (Boolean)createTestProjectCheckboxeditor.getValue();
testsPkgNameditor.setEnabled(value.booleanValue());
+ testProjectNameditor.setEnabled(value.booleanValue());
}
});
createTestProjectCheckboxeditor.setEnabled(isNewProjectWizard());
+ registerEditor(testProjectNameditor, generationGroup, 3);
registerEditor(testsPkgNameditor, generationGroup, 3);
setControl(root);
@@ -462,6 +494,19 @@
validatorDelegate.addValidatorForProperty(
ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS,
getDeploymentTypeValidator(getWizard()));
+
+ validatorDelegate.addValidatorForProperty(
+ ISeamFacetDataModelProperties.SEAM_EAR_PROJECT,
+ new ProjectNamesDuplicationValidator(
+ ISeamFacetDataModelProperties.SEAM_EAR_PROJECT));
+ validatorDelegate.addValidatorForProperty(
+ ISeamFacetDataModelProperties.SEAM_EJB_PROJECT,
+ new ProjectNamesDuplicationValidator(
+ ISeamFacetDataModelProperties.SEAM_EJB_PROJECT));
+ validatorDelegate.addValidatorForProperty(
+ ISeamFacetDataModelProperties.SEAM_TEST_PROJECT,
+ new ProjectNamesDuplicationValidator(
+ ISeamFacetDataModelProperties.SEAM_TEST_PROJECT));
}
@@ -591,6 +636,16 @@
model.setStringProperty(
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME,
getTestPkgName(p));
+ model.setStringProperty(
+ ISeamFacetDataModelProperties.SEAM_EAR_PROJECT,
+ earProjectNameditor.getValueAsString());
+ model.setStringProperty(
+ ISeamFacetDataModelProperties.SEAM_EJB_PROJECT,
+ ejbProjectNameditor.getValueAsString());
+ model.setStringProperty(
+ ISeamFacetDataModelProperties.SEAM_TEST_PROJECT,
+ testProjectNameditor.getValueAsString());
+
}
}
@@ -636,6 +691,9 @@
sessionBeanPkgNameditor.setValue(getSessionPkgName(p));
entityBeanPkgNameditor.setValue(getEntityPkgName(p));
testsPkgNameditor.setValue(getTestPkgName(p));
+ ejbProjectNameditor.setValue(getEJBProjectName(p));
+ earProjectNameditor.setValue(getEARProjectName(p));
+ testProjectNameditor.setValue(getTestProjectName(p));
}
private String getSessionPkgName(String projectName) {
@@ -652,6 +710,18 @@
return "org.domain." //$NON-NLS-1$
+ SeamUtil.getSeamPackageName(projectName) + ".test"; //$NON-NLS-1$
}
+
+ private String getEJBProjectName(String projectName) {
+ return projectName + "-ejb"; //$NON-NLS-1$
+ }
+
+ private String getEARProjectName(String projectName) {
+ return projectName + "-ear"; //$NON-NLS-1$
+ }
+
+ private String getTestProjectName(String projectName) {
+ return projectName + "-test"; //$NON-NLS-1$
+ }
/*
* Sets seam runtime field in default value.
@@ -747,23 +817,28 @@
* @see IValidator#validate(Object, Object)
*/
public Map<String, IStatus> validate(Object value, Object context) {
- final String projectName = (String) value;
final String deployAs = model
.getStringProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS);
+
+ final boolean testCreating = (Boolean)model.getProperty(ISeamFacetDataModelProperties.TEST_PROJECT_CREATING);
- final String testProjectName = projectName + "-test"; //$NON-NLS-1$
- IStatus status = ProjectCreationDataModelProviderNew
- .validateName(testProjectName);
+ IStatus status;
- if (((IStatus.ERROR | IStatus.WARNING) & status.getSeverity() ) != 0 ){
- return doPackStatus(status,
- propertyName,
- NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_TEST_PROJECT_ALREADY_EXISTS,
- testProjectName));
+ if (testCreating) {
+ final String testProjectName = testProjectNameditor.getValueAsString();
+ status = ProjectCreationDataModelProviderNew
+ .validateName(testProjectName);
+
+ if (((IStatus.ERROR | IStatus.WARNING) & status.getSeverity() ) != 0 ){
+ return doPackStatus(status,
+ propertyName,
+ NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_TEST_PROJECT_ALREADY_EXISTS,
+ testProjectName));
+ }
}
if (ISeamFacetDataModelProperties.DEPLOY_AS_EAR.equals(deployAs)) {
- final String earProjectName = projectName + "-ear"; //$NON-NLS-1$
+ final String earProjectName = earProjectNameditor.getValueAsString();
status = ProjectCreationDataModelProviderNew
.validateName(earProjectName);
@@ -774,7 +849,7 @@
earProjectName));
}
- final String ejbProjectName = projectName + "-ejb"; //$NON-NLS-1$
+ final String ejbProjectName = ejbProjectNameditor.getValueAsString();
status = ProjectCreationDataModelProviderNew
.validateName(ejbProjectName);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2010-04-14 10:06:37 UTC (rev 21462)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2010-04-14 11:17:42 UTC (rev 21463)
@@ -14,6 +14,9 @@
SEAM_PROJECT_WIZARD_CREATE_STANDALONE_SEAM_WEB_PROJECT=Create standalone Seam Web Project
SEAM_INSTALL_WIZARD_PAGE_SEAM_RUNTIME=Seam Runtime:
SEAM_INSTALL_WIZARD_PAGE_DEPLOY_AS=Deploy as:
+SEAM_INSTALL_WIZARD_PAGE_EJB_PROJECT_NAME=EJB project name:
+SEAM_INSTALL_WIZARD_PAGE_EAR_PROJECT_NAME=EAR project name:
+SEAM_INSTALL_WIZARD_PAGE_TEST_PROJECT_NAME=Test project name:
SEAM_VIEW_LAYOUT_ACTION_GROUP_FLAT=Flat
SEAM_VIEW_LAYOUT_ACTION_GROUP_NODE=Node
SEAM_INSTALL_WIZARD_PAGE_CONNECTION_PROFILE=Connection profile:
14 years, 9 months
JBoss Tools SVN: r21462 - branches/jbosstools-3.1.x/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-04-14 06:06:37 -0400 (Wed, 14 Apr 2010)
New Revision: 21462
Modified:
branches/jbosstools-3.1.x/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java
Log:
Revert committed by mistake code back
Modified: branches/jbosstools-3.1.x/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java
===================================================================
--- branches/jbosstools-3.1.x/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java 2010-04-14 10:03:38 UTC (rev 21461)
+++ branches/jbosstools-3.1.x/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java 2010-04-14 10:06:37 UTC (rev 21462)
@@ -47,21 +47,20 @@
rts.add(ioe);
final List<Object> emptyList = new ArrayList<Object>();
final Iterator<Object> emptyListIterator = emptyList.iterator();
- //see https://jira.jboss.org/jira/browse/JBIDE-6186
- final String innerIntricateName = "myInner$Id";
+
context.checking(new Expectations() {
{
oneOf(ioe).getEntityName();
- will(returnValue(innerIntricateName));
+ will(returnValue("testEntityName")); //$NON-NLS-1$
allowing(consoleConfig).getConfiguration();
will(returnValue(config));
oneOf(ioe).getEntityName();
- will(returnValue(innerIntricateName));
+ will(returnValue("")); //$NON-NLS-1$
oneOf(ioe).getEntityName();
- will(returnValue(innerIntricateName));
+ will(returnValue("")); //$NON-NLS-1$
oneOf(ioe).getIdentifierProperty();
will(returnValue(null));
@@ -94,7 +93,7 @@
will(returnValue("CCName")); //$NON-NLS-1$
allowing(ioe).getEntityName();
- will(returnValue(innerIntricateName)); //$NON-NLS-1$
+ will(returnValue("")); //$NON-NLS-1$
}
});
final OrmDiagram ormDiagram = new OrmDiagram("", rts) { //$NON-NLS-1$
@@ -102,7 +101,7 @@
return consoleConfig;
}
};
- ormDiagram.saveInXmlFile();
+ ormDiagram.saveInFile();
// test is the folder created
File folder = new File(ormDiagram.getStoreFolderPath().toOSString());
assertTrue(folder.exists() && folder.isDirectory());
14 years, 9 months
JBoss Tools SVN: r21461 - trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-04-14 06:03:38 -0400 (Wed, 14 Apr 2010)
New Revision: 21461
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java
Log:
removed unnecessary non-nls comments
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java 2010-04-14 09:59:15 UTC (rev 21460)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java 2010-04-14 10:03:38 UTC (rev 21461)
@@ -52,16 +52,16 @@
context.checking(new Expectations() {
{
oneOf(ioe).getEntityName();
- will(returnValue(innerIntricateName)); //$NON-NLS-1$
+ will(returnValue(innerIntricateName));
allowing(consoleConfig).getConfiguration();
will(returnValue(config));
oneOf(ioe).getEntityName();
- will(returnValue(innerIntricateName)); //$NON-NLS-1$
+ will(returnValue(innerIntricateName));
oneOf(ioe).getEntityName();
- will(returnValue(innerIntricateName)); //$NON-NLS-1$
+ will(returnValue(innerIntricateName));
oneOf(ioe).getIdentifierProperty();
will(returnValue(null));
@@ -94,7 +94,7 @@
will(returnValue("CCName")); //$NON-NLS-1$
allowing(ioe).getEntityName();
- will(returnValue(innerIntricateName)); //$NON-NLS-1$
+ will(returnValue(innerIntricateName));
}
});
final OrmDiagram ormDiagram = new OrmDiagram("", rts) { //$NON-NLS-1$
14 years, 9 months
JBoss Tools SVN: r21460 - branches/jbosstools-3.1.x/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-04-14 05:59:15 -0400 (Wed, 14 Apr 2010)
New Revision: 21460
Modified:
branches/jbosstools-3.1.x/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java
Log:
Modified: branches/jbosstools-3.1.x/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java
===================================================================
--- branches/jbosstools-3.1.x/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java 2010-04-14 09:56:12 UTC (rev 21459)
+++ branches/jbosstools-3.1.x/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java 2010-04-14 09:59:15 UTC (rev 21460)
@@ -47,20 +47,21 @@
rts.add(ioe);
final List<Object> emptyList = new ArrayList<Object>();
final Iterator<Object> emptyListIterator = emptyList.iterator();
-
+ //see https://jira.jboss.org/jira/browse/JBIDE-6186
+ final String innerIntricateName = "myInner$Id";
context.checking(new Expectations() {
{
oneOf(ioe).getEntityName();
- will(returnValue("testEntityName")); //$NON-NLS-1$
+ will(returnValue(innerIntricateName));
allowing(consoleConfig).getConfiguration();
will(returnValue(config));
oneOf(ioe).getEntityName();
- will(returnValue("")); //$NON-NLS-1$
+ will(returnValue(innerIntricateName));
oneOf(ioe).getEntityName();
- will(returnValue("")); //$NON-NLS-1$
+ will(returnValue(innerIntricateName));
oneOf(ioe).getIdentifierProperty();
will(returnValue(null));
@@ -93,7 +94,7 @@
will(returnValue("CCName")); //$NON-NLS-1$
allowing(ioe).getEntityName();
- will(returnValue("")); //$NON-NLS-1$
+ will(returnValue(innerIntricateName)); //$NON-NLS-1$
}
});
final OrmDiagram ormDiagram = new OrmDiagram("", rts) { //$NON-NLS-1$
@@ -101,7 +102,7 @@
return consoleConfig;
}
};
- ormDiagram.saveInFile();
+ ormDiagram.saveInXmlFile();
// test is the folder created
File folder = new File(ormDiagram.getStoreFolderPath().toOSString());
assertTrue(folder.exists() && folder.isDirectory());
14 years, 9 months
JBoss Tools SVN: r21459 - trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-04-14 05:56:12 -0400 (Wed, 14 Apr 2010)
New Revision: 21459
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java
Log:
removed unused imports
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java 2010-04-14 09:55:30 UTC (rev 21458)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java 2010-04-14 09:56:12 UTC (rev 21459)
@@ -17,10 +17,7 @@
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
-import org.hibernate.mapping.SimpleValue;
-import org.hibernate.mapping.Value;
import org.jboss.tools.hibernate.ui.diagram.editors.model.OrmDiagram;
import org.jmock.Expectations;
import org.jmock.Mockery;
14 years, 9 months
JBoss Tools SVN: r21458 - trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-04-14 05:55:30 -0400 (Wed, 14 Apr 2010)
New Revision: 21458
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6186
Added reference to the issue
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java 2010-04-14 09:54:51 UTC (rev 21457)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java 2010-04-14 09:55:30 UTC (rev 21458)
@@ -50,6 +50,7 @@
rts.add(ioe);
final List<Object> emptyList = new ArrayList<Object>();
final Iterator<Object> emptyListIterator = emptyList.iterator();
+ //see https://jira.jboss.org/jira/browse/JBIDE-6186
final String innerIntricateName = "myInner$Id";
context.checking(new Expectations() {
{
14 years, 9 months
JBoss Tools SVN: r21457 - trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-04-14 05:54:51 -0400 (Wed, 14 Apr 2010)
New Revision: 21457
Modified:
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6186
Removed redundant code
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java 2010-04-14 09:46:31 UTC (rev 21456)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java 2010-04-14 09:54:51 UTC (rev 21457)
@@ -121,91 +121,5 @@
// check for all expectations
context.assertIsSatisfied();
}
-/*
- public void testSaveInXmlFile() {
-
- final ConsoleConfiguration consoleConfig = context.mock(ConsoleConfiguration.class);
- final Configuration config = context.mock(Configuration.class);
- final RootClass ioe = context.mock(RootClass.class);
- ArrayList<RootClass> rts = new ArrayList<RootClass>();
- final Property id = new Property();
- Value v = new SimpleValue();
- id.setValue(v);
- id.setName("id");
- id.setPersistentClass(ioe);
- rts.add(ioe);
- final List<Object> emptyList = new ArrayList<Object>();
- final Iterator<Object> emptyListIterator = emptyList.iterator();
- final String innerInnerClass = "myInner$Id";
- context.checking(new Expectations() {
- {
- oneOf(ioe).getEntityName();
- will(returnValue(innerInnerClass)); //$NON-NLS-1$
-
- allowing(consoleConfig).getConfiguration();
- will(returnValue(config));
-
- oneOf(ioe).getEntityName();
- will(returnValue(innerInnerClass)); //$NON-NLS-1$
-
- oneOf(ioe).getEntityName();
- will(returnValue(innerInnerClass)); //$NON-NLS-1$
-
- oneOf(ioe).getIdentifierProperty();
- will(returnValue(id));
-
- oneOf(ioe).getIdentifier();
- will(returnValue(null));
-
- oneOf(ioe).getPropertyIterator();
- will(returnValue(emptyListIterator));
-
- oneOf(ioe).getTable();
- will(returnValue(null));
-
- oneOf(ioe).getSubclassIterator();
- will(returnValue(emptyListIterator));
-
- oneOf(ioe).getIdentifier();
- will(returnValue(null));
-
- oneOf(ioe).getJoinIterator();
- will(returnValue(emptyListIterator));
-
- allowing(ioe).getNodeName();
- will(returnValue("NodeName")); //$NON-NLS-1$
-
- allowing(ioe).getClassName();
- will(returnValue("ClassName")); //$NON-NLS-1$
-
- allowing(consoleConfig).getName();
- will(returnValue("CCName")); //$NON-NLS-1$
-
- allowing(ioe).getEntityName();
- will(returnValue(innerInnerClass)); //$NON-NLS-1$
- }
- });
- final OrmDiagram ormDiagram = new OrmDiagram("", rts) { //$NON-NLS-1$
- public ConsoleConfiguration getConsoleConfig() {
- return consoleConfig;
- }
- };
- ormDiagram.saveInXmlFile();
- // test is the folder created
- File folder = new File(ormDiagram.getStoreFolderPath().toOSString());
- assertTrue(folder.exists() && folder.isDirectory());
- // test is the file created
- File file = new File(ormDiagram.getStoreFilePath().toOSString());
- assertTrue(file.exists() && file.isFile());
- //
- boolean res = file.delete();
- assertTrue(res);
- //
- res = folder.delete();
- assertTrue(res);
- // GENERAL TEST:
- // check for all expectations
- context.assertIsSatisfied();
- }*/
}
14 years, 9 months
JBoss Tools SVN: r21456 - in trunk/hibernatetools: tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-04-14 05:46:31 -0400 (Wed, 14 Apr 2010)
New Revision: 21456
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Utils.java
trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6186
Replace '$' to '.' in class name
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Utils.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Utils.java 2010-04-14 08:40:45 UTC (rev 21455)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Utils.java 2010-04-14 09:46:31 UTC (rev 21456)
@@ -57,7 +57,7 @@
res = getTableName((Table)obj);
} else if (obj instanceof Property) {
Property property = (Property)obj;
- res = property.getPersistentClass().getEntityName() + "." + property.getName(); //$NON-NLS-1$
+ res = getName(property.getPersistentClass()) + "." + property.getName(); //$NON-NLS-1$
} else if (obj instanceof SimpleValue) {
SimpleValue sv = (SimpleValue)obj;
res = getTableName(sv.getTable()) + "." + sv.getForeignKeyName(); //$NON-NLS-1$
Modified: trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java
===================================================================
--- trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java 2010-04-14 08:40:45 UTC (rev 21455)
+++ trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java 2010-04-14 09:46:31 UTC (rev 21456)
@@ -17,7 +17,10 @@
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
+import org.hibernate.mapping.SimpleValue;
+import org.hibernate.mapping.Value;
import org.jboss.tools.hibernate.ui.diagram.editors.model.OrmDiagram;
import org.jmock.Expectations;
import org.jmock.Mockery;
@@ -47,20 +50,20 @@
rts.add(ioe);
final List<Object> emptyList = new ArrayList<Object>();
final Iterator<Object> emptyListIterator = emptyList.iterator();
-
+ final String innerIntricateName = "myInner$Id";
context.checking(new Expectations() {
{
oneOf(ioe).getEntityName();
- will(returnValue("testEntityName")); //$NON-NLS-1$
+ will(returnValue(innerIntricateName)); //$NON-NLS-1$
allowing(consoleConfig).getConfiguration();
will(returnValue(config));
oneOf(ioe).getEntityName();
- will(returnValue("")); //$NON-NLS-1$
+ will(returnValue(innerIntricateName)); //$NON-NLS-1$
oneOf(ioe).getEntityName();
- will(returnValue("")); //$NON-NLS-1$
+ will(returnValue(innerIntricateName)); //$NON-NLS-1$
oneOf(ioe).getIdentifierProperty();
will(returnValue(null));
@@ -93,7 +96,7 @@
will(returnValue("CCName")); //$NON-NLS-1$
allowing(ioe).getEntityName();
- will(returnValue("")); //$NON-NLS-1$
+ will(returnValue(innerIntricateName)); //$NON-NLS-1$
}
});
final OrmDiagram ormDiagram = new OrmDiagram("", rts) { //$NON-NLS-1$
@@ -101,7 +104,7 @@
return consoleConfig;
}
};
- ormDiagram.saveInFile();
+ ormDiagram.saveInXmlFile();
// test is the folder created
File folder = new File(ormDiagram.getStoreFolderPath().toOSString());
assertTrue(folder.exists() && folder.isDirectory());
@@ -118,5 +121,91 @@
// check for all expectations
context.assertIsSatisfied();
}
+/*
+ public void testSaveInXmlFile() {
+
+ final ConsoleConfiguration consoleConfig = context.mock(ConsoleConfiguration.class);
+ final Configuration config = context.mock(Configuration.class);
+ final RootClass ioe = context.mock(RootClass.class);
+ ArrayList<RootClass> rts = new ArrayList<RootClass>();
+ final Property id = new Property();
+ Value v = new SimpleValue();
+ id.setValue(v);
+ id.setName("id");
+ id.setPersistentClass(ioe);
+ rts.add(ioe);
+ final List<Object> emptyList = new ArrayList<Object>();
+ final Iterator<Object> emptyListIterator = emptyList.iterator();
+ final String innerInnerClass = "myInner$Id";
+ context.checking(new Expectations() {
+ {
+ oneOf(ioe).getEntityName();
+ will(returnValue(innerInnerClass)); //$NON-NLS-1$
+
+ allowing(consoleConfig).getConfiguration();
+ will(returnValue(config));
+
+ oneOf(ioe).getEntityName();
+ will(returnValue(innerInnerClass)); //$NON-NLS-1$
+
+ oneOf(ioe).getEntityName();
+ will(returnValue(innerInnerClass)); //$NON-NLS-1$
+
+ oneOf(ioe).getIdentifierProperty();
+ will(returnValue(id));
+
+ oneOf(ioe).getIdentifier();
+ will(returnValue(null));
+
+ oneOf(ioe).getPropertyIterator();
+ will(returnValue(emptyListIterator));
+
+ oneOf(ioe).getTable();
+ will(returnValue(null));
+
+ oneOf(ioe).getSubclassIterator();
+ will(returnValue(emptyListIterator));
+
+ oneOf(ioe).getIdentifier();
+ will(returnValue(null));
+
+ oneOf(ioe).getJoinIterator();
+ will(returnValue(emptyListIterator));
+
+ allowing(ioe).getNodeName();
+ will(returnValue("NodeName")); //$NON-NLS-1$
+
+ allowing(ioe).getClassName();
+ will(returnValue("ClassName")); //$NON-NLS-1$
+
+ allowing(consoleConfig).getName();
+ will(returnValue("CCName")); //$NON-NLS-1$
+
+ allowing(ioe).getEntityName();
+ will(returnValue(innerInnerClass)); //$NON-NLS-1$
+ }
+ });
+ final OrmDiagram ormDiagram = new OrmDiagram("", rts) { //$NON-NLS-1$
+ public ConsoleConfiguration getConsoleConfig() {
+ return consoleConfig;
+ }
+ };
+ ormDiagram.saveInXmlFile();
+ // test is the folder created
+ File folder = new File(ormDiagram.getStoreFolderPath().toOSString());
+ assertTrue(folder.exists() && folder.isDirectory());
+ // test is the file created
+ File file = new File(ormDiagram.getStoreFilePath().toOSString());
+ assertTrue(file.exists() && file.isFile());
+ //
+ boolean res = file.delete();
+ assertTrue(res);
+ //
+ res = folder.delete();
+ assertTrue(res);
+ // GENERAL TEST:
+ // check for all expectations
+ context.assertIsSatisfied();
+ }*/
}
14 years, 9 months
JBoss Tools SVN: r21455 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2010-04-14 04:40:45 -0400 (Wed, 14 Apr 2010)
New Revision: 21455
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Shape.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6186
Replace '$' to '.' in class name
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Shape.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Shape.java 2010-04-14 06:34:58 UTC (rev 21454)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Shape.java 2010-04-14 08:40:45 UTC (rev 21455)
@@ -153,7 +153,8 @@
@Override
public String getKey() {
- return Utils.getName(getOrmElement());
+ //fix for https://jira.jboss.org/jira/browse/JBIDE-6186
+ return Utils.getName(getOrmElement()).replaceAll("\\$", "."); //$NON-NLS-1$ //$NON-NLS-2$
}
public void setFocus() {
14 years, 9 months
JBoss Tools SVN: r21454 - branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-04-14 02:34:58 -0400 (Wed, 14 Apr 2010)
New Revision: 21454
Modified:
branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
Log:
JBIDE-6024 - only publishing changed files
Modified: branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
--- branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2010-04-13 20:39:11 UTC (rev 21453)
+++ branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2010-04-14 06:34:58 UTC (rev 21454)
@@ -92,7 +92,11 @@
if (publishType == FULL_PUBLISH ) {
status = fullPublish(module, module[module.length-1], monitor);
} else if (publishType == INCREMENTAL_PUBLISH) {
- status = incrementalPublish(module, module[module.length-1], monitor);
+ if(getDeployPath(module, this.server).toFile().isDirectory()) {
+ status = incrementalPublish(module, module[module.length-1], monitor);
+ } else {
+ status =fullPublish(module, module[module.length-1], monitor);
+ }
}
}
}
14 years, 9 months