From 4c2a19a4aca323ddaa3033257ac900a9290c9590 Mon Sep 17 00:00:00 2001 From: jihye kim Date: Mon, 12 Nov 2012 16:06:58 +0900 Subject: [PATCH] [Title] emualtor-manager : modify key listener for 'Del' key and set focus after handling menu. [Desc.] modify key listener for 'Del' key and set focus after handling menu. [Issue] N_SE-13453, N_SE-13743 --- package/changelog | 6 +++ package/pkginfo.manifest | 2 +- src/org/tizen/emulator/manager/ui/CloneDialog.java | 2 + src/org/tizen/emulator/manager/ui/MainDialog.java | 5 ++ .../tizen/emulator/manager/ui/MenuHandling.java | 1 + .../emulator/manager/ui/detail/TableWidget.java | 61 ++++++++++++++++------ .../tizen/emulator/manager/ui/vmstree/VMsTree.java | 15 ++++-- 7 files changed, 71 insertions(+), 21 deletions(-) diff --git a/package/changelog b/package/changelog index 444b891..bbf3561 100644 --- a/package/changelog +++ b/package/changelog @@ -1,3 +1,9 @@ +*1.3.56 +- modify key listener for 'Del' key +- add tool tip resolution combo and skin combo +- set forcus after create and clone vm. +== 김지혜 2012-11-12 + *1.3.55 - disable hw-virtualization and gl-acceleration in the arm emulator - fix option in the arm emulator. diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index 5defa48..d2f7279 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,5 +1,5 @@ Source: emulator-manager -Version: 1.3.55 +Version: 1.3.56 Maintainer: Yeong-Kyoon Lee Package: emulator-manager diff --git a/src/org/tizen/emulator/manager/ui/CloneDialog.java b/src/org/tizen/emulator/manager/ui/CloneDialog.java index 91d8d27..02beb93 100644 --- a/src/org/tizen/emulator/manager/ui/CloneDialog.java +++ b/src/org/tizen/emulator/manager/ui/CloneDialog.java @@ -136,6 +136,7 @@ public class CloneDialog { dialog.close(); mainDialog.refreshProperties(); + mainDialog.vmsTree.setSelectProperty(property); } }); @@ -149,6 +150,7 @@ public class CloneDialog { public void widgetSelected(SelectionEvent arg0) { dialog.close(); mainDialog.refreshProperties(); + mainDialog.vmsTree.setSelectProperty(property); } }); diff --git a/src/org/tizen/emulator/manager/ui/MainDialog.java b/src/org/tizen/emulator/manager/ui/MainDialog.java index fe408f5..7e65ec3 100644 --- a/src/org/tizen/emulator/manager/ui/MainDialog.java +++ b/src/org/tizen/emulator/manager/ui/MainDialog.java @@ -199,6 +199,7 @@ public class MainDialog { openCreateDetailView(); } else { openDetailView(detailView.getCurrentPoperty()); + vmsTree.setSelectProperty(detailView.getCurrentPoperty()); } } } @@ -258,6 +259,7 @@ public class MainDialog { public void resetVM() { handling.resetVirtualMachine(detailView.getCurrentPoperty()); + vmsTree.setSelectProperty(detailView.getCurrentPoperty()); } public void cloneVM() { @@ -269,11 +271,14 @@ public class MainDialog { if (handling.deleteVirtualMachine(detailView.getCurrentPoperty())) { refreshProperties(); closeDetailView(); + } else { + vmsTree.setSelectProperty(detailView.getCurrentPoperty()); } } public void createBaseImage() { handling.createBaseImage(detailView.getCurrentPoperty()); + vmsTree.setSelectProperty(detailView.getCurrentPoperty()); } public void refreshVMsTable() { diff --git a/src/org/tizen/emulator/manager/ui/MenuHandling.java b/src/org/tizen/emulator/manager/ui/MenuHandling.java index 38dc0ac..c01e23c 100644 --- a/src/org/tizen/emulator/manager/ui/MenuHandling.java +++ b/src/org/tizen/emulator/manager/ui/MenuHandling.java @@ -148,6 +148,7 @@ public class MenuHandling { returnMSG =e.getMessage(); msg.openInfoDialog(returnMSG); } + } public void cloneVirtualMachine(VMsProperty currentPoperty) { diff --git a/src/org/tizen/emulator/manager/ui/detail/TableWidget.java b/src/org/tizen/emulator/manager/ui/detail/TableWidget.java index 04325a3..9291c2c 100644 --- a/src/org/tizen/emulator/manager/ui/detail/TableWidget.java +++ b/src/org/tizen/emulator/manager/ui/detail/TableWidget.java @@ -172,6 +172,7 @@ class NameText extends TableWidget { checkImageName(); } }); + return false; } @@ -393,6 +394,7 @@ class ResolutionCombo extends TableWidget { resolutionCombo = helper.makeCombo(table); helper.addComboItem(resolutionCombo, DisplayResoultion.getInstance().getList(), DisplayResoultion.getInstance().findIndex(oldResolution.toString())); + resolutionCombo.setToolTipText(resolutionCombo.getItem(resolutionCombo.getSelectionIndex())); return true; } @@ -401,6 +403,7 @@ class ResolutionCombo extends TableWidget { resolutionCombo.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { String re = resolutionCombo.getItem(resolutionCombo.getSelectionIndex()); + resolutionCombo.setToolTipText(re); for (RESOLUTION d : RESOLUTION.values()) { if (re.equals(d.toString())) { newResolution = d; @@ -485,6 +488,7 @@ class SkinCombo extends TableWidget { Skin oldSkin; Skin newSkin; VMCreateHelper helper; + private Skin selectSkin = null; public SkinCombo(boolean isCreate) { super("skin", isCreate); @@ -528,6 +532,7 @@ class SkinCombo extends TableWidget { } skinCombo.add(s.getName()); } + if (!isCreateMode() && oldSkin != null) { tempSkin = oldSkin; } @@ -537,6 +542,7 @@ class SkinCombo extends TableWidget { for (int i = 0; i < skinCombo.getItemCount(); i++) { if (skinCombo.getItem(i).equals(tempSkin.toString())) { skinCombo.select(i); + skinCombo.setToolTipText(skinCombo.getItem(i)); find = true; break; } @@ -547,11 +553,14 @@ class SkinCombo extends TableWidget { if (oldSkin != null) { skinCombo.add(oldSkin.toString(), 0); skinCombo.select(0); + skinCombo.setToolTipText(skinCombo.getItem(0)); } } else { newSkin = tempSkin; } + selectSkin = newSkin; + return true; } @@ -560,10 +569,14 @@ class SkinCombo extends TableWidget { skinCombo.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { String name = skinCombo.getItem(skinCombo.getSelectionIndex()); + skinCombo.setToolTipText(name); + newSkin = SkinList.getInstance().findSkinUseName(name); if (newSkin == null && name.equals(oldSkin)){ newSkin = oldSkin; } + selectSkin = newSkin; + if (!isCreateMode()) { getListener().ChangeValue(getThis()); } @@ -580,26 +593,44 @@ class SkinCombo extends TableWidget { ArrayList skinList = null; skinList = SkinList.getInstance().findSkinList(resolution); - helper.addComboItem(skinCombo, skinList.toArray(), 0); + Skin tempSkin = null; + for (Skin s : skinList) { + if (s.getResolution() != StringResource.SKIN_GENERAL) { + tempSkin = s; + } + skinCombo.add(s.getName()); + } - if (!isCreateMode() && oldSkin != null - && oldSkin.getResolution().equals(StringResource.SKIN_GENERAL)) { - boolean find = false; - for (int i = 0; i < skinCombo.getItemCount(); i++) { - if (skinCombo.getItem(i).equals(oldSkin.toString())) { - find = true; - break; + if (!isCreateMode() && selectSkin != null + && selectSkin.getResolution().equals(StringResource.SKIN_GENERAL)) { + boolean find = false; + for (int i = 0; i < skinCombo.getItemCount(); i++) { + if (skinCombo.getItem(i).equals(selectSkin.toString())) { + find = true; + break; + } } - } - if (!find) { - skinList.add(0, oldSkin); - skinCombo.add(oldSkin.toString(), 0); - skinCombo.select(0); + + if (!find) { + skinList.add(0, selectSkin); + skinCombo.add(selectSkin.toString(), 0); + } + tempSkin = selectSkin; + } else if (tempSkin == null) { + if (!skinList.isEmpty()) { + tempSkin = skinList.get(0); } } - if (!skinList.isEmpty()) { - newSkin = skinList.get(0); + if (tempSkin != null) { + for (int i = 0; i < skinCombo.getItemCount(); i++) { + if (skinCombo.getItem(i).equals(tempSkin.toString())) { + skinCombo.select(i); + skinCombo.setToolTipText(skinCombo.getItem(i)); + break; + } + } + newSkin = tempSkin; } else { newSkin = null; } diff --git a/src/org/tizen/emulator/manager/ui/vmstree/VMsTree.java b/src/org/tizen/emulator/manager/ui/vmstree/VMsTree.java index d674fe4..f150457 100644 --- a/src/org/tizen/emulator/manager/ui/vmstree/VMsTree.java +++ b/src/org/tizen/emulator/manager/ui/vmstree/VMsTree.java @@ -148,12 +148,16 @@ public class VMsTree { @Override public void keyPressed(KeyEvent e) { if(e.keyCode == SWT.DEL) { - for(TreeItem item : vmsTree.getSelection()) { - if(!(item.getData() instanceof PropertyContent)) { - return; + if (vmsTree.getSelectionCount() == 0) { + return; + } else { + for(TreeItem item : vmsTree.getSelection()) { + if(!(item.getData() instanceof PropertyContent)) { + return; + } } + mainDialog.deleteVM(); } - mainDialog.deleteVM(); } } }); @@ -351,7 +355,8 @@ public class VMsTree { for (TreeItem item : vmsTree.getItems()) { t = isPropertySelected(item, property); if (t != null) { - vmsTree.select(t); + vmsTree.setFocus(); + vmsTree.setSelection(t); break; } } -- 2.7.4