package net.sourceforge.phpdt.sql.wizards;
+import java.text.MessageFormat;
+
+import net.sourceforge.phpdt.sql.PHPEclipseSQLPlugin;
import net.sourceforge.phpdt.sql.sql.TableRow;
import net.sourceforge.phpdt.sql.view.PHPSourceConsole;
import net.sourceforge.phpdt.sql.view.tableview.TableAdapter;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
Button[] primaryKeys;
Button[] setValues;
Label query;
+ IPreferenceStore fStore;
+
public PHPUpdateRowPage(String pageName) {
super(pageName);
}
if (DEBUG) {
System.out.println("page create control");
}
+ fStore = PHPEclipseSQLPlugin.getDefault().getPreferenceStore();
Composite container = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
container.setLayout(layout);
setClause.deleteCharAt(setClause.length() - 1);
setClause.deleteCharAt(setClause.length() - 1);
}
- String query = "$results = mysql_query(\"UPDATE " + row.getTable();
- query += " SET " + setClause.toString();
- query += " WHERE " + whereClause.toString() + "\");";
+ String[] arguments = { setClause.toString(), row.getTable(), whereClause.toString() };
+ MessageFormat form = new MessageFormat(fStore.getString("phpeclipse.sql.update.template"));
+
+ String query = form.format(arguments);
+//
+// String query = "$results = mysql_query(\"UPDATE " + row.getTable();
+// query += " SET " + setClause.toString();
+// query += " WHERE " + whereClause.toString() + "\");";
this.query.setText(query);
}
public boolean performFinish() {