import com.quantum.sql.SQLResults;
import com.quantum.sql.SQLUpdateResults;
import com.quantum.ui.dialog.ExceptionDisplayDialog;
+import com.quantum.ui.dialog.SQLExceptionDialog;
import com.quantum.ui.dialog.SimpleSelectionDialog;
import com.quantum.util.connection.ConnectionUtil;
import com.quantum.view.LogProxy;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.actions.SelectionListenerAction;
/**
* @author BC
*/
-public abstract class BaseExecuteAction extends Action {
+public abstract class BaseExecuteAction extends SelectionListenerAction {
class Metrics {
int resultCount = 0;
String execute1 = Messages.getString(BaseExecuteAction.class, "execute1");
String execute2 = Messages.getString(BaseExecuteAction.class, "execute2");
+ protected BaseExecuteAction(String text) {
+ super(text);
+ }
+
+ protected BaseExecuteAction() {
+ super(null);
+ }
+
public void run() {
Bookmark bookmark = getBookmark();
if (bookmark != null) {
} catch (IOException e) {
ExceptionDisplayDialog.openError(getShell(), null, null, e);
} catch (SQLException e) {
- ExceptionDisplayDialog.openError(getShell(), null, null, e);
+ SQLExceptionDialog.openException(getShell(), bookmark, e);
} catch (CoreException e) {
ErrorDialog.openError(getShell(), null, null, e.getStatus());
}
LogProxy log = LogProxy.getInstance();
log.addText(LogProxy.ERROR,
"Error Executing: " + query + ":" + e.toString(), e); //$NON-NLS-1$ //$NON-NLS-2$
- MessageDialog.openConfirm(getShell(),
- "Database returned error",
- e.getLocalizedMessage()); //$NON-NLS-1$
+ SQLExceptionDialog.openException(getShell(), bookmark, e);
}
return results;
}