Author: tfennelly
Date: 2009-12-04 07:28:49 -0500 (Fri, 04 Dec 2009)
New Revision: 19046
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AddNextTaskNodeAction.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/FreemarkerCSVCreationWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/FreemarkerCSVTemplateCreationWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/messages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-5378
Replace table entry on CSV template creation dialog with simple CSV field decl
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java 2009-12-04
12:22:40 UTC (rev 19045)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java 2009-12-04
12:28:49 UTC (rev 19046)
@@ -39,7 +39,7 @@
*/
public class SmooksConfigurationFileNewWizard extends Wizard implements INewWizard {
private SmooksFileContainerSelectionPage containerSelectionPage;
- private SmooksVersionSelectionPage versionSelectionPage;
+// private SmooksVersionSelectionPage versionSelectionPage;
private ISelection selection;
/**
@@ -60,8 +60,8 @@
(IStructuredSelection) selection);
addPage(containerSelectionPage);
- versionSelectionPage = new
SmooksVersionSelectionPage(Messages.SmooksConfigurationFileNewWizard_VersionPageName);
- addPage(versionSelectionPage);
+// versionSelectionPage = new
SmooksVersionSelectionPage(Messages.SmooksConfigurationFileNewWizard_VersionPageName);
+// addPage(versionSelectionPage);
}
/**
@@ -71,7 +71,7 @@
public boolean performFinish() {
final IPath containerPath = containerSelectionPage.getContainerFullPath();
final String fileName = containerSelectionPage.getFileName();
- final String version = versionSelectionPage.getVersion();
+ final String version = SmooksConstants.VERSION_1_2;
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
@@ -193,7 +193,6 @@
+ " <params>\n"//$NON-NLS-1$
+ " <param
name=\"stream.filter.type\">SAX</param>\n"//$NON-NLS-1$
+ " </params>\n"//$NON-NLS-1$
-// + " <graph:smooks-graphics-ext platformVersion =
\"1.2\"/>\n"//$NON-NLS-1$
+ "</smooks-resource-list>"; //$NON-NLS-1$
}
return new ByteArrayInputStream(contents.getBytes());
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AddNextTaskNodeAction.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AddNextTaskNodeAction.java 2009-12-04
12:22:40 UTC (rev 19045)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AddNextTaskNodeAction.java 2009-12-04
12:28:49 UTC (rev 19046)
@@ -10,9 +10,6 @@
******************************************************************************/
package org.jboss.tools.smooks.graphical.actions;
-import java.util.Iterator;
-import java.util.List;
-
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.ecore.util.FeatureMapUtil;
import org.eclipse.emf.edit.command.AddCommand;
@@ -65,15 +62,16 @@
IWizard currentWizard = wizard.getWizard();
if (currentWizard instanceof FreemarkerCSVTemplateCreationWizard) {
- List<String> fields = ((FreemarkerCSVTemplateCreationWizard)
currentWizard).getFields();
- String fieldsString = "";
- for (Iterator<?> iterator = fields.iterator(); iterator.hasNext();) {
- String string = (String) iterator.next();
- fieldsString += string + ",";
- }
- if (fieldsString.length() > 0) {
- fieldsString = fieldsString.substring(0, fieldsString.length() - 1);
- }
+ String fieldsString = ((FreemarkerCSVTemplateCreationWizard)
currentWizard).getFieldsString();
+ // for (Iterator<?> iterator = fields.iterator();
+ // iterator.hasNext();) {
+ // String string = (String) iterator.next();
+ // fieldsString += string + ",";
+ // }
+ // if (fieldsString.length() > 0) {
+ // fieldsString = fieldsString.substring(0,
+ // fieldsString.length() - 1);
+ // }
String quote = ((FreemarkerCSVTemplateCreationWizard) currentWizard).getQuote();
String seperator = ((FreemarkerCSVTemplateCreationWizard)
currentWizard).getSeprator();
@@ -99,12 +97,16 @@
freemarker.getParam().add(speratorParam);
freemarker.getParam().add(quoteParam);
freemarker.getParam().add(fieldsParam);
-
-// SmooksModelUtils.addParam(freemarker.getTemplate(), messageTypeParam);
-// SmooksModelUtils.addParam(freemarker.getTemplate(), quoteParam);
-// SmooksModelUtils.addParam(freemarker.getTemplate(), speratorParam);
-// SmooksModelUtils.addParam(freemarker.getTemplate(), fieldsParam);
+ // SmooksModelUtils.addParam(freemarker.getTemplate(),
+ // messageTypeParam);
+ // SmooksModelUtils.addParam(freemarker.getTemplate(),
+ // quoteParam);
+ // SmooksModelUtils.addParam(freemarker.getTemplate(),
+ // speratorParam);
+ // SmooksModelUtils.addParam(freemarker.getTemplate(),
+ // fieldsParam);
+
Command addFreemarkerCommand = AddCommand.create(this.provider.getEditingDomain(),
resourceList,
SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__ABSTRACT_RESOURCE_CONFIG_GROUP,
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java 2009-12-04
12:22:40 UTC (rev 19045)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java 2009-12-04
12:28:49 UTC (rev 19046)
@@ -170,7 +170,7 @@
}
List<TreeNodeConnection> collectionConnections =
csvRecordGraphModel.getTargetConnections();
if (collectionConnections.isEmpty()) {
- csvRecordGraphModel.addMessage("Must be linked with source node");
+ csvRecordGraphModel.addMessage("Must be linked with collection java class
node");
csvRecordGraphModel.setSeverity(AbstractSmooksGraphicalModel.WARNING);
List<AbstractSmooksGraphicalModel> csvFields =
csvRecordGraphModel.getChildren();
for (Iterator<?> iterator2 = csvFields.iterator(); iterator2.hasNext();) {
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2009-12-04
12:22:40 UTC (rev 19045)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2009-12-04
12:28:49 UTC (rev 19046)
@@ -311,11 +311,7 @@
break;
}
}
-
Collection<?> deletedObjs = null;
- // if(command instanceof AddCommand){
- // deletedObjs = ((AddCommand)command).getCollection();
- // }
if (command instanceof DeleteCommand) {
deletedObjs = ((DeleteCommand) command).getCollection();
}
@@ -329,10 +325,6 @@
refreshInputModel = true;
break;
}
- // if (needToLayoutWhenAddModel(object2)) {
- // refreshInputModel = true;
- // break;
- // }
}
}
if (refreshInputModel)
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/FreemarkerCSVCreationWizardPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/FreemarkerCSVCreationWizardPage.java 2009-12-04
12:22:40 UTC (rev 19045)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/FreemarkerCSVCreationWizardPage.java 2009-12-04
12:28:49 UTC (rev 19046)
@@ -14,26 +14,16 @@
import java.util.List;
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.IStructuredSelection;
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.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Item;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
@@ -46,7 +36,10 @@
private List<FieldText> fieldsList = new ArrayList<FieldText>();
private Text seperatorText;
private Text quoteText;
+ private Text fieldsText;
+
+
public FreemarkerCSVCreationWizardPage(String pageName, String title, ImageDescriptor
titleImage) {
super(pageName, title, titleImage);
}
@@ -56,7 +49,15 @@
this.setTitle(Messages.FreemarkerCSVCreationWizardPage_WizardTitle);
this.setDescription(Messages.FreemarkerCSVCreationWizardPage_WizardDes);
}
+
+ public Text getFieldsText() {
+ return fieldsText;
+ }
+ public void setFieldsText(Text fieldsText) {
+ this.fieldsText = fieldsText;
+ }
+
/**
* @return the fieldsList
*/
@@ -101,162 +102,176 @@
gd = new GridData(GridData.FILL_HORIZONTAL);
seperatorText.setLayoutData(gd);
seperatorText.setTextLimit(1);
-
+
Label quoteLabel = new Label(mainComposite, SWT.NONE);
quoteLabel.setText(Messages.FreemarkerCSVCreationWizardPage_QuoteCharLabel);
quoteText = new Text(mainComposite, SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
quoteText.setLayoutData(gd);
quoteText.setTextLimit(1);
-
-
+ Label filedsLabel = new Label(mainComposite, SWT.NONE);
+ filedsLabel.setText(Messages.FreemarkerCSVCreationWizardPage_FieldsGroupText);
+ fieldsText = new Text(mainComposite, SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.heightHint = 200;
- gd.horizontalSpan = 2;
- Group fieldsComposite = new Group(mainComposite, SWT.NONE);
- fieldsComposite.setText(Messages.FreemarkerCSVCreationWizardPage_FieldsGroupText);
- fieldsComposite.setLayoutData(gd);
- GridLayout gl = new GridLayout();
- gl.numColumns = 2;
- fieldsComposite.setLayout(gl);
+ fieldsText.setLayoutData(gd);
- gd = new GridData(GridData.FILL_BOTH);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // gd.heightHint = 200;
+ // gd.horizontalSpan = 2;
+ // Group fieldsComposite = new Group(mainComposite, SWT.NONE);
+ // fieldsComposite.setText(Messages.FreemarkerCSVCreationWizardPage_FieldsGroupText);
+ // fieldsComposite.setLayoutData(gd);
+ // GridLayout gl = new GridLayout();
+ // gl.numColumns = 2;
+ // fieldsComposite.setLayout(gl);
+ //
+ // gd = new GridData(GridData.FILL_BOTH);
+ //
+ // String fields = null;
+ //
+ // final TableViewer fieldsViewer = new TableViewer(fieldsComposite,
+ // SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
+ // fieldsViewer.getControl().setLayoutData(gd);
+ // fieldsViewer.getTable().setLinesVisible(true);
+ // fieldsViewer.setContentProvider(new FieldsContentProvider());
+ // fieldsViewer.setLabelProvider(new FieldsLabelProvider());
+ //
+ // CellEditor fieldCellEditor = new
+ // TextCellEditor(fieldsViewer.getTable(), SWT.BORDER);
+ //
+ // fieldsViewer.getTable().setLinesVisible(true);
+ //
+ // fieldsViewer.setCellEditors(new CellEditor[] { fieldCellEditor });
+ //
+ // fieldsViewer.setColumnProperties(new String[] { "field" });
//$NON-NLS-1$
+ //
+ // fieldsViewer.setCellModifier(new ICellModifier() {
+ //
+ // public void modify(Object element, String property, Object value) {
+ // Object el = null;
+ // if (element instanceof Item) {
+ // el = ((Item) element).getData();
+ // }
+ // if (el == null)
+ // return;
+ // if (el instanceof FieldText && value instanceof String) {
+ // if (property.equals("field")) { //$NON-NLS-1$
+ // if (value.toString().equals(((FieldText) el).getText())) {
+ // return;
+ // }
+ // ((FieldText) el).setText(value.toString());
+ // fieldsViewer.refresh(el);
+ // updatePage();
+ // }
+ // }
+ // }
+ //
+ // public Object getValue(Object element, String property) {
+ // if (element instanceof FieldText) {
+ // if (property.equals("field")) { //$NON-NLS-1$
+ // return ((FieldText) element).getText();
+ // }
+ // }
+ //
+ // return null;
+ // }
+ //
+ // public boolean canModify(Object element, String property) {
+ // if (element instanceof FieldText) {
+ // if (property.equals("field")) { //$NON-NLS-1$
+ // return true;
+ // }
+ // }
+ // return false;
+ // }
+ // });
+ // if (fields == null) {
+ // fields = ""; //$NON-NLS-1$
+ // }
+ // fillFieldsList(fields);
+ // fieldsViewer.setInput(fieldsList);
+ //
+ // Composite buttonComposite = new Composite(fieldsComposite, SWT.NONE);
+ // gd = new GridData(GridData.FILL_VERTICAL);
+ // gd.widthHint = 100;
+ // buttonComposite.setLayoutData(gd);
+ //
+ // GridLayout bgl = new GridLayout();
+ // buttonComposite.setLayout(bgl);
+ //
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ //
+ // final Button addButton = new Button(buttonComposite, SWT.NONE);
+ // addButton.setLayoutData(gd);
+ // addButton.setText(Messages.FreemarkerCSVCreationWizardPage_AddFieldButtonText);
+ //
+ // final Button removeButton = new Button(buttonComposite, SWT.NONE);
+ // removeButton.setLayoutData(gd);
+ //
removeButton.setText(Messages.FreemarkerCSVCreationWizardPage_RemoveFieldButtonLabel);
+ //
+ // addButton.addSelectionListener(new SelectionListener() {
+ //
+ // public void widgetSelected(SelectionEvent e) {
+ // addButton.setEnabled(false);
+ // try {
+ // FieldText field = new FieldText("field"); //$NON-NLS-1$
+ // fieldsList.add(field);
+ // fieldsViewer.refresh();
+ // updatePage();
+ // } catch (Throwable t) {
+ //
+ // } finally {
+ // addButton.setEnabled(true);
+ // }
+ // }
+ //
+ // public void widgetDefaultSelected(SelectionEvent e) {
+ // // TODO Auto-generated method stub
+ //
+ // }
+ // });
+ //
+ // removeButton.addSelectionListener(new SelectionListener() {
+ //
+ // public void widgetSelected(SelectionEvent e) {
+ // IStructuredSelection s = (IStructuredSelection)
+ // fieldsViewer.getSelection();
+ // fieldsList.removeAll(s.toList());
+ // fieldsViewer.refresh();
+ // updatePage();
+ // }
+ //
+ // public void widgetDefaultSelected(SelectionEvent e) {
+ //
+ // }
+ // });
- String fields = null;
+ this.setControl(mainComposite);
- final TableViewer fieldsViewer = new TableViewer(fieldsComposite, SWT.BORDER |
SWT.MULTI | SWT.FULL_SELECTION);
- fieldsViewer.getControl().setLayoutData(gd);
- fieldsViewer.getTable().setLinesVisible(true);
- fieldsViewer.setContentProvider(new FieldsContentProvider());
- fieldsViewer.setLabelProvider(new FieldsLabelProvider());
+ seperatorText.setText(","); //$NON-NLS-1$
+ quoteText.setText("\""); //$NON-NLS-1$
- CellEditor fieldCellEditor = new TextCellEditor(fieldsViewer.getTable(), SWT.BORDER);
+ seperatorText.addModifyListener(new ModifyListener() {
- fieldsViewer.getTable().setLinesVisible(true);
-
- fieldsViewer.setCellEditors(new CellEditor[] { fieldCellEditor });
-
- fieldsViewer.setColumnProperties(new String[] { "field" }); //$NON-NLS-1$
-
- fieldsViewer.setCellModifier(new ICellModifier() {
-
- public void modify(Object element, String property, Object value) {
- Object el = null;
- if (element instanceof Item) {
- el = ((Item) element).getData();
- }
- if (el == null)
- return;
- if (el instanceof FieldText && value instanceof String) {
- if (property.equals("field")) { //$NON-NLS-1$
- if (value.toString().equals(((FieldText) el).getText())) {
- return;
- }
- ((FieldText) el).setText(value.toString());
- fieldsViewer.refresh(el);
- updatePage();
- }
- }
+ public void modifyText(ModifyEvent e) {
+ updatePage();
}
-
- public Object getValue(Object element, String property) {
- if (element instanceof FieldText) {
- if (property.equals("field")) { //$NON-NLS-1$
- return ((FieldText) element).getText();
- }
- }
-
- return null;
- }
-
- public boolean canModify(Object element, String property) {
- if (element instanceof FieldText) {
- if (property.equals("field")) { //$NON-NLS-1$
- return true;
- }
- }
- return false;
- }
});
- if (fields == null) {
- fields = ""; //$NON-NLS-1$
- }
- fillFieldsList(fields);
- fieldsViewer.setInput(fieldsList);
+ quoteText.addModifyListener(new ModifyListener() {
- Composite buttonComposite = new Composite(fieldsComposite, SWT.NONE);
- gd = new GridData(GridData.FILL_VERTICAL);
- gd.widthHint = 100;
- buttonComposite.setLayoutData(gd);
-
- GridLayout bgl = new GridLayout();
- buttonComposite.setLayout(bgl);
-
- gd = new GridData(GridData.FILL_HORIZONTAL);
-
- final Button addButton = new Button(buttonComposite, SWT.NONE);
- addButton.setLayoutData(gd);
- addButton.setText(Messages.FreemarkerCSVCreationWizardPage_AddFieldButtonText);
-
- final Button removeButton = new Button(buttonComposite, SWT.NONE);
- removeButton.setLayoutData(gd);
- removeButton.setText(Messages.FreemarkerCSVCreationWizardPage_RemoveFieldButtonLabel);
-
- addButton.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- addButton.setEnabled(false);
- try {
- FieldText field = new FieldText("field"); //$NON-NLS-1$
- fieldsList.add(field);
- fieldsViewer.refresh();
- updatePage();
- } catch (Throwable t) {
-
- } finally {
- addButton.setEnabled(true);
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // TODO Auto-generated method stub
-
- }
- });
-
- removeButton.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection s = (IStructuredSelection) fieldsViewer.getSelection();
- fieldsList.removeAll(s.toList());
- fieldsViewer.refresh();
+ public void modifyText(ModifyEvent e) {
updatePage();
}
-
- public void widgetDefaultSelected(SelectionEvent e) {
-
- }
});
- this.setControl(mainComposite);
-
- seperatorText.setText(","); //$NON-NLS-1$
- quoteText.setText("\""); //$NON-NLS-1$
-
- seperatorText.addModifyListener(new ModifyListener() {
+ fieldsText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
updatePage();
}
});
- quoteText.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- updatePage();
- }
- });
-
this.setPageComplete(false);
}
@@ -285,6 +300,7 @@
String error = null;
String seperator = seperatorText.getText();
String quote = quoteText.getText();
+ String fields = fieldsText.getText();
if (seperator == null || seperator.length() == 0) {
error = Messages.FreemarkerCSVCreationWizardPage_SeperatorEmptyErrorMessage;
}
@@ -298,9 +314,44 @@
if (quote != null && quote.length() > 1) {
error = "Quote must be only one character"; //$NON-NLS-1$
}
- if (fieldsList.isEmpty()) {
- error = Messages.FreemarkerCSVCreationWizardPage_FieldEmptyErrorMessage;
+ if (fields == null) {
+ error = "Fields can't be empty";
+ } else {
+ fields = fields.trim();
+ if ("".equals(fields)) { //$NON-NLS-1$
+ error = "Fields can't be empty";
+ } else {
+ char[] chars = fields.toCharArray();
+ for (int i = 0; i < chars.length; i++) {
+ char c = chars[i];
+ if (c == ',') {
+ continue;
+ }
+ if (Character.isLetterOrDigit(c)) {
+
+ } else {
+ error = "The '" + c + "' is incorrect in the fields
string";
+ break;
+ }
+ }
+
+ String[] fieldsArray = fields.split(",");
+ if(fieldsArray.length == 0){
+ error = "Fields can't be empty";
+ }
+ for (int i = 0; i < fieldsArray.length; i++) {
+ String f = fieldsArray[i];
+ if(f == null || "".equals(f.trim())){
+ error = "Fields can't be empty";
+ break;
+ }
+ }
+ }
}
+ // if (fieldsList.isEmpty()) {
+ // error =
+ // Messages.FreemarkerCSVCreationWizardPage_FieldEmptyErrorMessage;
+ // }
this.setErrorMessage(error);
this.setPageComplete(error == null);
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/FreemarkerCSVTemplateCreationWizard.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/FreemarkerCSVTemplateCreationWizard.java 2009-12-04
12:22:40 UTC (rev 19045)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/FreemarkerCSVTemplateCreationWizard.java 2009-12-04
12:28:49 UTC (rev 19046)
@@ -11,11 +11,9 @@
package org.jboss.tools.smooks.graphical.wizard.freemarker;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.jface.wizard.Wizard;
-import
org.jboss.tools.smooks.graphical.wizard.freemarker.FreemarkerCSVCreationWizardPage.FieldText;
/**
* @author Dart
@@ -28,6 +26,7 @@
private String quote;
private List<String> fields = new ArrayList<String>();
+ private String fieldsString;
public FreemarkerCSVTemplateCreationWizard() {
super();
@@ -51,9 +50,9 @@
/**
* @return the fields
*/
- public List<String> getFields() {
- return fields;
- }
+// public List<String> getFields() {
+// return fields;
+// }
/*
* (non-Javadoc)
@@ -68,7 +67,13 @@
this.addPage(page);
super.addPages();
}
+
+
+ public String getFieldsString() {
+ return fieldsString;
+ }
+
/*
* (non-Javadoc)
*
@@ -79,11 +84,12 @@
if (page != null) {
seprator = page.getSeperatorText().getText();
quote = page.getQuoteText().getText();
- List<FieldText> fieldList = page.getFieldsList();
- for (Iterator<?> iterator = fieldList.iterator(); iterator.hasNext();) {
- FieldText fieldText = (FieldText) iterator.next();
- fields.add(fieldText.getText());
- }
+ fieldsString = page.getFieldsText().getText();
+// List<FieldText> fieldList = page.getFieldsList();
+// for (Iterator<?> iterator = fieldList.iterator(); iterator.hasNext();) {
+// FieldText fieldText = (FieldText) iterator.next();
+// fields.add(fieldText.getText());
+// }
return true;
}
return true;
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/messages.properties
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/messages.properties 2009-12-04
12:22:40 UTC (rev 19045)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/wizard/freemarker/messages.properties 2009-12-04
12:28:49 UTC (rev 19046)
@@ -6,5 +6,5 @@
FreemarkerCSVCreationWizardPage_RemoveFieldButtonLabel=Remove
FreemarkerCSVCreationWizardPage_SeperatorCharLabel=Seperator Character :
FreemarkerCSVCreationWizardPage_SeperatorEmptyErrorMessage=Seperator can't be null
-FreemarkerCSVCreationWizardPage_WizardDes=Configurate CSV Template
+FreemarkerCSVCreationWizardPage_WizardDes=Configurate CSV Template. Use ',' to
seperate the CSV field string.
FreemarkerCSVCreationWizardPage_WizardTitle=CSV Template Configuration