Author: dgolovin
Date: 2007-10-01 22:00:06 -0400 (Mon, 01 Oct 2007)
New Revision: 3950
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizardPage1.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.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/SeamConversationWizardPage1.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.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/SeamFormWizardPage1.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardFactory.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-988
location for seam Action, form, conversation adjusted to seam-gen
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizardPage1.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizardPage1.java 2007-10-02
01:58:20 UTC (rev 3949)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizardPage1.java 2007-10-02
02:00:06 UTC (rev 3950)
@@ -32,28 +32,6 @@
}
protected void createEditors() {
- addEditors(SeamWizardFactory.createActionFormFieldEditors(SeamWizardUtils.getSelectedProjectName()));
+ addEditors(SeamWizardFactory.createBaseFormFieldEditors(SeamWizardUtils.getSelectedProjectName()));
}
-
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- if(event.getPropertyName().equals(IParameter.SEAM_COMPONENT_NAME) ||
event.getPropertyName().equals(IParameter.SEAM_PROJECT_NAME)) {
- String value = getEditor(IParameter.SEAM_COMPONENT_NAME).getValueAsString();
- if(value==null||"".equals(value)) {
- setDefaultValue(IParameter.SEAM_COMPONENT_NAME, "");
- setDefaultValue(IParameter.SEAM_LOCAL_INTERFACE_NAME, "");
- setDefaultValue(IParameter.SEAM_BEAN_NAME, "");
- setDefaultValue(IParameter.SEAM_METHOD_NAME, "");
- setDefaultValue(IParameter.SEAM_PAGE_NAME, "");
- } else {
- String valueU = value.substring(0,1).toUpperCase() + value.substring(1);
- setDefaultValue(IParameter.SEAM_LOCAL_INTERFACE_NAME, valueU);
- setDefaultValue(IParameter.SEAM_BEAN_NAME, valueU+"Bean");
- String valueL = value.substring(0,1).toLowerCase() + value.substring(1);
- setDefaultValue(IParameter.SEAM_METHOD_NAME, valueL);
- setDefaultValue(IParameter.SEAM_PAGE_NAME, valueL);
- }
- }
- super.propertyChange(event);
- }
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java 2007-10-02
01:58:20 UTC (rev 3949)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java 2007-10-02
02:00:06 UTC (rev 3950)
@@ -66,7 +66,9 @@
createEditors();
}
- protected abstract void createEditors();
+ protected void createEditors() {
+ addEditors(SeamWizardFactory.createBaseFormFieldEditors(SeamWizardUtils.getSelectedProjectName()));
+ }
Map<String,IFieldEditor> editorRegistry = new
HashMap<String,IFieldEditor>();
@@ -179,7 +181,14 @@
* @see
java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
*/
public void propertyChange(PropertyChangeEvent event) {
+ doFillDefaults(event);
+ doValidate(event);
+ }
+ /**
+ *
+ */
+ protected void doValidate(PropertyChangeEvent event) {
Map errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_PROJECT_NAME).getValue(), null);
@@ -264,6 +273,29 @@
}
/**
+ *
+ */
+ protected void doFillDefaults(PropertyChangeEvent event) {
+ if(event.getPropertyName().equals(IParameter.SEAM_COMPONENT_NAME) ||
event.getPropertyName().equals(IParameter.SEAM_PROJECT_NAME)) {
+ String value = getEditor(IParameter.SEAM_COMPONENT_NAME).getValueAsString();
+ if(value==null||"".equals(value)) {
+ setDefaultValue(IParameter.SEAM_COMPONENT_NAME, "");
+ setDefaultValue(IParameter.SEAM_LOCAL_INTERFACE_NAME, "");
+ setDefaultValue(IParameter.SEAM_BEAN_NAME, "");
+ setDefaultValue(IParameter.SEAM_METHOD_NAME, "");
+ setDefaultValue(IParameter.SEAM_PAGE_NAME, "");
+ } else {
+ String valueU = value.substring(0,1).toUpperCase() + value.substring(1);
+ setDefaultValue(IParameter.SEAM_LOCAL_INTERFACE_NAME, valueU);
+ setDefaultValue(IParameter.SEAM_BEAN_NAME, valueU+"Bean");
+ String valueL = value.substring(0,1).toLowerCase() + value.substring(1);
+ setDefaultValue(IParameter.SEAM_METHOD_NAME, valueL);
+ setDefaultValue(IParameter.SEAM_PAGE_NAME, valueL);
+ }
+ }
+ }
+
+ /**
* @return
*/
public IResource getSelectedProject() {
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 2007-10-02
01:58:20 UTC (rev 3949)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizard.java 2007-10-02
02:00:06 UTC (rev 3950)
@@ -63,10 +63,10 @@
// initialize war files mapping
ACTION_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/ConversationBean.java",
- "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/model/${"
+ ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_BEAN_NAME +"}.java"});
+ "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/action/${"
+ ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_BEAN_NAME +"}.java"});
ACTION_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/Conversation.java",
- "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/model/${"
+ ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"});
+ "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/action/${"
+ ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"});
ACTION_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/view/conversation.xhtml",
"${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" +
IParameter.SEAM_PAGE_NAME +"}.xhtml"});
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizardPage1.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizardPage1.java 2007-10-02
01:58:20 UTC (rev 3949)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizardPage1.java 2007-10-02
02:00:06 UTC (rev 3950)
@@ -33,10 +33,6 @@
"managing a coversation will be created.");
}
- protected void createEditors() {
- addEditors(SeamWizardFactory.createActionFormFieldEditors(SeamWizardUtils.getSelectedProjectName()));
- }
-
/**
* @see
org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
@@ -54,25 +50,4 @@
}
setPageComplete(false);
}
-
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- if(event.getPropertyName().equals(IParameter.SEAM_COMPONENT_NAME)) {
- String value = getEditor(IParameter.SEAM_COMPONENT_NAME).getValueAsString();
- if(value==null||"".equals(value)) {
- setDefaultValue(IParameter.SEAM_COMPONENT_NAME, "");
- setDefaultValue(IParameter.SEAM_LOCAL_INTERFACE_NAME, "");
- setDefaultValue(IParameter.SEAM_BEAN_NAME, "");
- setDefaultValue(IParameter.SEAM_METHOD_NAME, "");
- setDefaultValue(IParameter.SEAM_PAGE_NAME, "");
- } else {
- String valueU = value.substring(0,1).toUpperCase() + value.substring(1);
- setDefaultValue(IParameter.SEAM_LOCAL_INTERFACE_NAME, valueU);
- setDefaultValue(IParameter.SEAM_BEAN_NAME, valueU+"Bean");
- String valueL = value.substring(0,1).toLowerCase() + value.substring(1);
- setDefaultValue(IParameter.SEAM_METHOD_NAME, valueL);
- setDefaultValue(IParameter.SEAM_PAGE_NAME, valueL);
- }
- }
- }
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.java 2007-10-02
01:58:20 UTC (rev 3949)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.java 2007-10-02
02:00:06 UTC (rev 3950)
@@ -56,7 +56,7 @@
setPageComplete(false);
}
- public void propertyChange(PropertyChangeEvent event) {
+ public void doFillDefaults(PropertyChangeEvent event) {
if(event.getPropertyName().equals(IParameter.SEAM_ENTITY_CLASS_NAME)) {
if(event.getNewValue()==null||"".equals(event.getNewValue().toString().trim()))
{
setDefaultValue(IParameter.SEAM_COMPONENT_NAME, "");
@@ -71,7 +71,9 @@
setDefaultValue(IParameter.SEAM_PAGE_NAME, valueL+"List");
}
}
-
+ }
+
+ protected void doValidate(PropertyChangeEvent event) {
Map errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_PROJECT_NAME).getValue(), null);
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-02
01:58:20 UTC (rev 3949)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizard.java 2007-10-02
02:00:06 UTC (rev 3950)
@@ -84,7 +84,7 @@
static {
FORM_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/FormActionJavaBean.java",
- "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/model/${"
+ ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"});
+ "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/action/${"
+ ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"});
FORM_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/test/FormTest.java",
"${" + IParameter.SEAM_TEST_PROJECT_LOCATION_PATH +
"}/test-src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH +
"}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"});
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-02
01:58:20 UTC (rev 3949)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizardPage1.java 2007-10-02
02:00:06 UTC (rev 3950)
@@ -31,28 +31,6 @@
}
protected void createEditors() {
- addEditors(SeamWizardFactory.createActionFormFieldEditors(SeamWizardUtils.getSelectedProjectName()));
+ addEditors(SeamWizardFactory.createBaseFormFieldEditors(SeamWizardUtils.getSelectedProjectName()));
}
-
- @Override
- public void propertyChange(PropertyChangeEvent event) {
- if(event.getPropertyName().equals(IParameter.SEAM_COMPONENT_NAME) ||
event.getPropertyName().equals(IParameter.SEAM_PROJECT_NAME)) {
- String value = getEditor(IParameter.SEAM_COMPONENT_NAME).getValueAsString();
- if(value==null||"".equals(value)) {
- setDefaultValue(IParameter.SEAM_COMPONENT_NAME, "");
- setDefaultValue(IParameter.SEAM_LOCAL_INTERFACE_NAME, "");
- setDefaultValue(IParameter.SEAM_BEAN_NAME, "");
- setDefaultValue(IParameter.SEAM_METHOD_NAME, "");
- setDefaultValue(IParameter.SEAM_PAGE_NAME, "");
- } else {
- String valueU = value.substring(0,1).toUpperCase() + value.substring(1);
- setDefaultValue(IParameter.SEAM_LOCAL_INTERFACE_NAME, valueU);
- setDefaultValue(IParameter.SEAM_BEAN_NAME, valueU+"Bean");
- String valueL = value.substring(0,1).toLowerCase() + value.substring(1);
- setDefaultValue(IParameter.SEAM_METHOD_NAME, valueL);
- setDefaultValue(IParameter.SEAM_PAGE_NAME, valueL);
- }
- }
- super.propertyChange(event);
- }
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardFactory.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardFactory.java 2007-10-02
01:58:20 UTC (rev 3949)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardFactory.java 2007-10-02
02:00:06 UTC (rev 3950)
@@ -77,7 +77,7 @@
IParameter.SEAM_MASTER_PAGE_NAME, "Master page name:", "");
}
- public static final IFieldEditor[] createActionFormFieldEditors(String defaultSelection)
{
+ public static final IFieldEditor[] createBaseFormFieldEditors(String defaultSelection)
{
return new IFieldEditor[]{
SeamWizardFactory.createSeamProjectSelectionFieldEditor(SeamWizardUtils.getSelectedProjectName()),
SeamWizardFactory.createSeamComponentNameFieldEditor(),