initial quantum version
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / actions / BaseSQLAction.java
diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/BaseSQLAction.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/actions/BaseSQLAction.java
new file mode 100644 (file)
index 0000000..e651640
--- /dev/null
@@ -0,0 +1,25 @@
+package com.quantum.actions;
+
+import java.sql.Connection;
+
+import com.quantum.model.Bookmark;
+import com.quantum.util.connection.ConnectionUtil;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * @author BC
+ */
+public abstract class BaseSQLAction extends Action {
+    
+    private ConnectionUtil connectionUtil = new ConnectionUtil();
+    
+    protected abstract Shell getShell();
+    
+    protected abstract Bookmark getBookmark();
+
+    protected Connection getConnection() {
+        return this.connectionUtil.getConnection(getBookmark(), getShell());
+    }
+}