From a0b064f15495248adcc24999b99818f84b55aa28 Mon Sep 17 00:00:00 2001 From: "jihye424.kim" Date: Mon, 12 Oct 2015 13:50:09 +0900 Subject: [PATCH] Template Table: set higher priority of standard template then custom template Change-Id: Ie5c67551e2a31d9385c6d8b4ee6a5679f5d2c853 Signed-off-by: jihye424.kim --- .../tableviewer/DeviceTemplateTableViewer.java | 32 +++++++++++++++------- .../ui/renewal/tableviewer/ProfileButton.java | 4 +-- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/DeviceTemplateTableViewer.java b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/DeviceTemplateTableViewer.java index e2dfa4d..55aa7ce 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/DeviceTemplateTableViewer.java +++ b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/DeviceTemplateTableViewer.java @@ -115,6 +115,7 @@ public class DeviceTemplateTableViewer extends AbstractTableViewer { @Override void setIconMenu() { refreshButton = new ImageButton(getTopComp(), SWT.PUSH); + refreshButton.setToolTipText("reloading device template list"); refreshButton.setImages(ImageResources.BUTTON_REFRESH_NML.getImage(), ImageResources.BUTTON_REFRESH_HOVER.getImage(), ImageResources.BUTTON_REFRESH_HOVER.getImage(), @@ -145,14 +146,14 @@ public class DeviceTemplateTableViewer extends AbstractTableViewer { makeTable(); makeBackButton(); makeProfileButton(); - makeTemplateButton(); + makeFunctionButton(); setLayout(); } @Override void showTableComposite() { if (!isTableInitialize) { - setTemplateList(); + setTemplateListTable(); isTableInitialize = true; } @@ -160,7 +161,7 @@ public class DeviceTemplateTableViewer extends AbstractTableViewer { public void refreshDeviceTemplateList() { ProfileList.settingDeviceTemplateList(); - setTemplateList(); + setTemplateListTable(); } private void makeProfileButton() { @@ -204,9 +205,9 @@ public class DeviceTemplateTableViewer extends AbstractTableViewer { }); } - private final String[] titles = {"Type", "Name", "Resolution", "Display Size", "Ram", "Processor"}; + private final String[] titles = {"Type", "Name", "Resolution", "Display Size", "RAM Size", "Processors"}; private void makeTable() { - table = new Table(comp, SWT.BORDER); + table = new Table(comp, SWT.BORDER | SWT.SINGLE); for (String t : titles) { TableColumn column = new TableColumn(table, SWT.None); @@ -243,7 +244,11 @@ public class DeviceTemplateTableViewer extends AbstractTableViewer { for (int i = 0; i < table.getItemCount(); i++) { DeviceTemplate t = (DeviceTemplate)table.getItem(i).getData(); Profile p = ProfileList.getProfile(t.getValue().getProfile()); - pairs[i] = new ItemProfilePair(table.getItem(i), 1, dir, p.getPriority()); + int priority = p.getPriority(); + if (!t.getValue().isStandard()) { + priority += 1; + } + pairs[i] = new ItemProfilePair(table.getItem(i), 1, dir, priority); } column.setTableItemPairs(pairs); // sort table item @@ -253,7 +258,7 @@ public class DeviceTemplateTableViewer extends AbstractTableViewer { }); } - private void setTemplateList() { + private void setTemplateListTable() { table.removeAll(); for (ProfileButton pButton : profileButtonList) { if (pButton.getProfile() == null) { @@ -298,12 +303,19 @@ public class DeviceTemplateTableViewer extends AbstractTableViewer { } else { item.setImage(0, pButton.getCustomIcon()); } - setTableItemProperty(item, template); + + // + setTableItemProperty(pButton, item, template); // } - private void setTableItemProperty(TableItem item, DeviceTemplate template) { + private void setTableItemProperty(ProfileButton pButton, TableItem item, DeviceTemplate template) { DeviceTemplateValue value = template.getValue(); + if (value.isStandard()) { + item.setImage(0, pButton.getIcon()); + } else { + item.setImage(0, pButton.getCustomIcon()); + } item.setText(1, value.getName()); item.setText(2, value.getResolution().toString()); item.setText(3, String.valueOf(value.getDisplaySize()) + " " + value.getDisplaySizeUnit()); @@ -355,7 +367,7 @@ public class DeviceTemplateTableViewer extends AbstractTableViewer { } }; - private void makeTemplateButton() { + private void makeFunctionButton() { createButton = new ImageButton(comp, SWT.PUSH); createButton.setToolTipText("create device template"); createButton.setBackground(null); diff --git a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/ProfileButton.java b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/ProfileButton.java index b914669..dc25146 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/ProfileButton.java +++ b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/ProfileButton.java @@ -66,9 +66,9 @@ public class ProfileButton { if (profileName.equals("mobile")) { this.profile.setPriority(0); } else if (profileName.equals("wearable")) { - this.profile.setPriority(1); + this.profile.setPriority(2); } else if (profileName.equals("tv")) { - this.profile.setPriority(3); + this.profile.setPriority(4); } } } -- 2.7.4