*/
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;
public class TableViewToolBar {
private ToolBar toolBar;
- private RefreshTableAction refreshTableAction;
- private CloseTableAction closeTableAction;
private ToolItem previous;
private ToolItem next;
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) {
}
});
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) {
});
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);
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() {
}
}
});
- 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) {
}
}
});
- 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) {
}
});
- 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) {