*/
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;
*/
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());