Author: DartPeng
Date: 2009-06-30 06:37:00 -0400 (Tue, 30 Jun 2009)
New Revision: 16279
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataConfiguraitonWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataPathWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/ViewerInitorStore.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/AbstractFileSelectionWizardPage.java
Log:
JBIDE-4540
Create Json reader config wizard page
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataConfiguraitonWizardPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataConfiguraitonWizardPage.java 2009-06-30
10:05:39 UTC (rev 16278)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataConfiguraitonWizardPage.java 2009-06-30
10:37:00 UTC (rev 16279)
@@ -10,32 +10,443 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.json;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Text;
/**
* @author Dart (dpeng(a)redhat.com)
- *
+ *
*/
public class JsonDataConfiguraitonWizardPage extends WizardPage {
- /* (non-Javadoc)
- * @see
org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ private String rootName = null;
+
+ private String arrayElementName = "element";
+
+ private String keyWhitspaceReplacement = "-";
+
+ private String keyPrefixOnNumeric;
+
+ private String illegalElementNameCharReplacement;
+
+ private String nullValueReplacement = "";
+
+ private Map<String, String> keyMap;
+
+ private String encoding = "UTF-8";
+
+ private Text rootNameText;
+
+ private Text arrayElementNameText;
+
+ private Text keyWhitspaceReplacementText;
+
+ private Text keyPrefixOnNumericText;
+
+ private Text illegalElementNameCharReplacementText;
+
+ private Text nullValueReplacementText;
+
+ private Text encodingText;
+
+ private TableViewer keyMapViewer;
+
+ private ArrayList<KeyValueModel> keyValueList;
+
+ private void initValue() {
+ rootName = null;
+
+ arrayElementName = "element";
+
+ keyWhitspaceReplacement = "-";
+
+ keyPrefixOnNumeric = null;
+
+ illegalElementNameCharReplacement = null;
+ nullValueReplacement = "";
+ keyMap = new HashMap<String, String>();
+ encoding = "UTF-8";
+ keyValueList = new ArrayList<KeyValueModel>();
+
+ keyValueList.add(new KeyValueModel("ket", "aaaa"));
+ keyValueList.add(new KeyValueModel("12", "4"));
+ keyValueList.add(new KeyValueModel("fg", "1a"));
+ keyValueList.add(new KeyValueModel("g", "y4"));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
+ * .Composite)
*/
public void createControl(Composite parent) {
+ initValue();
+ Composite mainComposite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ mainComposite.setLayout(layout);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.grabExcessHorizontalSpace = true;
+ gd.grabExcessVerticalSpace = true;
+ mainComposite.setLayoutData(gd);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ /**
+ * String rootName, String arrayElementName, String
+ * keyWhitspaceReplacement, String keyPrefixOnNumeric, String
+ * illegalElementNameCharReplacement, String nullValueReplacement,
+ * Map<String, String> keyMap, String encoding
+ */
+ Label rootnameLabel = new Label(mainComposite, SWT.NONE);
+ rootnameLabel.setText("Root Element Name");
+ rootNameText = new Text(mainComposite, SWT.BORDER);
+ rootNameText.setLayoutData(gd);
+
+ Label arrayElementNameLabel = new Label(mainComposite, SWT.NONE);
+ arrayElementNameLabel.setText("Array Element Name");
+ arrayElementNameText = new Text(mainComposite, SWT.BORDER);
+ arrayElementNameText.setLayoutData(gd);
+ arrayElementNameText.setText(arrayElementName);
+
+ Label keyWhitspaceReplacementLabel = new Label(mainComposite, SWT.NONE);
+ keyWhitspaceReplacementLabel.setText("Space Replacement");
+ keyWhitspaceReplacementText = new Text(mainComposite, SWT.BORDER);
+ keyWhitspaceReplacementText.setLayoutData(gd);
+ if (keyWhitspaceReplacement == null) {
+ keyWhitspaceReplacement = "";
+ }
+ keyWhitspaceReplacementText.setText(keyWhitspaceReplacement);
+
+ Label keyPrefixOnNumeric = new Label(mainComposite, SWT.NONE);
+ keyPrefixOnNumeric.setText("Prefix On Numeric");
+ keyPrefixOnNumericText = new Text(mainComposite, SWT.BORDER);
+ keyPrefixOnNumericText.setLayoutData(gd);
+
+ Label illegalElementNameCharReplacementLabel = new Label(mainComposite,
+ SWT.NONE);
+ illegalElementNameCharReplacementLabel
+ .setText("IllegalChar Replacement");
+ illegalElementNameCharReplacementText = new Text(mainComposite,
+ SWT.BORDER);
+ illegalElementNameCharReplacementText.setLayoutData(gd);
+
+ Label nullValueReplacementlabel = new Label(mainComposite, SWT.NONE);
+ nullValueReplacementlabel.setText("NullValue Replacement");
+ nullValueReplacementText = new Text(mainComposite, SWT.BORDER);
+ nullValueReplacementText.setLayoutData(gd);
+ nullValueReplacementText.setText(nullValueReplacement);
+
+ Label encodingLabel = new Label(mainComposite, SWT.NONE);
+ encodingLabel.setText("Encoding");
+ encodingText = new Text(mainComposite, SWT.BORDER);
+ encodingText.setLayoutData(gd);
+ encodingText.setText(encoding);
+
+ Label keyMapLabel = new Label(mainComposite, SWT.NONE);
+ keyMapLabel.setText("Key Map:");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ keyMapLabel.setLayoutData(gd);
+
+ keyMapViewer = new TableViewer(mainComposite, SWT.BORDER);
+
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 2;
+ keyMapViewer.getControl().setLayoutData(gd);
+ keyMapViewer.getTable().setHeaderVisible(true);
+ keyMapViewer.getTable().setLinesVisible(true);
+ keyMapViewer.setContentProvider(new KeyMapContentProvider());
+ keyMapViewer.setLabelProvider(new KeyMapLabelProvider());
+ keyMapViewer.setInput(keyValueList);
+
+ CellEditor keyCellEditor = new TextCellEditor(keyMapViewer.getTable(),SWT.BORDER);
+
+ CellEditor valueCellEditor = new TextCellEditor(keyMapViewer.getTable(),SWT.BORDER);
+
+
+ keyMapViewer.setCellEditors(new CellEditor[]{keyCellEditor,valueCellEditor});
+
+ keyMapViewer.setColumnProperties(new String[]{"key","value"});
+
+ keyMapViewer.setCellModifier(new ICellModifier() {
+
+ public void modify(Object element, String property, Object value) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Object getValue(Object element, String property) {
+ // TODO Auto-generated method stub
+ return "ggg";
+ }
+
+ public boolean canModify(Object element, String property) {
+ return true;
+ }
+ });
+
+ TableColumn keyColumn = new TableColumn(keyMapViewer.getTable(),
+ SWT.NONE);
+ keyColumn.setWidth(150);
+ keyColumn.setText("Key");
+ TableColumn replaceColumn = new TableColumn(keyMapViewer.getTable(),
+ SWT.NONE);
+ replaceColumn.setWidth(150);
+ replaceColumn.setText("Replace");
+
+ hookControls();
+ changePageStatus();
+ this.setControl(mainComposite);
}
- public JsonDataConfiguraitonWizardPage(String pageName, String title, ImageDescriptor
titleImage) {
+ private void hookControls() {
+ encodingText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ encoding = encodingText.getText();
+ changePageStatus();
+ }
+ });
+
+ nullValueReplacementText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ nullValueReplacement = nullValueReplacementText.getText();
+ changePageStatus();
+ }
+ });
+
+ illegalElementNameCharReplacementText
+ .addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ illegalElementNameCharReplacement = illegalElementNameCharReplacementText
+ .getText();
+ changePageStatus();
+ }
+ });
+
+ keyPrefixOnNumericText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ keyPrefixOnNumeric = keyPrefixOnNumericText.getText();
+ changePageStatus();
+ }
+ });
+
+ keyWhitspaceReplacementText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ keyWhitspaceReplacement = keyWhitspaceReplacementText.getText();
+ changePageStatus();
+ }
+ });
+
+ arrayElementNameText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ arrayElementName = arrayElementNameText.getText();
+ changePageStatus();
+ }
+ });
+
+ rootNameText.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ rootName = rootNameText.getText();
+ changePageStatus();
+ }
+ });
+ }
+
+ private void changePageStatus() {
+ String error = null;
+ rootName = rootNameText.getText();
+ if (rootName == null || rootName.length() == 0) {
+ error = "Root Name can't be null";
+ }
+
+ arrayElementName = arrayElementNameText.getText();
+ if (arrayElementName == null || arrayElementName.length() == 0) {
+ error = "Array Element Name can't be null";
+ }
+
+ // if (keyWhitspaceReplacement == null
+ // || keyWhitspaceReplacement.length() == 0) {
+ // error = "Space replacement string can't be null";
+ // }
+
+ encoding = encodingText.getText();
+ if (encoding == null || encoding.length() == 0) {
+ error = "Encoding can't be null";
+ }
+
+ setErrorMessage(error);
+ setPageComplete(error == null);
+ }
+
+ public JsonDataConfiguraitonWizardPage(String pageName, String title,
+ ImageDescriptor titleImage) {
super(pageName, title, titleImage);
// TODO Auto-generated constructor stub
}
public JsonDataConfiguraitonWizardPage(String pageName) {
super(pageName);
- // TODO Auto-generated constructor stub
}
+ public String getRootName() {
+ return rootName;
+ }
+
+ public void setRootName(String rootName) {
+ this.rootName = rootName;
+ }
+
+ public String getArrayElementName() {
+ return arrayElementName;
+ }
+
+ public void setArrayElementName(String arrayElementName) {
+ this.arrayElementName = arrayElementName;
+ }
+
+ public String getKeyWhitspaceReplacement() {
+ return keyWhitspaceReplacement;
+ }
+
+ public void setKeyWhitspaceReplacement(String keyWhitspaceReplacement) {
+ this.keyWhitspaceReplacement = keyWhitspaceReplacement;
+ }
+
+ public String getKeyPrefixOnNumeric() {
+ return keyPrefixOnNumeric;
+ }
+
+ public void setKeyPrefixOnNumeric(String keyPrefixOnNumeric) {
+ this.keyPrefixOnNumeric = keyPrefixOnNumeric;
+ }
+
+ public String getIllegalElementNameCharReplacement() {
+ return illegalElementNameCharReplacement;
+ }
+
+ public void setIllegalElementNameCharReplacement(
+ String illegalElementNameCharReplacement) {
+ this.illegalElementNameCharReplacement = illegalElementNameCharReplacement;
+ }
+
+ public String getNullValueReplacement() {
+ return nullValueReplacement;
+ }
+
+ public void setNullValueReplacement(String nullValueReplacement) {
+ this.nullValueReplacement = nullValueReplacement;
+ }
+
+ public Map<String, String> getKeyMap() {
+ return keyMap;
+ }
+
+ public void setKeyMap(Map<String, String> keyMap) {
+ this.keyMap = keyMap;
+ }
+
+ public String getEncoding() {
+ return encoding;
+ }
+
+ public void setEncoding(String encoding) {
+ this.encoding = encoding;
+ }
+
+ private class KeyMapLabelProvider extends LabelProvider implements ITableLabelProvider{
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+// if(element instanceof KeyValueModel){
+// switch(columnIndex){
+// case 0:
+// return ((KeyValueModel)element).getKey();
+// case 1:
+// return ((KeyValueModel)element).getValue();
+// }
+// }
+ return getText(element);
+ }
+
+ }
+
+ private class KeyMapContentProvider implements IStructuredContentProvider{
+
+ public Object[] getElements(Object inputElement) {
+ if(inputElement instanceof List<?>){
+ return ((List<?>)inputElement).toArray();
+ }
+ // TODO Auto-generated method stub
+ return new Object[]{};
+ }
+
+ public void dispose() {
+
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ // TODO Auto-generated method stub
+
+ }
+
+ }
+
+ private class KeyValueModel{
+ private String key;
+ private String value;
+
+ public KeyValueModel(String key , String value){
+ this.key = key;
+ this.value = value;
+ }
+
+ public String getKey() {
+ return key;
+ }
+ public void setKey(String key) {
+ this.key = key;
+ }
+ public String getValue() {
+ return value;
+ }
+ public void setValue(String value) {
+ this.value = value;
+ }
+ }
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataPathWizardPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataPathWizardPage.java 2009-06-30
10:05:39 UTC (rev 16278)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataPathWizardPage.java 2009-06-30
10:37:00 UTC (rev 16279)
@@ -24,13 +24,13 @@
public JsonDataPathWizardPage(String pageName, boolean multiSelect, Object[]
initSelections,
List<ViewerFilter> filters) {
super(pageName, multiSelect, initSelections, filters);
- // TODO Auto-generated constructor stub
}
public JsonDataPathWizardPage(String pageName, String[] fileExtensionNames) {
super(pageName, fileExtensionNames);
- // TODO Auto-generated constructor stub
}
+
+
/* (non-Javadoc)
* @see
org.jboss.tools.smooks.configuration.editors.xml.AbstractFileSelectionWizardPage#loadedTheObject(java.lang.String)
@@ -39,5 +39,22 @@
protected Object loadedTheObject(String path) throws Exception {
return null;
}
-
+
+ @Override
+ protected void changeWizardPageStatus() {
+ super.changeWizardPageStatus();
+ }
+
+ @Override
+ public boolean canFlipToNextPage() {
+ return super.canFlipToNextPage();
+// String filePath = this.getFilePath();
+// try {
+// filePath = SmooksUIUtils.parseFilePath(filePath);
+// if(filePath == null) return false;
+// return new File(filePath).exists();
+// } catch (InvocationTargetException e) {
+// return false;
+// }
+ }
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataWizard.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataWizard.java 2009-06-30
10:05:39 UTC (rev 16278)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/json/JsonDataWizard.java 2009-06-30
10:37:00 UTC (rev 16279)
@@ -19,12 +19,14 @@
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
import
org.jboss.tools.smooks.configuration.editors.wizard.IStructuredDataSelectionWizard;
+import org.jboss.tools.smooks10.model.smooks.util.SmooksModelUtils;
/**
* @author Dart (dpeng(a)redhat.com)
*
*/
-public class JsonDataWizard extends Wizard implements IStructuredDataSelectionWizard,
INewWizard {
+public class JsonDataWizard extends Wizard implements
+ IStructuredDataSelectionWizard, INewWizard {
private JsonDataPathWizardPage pathPage = null;
@@ -32,24 +34,37 @@
public JsonDataWizard() {
super();
- pathPage = new JsonDataPathWizardPage("Json Input Data Selection ", new
String[]{});
- configPage = new JsonDataConfiguraitonWizardPage("Json data configuration
page");
}
-
-
- /* (non-Javadoc)
+ public boolean canFinish() {
+ if (configPage != null && pathPage != null) {
+ if (configPage.isPageComplete() && pathPage.isPageComplete())
+ return true;
+ }
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.wizard.Wizard#addPages()
*/
@Override
public void addPages() {
super.addPages();
+ if (pathPage == null) {
+ pathPage = new JsonDataPathWizardPage("Json Input Data Selection ",
+ new String[] {});
+
+ }
+ if (configPage == null) {
+ configPage = new JsonDataConfiguraitonWizardPage(
+ "Json data configuration page");
+ }
this.addPage(pathPage);
this.addPage(configPage);
}
-
-
/*
* (non-Javadoc)
*
@@ -80,7 +95,7 @@
*/
public String getInputDataTypeID() {
// TODO Auto-generated method stub
- return null;
+ return SmooksModelUtils.INPUT_TYPE_JSON;
}
/*
@@ -90,10 +105,50 @@
* IStructuredDataSelectionWizard#getProperties()
*/
public Properties getProperties() {
- // TODO Auto-generated method stub
- return null;
+ Properties properties = new Properties();
+ fillProperties(properties);
+ return properties;
}
+ private void fillProperties(Properties p) {
+ if (configPage != null) {
+ String aen = configPage.getArrayElementName();
+ if (aen != null && aen.length() != 0) {
+ p.setProperty("arrayElementName", aen);
+ }
+
+ String rn = configPage.getRootName();
+ if (rn != null && rn.length() != 0) {
+ p.setProperty("rootName", rn);
+ }
+
+ String encoding = configPage.getEncoding();
+ if (encoding != null && encoding.length() != 0) {
+ p.setProperty("encoding", encoding);
+ }
+
+ String sr = configPage.getKeyWhitspaceReplacement();
+ if (sr != null && sr.length() != 0) {
+ p.setProperty("spaceReplace", sr);
+ }
+
+ String pon = configPage.getKeyPrefixOnNumeric();
+ if (pon != null && pon.length() != 0) {
+ p.setProperty("prefixOnNumeric", pon);
+ }
+
+ String nvr = configPage.getNullValueReplacement();
+ if (nvr != null && nvr.length() != 0) {
+ p.setProperty("nullReplace", nvr);
+ }
+
+ String ier = configPage.getIllegalElementNameCharReplacement();
+ if (ier != null && ier.length() != 0) {
+ p.setProperty("illegalReplace", ier);
+ }
+ }
+ }
+
/*
* (non-Javadoc)
*
@@ -112,6 +167,9 @@
* IStructuredDataSelectionWizard#getStructuredDataSourcePath()
*/
public String getStructuredDataSourcePath() {
+ if (pathPage != null) {
+ return pathPage.getFilePath();
+ }
return null;
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-06-30
10:05:39 UTC (rev 16278)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-06-30
10:37:00 UTC (rev 16279)
@@ -402,6 +402,7 @@
}
public static String parseFilePath(String path) throws InvocationTargetException {
+ if(path == null) return null;
if (new File(path).exists()) {
return path;
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/ViewerInitorStore.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/ViewerInitorStore.java 2009-06-30
10:05:39 UTC (rev 16278)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/wizard/ViewerInitorStore.java 2009-06-30
10:37:00 UTC (rev 16279)
@@ -55,15 +55,16 @@
if (initor == null)
return null;
IStructuredDataSelectionWizard wizard = initor.getStructuredDataLoadWizard();
- if(wizard != null){
- try {
- return wizard.getClass().newInstance();
- } catch (Throwable t){
- t.printStackTrace();
- return wizard;
- }
- }
- return null;
+ return wizard;
+// if(wizard != null){
+// try {
+// return wizard.getClass().newInstance();
+// } catch (Throwable t){
+// t.printStackTrace();
+// return wizard;
+// }
+// }
+// return null;
}
public ILabelProvider getLabelProvider(String typeID) {
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/AbstractFileSelectionWizardPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/AbstractFileSelectionWizardPage.java 2009-06-30
10:05:39 UTC (rev 16278)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xml/AbstractFileSelectionWizardPage.java 2009-06-30
10:37:00 UTC (rev 16279)
@@ -66,7 +66,7 @@
public AbstractFileSelectionWizardPage(String pageName, String[] fileExtensionNames) {
this(pageName, false, null, Collections.EMPTY_LIST);
this.fileExtensionNames = fileExtensionNames;
- if (this.fileExtensionNames != null) {
+ if (this.fileExtensionNames != null && fileExtensionNames.length != 0) {
ViewerFilter extensionNameFilter = new ViewerFilter() {
/*
* (non-Javadoc)
@@ -332,7 +332,7 @@
gd.grabExcessHorizontalSpace = true;
gd.horizontalAlignment = GridData.END;
fileSystemBrowseButton.setLayoutData(gd);
-
+ changeWizardPageStatus();
return xsdComposite;
}
@@ -411,7 +411,6 @@
// }
this.setErrorMessage(error);
this.setPageComplete(error == null);
-
}
public void widgetDefaultSelected(SelectionEvent e) {