Author: akazakov
Date: 2007-10-22 13:41:40 -0400 (Mon, 22 Oct 2007)
New Revision: 4417
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java
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
Log:
http://jira.jboss.com/jira/browse/JBIDE-1037 Package Name for New Conversation Wizard
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java 2007-10-22
17:04:29 UTC (rev 4416)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java 2007-10-22
17:41:40 UTC (rev 4417)
@@ -23,9 +23,9 @@
public class ComboFieldEditor extends BaseFieldEditor implements
ITaggedFieldEditor,PropertyChangeListener{
List values = null;
-
+
boolean editable = false;
-
+
public ComboFieldEditor(String name, String label, List values,Object
defaultValue,boolean editableSelection) {
super(name, label, defaultValue);
this.values = Collections.unmodifiableList(values);
@@ -36,7 +36,6 @@
@Override
public Object[] getEditorControls(Object composite) {
- // TODO Auto-generated method stub
return new Control[] {getComboControl((Composite)composite)};
}
@@ -45,7 +44,6 @@
}
public Control getComboControl(Composite composite) {
- // TODO Auto-generated method stub
if(comboField == null) {
comboField = new ComboBoxField(composite,values,getValue(),editable);
comboField.addPropertyChangeListener(this);
@@ -57,7 +55,6 @@
@Override
public Object[] getEditorControls() {
- // TODO Auto-generated method stub
return null;
}
@@ -87,7 +84,6 @@
*/
@Override
public int getNumberOfControls() {
- // TODO Auto-generated method stub
return 1;
}
@@ -100,7 +96,7 @@
super.setEditable(ediatble);
comboField.setEditable(ediatble);
}
-
+
public void setValue(Object newValue) {
super.setValue(newValue);
if(comboField!=null) {
@@ -108,6 +104,5 @@
comboField.setValue(newValue.toString());
comboField.addPropertyChangeListener(this);
}
-
}
}
\ No newline at end of file
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-22
17:04:29 UTC (rev 4416)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizardPage1.java 2007-10-22
17:41:40 UTC (rev 4417)
@@ -29,15 +29,6 @@
setMessage(getDefaultMessageText());
}
- @Override
- protected void createEditors() {
- super.createEditors();
- String selectedProject = SeamWizardUtils.getRootSeamProjectName(initialSelection);
- String packageName = getDefaultPackageName(selectedProject);
- addEditor(SeamWizardFactory.createSeamJavaPackageSelectionFieldEditor(packageName));
- setSeamProjectNameData(selectedProject);
- }
-
/* (non-Javadoc)
* @see org.jboss.tools.seam.ui.wizard.SeamBaseWizardPage#getDefaultMessageText()
*/
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-22
17:04:29 UTC (rev 4416)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java 2007-10-22
17:41:40 UTC (rev 4417)
@@ -72,6 +72,10 @@
protected void createEditors() {
addEditors(SeamWizardFactory.createBaseFormFieldEditors(SeamWizardUtils.getRootSeamProjectName(initialSelection)));
+ String selectedProject = SeamWizardUtils.getRootSeamProjectName(initialSelection);
+ String packageName = getDefaultPackageName(selectedProject);
+ addEditor(SeamWizardFactory.createSeamJavaPackageSelectionFieldEditor(packageName));
+ setSeamProjectNameData(selectedProject);
}
Map<String,IFieldEditor> editorRegistry = new
HashMap<String,IFieldEditor>();
@@ -99,7 +103,10 @@
getEditor(IParameter.SEAM_BEAN_NAME).setEnabled(true);
}
} else {
- getEditor(IParameter.SEAM_BEAN_NAME).setEnabled(false);
+ getEditor(IParameter.SEAM_BEAN_NAME).setEnabled(false);
+ if(getEditor(IParameter.SEAM_PACKAGE_NAME)!=null) {
+ getEditor(IParameter.SEAM_PACKAGE_NAME).setEnabled(false);
+ }
}
String selectdProject = getEditor(IParameter.SEAM_PROJECT_NAME).getValueAsString();
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-22
17:04:29 UTC (rev 4416)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizard.java 2007-10-22
17:41:40 UTC (rev 4417)
@@ -15,17 +15,15 @@
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.jface.viewers.IStructuredSelection;
import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
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;
public class SeamConversationWizard extends SeamBaseWizard implements INewWizard {
-
-
public SeamConversationWizard() {
super(CREATE_SEAM_CONVERSATION);
setWindowTitle(SeamUIMessages.SEAM_CONVERSATION_WIZARD_CREATE_NEW_CONVERSATION);
@@ -37,13 +35,14 @@
super.addPages();
addPage(new SeamConversationWizardPage1(getInitialSelection()));
}
+
public static final IUndoableOperation CREATE_SEAM_CONVERSATION = new
SeamConversationCreateOperation();
+
/**
- *
* TODO move operations to core plugin
*/
public static class SeamConversationCreateOperation extends SeamBaseOperation{
-
+
/**
* @param label
*/
@@ -58,11 +57,11 @@
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[]{
@@ -74,7 +73,7 @@
ACTION_WAR_MAPPING.add(new String[]{
"${" + 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$
-
+
// initialize ear files mapping
ACTION_EAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/ConversationBean.java", //$NON-NLS-1$ //$NON-NLS-2$
@@ -84,6 +83,14 @@
"${" + IParameter.SEAM_EJB_PROJECT_LOCATION_PATH +
"}/ejbModule/${" + ISeamFacetDataModelProperties.SESION_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(2));
}
+
+ /*
+ * (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/SeamConversationWizardPage1.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizardPage1.java 2007-10-22
17:04:29 UTC (rev 4416)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizardPage1.java 2007-10-22
17:41:40 UTC (rev 4417)
@@ -25,14 +25,11 @@
*/
public class SeamConversationWizardPage1 extends SeamBaseWizardPage {
- private final IStructuredSelection initialSelection;
-
public SeamConversationWizardPage1(IStructuredSelection initialSelection) {
super("seam.new.conversation.page1",SeamUIMessages.SEAM_CONVERSATION_WIZARD_PAGE1_SEAM_CONVERSATION,null,
initialSelection);
- this.initialSelection = initialSelection;
setMessage(getDefaultMessageText());
}
-
+
/**
* @see
org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
@@ -43,11 +40,15 @@
if (!"".equals(editorRegistry.get(IParameter.SEAM_PROJECT_NAME).getValue())){
Map errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(
getEditor(IParameter.SEAM_PROJECT_NAME).getValue(), null);
-
+
if(errors.size()>0) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).toString());
getEditor(IParameter.SEAM_BEAN_NAME).setEnabled(false);
}
+ } else {
+ if(getEditor(IParameter.SEAM_PACKAGE_NAME)!=null) {
+ getEditor(IParameter.SEAM_PACKAGE_NAME).setEnabled(false);
+ }
}
setPageComplete(false);
}
@@ -57,7 +58,6 @@
*/
@Override
public String getDefaultMessageText() {
- // TODO Auto-generated method stub
return "Create a new Seam conversation";
}
-}
+}
\ No newline at end of file
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-22
17:04:29 UTC (rev 4416)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.java 2007-10-22
17:41:40 UTC (rev 4417)
@@ -47,11 +47,6 @@
protected void createEditors() {
super.createEditors();
- String selectedProject = SeamWizardUtils.getRootSeamProjectName(initialSelection);
- String packageName = getDefaultPackageName(selectedProject);
- addEditor(SeamWizardFactory.createSeamJavaPackageSelectionFieldEditor(packageName));
- setSeamProjectNameData(selectedProject);
-
addEditor(SeamWizardFactory.createSeamEntityClasNameFieldEditor());
addEditor(SeamWizardFactory.createSeamMasterPageNameFieldEditor());
addEditor(SeamWizardFactory.createSeamPageNameFieldEditor());
@@ -61,6 +56,11 @@
public void createControl(Composite parent) {
setControl(new GridLayoutComposite(parent));
setPageComplete(false);
+ if ("".equals(editorRegistry.get(IParameter.SEAM_PROJECT_NAME).getValue())) {
//$NON-NLS-1$
+ if(getEditor(IParameter.SEAM_PACKAGE_NAME)!=null) {
+ getEditor(IParameter.SEAM_PACKAGE_NAME).setEnabled(false);
+ }
+ }
}
@Override