public class MainDialog {
private static final String ICON_FILE_NAME = "res/em.ico"; //$NON-NLS-1$
+ // table viewer name
+ public static final String VM_LIST = "vmList";
+ public static final String CREATE_VM = "createVM";
+ public static final String BASE_IMAGE_LIST = "baseimageList";
+ public static final String TEMPLATE_LIST = "templateList";
public static final int DEFALUT_WIDTH = 842;
public static final int DEFAULT_HEIGHT = 580;
public void handleEvent(Event event) {
if (event.type == SWT.Selection) {
MainDialog mainDialog = EmulatorManager.getNewMainDialog();
- AbstractTableViewer viewer = mainDialog.findViewer("templateList");
+ AbstractTableViewer viewer = mainDialog.findViewer(MainDialog.TEMPLATE_LIST);
if (viewer == null) {
- DeviceTemplateTableViewer tViewer = new DeviceTemplateTableViewer(MainDialog.getShell(), "templateList");
- mainDialog.addViewer(tViewer);
- mainDialog.setStackTop(tViewer);
- } else {
- mainDialog.setStackTop(viewer);
+ viewer = new DeviceTemplateTableViewer(MainDialog.getShell(), MainDialog.TEMPLATE_LIST);
+ mainDialog.addViewer(viewer);
}
+ mainDialog.setStackTop(viewer);
}
}
});
public void handleEvent(Event event) {
if (event.type == SWT.Selection) {
MainDialog mainDialog = EmulatorManager.getNewMainDialog();
- AbstractTableViewer viewer = mainDialog.findViewer("vmList");
+ AbstractTableViewer viewer = mainDialog.findViewer(MainDialog.VM_LIST);
if (viewer != null) {
viewer.setNeedRedraw(isModified);
mainDialog.setStackTop(viewer);
public void handleEvent(Event event) {
if (event.type == SWT.Selection) {
MainDialog mainDialog = EmulatorManager.getNewMainDialog();
- AbstractTableViewer viewer = mainDialog.findViewer("vmList");
+ AbstractTableViewer viewer = mainDialog.findViewer(MainDialog.VM_LIST);
if (viewer != null) {
mainDialog.setStackTop(viewer);
}
}
MainDialog mainDialog = EmulatorManager.getNewMainDialog();
- AbstractTableViewer viewer = mainDialog.findViewer("vmList");
+ AbstractTableViewer viewer = mainDialog.findViewer(MainDialog.VM_LIST);
if (viewer != null) {
viewer.setNeedRedraw(true);
viewer.setData(prop);
public void handleEvent(Event event) {
if (event.type == SWT.Selection) {
MainDialog mainDialog = EmulatorManager.getNewMainDialog();
- AbstractTableViewer viewer = mainDialog.findViewer("baseimageList");
+ AbstractTableViewer viewer = mainDialog.findViewer(MainDialog.BASE_IMAGE_LIST);
if (viewer == null) {
- BaseImageTableViewer tViewer = new BaseImageTableViewer(MainDialog.getShell(), "baseimageList");
- mainDialog.addViewer(tViewer);
- mainDialog.setStackTop(tViewer);
- } else {
- mainDialog.setStackTop(viewer);
+ viewer = new BaseImageTableViewer(MainDialog.getShell(), MainDialog.BASE_IMAGE_LIST);
+ mainDialog.addViewer(viewer);
}
+ mainDialog.setStackTop(viewer);
}
}
});
public void handleEvent(Event event) {
if (event.type == SWT.Selection) {
MainDialog mainDialog = EmulatorManager.getNewMainDialog();
- AbstractTableViewer viewer = mainDialog.findViewer("templateList");
+ AbstractTableViewer viewer = mainDialog.findViewer(MainDialog.TEMPLATE_LIST);
if (viewer == null) {
- DeviceTemplateTableViewer tViewer = new DeviceTemplateTableViewer(MainDialog.getShell(), "templateList");
- mainDialog.addViewer(tViewer);
- mainDialog.setStackTop(tViewer);
- } else {
- mainDialog.setStackTop(viewer);
+ viewer = new DeviceTemplateTableViewer(MainDialog.getShell(), MainDialog.TEMPLATE_LIST);
+ mainDialog.addViewer(viewer);
}
+ mainDialog.setStackTop(viewer);
}
}
public void handleEvent(Event event) {
if (event.type == SWT.Selection) {
MainDialog mainDialog = EmulatorManager.getNewMainDialog();
- AbstractTableViewer viewer = mainDialog.findViewer("baseimageList");
+ AbstractTableViewer viewer = mainDialog.findViewer(MainDialog.BASE_IMAGE_LIST);
if (viewer == null) {
- BaseImageTableViewer tViewer = new BaseImageTableViewer(MainDialog.getShell(), "baseimageList");
- mainDialog.addViewer(tViewer);
- mainDialog.setStackTop(tViewer);
- } else {
- mainDialog.setStackTop(viewer);
+ viewer = new BaseImageTableViewer(MainDialog.getShell(), MainDialog.BASE_IMAGE_LIST);
+ mainDialog.addViewer(viewer);
}
+ mainDialog.setStackTop(viewer);
}
}
});
public void widgetSelected(SelectionEvent e) {
ProfileButton pButton = (ProfileButton)e.data;
MainDialog mainDialog = EmulatorManager.getNewMainDialog();
- AbstractTableViewer viewer = mainDialog.findViewer("createVM");
+ AbstractTableViewer viewer = mainDialog.findViewer(MainDialog.CREATE_VM);
if (viewer == null) {
- viewer = new CreateVMTableViewer(MainDialog.getShell(), "createVM");
+ viewer = new CreateVMTableViewer(MainDialog.getShell(), MainDialog.CREATE_VM);
mainDialog.addViewer(viewer);
}
viewer.setData(pButton.getProfile());