newest quantum CVS sources
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / actions / NextSequenceAction.java
index 88331d8..83a7a26 100644 (file)
@@ -1,8 +1,7 @@
 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;
@@ -19,17 +18,16 @@ public class NextSequenceAction extends BaseSequenceAction {
      * @param view
      */
     public NextSequenceAction(IViewPart view) {
-        super(Messages.getString(NextSequenceAction.class.getName() + ".text"), view);
-        setImageDescriptor(QuantumPlugin.getImageDescriptor("append.gif"));    
+        super(Messages.getString(NextSequenceAction.class, "text"), view);
+        setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.APPEND));    
     }
     
        public void run() {
-               EntityNode node = getEntityNode();
+               EntityNode sequence = getEntityNode();
                String name = null;
-               if (node.isSequence()) {
-                       EntityNode sequence = (EntityNode) node;
+               if (sequence.isSequence()) {
                        Bookmark bookmark = sequence.getBookmark();
-                       DatabaseAdapter adapter = AdapterFactory.getInstance().getAdapter(bookmark.getType());
+                       DatabaseAdapter adapter = bookmark.getAdapter();
                        if (adapter == null) return;
                        name = sequence.getName();
                        String query = adapter.getNextValue(name, sequence.getEntity().getSchema());