}
private void makeActions() {
addAction = new Action() {
public void run() {
NewDBCoordinatesWizard wizard = new NewDBCoordinatesWizard();
WizardDialog wd = new WizardDialog(viewer.getControl().getShell(), wizard);
wd.setTitle(wizard.getWindowTitle());
wd.open();
serverTreeViewer.setInput(dbProject);
}
};
addAction.setText("New");
addAction.setToolTipText("New database coordinates");
addAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJ_ADD));
refreshAction = new Action() {
public void run() {
if (currentDB == null){
viewer.setInput(null);
return;
}
Map<String, String> info = CitrusleafInfo.get(currentDB.getHostName(), currentDB.getPort());
if (info != null){
getDBStats(currentDB);
viewer.setInput(currentDB.getStats());
}
}
};
refreshAction.setText("Refresh");
refreshAction.setToolTipText("Refresh database statistics");
refreshAction.setImageDescriptor(Activator.getImageDescriptor("icons/refresh.gif"));
// dbCoordinates = new Action() {
// public void run() {
// DBCoordinatesDialog dialog = new DBCoordinatesDialog(viewer.getControl().getShell(),
// hostName, port);
// if (dialog.open() == Window.OK){
// hostName = dialog.getHostName();
// port = dialog.getPort();
// }
//
// }
// };
// dbCoordinates.setText("Database coordinates");
// dbCoordinates.setToolTipText("Host name and port for the Database");
// dbCoordinates.setImageDescriptor(Activator.getImageDescriptor("icons/repository.gif"));
doubleClickAction = new Action() {
public void run() {
ISelection selection = serverTreeViewer.getSelection();
ClusterCoordinates obj = (ClusterCoordinates) ((IStructuredSelection)selection).getFirstElement();
NewDBCoordinatesWizard wizard = new NewDBCoordinatesWizard(obj);
WizardDialog wd = new WizardDialog(viewer.getControl().getShell(), wizard);
wd.setTitle(wizard.getWindowTitle());
wd.open();
}
};
}