improved syntax highlighting (php tag/return keyword/brackets and operators)
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / view / tableview / TableViewToolBar.java
index cb06fbd..a4cd450 100644 (file)
@@ -4,8 +4,8 @@
  */
 package com.quantum.view.tableview;
 
+import com.quantum.ImageStore;
 import com.quantum.Messages;
-import com.quantum.QuantumPlugin;
 import com.quantum.actions.CloseTableAction;
 import com.quantum.actions.RefreshTableAction;
 import com.quantum.model.NotConnectedException;
@@ -33,8 +33,6 @@ import org.eclipse.swt.widgets.ToolItem;
 public class TableViewToolBar {
 
        private ToolBar toolBar;
-       private RefreshTableAction refreshTableAction;
-       private CloseTableAction closeTableAction;
        private ToolItem previous;
        private ToolItem next;
        
@@ -49,36 +47,14 @@ public class TableViewToolBar {
 
                this.toolBar = toolBar;
                
-               refreshTableAction = new RefreshTableAction();
-               refreshTableAction.setText(Messages.getString("tableview.refresh")); //$NON-NLS-1$
-               refreshTableAction.setImageDescriptor(
-                       QuantumPlugin.getImageDescriptor("refresh.gif")); //$NON-NLS-1$
-               refreshTableAction.init(view);
-               closeTableAction = new CloseTableAction();
-               closeTableAction.setText(Messages.getString("tableview.close")); //$NON-NLS-1$
-               closeTableAction.setImageDescriptor(
-                       QuantumPlugin.getImageDescriptor("close.gif")); //$NON-NLS-1$
-               closeTableAction.init(view);
-
-               ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
-               toolItem.setImage(QuantumPlugin.getImage("refresh.gif")); //$NON-NLS-1$
-               toolItem.setToolTipText(Messages.getString("tableview.refresh")); //$NON-NLS-1$
-               toolItem.addSelectionListener(new SelectionListener() {
-                       public void widgetDefaultSelected(SelectionEvent e) {
-                       }
-                       public void widgetSelected(SelectionEvent e) {
-                               refreshTableAction.run();
-                       }
-               });
-
                final Action copyAction = new CopyAction(view, table);
                final Action selectAllAction = new Action() {
                        public void run() {
                                table.selectAll();
                        }
                };
-               toolItem = new ToolItem(toolBar, SWT.PUSH);
-               toolItem.setImage(QuantumPlugin.getImage("copy.gif")); //$NON-NLS-1$
+               ToolItem toolItem = new ToolItem(toolBar, SWT.PUSH);
+               toolItem.setImage(ImageStore.getImage(ImageStore.COPY));
                toolItem.setToolTipText(Messages.getString("tableview.copy")); //$NON-NLS-1$
                toolItem.addSelectionListener(new SelectionListener() {
                        public void widgetDefaultSelected(SelectionEvent e) {
@@ -88,7 +64,7 @@ public class TableViewToolBar {
                        }
                });
                toolItem = new ToolItem(toolBar, SWT.PUSH);
-               toolItem.setImage(QuantumPlugin.getImage("table.gif")); //$NON-NLS-1$
+               toolItem.setImage(ImageStore.getImage(ImageStore.OPEN_TABLE)); //$NON-NLS-1$
                toolItem.setToolTipText(Messages.getString("tableview.selectAll")); //$NON-NLS-1$
                toolItem.addSelectionListener(new SelectionListener() {
                        public void widgetDefaultSelected(SelectionEvent e) {
@@ -99,7 +75,7 @@ public class TableViewToolBar {
                });
 
                filter = new ToolItem(toolBar, SWT.PUSH);
-               filter.setImage(QuantumPlugin.getImage("filter.gif")); //$NON-NLS-1$
+               filter.setImage(ImageStore.getImage(ImageStore.FILTER));
                filter.setToolTipText(Messages.getString("tableview.filterSort")); //$NON-NLS-1$
 
                toolItem = new ToolItem(toolBar, SWT.SEPARATOR);
@@ -109,7 +85,7 @@ public class TableViewToolBar {
                previous = new ToolItem(toolBar, SWT.PUSH);
                next = new ToolItem(toolBar, SWT.PUSH);
 
-               fullMode.setImage(QuantumPlugin.getImage("fulldata.gif")); //$NON-NLS-1$
+               fullMode.setImage(ImageStore.getImage(ImageStore.FULLDATA));
                fullMode.setToolTipText(Messages.getString("tableview.showAll")); //$NON-NLS-1$
                fullMode.setSelection(false);
                fullMode.addSelectionListener(new SelectionListener() {
@@ -136,7 +112,7 @@ public class TableViewToolBar {
                 }
                        }
                });
-               previous.setImage(QuantumPlugin.getImage("previous.gif")); //$NON-NLS-1$
+               previous.setImage(ImageStore.getImage(ImageStore.PREVIOUS));
                previous.setToolTipText("Previous"); //$NON-NLS-1$
                previous.addSelectionListener(new SelectionListener() {
                        public void widgetDefaultSelected(SelectionEvent e) {
@@ -158,7 +134,7 @@ public class TableViewToolBar {
                 }
                        }
                });
-               next.setImage(QuantumPlugin.getImage("next.gif")); //$NON-NLS-1$
+               next.setImage(ImageStore.getImage(ImageStore.NEXT));
                next.setToolTipText("Next"); //$NON-NLS-1$
                next.addSelectionListener(new SelectionListener() {
                        public void widgetDefaultSelected(SelectionEvent e) {
@@ -181,19 +157,6 @@ public class TableViewToolBar {
                        }
                });
 
-               toolItem = new ToolItem(toolBar, SWT.SEPARATOR);
-
-               toolItem = new ToolItem(toolBar, SWT.PUSH);
-               toolItem.setImage(QuantumPlugin.getImage("close.gif")); //$NON-NLS-1$
-               toolItem.setToolTipText(Messages.getString("tableview.close")); //$NON-NLS-1$
-               toolItem.addSelectionListener(new SelectionListener() {
-                       public void widgetDefaultSelected(SelectionEvent e) {
-                       }
-                       public void widgetSelected(SelectionEvent e) {
-                               closeTableAction.run();
-                       }
-               });
-
        }
 
        public void setColumns( final TableView view,   final TableAdapter ta,  Table table) {