Author: akazakov
Date: 2008-03-12 13:28:10 -0400 (Wed, 12 Mar 2008)
New Revision: 6902
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/FileMapping.java
Removed:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionCreateOperation.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1322 Added create.test property handling
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2008-03-12
16:54:42 UTC (rev 6901)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2008-03-12
17:28:10 UTC (rev 6902)
@@ -331,9 +331,11 @@
private Set<String> getVariablesNameByResource(IPath resourcePath) {
Set<ISeamContextVariable> variables = project.getVariablesByPath(resourcePath);
Set<String> result = new HashSet<String>();
- for (ISeamContextVariable variable : variables) {
- String name = variable.getName();
- result.add(name);
+ if(variables!=null) {
+ for (ISeamContextVariable variable : variables) {
+ String name = variable.getName();
+ result.add(name);
+ }
}
return result;
}
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/FileMapping.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/FileMapping.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/FileMapping.java 2008-03-12
17:28:10 UTC (rev 6902)
@@ -0,0 +1,93 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.wizard;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class FileMapping {
+
+ private String source;
+ private String destination;
+ private TYPE deployType;
+ private boolean test;
+
+ public static enum TYPE {
+ WAR("war"),
+ EAR("ear");
+
+ private String stringType;
+
+ private TYPE(String type) {
+ stringType = type;
+ }
+
+ @Override
+ public String toString() {
+ return stringType;
+ }
+
+ public boolean equalsString(String type) {
+ if(type==null) {
+ return false;
+ }
+ return stringType.equals(type);
+ }
+ }
+
+ public FileMapping(String source, String destination, TYPE deployType, boolean test) {
+ super();
+ this.source = source;
+ this.destination = destination;
+ this.deployType = deployType;
+ this.test = test;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ public String getDestination() {
+ return destination;
+ }
+
+ public void setDestination(String destination) {
+ this.destination = destination;
+ }
+
+ public boolean isWar() {
+ return deployType == TYPE.WAR;
+ }
+
+ public boolean isEar() {
+ return deployType == TYPE.EAR;
+ }
+
+ public TYPE getDeployType() {
+ return deployType;
+ }
+
+ public void setDeployType(TYPE deployType) {
+ this.deployType = deployType;
+ }
+
+ public boolean isTest() {
+ return test;
+ }
+
+ public void setTest(boolean test) {
+ this.test = test;
+ }
+}
\ No newline at end of file
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionCreateOperation.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionCreateOperation.java 2008-03-12
16:54:42 UTC (rev 6901)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionCreateOperation.java 2008-03-12
17:28:10 UTC (rev 6902)
@@ -1,76 +0,0 @@
-package org.jboss.tools.seam.ui.wizard;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
-import org.jboss.tools.seam.ui.SeamUIMessages;
-import org.jboss.tools.seam.ui.widget.editor.INamedElement;
-
-/**
- *
- * TODO move operations to core plugin
- */
-public class SeamActionCreateOperation extends SeamBaseOperation{
-
- /**
- * @param label
- */
- public SeamActionCreateOperation() {
- super((SeamUIMessages.SEAM_ACTION_WIZARD_ACTION_CREATING_OPERATION));
- }
-
- @Override
- public List<String[]> getFileMappings(Map<String, Object> vars) {
- if("war".equals(vars.get(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS)))
//$NON-NLS-1$
- return ACTION_WAR_MAPPING;
- else
- return ACTION_EAR_MAPPING;
- }
-
- public static final List<String[]> ACTION_WAR_MAPPING = new
ArrayList<String[]>();
-
- public static final List<String[]> ACTION_EAR_MAPPING = new
ArrayList<String[]>();
-
- static {
- // initialize war files mapping
- ACTION_WAR_MAPPING.add(new String[]{
- "${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/ActionJavaBean.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
- ACTION_WAR_MAPPING.add(new String[]{
- "${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/test/ActionTest.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_TEST_PROJECT_LOCATION_PATH +
"}/test-src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH +
"}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"});
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ACTION_WAR_MAPPING.add(new String[]{
- "${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/test/testng.xml", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_TEST_PROJECT_LOCATION_PATH +
"}/test-src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH +
"}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml"});
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ACTION_WAR_MAPPING.add(new String[]{
- "${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/view/action.xhtml", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" +
IParameter.SEAM_PAGE_NAME +"}.xhtml"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
-
- // initialize ear files mapping
- ACTION_EAR_MAPPING.add(new String[]{
- "${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/ActionBean.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_BEAN_NAME +"}.java"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
//$NON-NLS-4$
- ACTION_EAR_MAPPING.add(new String[]{
- "${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/Action.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
- ACTION_EAR_MAPPING.add(new String[]{
- "${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/test/ActionTest.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_TEST_PROJECT_LOCATION_PATH +
"}/test-src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH +
"}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"});
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ACTION_EAR_MAPPING.add(new String[]{
- "${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/test/testng.xml", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_TEST_PROJECT_LOCATION_PATH +
"}/test-src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH +
"}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml"});
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ACTION_EAR_MAPPING.add(ACTION_WAR_MAPPING.get(3));
- }
-
- /*
- * (non-Javadoc)
- * @see
org.jboss.tools.seam.ui.wizard.SeamBaseOperation#getSessionBeanPackageName(org.eclipse.core.runtime.preferences.IEclipsePreferences,
java.util.Map)
- */
- @Override
- protected String getSessionBeanPackageName(IEclipsePreferences seamFacetPrefs,
Map<String, INamedElement> wizardParams) {
- return wizardParams.get(IParameter.SEAM_PACKAGE_NAME).getValue().toString();
- }
-}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizard.java 2008-03-12
16:54:42 UTC (rev 6901)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizard.java 2008-03-12
17:28:10 UTC (rev 6902)
@@ -37,7 +37,6 @@
PlatformUI.getWorkbench().getHelpSystem().setHelp(pageContainer,
ISeamHelpContextIds.NEW_SEAM_ACTION);
}
-
/**
*
*/
@@ -46,20 +45,20 @@
setWindowTitle(SeamUIMessages.SEAM_ACTION_WIZARD_NEW_SEAM_ACTION);
setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(SeamActionWizard.class,
"SeamFormWizBan.png")); //$NON-NLS-1$
}
-
+
@Override
public void addPages() {
addPage(new SeamActionWizardPage1(getInitialSelection()));
}
public static IUndoableOperation CREATE_SEAM_ACTION = new SeamActionCreateOperation();
-
+
/**
*
* TODO move operations to core plugin
*/
public static class SeamActionCreateOperation extends SeamBaseOperation{
-
+
/**
* @param label
*/
@@ -68,46 +67,61 @@
}
@Override
- public List<String[]> getFileMappings(Map<String, Object> vars) {
- if("war".equals(vars.get(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS)))
//$NON-NLS-1$
- return ACTION_WAR_MAPPING;
- else
- return ACTION_EAR_MAPPING;
+ public List<FileMapping> getFileMappings(Map<String, Object> vars) {
+ return ACTION_MAPPING;
}
- public static final List<String[]> ACTION_WAR_MAPPING = new
ArrayList<String[]>();
+ public static final List<FileMapping> ACTION_MAPPING = new
ArrayList<FileMapping>();
- public static final List<String[]> ACTION_EAR_MAPPING = new
ArrayList<String[]>();
-
static {
// initialize war files mapping
- ACTION_WAR_MAPPING.add(new String[]{
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/ActionJavaBean.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
- ACTION_WAR_MAPPING.add(new String[]{
+ "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.WAR,
+ false));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/test/ActionTest.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.TEST_SOURCE_FOLDER + "}/${" +
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"}); //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ACTION_WAR_MAPPING.add(new String[]{
+ "${" + IParameter.TEST_SOURCE_FOLDER + "}/${" +
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.WAR,
+ true));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/test/testng.xml", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.TEST_SOURCE_FOLDER + "}/${" +
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
- ACTION_WAR_MAPPING.add(new String[]{
+ "${" + IParameter.TEST_SOURCE_FOLDER + "}/${" +
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.WAR,
+ true));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/view/action.xhtml", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" +
IParameter.SEAM_PAGE_NAME +"}.xhtml"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
+ "${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" +
IParameter.SEAM_PAGE_NAME +"}.xhtml", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
+ FileMapping.TYPE.WAR,
+ false));
// initialize ear files mapping
- ACTION_EAR_MAPPING.add(new String[]{
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/ActionBean.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_BEAN_NAME +"}.java"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
//$NON-NLS-4$
- ACTION_EAR_MAPPING.add(new String[]{
+ "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_BEAN_NAME +"}.java", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
//$NON-NLS-4$
+ FileMapping.TYPE.EAR,
+ false));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/Action.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
- ACTION_EAR_MAPPING.add(new String[]{
+ "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.EAR,
+ false));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/test/ActionTest.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.TEST_SOURCE_FOLDER + "}/${" +
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"}); //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- ACTION_EAR_MAPPING.add(new String[]{
+ "${" + IParameter.TEST_SOURCE_FOLDER + "}/${" +
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.EAR,
+ true));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/test/testng.xml", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.TEST_SOURCE_FOLDER + "}/${" +
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
- ACTION_EAR_MAPPING.add(ACTION_WAR_MAPPING.get(3));
+ "${" + IParameter.TEST_SOURCE_FOLDER + "}/${" +
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.EAR,
+ true));
+ ACTION_MAPPING.add(new FileMapping(
+ "${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/view/action.xhtml", //$NON-NLS-1$ //$NON-NLS-2$
+ "${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" +
IParameter.SEAM_PAGE_NAME +"}.xhtml", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
+ FileMapping.TYPE.EAR,
+ false));
}
/*
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java 2008-03-12
16:54:42 UTC (rev 6901)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java 2008-03-12
17:28:10 UTC (rev 6902)
@@ -42,6 +42,7 @@
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamProjectsSet;
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.internal.core.project.facet.SeamFacetFilterSetFactory;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
import org.jboss.tools.seam.ui.widget.editor.INamedElement;
@@ -107,7 +108,7 @@
vars.put(IParameter.ENTITY_BEAN_PACKAGE_PATH,
entityFolder.replace('.','/'));
vars.put(IParameter.ENTITY_BEAN_PACKAGE_NAME, entityFolder);
- List<String[]> fileMapping = getFileMappings(vars);
+ List<FileMapping> fileMapping = getFileMappings(vars);
List<String[]> fileMappingCopy = applyVariables(fileMapping,vars);
FilterSetCollection filters = getFilterSetCollection(vars);
final File[] file = new File[fileMappingCopy.size()];
@@ -186,23 +187,25 @@
* @param vars
* @return
*/
- public static List<String[]> applyVariables(List<String[]> fileMapping,
- Map<String, Object> vars) {
+ public static List<String[]> applyVariables(List<FileMapping> fileMapping,
Map<String, Object> vars) {
List<String[]> result = new ArrayList<String[]>();
- for (String[] filter : fileMapping) {
- String source = filter[0];
- for (Object property : vars.keySet()){
- if(source.contains("${"+property.toString()+"}")) { //$NON-NLS-1$
//$NON-NLS-2$
- source =
source.replace("${"+property.toString()+"}",vars.get(property.toString()).toString());
//$NON-NLS-1$ //$NON-NLS-2$
+ for (FileMapping filter : fileMapping) {
+ if(filter.getDeployType().equalsString((String)vars.get(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS))
&&
+ (!filter.isTest() ||
Boolean.parseBoolean(vars.get(ISeamFacetDataModelProperties.TEST_CREATING).toString()))) {
//$NON-NLS-1$
+ String source = filter.getSource();
+ for (Object property : vars.keySet()){
+ if(source.contains("${"+property.toString()+"}")) {
//$NON-NLS-1$ //$NON-NLS-2$
+ source =
source.replace("${"+property.toString()+"}",vars.get(property.toString()).toString());
//$NON-NLS-1$ //$NON-NLS-2$
+ }
}
- }
- String dest = filter[1];
- for (Object property : vars.keySet()){
- if(dest.contains("${"+property.toString()+"}")) { //$NON-NLS-1$
//$NON-NLS-2$
- dest =
dest.replace("${"+property.toString()+"}",vars.get(property.toString()).toString());
//$NON-NLS-1$ //$NON-NLS-2$
+ String dest = filter.getDestination();
+ for (Object property : vars.keySet()){
+ if(dest.contains("${"+property.toString()+"}")) { //$NON-NLS-1$
//$NON-NLS-2$
+ dest =
dest.replace("${"+property.toString()+"}",vars.get(property.toString()).toString());
//$NON-NLS-1$ //$NON-NLS-2$
+ }
}
+ result.add(new String[]{source, dest});
}
- result.add(new String[]{source,dest});
}
return result;
}
@@ -211,7 +214,7 @@
* @param vars
* @return
*/
- public abstract List<String[]> getFileMappings(Map<String, Object> vars);
+ public abstract List<FileMapping> getFileMappings(Map<String, Object>
vars);
/**
*
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizard.java 2008-03-12
16:54:42 UTC (rev 6901)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizard.java 2008-03-12
17:28:10 UTC (rev 6902)
@@ -59,34 +59,40 @@
}
@Override
- public List<String[]> getFileMappings(Map<String, Object> vars) {
- if("war".equals(vars.get(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS)))
//$NON-NLS-1$
- return ACTION_WAR_MAPPING;
- else
- return ACTION_EAR_MAPPING;
+ public List<FileMapping> getFileMappings(Map<String, Object> vars) {
+ return ACTION_MAPPING;
}
- public static final List<String[]> ACTION_WAR_MAPPING = new
ArrayList<String[]>();
+ public static final List<FileMapping> ACTION_MAPPING = new
ArrayList<FileMapping>();
- public static final List<String[]> ACTION_EAR_MAPPING = new
ArrayList<String[]>();
-
static {
// initialize war files mapping
- ACTION_WAR_MAPPING.add(new String[]{
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/ConversationJavaBean.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_BEAN_NAME +"}.java"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
//$NON-NLS-4$
- ACTION_WAR_MAPPING.add(new String[]{
+ "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_BEAN_NAME +"}.java", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
//$NON-NLS-4$
+ FileMapping.TYPE.WAR,
+ false));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/view/conversation.xhtml", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" +
IParameter.SEAM_PAGE_NAME +"}.xhtml"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
-
+ "${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" +
IParameter.SEAM_PAGE_NAME +"}.xhtml", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
+ FileMapping.TYPE.WAR,
+ false));
// initialize ear files mapping
- ACTION_EAR_MAPPING.add(new String[]{
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/ConversationBean.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_BEAN_NAME +"}.java"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
//$NON-NLS-4$
- ACTION_EAR_MAPPING.add(new String[]{
+ "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_BEAN_NAME +"}.java", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
//$NON-NLS-4$
+ FileMapping.TYPE.EAR,
+ false));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/Conversation.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
- ACTION_EAR_MAPPING.add(ACTION_WAR_MAPPING.get(1));
+ "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.EAR,
+ false));
+ ACTION_MAPPING.add(new FileMapping(
+ "${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/view/conversation.xhtml", //$NON-NLS-1$ //$NON-NLS-2$
+ "${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" +
IParameter.SEAM_PAGE_NAME +"}.xhtml", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
+ FileMapping.TYPE.EAR,
+ false));
}
/*
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizard.java 2008-03-12
16:54:42 UTC (rev 6901)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizard.java 2008-03-12
17:28:10 UTC (rev 6902)
@@ -31,11 +31,12 @@
*
*/
public class SeamEntityWizard extends SeamBaseWizard implements INewWizard {
-
+
public void createPageControls(Composite pageContainer) {
super.createPageControls(pageContainer);
PlatformUI.getWorkbench().getHelpSystem().setHelp(pageContainer,
ISeamHelpContextIds.NEW_SEAM_ENTITY);
}
+
/**
*
*/
@@ -43,7 +44,6 @@
super(CREATE_SEAM_ENTITY);
setWindowTitle(SeamUIMessages.SEAM_ENTITY_WIZARD_NEW_SEAM_ENTITY);
setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(SeamEntityWizard.class,
"SeamWebProjectWizBan.png"));
-
}
@Override
@@ -79,37 +79,55 @@
}
@Override
- public List<String[]> getFileMappings(Map<String, Object> vars) {
- if("war".equals(vars.get(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS)))
//$NON-NLS-1$
- return ACTION_WAR_MAPPING;
- else
- return ACTION_EAR_MAPPING;
+ public List<FileMapping> getFileMappings(Map<String, Object> vars) {
+ return ACTION_MAPPING;
}
- public static final List<String[]> ACTION_WAR_MAPPING = new
ArrayList<String[]>();
+ public static final List<FileMapping> ACTION_MAPPING = new
ArrayList<FileMapping>();
- public static final List<String[]> ACTION_EAR_MAPPING = new
ArrayList<String[]>();
-
static {
// initialize war files mapping
- ACTION_WAR_MAPPING.add(new String[]{
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/Entity.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_SRC_MODEL + "}/${" +
ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_ENTITY_CLASS_NAME +"}.java"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
- ACTION_WAR_MAPPING.add(new String[]{
+ "${" + IParameter.SEAM_PROJECT_SRC_MODEL + "}/${" +
ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_ENTITY_CLASS_NAME +"}.java", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.WAR,
+ false));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/EntityHome.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_ENTITY_CLASS_NAME +"}Home.java"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
- ACTION_WAR_MAPPING.add(new String[]{
+ "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_ENTITY_CLASS_NAME +"}Home.java", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.WAR,
+ false));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/EntityList.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_ENTITY_CLASS_NAME +"}List.java"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
-
- ACTION_WAR_MAPPING.add(new String[]{
+ "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_ENTITY_CLASS_NAME +"}List.java", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.WAR,
+ false));
+ // initialize ear files mapping
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/view/edit.xhtml", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" +
IParameter.SEAM_PAGE_NAME +"}.xhtml"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
- ACTION_WAR_MAPPING.add(new String[]{
+ "${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" +
IParameter.SEAM_PAGE_NAME +"}.xhtml", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ FileMapping.TYPE.EAR,
+ false));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/view/list.xhtml", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" +
IParameter.SEAM_MASTER_PAGE_NAME +"}.xhtml"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
-
- ACTION_EAR_MAPPING.addAll(ACTION_WAR_MAPPING);
+ "${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" +
IParameter.SEAM_MASTER_PAGE_NAME +"}.xhtml", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
+ FileMapping.TYPE.EAR,
+ false));
+ ACTION_MAPPING.add(new FileMapping(
+ "${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/Entity.java", //$NON-NLS-1$ //$NON-NLS-2$
+ "${" + IParameter.SEAM_PROJECT_SRC_MODEL + "}/${" +
ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_ENTITY_CLASS_NAME +"}.java", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.EAR,
+ false));
+ ACTION_MAPPING.add(new FileMapping(
+ "${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/EntityHome.java", //$NON-NLS-1$ //$NON-NLS-2$
+ "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_ENTITY_CLASS_NAME +"}Home.java", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.EAR,
+ false));
+ ACTION_MAPPING.add(new FileMapping(
+ "${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/EntityList.java", //$NON-NLS-1$ //$NON-NLS-2$
+ "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_ENTITY_CLASS_NAME +"}List.java", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.EAR,
+ false));
}
/*
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizard.java 2008-03-12
16:54:42 UTC (rev 6901)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizard.java 2008-03-12
17:28:10 UTC (rev 6902)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.seam.ui.wizard;
-import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -32,11 +31,12 @@
*
*/
public class SeamFormWizard extends SeamBaseWizard implements INewWizard {
-
+
public void createPageControls(Composite pageContainer) {
super.createPageControls(pageContainer);
PlatformUI.getWorkbench().getHelpSystem().setHelp(pageContainer,
ISeamHelpContextIds.NEW_SEAM_FORM);
}
+
/**
*
*/
@@ -44,9 +44,12 @@
super(CREATE_SEAM_FORM);
setWindowTitle(SeamUIMessages.SEAM_FORM_WIZARD_NEW_SEAM_FORM);
setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(SeamActionWizard.class,
"SeamFormWizBan.png")); //$NON-NLS-1$
-
}
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#addPages()
+ */
@Override
public void addPages() {
addPage(new SeamFormWizardPage1(getInitialSelection()));
@@ -60,49 +63,65 @@
super(SeamUIMessages.SEAM_FORM_WIZARD_FORM_CREATING_OPERATION);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see
org.jboss.tools.seam.ui.wizard.SeamBaseOperation#getFileMappings(java.util.Map)
*/
@Override
- public List<String[]> getFileMappings(Map<String, Object> vars) {
- if("war".equals(vars.get(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS)))
//$NON-NLS-1$
- return FORM_WAR_MAPPING;
- else
- return FORM_EAR_MAPPING;
+ public List<FileMapping> getFileMappings(Map<String, Object> vars) {
+ return ACTION_MAPPING;
}
- public static final List<String[]> FORM_WAR_MAPPING = new
ArrayList<String[]>();
+ public static final List<FileMapping> ACTION_MAPPING = new
ArrayList<FileMapping>();
- public static final List<String[]> FORM_EAR_MAPPING = new
ArrayList<String[]>();
-
static {
- FORM_WAR_MAPPING.add(new String[]{
+ // initialize war files mapping
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/FormActionJavaBean.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
- FORM_WAR_MAPPING.add(new String[]{
+ "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.WAR,
+ false));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/test/FormTest.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.TEST_SOURCE_FOLDER + "}/${" +
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"}); //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- FORM_WAR_MAPPING.add(new String[]{
+ "${" + IParameter.TEST_SOURCE_FOLDER + "}/${" +
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.WAR,
+ true));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/test/testng.xml", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.TEST_SOURCE_FOLDER + "}/${" +
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
- FORM_WAR_MAPPING.add(new String[]{
+ "${" + IParameter.TEST_SOURCE_FOLDER + "}/${" +
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.WAR,
+ true));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/view/form.xhtml", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" +
IParameter.SEAM_PAGE_NAME +"}.xhtml"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
-
+ "${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" +
IParameter.SEAM_PAGE_NAME +"}.xhtml", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ FileMapping.TYPE.WAR,
+ false));
// initialize ear files mapping
- FORM_EAR_MAPPING.add(new String[]{
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/FormActionBean.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_BEAN_NAME +"}.java"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
//$NON-NLS-4$
- FORM_EAR_MAPPING.add(new String[]{
+ "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_BEAN_NAME +"}.java", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
//$NON-NLS-4$
+ FileMapping.TYPE.EAR,
+ false));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/FormAction.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
- FORM_EAR_MAPPING.add(new String[]{
+ "${" + IParameter.SEAM_PROJECT_SRC_ACTION + "}/${" +
ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.EAR,
+ false));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/test/FormTest.java", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.TEST_SOURCE_FOLDER + "}/${" +
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"}); //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- FORM_EAR_MAPPING.add(new String[]{
+ "${" + IParameter.TEST_SOURCE_FOLDER + "}/${" +
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.EAR,
+ true));
+ ACTION_MAPPING.add(new FileMapping(
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/test/testng.xml", //$NON-NLS-1$ //$NON-NLS-2$
- "${" + IParameter.TEST_SOURCE_FOLDER + "}/${" +
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml"}); //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
- FORM_EAR_MAPPING.add(FORM_WAR_MAPPING.get(3));
+ "${" + IParameter.TEST_SOURCE_FOLDER + "}/${" +
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH + "}/${"+
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.xml", //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$ //$NON-NLS-4$
+ FileMapping.TYPE.EAR,
+ true));
+ ACTION_MAPPING.add(new FileMapping(
+ "${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/view/form.xhtml", //$NON-NLS-1$ //$NON-NLS-2$
+ "${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" +
IParameter.SEAM_PAGE_NAME +"}.xhtml", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ FileMapping.TYPE.EAR,
+ false));
}
/*
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 2008-03-12
16:54:42 UTC (rev 6901)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java 2008-03-12
17:28:10 UTC (rev 6902)
@@ -50,12 +50,12 @@
* @author Alexey Kazakov
*/
public class SeamGenerateEnitiesWizard extends SeamBaseWizard implements INewWizard {
-
+
public void createPageControls(Composite pageContainer) {
super.createPageControls(pageContainer);
PlatformUI.getWorkbench().getHelpSystem().setHelp(pageContainer,
ISeamHelpContextIds.GENERATE_SEAM_ENTITIES);
}
-
+
public SeamGenerateEnitiesWizard() {
super(GENERATE_SEAM_ENTITIES);
setWindowTitle(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_TITLE);
@@ -65,6 +65,10 @@
public static final IUndoableOperation GENERATE_SEAM_ENTITIES = new
SeamBaseOperation(SeamUIMessages.SEAM_GENERATE_ENTITIES_WIZARD_ACTION_CREATING_OPERATION)
{
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.seam.ui.wizard.SeamBaseOperation#execute(org.eclipse.core.runtime.IProgressMonitor,
org.eclipse.core.runtime.IAdaptable)
+ */
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws
ExecutionException {
Map<String, String> params = (Map)info.getAdapter(Map.class);
@@ -119,7 +123,7 @@
// Create exporters
// TODO Add others exporters
List<String> exporters = new ArrayList<String>();
-
+
if(isReverseEngineer) {
exporters.add("hbmtemplate0"); //$NON-NLS-1$
}
@@ -132,14 +136,14 @@
exporters.add("hbmtemplate7"); //$NON-NLS-1$
exporters.add("hbmtemplate8"); //$NON-NLS-1$
exporters.add("hbmtemplate9"); //$NON-NLS-1$
-
+
wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS, exporters);
-
+
if(isReverseEngineer) {
wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate0",
true); //$NON-NLS-1$
wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate0.extension_id", "org.hibernate.tools.hbm2java");
//$NON-NLS-1$ //$NON-NLS-2$
}
-
+
wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate1",
true); //$NON-NLS-1$
wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate1.extension_id", "org.hibernate.tools.hbmtemplate");
//$NON-NLS-1$ //$NON-NLS-2$
wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate2",
true); //$NON-NLS-1$
@@ -308,8 +312,12 @@
return Status.OK_STATUS;
}
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.seam.ui.wizard.SeamBaseOperation#getFileMappings(java.util.Map)
+ */
@Override
- public List<String[]> getFileMappings(Map<String, Object> vars) {
+ public List<FileMapping> getFileMappings(Map<String, Object> vars) {
throw new
UnsupportedOperationException(SeamUIMessages.SEAM_GENERATE_ENTITIES_WIZARD_THIS_METHOD_IS_NOT_RELEVANT_IN_GENERATING_SEAM_ENTITIES);
}
};