/**
* @author
*/
-public class PHPEclipseSQLPlugin extends AbstractUIPlugin implements IConstants {
-
+public class PHPEclipseSQLPlugin
+ extends AbstractUIPlugin
+ implements IConstants {
+
private static final String BUNDLE_NAME =
"net.sourceforge.phpdt.sql.PHPEclipseSQLResources";
private static final ResourceBundle RESOURCE_BUNDLE =
"phpeclipse.sql.background.color",
BACKGROUND);
PreferenceConverter.setDefault(store, "phpeclipse.sql.text.color", DEFAULT);
- PreferenceConverter.setDefault(store, "phpeclipse.sql.keyword.color", KEYWORD);
- PreferenceConverter.setDefault(store, "phpeclipse.sql.comment.color", COMMENT);
- PreferenceConverter.setDefault(store, "phpeclipse.sql.string.color", STRING);
- PreferenceConverter.setDefault(store, "phpeclipse.sql.numeric.color", NUMERIC);
+ PreferenceConverter.setDefault(
+ store,
+ "phpeclipse.sql.keyword.color",
+ KEYWORD);
+ PreferenceConverter.setDefault(
+ store,
+ "phpeclipse.sql.comment.color",
+ COMMENT);
+ PreferenceConverter.setDefault(
+ store,
+ "phpeclipse.sql.string.color",
+ STRING);
+ PreferenceConverter.setDefault(
+ store,
+ "phpeclipse.sql.numeric.color",
+ NUMERIC);
getPreferenceStore().setDefault("phpeclipse.sql.text.bold", false);
getPreferenceStore().setDefault("phpeclipse.sql.keyword.bold", true);
getPreferenceStore().setDefault("phpeclipse.sql.string.bold", false);
getPreferenceStore().setDefault("phpeclipse.sql.comment.bold", false);
getPreferenceStore().setDefault("phpeclipse.sql.numeric.bold", false);
+
+ getPreferenceStore().setDefault(
+ "phpeclipse.sql.select.template",
+ "$results = mysql_query(\"SELECT {0} FROM {1} WHERE {2} \");");
+
+ getPreferenceStore().setDefault(
+ "phpeclipse.sql.insert.template",
+ "$results = mysql_query(\"INSERT INTO {0} ({1}) VALUES {2} \");");
+
+ getPreferenceStore().setDefault(
+ "phpeclipse.sql.update.template",
+ "$results = mysql_query(\"UPDATE {0} SET {1} WHERE {2} \");");
+
+ getPreferenceStore().setDefault(
+ "phpeclipse.sql.delete.template",
+ "$results = mysql_query(\"DELETE FROM {0} WHERE {1} \");");
+
+ getPreferenceStore().setDefault("phpeclipse.sql.username.connect", "root");
+
+ getPreferenceStore().setDefault(
+ "phpeclipse.sql.connect.connect",
+ "jdbc:mysql://localhost/test");
+
+ getPreferenceStore().setDefault(
+ "phpeclipse.sql.driver.connect",
+ "com.mysql.jdbc.Driver");
+
+ getPreferenceStore().setDefault("phpeclipse.sql.type.connect", "MySQL");
+
+ getPreferenceStore().setDefault(
+ "phpeclipse.sql.filename.connect",
+ "C:\\apache\\mysql\\lib\\mysql-connector-java-2.0.14-bin.jar");
+
PreferenceConverter.setDefault(
getPreferenceStore(),
"phpeclipse.sql.font",
public void saving(ISaveContext context) throws CoreException {
switch (context.getKind()) {
case ISaveContext.FULL_SAVE :
- PHPEclipseSQLPlugin sqlPluginInstance = PHPEclipseSQLPlugin.getDefault();
+ PHPEclipseSQLPlugin sqlPluginInstance =
+ PHPEclipseSQLPlugin.getDefault();
// save the plug in state
if (BookmarkContentProvider.getInstance().hasChanged()) {
int saveNumber = context.getSaveNumber();
String saveFileName = "save " + Integer.toString(saveNumber);
File f =
- sqlPluginInstance
- .getStateLocation()
- .append(saveFileName)
- .toFile();
+ sqlPluginInstance.getStateLocation().append(saveFileName).toFile();
// if we fail to write, an exception is thrown and we do not update the path
sqlPluginInstance.writeImportantState(f);
context.map(new Path("save"), new Path(saveFileName));
context.needSaveNumber();
} else {
if (DEBUG) {
- System.out.println("Not saving unchanged bookmarks");
+ System.out.println("Not saving unchanged bookmarks");
}
}
break;