Initial implementation
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / actions / PrevSequenceAction.java
index 875df6d..ab63311 100644 (file)
@@ -4,9 +4,8 @@
  */
 package com.quantum.actions;
 
+import com.quantum.ImageStore;
 import com.quantum.Messages;
-import com.quantum.QuantumPlugin;
-import com.quantum.adapters.AdapterFactory;
 import com.quantum.adapters.DatabaseAdapter;
 import com.quantum.model.Bookmark;
 import com.quantum.sql.SQLResults;
@@ -23,16 +22,14 @@ public class PrevSequenceAction extends BaseSequenceAction {
      */
     public PrevSequenceAction(IViewPart view) {
         super(Messages.getString(PrevSequenceAction.class.getName() + ".text"), view);
-        setImageDescriptor(QuantumPlugin.getImageDescriptor("grid.gif"));
+        setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.GRID));
     }
 
     public void run() {
-               EntityNode node = getEntityNode();
-               if (((EntityNode) node).isSequence()) {
-            EntityNode sequence = (EntityNode) node;
+               EntityNode sequence = getEntityNode();
+               if (sequence.isSequence()) {
                        Bookmark bookmark = sequence.getBookmark();
-                       DatabaseAdapter adapter = AdapterFactory.getInstance().getAdapter(
-                bookmark.getType());
+                       DatabaseAdapter adapter = bookmark.getAdapter();
                        if (adapter == null) return;
                        String name = sequence.getName();
                        String query = adapter.getPrevValue(name, sequence.getEntity().getSchema());