Author: akazakov
Date: 2007-10-22 13:48:30 -0400 (Mon, 22 Oct 2007)
New Revision: 4418
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/SeamFormWizardPage1.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1037 Package Name for New Form Wizard
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 2007-10-22
17:41:40 UTC (rev 4417)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizard.java 2007-10-22
17:48:30 UTC (rev 4418)
@@ -16,10 +16,12 @@
import java.util.Map;
import org.eclipse.core.commands.operations.IUndoableOperation;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.INewWizard;
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;
/**
*
@@ -37,32 +39,32 @@
setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(SeamActionWizard.class,
"SeamFormWizBan.png")); //$NON-NLS-1$
}
-
+
@Override
public void addPages() {
addPage(new SeamFormWizardPage1(getInitialSelection()));
}
private static IUndoableOperation CREATE_SEAM_FORM = new SeamFormCreateOperation();
-
+
public static class SeamFormCreateOperation extends SeamBaseOperation {
-
+
public SeamFormCreateOperation() {
super(SeamUIMessages.SEAM_FORM_WIZARD_FORM_CREATING_OPERATION);
}
-
+
public File getBeanFile(Map<String, Object> vars) {
return new File(getSeamFolder(vars),"src/FormActionJavaBean.java");
//$NON-NLS-1$
}
-
+
public File getTestClassFile(Map<String, Object> vars) {
return new File(getSeamFolder(vars),"test/FormTest.java"); //$NON-NLS-1$
}
-
+
public File getTestngXmlFile(Map<String, Object> vars) {
return new File(getSeamFolder(vars),"test/testng.xml"); //$NON-NLS-1$
}
-
+
public File getPageXhtml(Map<String, Object> vars) {
return new File(getSeamFolder(vars),"view/form.xhtml"); //$NON-NLS-1$
}
@@ -77,11 +79,11 @@
else
return FORM_EAR_MAPPING;
}
-
+
public static final List<String[]> FORM_WAR_MAPPING = new
ArrayList<String[]>();
-
+
public static final List<String[]> FORM_EAR_MAPPING = new
ArrayList<String[]>();
-
+
static {
FORM_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/FormActionJavaBean.java", //$NON-NLS-1$ //$NON-NLS-2$
@@ -95,7 +97,7 @@
FORM_WAR_MAPPING.add(new String[]{
"${" + 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$
-
+
// initialize ear files mapping
FORM_EAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/FormActionBean.java", //$NON-NLS-1$ //$NON-NLS-2$
@@ -111,5 +113,14 @@
"${" + 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$
FORM_EAR_MAPPING.add(FORM_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/SeamFormWizardPage1.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizardPage1.java 2007-10-22
17:41:40 UTC (rev 4417)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizardPage1.java 2007-10-22
17:48:30 UTC (rev 4418)
@@ -13,7 +13,6 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.jboss.tools.seam.ui.SeamUIMessages;
-
/**
* @author eskimo
*
@@ -28,16 +27,12 @@
super("seam.new.form.page1",SeamUIMessages.SEAM_FORM_WIZARD_PAGE1_SEAM_FORM,null,
is); //$NON-NLS-1$
setMessage(getDefaultMessageText());
}
-
/* (non-Javadoc)
* @see org.jboss.tools.seam.ui.wizard.SeamBaseWizardPage#getDefaultMessageText()
*/
@Override
public String getDefaultMessageText() {
- // TODO Auto-generated method stub
return "Create a new Seam form";
}
-
-
-}
+}
\ No newline at end of file