1 package com.quantum.actions;
3 import java.sql.SQLException;
4 import java.util.Iterator;
7 import com.quantum.ImageStore;
8 import com.quantum.Messages;
9 import com.quantum.model.NotConnectedException;
10 import com.quantum.ui.dialog.ExceptionDisplayDialog;
11 import com.quantum.ui.dialog.SQLExceptionDialog;
12 import com.quantum.view.bookmark.TreeNode;
14 import org.eclipse.ui.IViewPart;
15 import org.eclipse.ui.actions.SelectionListenerAction;
20 public class RefreshBookmarkAction extends SelectionListenerAction {
21 private IViewPart view;
22 public RefreshBookmarkAction(IViewPart view) {
23 super(Messages.getString(RefreshBookmarkAction.class, "text"));
25 setImageDescriptor(ImageStore.getImageDescriptor(ImageStore.REFRESH));
29 List list = getSelectedNonResources();
30 for (Iterator i = list.iterator(); i.hasNext(); ) {
31 Object object = i.next();
32 if (object != null && object instanceof TreeNode) {
34 ((TreeNode) object).reload();
35 } catch (NotConnectedException e) {
37 } catch (SQLException e) {
47 private void handleException(Throwable t) {
48 if (t instanceof SQLException) {
49 SQLExceptionDialog.openException(
50 this.view.getSite().getShell(), null, (SQLException) t);
52 ExceptionDisplayDialog.openError(
53 this.view.getSite().getShell(), null, null, t);