}
} else if (type.equals(Confirm)) {
VMsProperty pro = detailView.confirm();
- if (pro != null) { // successs
+ if (pro != null) { // success
refreshProperties();
openDetailView(pro);
}
handling = new MenuHandling(shell, vmsTree);
+ deleteButton.setEnabled(false);
+ resetButton.setEnabled(false);
}
public void open() {
// TOOD : error checking
public void deleteVirtualMachine() {
if (handling.deleteVirtualMachine()) {
- detailView.closeDetailView();
+ closeDetailView();
refreshProperties();
}
}
}
public void openDetailView(VMsProperty property) {
- deleteButton.setEnabled(true);
- resetButton.setEnabled(true);
+ if (vmsTree.getSelectionContentCount() == 1) {
+ deleteButton.setEnabled(true);
+ resetButton.setEnabled(true);
+ } else {
+ deleteButton.setEnabled(false);
+ resetButton.setEnabled(false);
+ }
leftButton.setText(Modify);
leftButton.setImage(ResourceRegistry.getImage(ImageName.MODIFY));
deleteButton.setEnabled(false);
resetButton.setEnabled(false);
}
- resetButton.setEnabled(false);
detailView.closeDetailView();
}
public void dispose() {
ResourceRegistry.dispose();
-
+
if(icon != null)
icon.dispose();
}
public boolean isX86Selected() {
return archGroup.x86RadioButton.getSelection();
}
-
}
public class ResourceRegistry {
public enum ImageName {
CANCEL("cancel"), CONFIRM("confirm"), CREATE("create"), DELETE("delete"), DETAILS("details"),
- FOLDER("folder"), MODIFY("modify"), REFRESH("refresh"), RESET("reset"), LAUNCH("launch");
+ FOLDER("folder"), MODIFY("modify"), REFRESH("refresh"), RESET("reset"), LAUNCH("launch"), CLONE("clone");
String name;
final MenuItem cloneItem = new MenuItem(treeMenu, SWT.NONE);
cloneItem.setText("Clone");
+ cloneItem.setImage(ResourceRegistry.getImage(ImageName.CLONE));
cloneItem.addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(SelectionEvent arg0) {