Author: dgolovin
Date: 2007-07-12 03:28:17 -0400 (Thu, 12 Jul 2007)
New Revision: 2396
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ITaggedFieldEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TaggedComboFieldEditor.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
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/SwtFieldEditorFactory.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/BaseFieldEditor.java
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/CompositeEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/IFieldEditorFactory.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/ComboBoxField.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
http://jira.jboss.org/jira/browse/EXIN-221
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2007-07-12 07:23:47
UTC (rev 2395)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2007-07-12 07:28:17
UTC (rev 2396)
@@ -27,6 +27,7 @@
org.eclipse.jem,
org.eclipse.jem.util,
org.eclipse.emf.ecore,
+ org.eclipse.jst.j2ee.ui,
org.eclipse.jst.j2ee.web
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.seam.ui,
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 2007-07-12
07:23:47 UTC (rev 2395)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-07-12
07:28:17 UTC (rev 2396)
@@ -10,7 +10,8 @@
******************************************************************************/
package org.jboss.tools.seam.ui.internal.project.facet;
-import java.util.ArrayList;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import java.util.Arrays;
import org.eclipse.jface.wizard.IWizard;
@@ -29,6 +30,7 @@
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditor;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditorFactory;
+import org.jboss.tools.seam.ui.widget.editor.ITaggedFieldEditor;
/**
* @author eskimo
@@ -52,9 +54,9 @@
DataModelValidatorDelegate validatorDelegate;
// General group
- IFieldEditor jBossAsHomeEditor = IFieldEditorFactory.INSTANCE.createBrowseFolderEditor(
- ISeamFacetDataModelProperties.JBOSS_AS_HOME,
- "JBoss AS Home Folder:","C:\\java\\jboss-4.0.5.GA");
+ // IFieldEditor jBossAsHomeEditor =
IFieldEditorFactory.INSTANCE.createBrowseFolderEditor(
+ // ISeamFacetDataModelProperties.JBOSS_AS_HOME,
+ // "JBoss AS Home Folder:","C:\\java\\jboss-4.0.5.GA");
IFieldEditor jBossSeamHomeEditor =
IFieldEditorFactory.INSTANCE.createBrowseFolderEditor(
ISeamFacetDataModelProperties.JBOSS_SEAM_HOME,
"JBoss Seam Home Folder:","C:\\java\\jboss-seam-1.2.1.GA");
@@ -66,15 +68,17 @@
IFieldEditor jBossAsDbTypeEditor = IFieldEditorFactory.INSTANCE.createComboEditor(
ISeamFacetDataModelProperties.DB_TYPE,
"Database
Type:",Arrays.asList(HIBERNATE_HELPER.getDialectNames()),"HSQL");
- IFieldEditor jBossHibernateDialectEditor =
IFieldEditorFactory.INSTANCE.createComboEditor(
+ IFieldEditor jBossHibernateDialectEditor =
IFieldEditorFactory.INSTANCE.createUneditableTextEditor(
ISeamFacetDataModelProperties.HIBERNATE_DIALECT,
- "Hibernate
Dialect:",Arrays.asList(HIBERNATE_HELPER.getDialectNames()),"HSQL");
- IFieldEditor jdbcDriverClassname = IFieldEditorFactory.INSTANCE.createTextEditor(
+ "Hibernate Dialect:",HIBERNATE_HELPER.getDialectClass("HSQL"));
+
+ ITaggedFieldEditor jdbcDriverClassname =
IFieldEditorFactory.INSTANCE.createComboEditor(
ISeamFacetDataModelProperties.JDBC_DRIVER_CLASS_NAME,
- "JDBC Driver Class for Your Database:","com.package1.Classname");
- IFieldEditor jdbcUrlForDb = IFieldEditorFactory.INSTANCE.createTextEditor(
+ "JDBC Driver Class for Your
Database:",Arrays.asList(HIBERNATE_HELPER.getDriverClasses(HIBERNATE_HELPER.getDialectClass("HSQL"))),HIBERNATE_HELPER.getDriverClasses(HIBERNATE_HELPER.getDialectClass("HSQL"))[0]);
+ ITaggedFieldEditor jdbcUrlForDb = IFieldEditorFactory.INSTANCE.createComboEditor(
ISeamFacetDataModelProperties.JDBC_URL_FOR_DB,
- "JDBC Url for Your Database:", "url://domain/");
+ "JDBC Url for Your Database:",
+ Arrays.asList(HIBERNATE_HELPER.getConnectionURLS(HIBERNATE_HELPER.getDriverClasses(HIBERNATE_HELPER.getDialectClass("HSQL"))[0])),HIBERNATE_HELPER.getConnectionURLS(HIBERNATE_HELPER.getDriverClasses(HIBERNATE_HELPER.getDialectClass("HSQL"))[0])[0]);
IFieldEditor dbUserName = IFieldEditorFactory.INSTANCE.createTextEditor(
ISeamFacetDataModelProperties.DB_USER_NAME,
"Database User Name:", "username");
@@ -180,7 +184,7 @@
gridLayout = new GridLayout(3, false);
generalGroup.setLayout(gridLayout);
- registerEditor(jBossAsHomeEditor,generalGroup, 3);
+// registerEditor(jBossAsHomeEditor,generalGroup, 3);
registerEditor(jBossSeamHomeEditor,generalGroup, 3);
registerEditor(jBossAsDeployAsEditor,generalGroup, 3);
@@ -219,9 +223,25 @@
setControl(root);
validatorDelegate.addValidatorForProperty(jBossSeamHomeEditor.getName(),
ValidatorFactory.JBOSS_SEAM_HOME_FOLDER_VALIDATOR);
- validatorDelegate.addValidatorForProperty(jBossAsHomeEditor.getName(),
ValidatorFactory.JBOSS_AS_HOME_FOLDER_VALIDATOR);
+// validatorDelegate.addValidatorForProperty(jBossAsHomeEditor.getName(),
ValidatorFactory.JBOSS_AS_HOME_FOLDER_VALIDATOR);
validatorDelegate.addValidatorForProperty(pathToJdbcDriverJar.getName(),
ValidatorFactory.FILESYSTEM_FILE_EXISTS_VALIDATOR);
+ jBossAsDbTypeEditor.addPropertyChangeListener(new PropertyChangeListener() {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ jBossHibernateDialectEditor.setValue(HIBERNATE_HELPER.getDialectClass(evt.getNewValue().toString()));
+ jdbcDriverClassname.setTags(HIBERNATE_HELPER.getDriverClasses(HIBERNATE_HELPER.getDialectClass(evt.getNewValue().toString())));
+
+ }
+ });
+
+ jdbcDriverClassname.addPropertyChangeListener(new PropertyChangeListener(){
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ jdbcUrlForDb.setTags(HIBERNATE_HELPER.getConnectionURLS(evt.getNewValue().toString()));
+ }
+ });
+
}
/**
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SwtFieldEditorFactory.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SwtFieldEditorFactory.java 2007-07-12
07:23:47 UTC (rev 2395)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SwtFieldEditorFactory.java 2007-07-12
07:28:17 UTC (rev 2396)
@@ -21,7 +21,9 @@
import org.jboss.tools.seam.ui.widget.editor.CompositeEditor;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditor;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditorFactory;
+import org.jboss.tools.seam.ui.widget.editor.ITaggedFieldEditor;
import org.jboss.tools.seam.ui.widget.editor.LabelFieldEditor;
+import org.jboss.tools.seam.ui.widget.editor.TaggedComboFieldEditor;
import org.jboss.tools.seam.ui.widget.editor.TextFieldEditor;
/**
@@ -45,11 +47,9 @@
/**
*
*/
- public IFieldEditor createComboEditor(String name, String label,
+ public ITaggedFieldEditor createComboEditor(String name, String label,
List values, Object defaultValue) {
- CompositeEditor editor = new CompositeEditor(name,label, defaultValue);
- editor.addFieldEditors(new IFieldEditor[]{new LabelFieldEditor(name,label),
- new ComboFieldEditor(name,label,values,defaultValue.toString())});
+ TaggedComboFieldEditor editor = new TaggedComboFieldEditor(name,label,values,
defaultValue,true);
return editor;
}
@@ -66,6 +66,16 @@
/**
*
*/
+ public IFieldEditor createUneditableTextEditor(String name, String label, String
defaultValue) {
+ CompositeEditor editor = new CompositeEditor(name,label, defaultValue);
+ editor.addFieldEditors(new IFieldEditor[]{new LabelFieldEditor(name,label),
+ new TextFieldEditor(name,label, defaultValue,false)});
+ return editor;
+ }
+
+ /**
+ *
+ */
public IFieldEditor createBrowseFolderEditor(String name, String label, String
defaultValue) {
CompositeEditor editor = new CompositeEditor(name,label, defaultValue);
editor.addFieldEditors(new IFieldEditor[]{new LabelFieldEditor(name,label),
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/BaseFieldEditor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/BaseFieldEditor.java 2007-07-12
07:23:47 UTC (rev 2395)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/BaseFieldEditor.java 2007-07-12
07:28:17 UTC (rev 2396)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.seam.ui.widget.editor;
+import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
@@ -206,4 +207,23 @@
public void setLabelText(String labelText) {
this.labelText = labelText;
}
+
+ /**
+ *
+ */
+ private boolean editable = true;
+
+ /**
+ *
+ */
+ public boolean isEditable() {
+ return editable;
+ }
+
+ /**
+ *
+ */
+ public void setEditable(boolean aEditable) {
+ this.editable = aEditable;
+ }
}
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-07-12
07:23:47 UTC (rev 2395)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java 2007-07-12
07:28:17 UTC (rev 2396)
@@ -25,9 +25,13 @@
public class ComboFieldEditor extends BaseFieldEditor implements PropertyChangeListener{
List values = null;
- public ComboFieldEditor(String name, String label, List values,Object defaultValue) {
+
+ boolean flat = false;
+
+ public ComboFieldEditor(String name, String label, List values,Object
defaultValue,boolean flat) {
super(name, label, defaultValue);
this.values = Collections.unmodifiableList(values);
+ this.flat = flat;
}
private Control comboControl;
@@ -45,7 +49,7 @@
public Control getComboControl(Composite composite) {
// TODO Auto-generated method stub
if(comboControl == null) {
- ComboBoxField comboField = new ComboBoxField(composite,values,getValue());
+ ComboBoxField comboField = new ComboBoxField(composite,values,getValue(),flat);
comboControl = comboField.getComboControl();
comboField.addPropertyChangeListener(this);
} else if(composite!=null) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CompositeEditor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CompositeEditor.java 2007-07-12
07:23:47 UTC (rev 2395)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CompositeEditor.java 2007-07-12
07:28:17 UTC (rev 2396)
@@ -40,7 +40,7 @@
for(int i=0;i<controls.length;i++) {
GridData gd = new GridData();
gd.horizontalSpan = controls.length-1==i?gl.numColumns-i:1;
- gd.horizontalAlignment = controls[i] instanceof
Combo?SWT.BEGINNING:GridData.FILL;
+ gd.horizontalAlignment = GridData.FILL;
gd.grabExcessHorizontalSpace = (i==1);
controls[i].setLayoutData(gd);
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/IFieldEditorFactory.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/IFieldEditorFactory.java 2007-07-12
07:23:47 UTC (rev 2395)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/IFieldEditorFactory.java 2007-07-12
07:28:17 UTC (rev 2396)
@@ -33,7 +33,7 @@
* @param defaultValue
* @return
*/
- IFieldEditor createComboEditor(String name, String label, List values, Object
defaultValue);
+ ITaggedFieldEditor createComboEditor(String name, String label, List values, Object
defaultValue);
/**
*
@@ -61,5 +61,13 @@
* @return
*/
IFieldEditor createBrowseFileEditor(String name, String label, String defaultValue);
+ /**
+ * @param jdbcDriverClassName
+ * @param string
+ * @param string2
+ * @return
+ */
+ IFieldEditor createUneditableTextEditor(String jdbcDriverClassName,
+ String string, String string2);
}
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ITaggedFieldEditor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ITaggedFieldEditor.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ITaggedFieldEditor.java 2007-07-12
07:28:17 UTC (rev 2396)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.seam.ui.widget.editor;
+
+/**
+ * @author eskimo
+ *
+ */
+public interface ITaggedFieldEditor extends IFieldEditor {
+
+ /**
+ *
+ * @return
+ */
+ public String[] getTags();
+
+ /**
+ *
+ * @param tags
+ */
+ public void setTags(String[] tags);
+}
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TaggedComboFieldEditor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TaggedComboFieldEditor.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TaggedComboFieldEditor.java 2007-07-12
07:28:17 UTC (rev 2396)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.widget.editor;
+
+import java.beans.PropertyChangeListener;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Control;
+
+public class TaggedComboFieldEditor extends CompositeEditor implements
ITaggedFieldEditor, PropertyChangeListener{
+
+ List values = null;
+
+ boolean floatStyle = true;
+ ComboFieldEditor combo = null;
+
+ public TaggedComboFieldEditor(String name, String label, List values,Object
defaultValue, boolean floatStyle) {
+ super(name, label, defaultValue);
+ this.values = Collections.unmodifiableList(values);
+ this.floatStyle = floatStyle;
+ combo = new ComboFieldEditor(name,label,values,defaultValue.toString(),floatStyle);
+ addFieldEditors(new IFieldEditor[]{new LabelFieldEditor(name,label),
+ combo});
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.ui.widget.editor.ITaggedFieldEditor#getTags()
+ */
+ public String[] getTags() {
+ return ((Combo)getEditorControls()[1]).getItems();
+ }
+
+ /* (non-Javadoc)
+ * @see
org.jboss.tools.seam.ui.widget.editor.ITaggedFieldEditor#setTags(java.lang.String[])
+ */
+ public void setTags(String[] tags) {
+ ((Combo)getEditorControls()[1]).setItems(tags);
+ combo.setValue(tags.length==0? "":tags[0]);
+ ((Combo)getEditorControls()[1]).getParent().layout(new
Control[]{(Combo)getEditorControls()[1]});
+ }
+
+}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java 2007-07-12
07:23:47 UTC (rev 2395)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java 2007-07-12
07:28:17 UTC (rev 2396)
@@ -8,7 +8,6 @@
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
******************************************************************************/
-
package org.jboss.tools.seam.ui.widget.editor;
@@ -43,13 +42,31 @@
protected int style = -1;
+ /**
+ *
+ * @param name
+ * @param aLabelText
+ * @param defaultvalue
+ */
public TextFieldEditor(String name,String aLabelText,String defaultvalue) {
super(name, aLabelText, defaultvalue);
}
/**
*
+ * @param name
+ * @param aLabelText
+ * @param defaultvalue
+ * @param editable
*/
+ public TextFieldEditor(String name,String aLabelText,String defaultvalue,boolean
editable) {
+ super(name, aLabelText, defaultvalue);
+ setEditable(editable);
+ }
+
+ /**
+ *
+ */
protected TextField fTextField = null;
/**
@@ -97,17 +114,25 @@
textField.setFont(parent.getFont());
Object value = getValue();
textField.setText(getValue().toString());
+ textField.setEditable(isEditable());
fTextField.addPropertyChangeListener(this);
} else if (parent!=null){
Assert.isTrue(parent==fTextField.getTextControl().getParent());
}
return fTextField.getTextControl();
}
-
+
+ /**
+ *
+ */
protected void updateWidgetValues() {
setValueAsString(getValueAsString());
}
+ /**
+ *
+ * @return
+ */
protected int getInitialStyle() {
if(this.style >= 0) return style;
return SWT.SINGLE | SWT.BORDER;
@@ -146,6 +171,7 @@
private String checkSimple(Object value){
return (value != null) ? value.toString() : new String("");
}
+
/**
*
*/
@@ -160,10 +186,9 @@
* text field is created yet
*/
protected Text getTextControl() {
- return fTextField.getTextControl();
+ return fTextField!=null?fTextField.getTextControl():null;
}
-
/**
* @see
com.kabira.ide.ex.workbench.ui.feature.eitors.BaseFeatureFieldEditor#setFocus()
*/
@@ -174,30 +199,41 @@
return setfocus;
}
+ /**
+ *
+ */
@Override
public Object[] getEditorControls(Object composite) {
return new Control[]{getTextControl((Composite)composite)};
}
+ /**
+ *
+ * @param object
+ */
public void save(Object object) {
}
+ /**
+ *
+ */
public void setValue(Object newWalue) {
fTextField.removePropertyChangeListener(this);
fTextField.getTextControl().setText(newWalue.toString());
fTextField.addPropertyChangeListener(this);
}
-
- public boolean isEditable() {
- // TODO Auto-generated method stub
- return false;
+
+ /**
+ *
+ */
+ public void setEditable(boolean aEditable) {
+ super.setEditable(aEditable);
+ if(getTextControl()!=null) getTextControl().setEditable(aEditable);
}
-
- public void setEditable(boolean aEdiatble) {
- // TODO Auto-generated method stub
-
- }
-
+
+ /**
+ *
+ */
public void propertyChange(PropertyChangeEvent evt) {
super.setValue(evt.getNewValue());
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/ComboBoxField.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/ComboBoxField.java 2007-07-12
07:23:47 UTC (rev 2395)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/ComboBoxField.java 2007-07-12
07:28:17 UTC (rev 2396)
@@ -38,9 +38,11 @@
ComboViewer comboControl = null;
List values = new ArrayList();
- public ComboBoxField(Composite parent,List values, Object value) {
+
+
+ public ComboBoxField(Composite parent,List values, Object value, boolean floatStyle) {
this.values = values;
- comboControl = new ComboViewer(parent, SWT.READ_ONLY);
+ comboControl = new ComboViewer(parent,floatStyle?SWT.FLAT:SWT.READ_ONLY);
comboControl.setContentProvider(new IStructuredContentProvider() {
@@ -101,7 +103,7 @@
}
public void selectionChanged(SelectionChangedEvent event) {
- firePropertyChange("", event.getSelection());
+ firePropertyChange("",
((StructuredSelection)event.getSelection()).getFirstElement());
}
public Combo getComboControl() {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2007-07-12
07:23:47 UTC (rev 2395)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2007-07-12
07:28:17 UTC (rev 2396)
@@ -14,16 +14,20 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jst.servlet.ui.project.facet.WebProjectWizard;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.ui.PresetSelectionPanel;
import org.osgi.framework.Bundle;
/**
-
+ *
+ * @author eskimo
+ *
*/
-
public class SeamProjectWizard extends WebProjectWizard {
@@ -50,6 +54,42 @@
page.setDescription("TBD Description of wizard");
return page;
}
+
+ @Override
+ public void createPageControls(Composite container) {
+ super.createPageControls(container);
+ getModel().setSelectedPreset("preset.jst.seam.v2_0");
+ Control control = findControlByClass((Composite)getShell(),
PresetSelectionPanel.class);
+ control.setVisible(false);
+ control = findGroupByText((Composite)getShell(), "EAR Membership");
+ control.setVisible(false);
+ }
+ Control findControlByClass(Composite comp, Class claz) {
+ for (Control child : comp.getChildren()) {
+ System.out.println(child.getClass().getName());
+ if(child.getClass()==claz) {
+ return child;
+ } else if(child instanceof Composite){
+ Control control = findControlByClass((Composite)child, claz);
+ if(control!=null) return control;
+ }
+ }
+ return null;
+ }
+
+
+ Control findGroupByText(Composite comp, String text) {
+ for (Control child : comp.getChildren()) {
+ System.out.println(child.getClass().getName());
+ if(child instanceof Group && ((Group)child).getText().equals(text)) {
+ return child;
+ } else if(child instanceof Composite){
+ Control control = findGroupByText((Composite)child, text);
+ if(control!=null) return control;
+ }
+ }
+ return null;
+ }
}
\ No newline at end of file