Author: dgolovin
Date: 2007-07-11 04:33:20 -0400 (Wed, 11 Jul 2007)
New Revision: 2380
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ProjectSelectionFieldEditor.java
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/SwtFieldEditorFactory.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ButtonFieldEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/IFieldEditorFactory.java
Log:
http://jira.jboss.org/jira/browse/EXIN-221
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-11
07:43:51 UTC (rev 2379)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-07-11
08:33:20 UTC (rev 2380)
@@ -93,7 +93,7 @@
IFieldEditor recreateTablesOnDeploy =
IFieldEditorFactory.INSTANCE.createCheckboxEditor(
ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY,
"Recreate database tables and data on deploy:", false);
- IFieldEditor pathToJdbcDriverJar =
IFieldEditorFactory.INSTANCE.createBrowseFolderEditor(
+ IFieldEditor pathToJdbcDriverJar = IFieldEditorFactory.INSTANCE.createBrowseFileEditor(
ISeamFacetDataModelProperties. JDBC_DRIVER_JAR_PATH,
"JDBC Driver jar:", "");
@@ -231,6 +231,8 @@
if(event.getPropertyName().equals(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER))
{
model.setStringProperty(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER,
event.getProperty()
.toString());
+ } if (event.getPropertyName().equals(ISeamFacetDataModelProperties.DB_TYPE)) {
+
}
}
}
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-11
07:43:51 UTC (rev 2379)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SwtFieldEditorFactory.java 2007-07-11
08:33:20 UTC (rev 2380)
@@ -14,6 +14,7 @@
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
import org.jboss.tools.seam.ui.widget.editor.ButtonFieldEditor;
import org.jboss.tools.seam.ui.widget.editor.CheckBoxFieldEditor;
import org.jboss.tools.seam.ui.widget.editor.ComboFieldEditor;
@@ -69,12 +70,24 @@
CompositeEditor editor = new CompositeEditor(name,label, defaultValue);
editor.addFieldEditors(new IFieldEditor[]{new LabelFieldEditor(name,label),
new TextFieldEditor(name,label, defaultValue),
- new ButtonFieldEditor(name,createSelectFolderAction("Browse"))});
+ new
ButtonFieldEditor(name,createSelectFolderAction("Browse"),defaultValue)});
return editor;
}
+
/**
*
+ */
+ public IFieldEditor createBrowseFileEditor(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),
+ new
ButtonFieldEditor(name,createSelectFileAction("Browse"),defaultValue)});
+ return editor;
+ }
+
+ /**
+ *
* @param buttonName
* @return
*/
@@ -93,4 +106,25 @@
}
};
}
+
+ /**
+ *
+ * @param buttonName
+ * @return
+ */
+ public ButtonFieldEditor.ButtonPressedAction createSelectFileAction(String buttonName)
{
+ return new ButtonFieldEditor.ButtonPressedAction(buttonName) {
+ @Override
+ public void run() {
+ FileDialog dialog = new FileDialog(Display.getCurrent().getActiveShell());
+ dialog.setFilterPath(getFieldEditor().getValueAsString());
+ dialog.setText("Select Seam Home Folder");
+ dialog.setFilterPath(getFieldEditor().getValueAsString());
+ String directory = dialog.open();
+ if(directory!=null) {
+ getFieldEditor().setValue(directory);
+ }
+ }
+ };
+ }
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ButtonFieldEditor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ButtonFieldEditor.java 2007-07-11
07:43:51 UTC (rev 2379)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ButtonFieldEditor.java 2007-07-11
08:33:20 UTC (rev 2380)
@@ -34,8 +34,8 @@
super(name, label, new Object());
}
- public ButtonFieldEditor(String name, ButtonPressedAction action) {
- super(name, action.getText(), new Object());
+ public ButtonFieldEditor(String name, ButtonPressedAction action, Object defaultValue)
{
+ super(name, action.getText(), defaultValue);
buttonAction = action;
buttonAction.setFieldEditor(this);
}
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-11
07:43:51 UTC (rev 2379)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/IFieldEditorFactory.java 2007-07-11
08:33:20 UTC (rev 2380)
@@ -52,5 +52,14 @@
* @return
*/
IFieldEditor createBrowseFolderEditor(String name, String label, String defaultValue);
+
+ /**
+ *
+ * @param name
+ * @param label
+ * @param defaultValue
+ * @return
+ */
+ IFieldEditor createBrowseFileEditor(String name, String label, String defaultValue);
}
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ProjectSelectionFieldEditor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ProjectSelectionFieldEditor.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ProjectSelectionFieldEditor.java 2007-07-11
08:33:20 UTC (rev 2380)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * 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 class ProjectSelectionFieldEditor extends BaseFieldEditor {
+
+ /**
+ * @param name
+ * @param label
+ * @param defaultValue
+ */
+ public ProjectSelectionFieldEditor(String name, String label,
+ Object defaultValue) {
+ super(name, label, defaultValue);
+ // TODO Auto-generated constructor stub
+ }
+
+ /* (non-Javadoc)
+ * @see
org.jboss.tools.seam.ui.widget.editor.BaseFieldEditor#doFillIntoGrid(java.lang.Object)
+ */
+ @Override
+ public void doFillIntoGrid(Object parent) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see
org.jboss.tools.seam.ui.widget.editor.BaseFieldEditor#getEditorControls(java.lang.Object)
+ */
+ @Override
+ public Object[] getEditorControls(Object composite) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.ui.widget.editor.BaseFieldEditor#getEditorControls()
+ */
+ @Override
+ public Object[] getEditorControls() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.ui.widget.editor.IFieldEditor#isEditable()
+ */
+ public boolean isEditable() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.ui.widget.editor.IFieldEditor#setEditable(boolean)
+ */
+ public void setEditable(boolean ediatble) {
+ // TODO Auto-generated method stub
+
+ }
+
+}