From 58657eb43fbe1af3c2231fde701e5d59da1ef2de Mon Sep 17 00:00:00 2001 From: "jihye424.kim" Date: Sun, 25 Oct 2015 10:26:57 +0900 Subject: [PATCH] BaseImageTableViewer: create base image table viewer - list up base images (standard and custom type) - does not work create and delete function Change-Id: I84386540694f378856aed2242d3babdf4faeffe6 Signed-off-by: jihye424.kim --- resource/renewal/res/icon_title_description.png | Bin 0 -> 2861 bytes .../manager/renewal/resources/ImageResources.java | 2 + .../renewal/tableviewer/BaseImageTableViewer.java | 491 +++++++++++++++++++++ .../tableviewer/DeviceTemplateTableViewer.java | 12 +- .../ui/renewal/tableviewer/VMListTableViewer.java | 13 +- 5 files changed, 509 insertions(+), 9 deletions(-) create mode 100644 resource/renewal/res/icon_title_description.png create mode 100644 src/org/tizen/emulator/manager/ui/renewal/tableviewer/BaseImageTableViewer.java diff --git a/resource/renewal/res/icon_title_description.png b/resource/renewal/res/icon_title_description.png new file mode 100644 index 0000000000000000000000000000000000000000..4e1c77f748fb90f9b8417fdd289d50c11fdafe62 GIT binary patch literal 2861 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 LNkvXXu0mjfh)_#8 literal 0 HcmV?d00001 diff --git a/src/org/tizen/emulator/manager/renewal/resources/ImageResources.java b/src/org/tizen/emulator/manager/renewal/resources/ImageResources.java index 6281dde..1605e8d 100644 --- a/src/org/tizen/emulator/manager/renewal/resources/ImageResources.java +++ b/src/org/tizen/emulator/manager/renewal/resources/ImageResources.java @@ -194,6 +194,7 @@ public enum ImageResources { TITLE_IMAGE("img_titlebar"), VMLIST_TITLE_IMAGE("img_title_yourvmlist"), TEMPLATE_LIST_TITLE_IMAGE("img_title_templates"), + BASEIMAGE_LIST_TITLE_IMAGE("img_title_baseimages"), BUTTON_INFO_HOVER("btn_info_hover"), BUTTON_INFO_NML("btn_info_nml"), BUTTON_REFRESH_HOVER("btn_refreshlist_hover"), @@ -269,6 +270,7 @@ public enum ImageResources { ICON_TITLE_PROCESSOR("icon_title_processor"), ICON_TITLE_TREE_EXPANDED("icon_title_tree_expanded"), ICON_TITLE_TREE_CLOSED("icon_title_tree_closed"), + ICON_TITILE_DESCRIPTION("icon_title_description"), ICON_BLUE_BUTTON_OPEN("icon_blue_btn_open"), // profile select button diff --git a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/BaseImageTableViewer.java b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/BaseImageTableViewer.java new file mode 100644 index 0000000..7a3cbd2 --- /dev/null +++ b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/BaseImageTableViewer.java @@ -0,0 +1,491 @@ +/* + * Emulator Manager + * + * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * JiHye Kim + * Minkee Lee + * SeokYeon Hwang + * Sangho Park + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.emulator.manager.ui.renewal.tableviewer; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.KeyAdapter; +import org.eclipse.swt.events.KeyEvent; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Shell; +import org.tizen.emulator.manager.EmulatorManager; +import org.tizen.emulator.manager.platform.BaseImage; +import org.tizen.emulator.manager.platform.Profile; +import org.tizen.emulator.manager.platform.ProfileList; +import org.tizen.emulator.manager.renewal.resources.ColorResources; +import org.tizen.emulator.manager.renewal.resources.FontResources; +import org.tizen.emulator.manager.renewal.resources.ImageResources; +import org.tizen.emulator.manager.renewal.resources.PatchImageResources; +import org.tizen.emulator.manager.ui.renewal.MainDialog; +import org.tizen.emulator.manager.ui.renewal.widgets.Hyperlink; +import org.tizen.emulator.manager.ui.renewal.widgets.ImageButton; +import org.tizen.emulator.manager.ui.renewal.widgets.NinePatchResourceInfo; +import org.tizen.emulator.manager.ui.table.Table; +import org.tizen.emulator.manager.ui.table.TableColumn; +import org.tizen.emulator.manager.ui.table.TableItem; + +public class BaseImageTableViewer extends AbstractTableViewer { + private static final int BACK_BUTTON_WIDTH = 124; + private static final int BACK_BUTTON_HEIGHT = 26; + private static final int BUTTON_WIDTH = 32; + private static final int BUTTON_HEIGHT = 26; + + private Hyperlink templateList; + + private Composite comp; + private boolean isTableInitialize = false; + private Table table; + + private List profileButtonList; + + private ImageButton backButton; + private ImageButton createButton; + private ImageButton deleteButton; + + public BaseImageTableViewer(Shell shell, String key) { + super(shell, key); + } + + @Override + void setTitleImage() { + setTtileBackgroundImage(ImageResources.BASEIMAGE_LIST_TITLE_IMAGE.getImage()); + } + + @Override + void setLinkerMenu() { + templateList = new Hyperlink(getTopComp(), SWT.None); + templateList.setText("Templates"); + templateList.addListener(SWT.Selection, new Listener() { + @Override + public void handleEvent(Event event) { + if (event.type == SWT.Selection) { + MainDialog mainDialog = EmulatorManager.getMainDialog(); + AbstractTableViewer viewer = mainDialog.findViewer("templateList"); + if (viewer == null) { + DeviceTemplateTableViewer tViewer = new DeviceTemplateTableViewer(MainDialog.getShell(), "templateList"); + mainDialog.addViewer(tViewer); + mainDialog.setStackTop(tViewer); + } else { + mainDialog.setStackTop(viewer); + } + } + } + }); + addLinkMenu(templateList); + } + + @Override + void setIconMenu() { + // TODO + } + + @Override + void makeTableComposite() { + if (table != null) { + return; + } + + comp = getTableComp(); + + makeTable(); + makeBackButton(); + makeProfileButton(); + makeFunctionButton(); + setLayout(); + } + + @Override + void showTableComposite() { + if (!isTableInitialize) { + setBaseImageListTable(); + isTableInitialize = true; + } + } + + private final String[] titles = {"", "Type", "Name", "Platform", "File Name", "Description"}; + private void makeTable() { + table = new Table(comp, SWT.BORDER | SWT.SINGLE); + + for (String t : titles) { + TableColumn column = new TableColumn(table, SWT.None); + column.setText(t); + column.setAlignment(SWT.CENTER); + } + + table.setSelectedItemHeight(table.getItemHeight()); + table.getColumn(0).setResizable(false); + table.addListener(SWT.Selection, new Listener() { + @Override + public void handleEvent(Event e) { + if (e.type == SWT.Selection) { + tableSelected(); + } + } + }); + + table.addKeyListener(new KeyAdapter() { + @Override + public void keyPressed(KeyEvent event) { + if (table.getSelectionCount() == 0) { + return; + } + if (event.keyCode != SWT.DEL) { + return; + } + + TableItem item = table.getSelection()[0]; + deleteBaseImage(item, true); + } + }); + + settingSortingPair(); + } + + private void settingSortingPair() { + table.getColumn(1).addListener(SWT.Selection, new Listener() { + + @Override + public void handleEvent(Event event) { + TableColumn column = (TableColumn)event.widget; + // set column + table.settingSortColumn(column); + // make comparable item list + int dir = table.getSortDirection(); + IntegerTypeItemPair[] pairs = new IntegerTypeItemPair[table.getItemCount()]; + for (int i = 0; i < table.getItemCount(); i++) { + BaseImage t = (BaseImage)table.getItem(i).getData(); + Profile p = ProfileList.getProfile(t.getProfile()); + int priority = p.getPriority(); + if (!t.isStandard()) { + priority += 1; + } + pairs[i] = new IntegerTypeItemPair(table.getItem(i), 1, dir, priority); + } + column.setTableItemPairs(pairs); + // sort table item + table.defaultSortTableItem(column); + } + + }); + + table.getColumn(2).addListener(SWT.Selection, table.getDefaultSortListener()); + table.getColumn(3).addListener(SWT.Selection, table.getDefaultSortListener()); + table.getColumn(4).addListener(SWT.Selection, table.getDefaultSortListener()); + } + + private void setBaseImageListTable() { + table.removeAll(); + for (ProfileButton pButton : profileButtonList) { + if (pButton.getProfile() == null) { + continue; + } + if (!pButton.getButton().isSelection()) { + makeTableItem(pButton); + } + } + + table.getColumn(0).setWidth(30); + table.getColumn(1).setWidth(100); + for (int i = 2; i < titles.length; i++) { + table.getColumn(i).pack(); + } + } + + private void makeTableItem(ProfileButton pButton) { + for (BaseImage image : pButton.getProfile().getImageList()) { + addTableItem(pButton, image); + } + } + + private void addTableItem(ProfileButton pButton, BaseImage image) { + addTableItem(pButton, image, -1); + } + + private void addTableItem(ProfileButton pButton, BaseImage image, int index) { + if (pButton == null) { + return; + } + + TableItem item = null; + if (index >= 0) { + item = new TableItem(table, SWT.NULL, index); + } else { + item = new TableItem(table, SWT.NULL); + } + + if (image.isStandard()) { + item.setImage(1, pButton.getIcon()); + } else { + item.setImage(1, pButton.getCustomIcon()); + } + + setTableItemProperty(item, image); + setTableItemMenu(item, image); + } + + private void setTableItemProperty(TableItem item, BaseImage image) { + item.setText(2, image.getName()); + item.setText(3, image.getPlatformName()); + item.setText(4, image.getPathName()); + // TODO set description + item.setText(5, image.getDescription()); + item.setData(image); + // TODO + // setting tool tip + } + + private void setTableItemMenu(TableItem item, BaseImage image) { + // TODO + } + + private void makeFunctionButton() { + createButton = new ImageButton(comp, SWT.PUSH); + createButton.setToolTipText("create custom base image"); + createButton.setBackground(null); + createButton.setImages(ImageResources.BUTTON_CREATE_NORMAL.getImage(), + ImageResources.BUTTON_CREATE_HOVER.getImage(), + ImageResources.BUTTON_CREATE_HOVER.getImage(), + ImageResources.BUTTON_CREATE_DISABLE.getImage()); + createButton.addListener(SWT.Selection, new Listener() { + @Override + public void handleEvent(Event event) { + if (event.type == SWT.Selection) { + createBaseImage(); + } + } + }); + + deleteButton = new ImageButton(comp, SWT.PUSH); + deleteButton.setToolTipText("delete base image"); + deleteButton.setBackground(null); + deleteButton.setImages(ImageResources.BUTTON_DELETE_NORMAL.getImage(), + ImageResources.BUTTON_DELETE_HOVER.getImage(), + ImageResources.BUTTON_DELETE_HOVER.getImage(), + ImageResources.BUTTON_DELETE_DISABLE.getImage()); + deleteButton.addListener(SWT.Selection, new Listener() { + @Override + public void handleEvent(Event event) { + if (event.type == SWT.Selection) { + TableItem[] items = table.getSelection(); + if (items != null && items.length > 0) { + deleteBaseImage(items[0], false); + } + } + } + }); + + deleteButton.setEnabled(false); + } + + private void makeProfileButton() { + profileButtonList = new ArrayList(); + profileButtonList.add(ProfileButtonMaker.getProfileButton("mobile", comp)); + profileButtonList.add(ProfileButtonMaker.getProfileButton("tv", comp)); + profileButtonList.add(ProfileButtonMaker.getProfileButton("wearable", comp)); + + for (Profile profile : ProfileList.getProfileList()) { + for (ProfileButton pButton : profileButtonList) { + if (pButton.getProfileName().equals(profile.getName())) { + pButton.setProfile(profile); + pButton.getButton().setEnabled(true); + pButton.getButton().addSelectionListener(profileButtonSelectionListener); + break; + } + } + } + + } + + private void makeBackButton() { + backButton = new ImageButton(comp, SWT.PUSH); + Image hover = PatchImageResources.getThreePatchButtonImage(BACK_BUTTON_WIDTH, hoverInfo); + Image normal = PatchImageResources.getThreePatchButtonImage(BACK_BUTTON_WIDTH, normalInfo); + + backButton.setText(" Back to VM List"); + backButton.setFont(FontResources.DEFAULT_FONT_9.getFont()); + backButton.setFontColor(ColorResources.DEFAULT_FONT.getColor()); + backButton.setImages(normal, hover, hover, normal); + backButton.addListener(SWT.Selection, new Listener() { + @Override + public void handleEvent(Event event) { + if (event.type == SWT.Selection) { + MainDialog mainDialog = EmulatorManager.getMainDialog(); + AbstractTableViewer viewer = mainDialog.findViewer("vmList"); + if (viewer != null) { + mainDialog.setStackTop(viewer); + } + } + } + }); + } + + private final SelectionListener profileButtonSelectionListener = new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + ImageButton b = (ImageButton)e.widget; + for (ProfileButton pButton : profileButtonList) { + if (pButton.getButton() != b) { + continue; + } + + if (!b.isSelection()) { + makeTableItem(pButton); + } else { + if (pButton.getProfile().getImageList().isEmpty()) { + return; + } + + String profile = pButton.getProfileName(); + for (TableItem item : table.getSelection()) { + BaseImage image = (BaseImage)(item.getData()); + if (image.getProfile().equals(profile)) { + table.deselectAll(); + } + } + for (BaseImage image : pButton.getProfile().getImageList()) { + for (TableItem item : table.getItems()) { + if (item.getData() == image) { + int index = table.indexOf(item); + table.remove(index); + break; + } + } + } + } + } + + tableSelected(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + } + }; + + private void createBaseImage() { + // TODO + } + + private void deleteBaseImage(TableItem item, boolean needCheck) { + // TODO + } + + private void tableSelected() { + if (table.getSelectionCount() == 0) { + deleteButton.setEnabled(false); + } else { + BaseImage image = (BaseImage)table.getSelection()[0].getData(); + if (image.isStandard()) { + deleteButton.setEnabled(false); + } else { + deleteButton.setEnabled(true); + } + } + } + + private void setLayout() { + // composite is form layout + FormData backButtonData; + backButtonData = new FormData(); + backButtonData.left = new FormAttachment(0, 10); + backButtonData.top = new FormAttachment(0, 13); + backButtonData.width = BACK_BUTTON_WIDTH; + backButtonData.height = BACK_BUTTON_HEIGHT; + backButton.setLayoutData(backButtonData); + + FormData profileButtonData; + for (int i = 0; i < profileButtonList.size(); i++) { + ProfileButton button = profileButtonList.get(i); + profileButtonData = new FormData(); + if (i == 0) { + profileButtonData.left = new FormAttachment(0, 372); + } else { + profileButtonData.left = new FormAttachment(profileButtonList.get(i-1).getButton(), 2); + } + profileButtonData.top = new FormAttachment(0, 13); + profileButtonData.width = button.getButton().getSize().x; + profileButtonData.height = button.getButton().getSize().y; + button.getButton().setLayoutData(profileButtonData); + } + + FormData workerButtonData = new FormData(); + workerButtonData.right = new FormAttachment(100, -10); + workerButtonData.top = new FormAttachment(0, 13); + workerButtonData.width = BUTTON_WIDTH; + workerButtonData.height = BUTTON_HEIGHT; + deleteButton.setLayoutData(workerButtonData); + + workerButtonData = new FormData(); + workerButtonData.right = new FormAttachment(deleteButton, -5); + workerButtonData.top = new FormAttachment(0, 13); + workerButtonData.width = BUTTON_WIDTH; + workerButtonData.height = BUTTON_HEIGHT; + createButton.setLayoutData(workerButtonData); + + workerButtonData = new FormData(); + workerButtonData.top = new FormAttachment(0, 45); + workerButtonData.left = new FormAttachment(0, 10); + workerButtonData.right = new FormAttachment(100, -10); + workerButtonData.bottom = new FormAttachment(100, -10); + table.setLayoutData(workerButtonData); + } + + private final NinePatchResourceInfo normalInfo = new NinePatchResourceInfo(ColorResources.TABLE_VIEWER_BG, + ColorResources.TABLE_VIEWER_BG, + null, //left top + ImageResources.BACK_BTN_NORMAL_C, // top -> center + null, // right top + ImageResources.BACK_BTN_NORMAL_R, // right + null, // right bottom + null, // bottom + null, // left bottom + ImageResources.BACK_BTN_NORMAL_L); // left + + private final NinePatchResourceInfo hoverInfo = new NinePatchResourceInfo(ColorResources.TABLE_VIEWER_BG, + ColorResources.TABLE_VIEWER_BG, + null, //left top + ImageResources.BACK_BTN_HOVER_C, // top -> center + null, // right top + ImageResources.BACK_BTN_HOVER_R, // right + null, // right bottom + null, // bottom + null, // left bottom + ImageResources.BACK_BTN_HOVER_L); // left +} 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 ea85814..d2a5131 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/DeviceTemplateTableViewer.java +++ b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/DeviceTemplateTableViewer.java @@ -110,10 +110,14 @@ public class DeviceTemplateTableViewer extends AbstractTableViewer { @Override public void handleEvent(Event event) { if (event.type == SWT.Selection) { - if (event.type == SWT.Selection) { - MessageBox dialog = new MessageBox(MainDialog.getShell()); - dialog.setMessage("Click Base Images menu"); - dialog.open(); + MainDialog mainDialog = EmulatorManager.getMainDialog(); + AbstractTableViewer viewer = mainDialog.findViewer("baseimageList"); + if (viewer == null) { + BaseImageTableViewer tViewer = new BaseImageTableViewer(MainDialog.getShell(), "baseimageList"); + mainDialog.addViewer(tViewer); + mainDialog.setStackTop(tViewer); + } else { + mainDialog.setStackTop(viewer); } } } diff --git a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/VMListTableViewer.java b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/VMListTableViewer.java index 45626d1..c7fe3b8 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/VMListTableViewer.java +++ b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/VMListTableViewer.java @@ -39,7 +39,6 @@ import org.eclipse.swt.widgets.Shell; import org.tizen.emulator.manager.EmulatorManager; import org.tizen.emulator.manager.renewal.resources.ImageResources; import org.tizen.emulator.manager.ui.renewal.MainDialog; -import org.tizen.emulator.manager.ui.renewal.dialog.MessageBox; import org.tizen.emulator.manager.ui.renewal.widgets.Hyperlink; import org.tizen.emulator.manager.ui.renewal.widgets.ImageButton; @@ -100,10 +99,14 @@ public class VMListTableViewer extends AbstractTableViewer { @Override public void handleEvent(Event event) { if (event.type == SWT.Selection) { - if (event.type == SWT.Selection) { - MessageBox dialog = new MessageBox(MainDialog.getShell()); - dialog.setMessage("Click BaseImages menu"); - dialog.open(); + MainDialog mainDialog = EmulatorManager.getMainDialog(); + AbstractTableViewer viewer = mainDialog.findViewer("baseimageList"); + if (viewer == null) { + BaseImageTableViewer tViewer = new BaseImageTableViewer(MainDialog.getShell(), "baseimageList"); + mainDialog.addViewer(tViewer); + mainDialog.setStackTop(tViewer); + } else { + mainDialog.setStackTop(viewer); } } } -- 2.7.4