*** empty log message ***
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / actions / RefreshBookmarkAction.java
index c28df56..3250564 100644 (file)
@@ -4,10 +4,11 @@ import java.sql.SQLException;
 import java.util.Iterator;
 import java.util.List;
 
+import com.quantum.ImageStore;
 import com.quantum.Messages;
-import com.quantum.QuantumPlugin;
 import com.quantum.model.NotConnectedException;
 import com.quantum.ui.dialog.ExceptionDisplayDialog;
+import com.quantum.ui.dialog.SQLExceptionDialog;
 import com.quantum.view.bookmark.TreeNode;
 
 import org.eclipse.ui.IViewPart;
@@ -19,9 +20,9 @@ import org.eclipse.ui.actions.SelectionListenerAction;
 public class RefreshBookmarkAction extends SelectionListenerAction {
     private IViewPart view;
        public RefreshBookmarkAction(IViewPart view) {
-        super(Messages.getString(RefreshBookmarkAction.class.getName() + ".text"));
+        super(Messages.getString(RefreshBookmarkAction.class, "text"));
                this.view = view;
-        setImageDescriptor(QuantumPlugin.getImageDescriptor("refresh.gif"));
+        setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.REFRESH));
        }
 
        public void run() {
@@ -44,7 +45,12 @@ public class RefreshBookmarkAction extends SelectionListenerAction {
         * @param e
         */
        private void handleException(Throwable t) {
-               ExceptionDisplayDialog.openError(
-                               this.view.getSite().getShell(), null, null, t);
+               if (t instanceof SQLException) {
+                       SQLExceptionDialog.openException(
+                                       this.view.getSite().getShell(), null, (SQLException) t);
+               } else {
+                       ExceptionDisplayDialog.openError(
+                                       this.view.getSite().getShell(), null, null, t);
+               }
        }
 }