From 2fd138a956f6b398ef3aceb4738478c8d2b698ac Mon Sep 17 00:00:00 2001 From: "jihye424.kim" Date: Wed, 2 Sep 2015 15:25:48 +0900 Subject: [PATCH] ProfileButton: seperate 'ProfileButton' class from 'ProfileButtonList' Change-Id: I8db2eebb7e68c71dd2b88d8ab5fe53200806b3a3 Signed-off-by: jihye424.kim --- .../ui/renewal/tableviewer/ProfileButton.java | 97 ++++++++++++++++++++++ .../ui/renewal/tableviewer/ProfileButtonList.java | 57 ++----------- 2 files changed, 102 insertions(+), 52 deletions(-) create mode 100644 src/org/tizen/emulator/manager/ui/renewal/tableviewer/ProfileButton.java diff --git a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/ProfileButton.java b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/ProfileButton.java new file mode 100644 index 0000000..28842bc --- /dev/null +++ b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/ProfileButton.java @@ -0,0 +1,97 @@ +/* + * 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 org.eclipse.swt.graphics.Image; +import org.tizen.emulator.manager.platform.Profile; +import org.tizen.emulator.manager.ui.renewal.widgets.ImageButton; + +public class ProfileButton { + private String profileName; + private Profile profile; + private ImageButton button; + private Image icon; + private Image selectedIcon; + + // for create vm combo + private Image createIcon; + + public ProfileButton(String name, ImageButton button) { + this.profileName = name; + this.button = button; + } + + public Profile getProfile() { + return profile; + } + + public void setProfile(Profile profile) { + if (profile == null) { + return; + } + + if (profile.getName().equals(profileName)) { + this.profile = profile; + } + } + + public ImageButton getButton() { + return button; + } + + public String getProfileName() { + return profileName; + } + + public Image getIcon() { + return icon; + } + + public void setIcon(Image icon) { + this.icon = icon; + } + + public Image getSelectedIcon() { + return selectedIcon; + } + + public void setSelectedIcon(Image selectedIcon) { + this.selectedIcon = selectedIcon; + } + + public Image getCreateIcon() { + return createIcon; + } + + public void setCreateIcon(Image createIcon) { + this.createIcon = createIcon; + } +} diff --git a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/ProfileButtonList.java b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/ProfileButtonList.java index 847a43f..2c110ac 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/tableviewer/ProfileButtonList.java +++ b/src/org/tizen/emulator/manager/ui/renewal/tableviewer/ProfileButtonList.java @@ -31,7 +31,6 @@ package org.tizen.emulator.manager.ui.renewal.tableviewer; import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Composite; import org.tizen.emulator.manager.platform.Platform; import org.tizen.emulator.manager.platform.Profile; @@ -40,57 +39,6 @@ import org.tizen.emulator.manager.plugin.PluginImageResources; import org.tizen.emulator.manager.renewal.resources.ImageResources; import org.tizen.emulator.manager.ui.renewal.widgets.ImageButton; -class ProfileButton { - private String profileName; - private Profile profile; - private ImageButton button; - private Image icon; - private Image selectedIcon; - - public ProfileButton(String name, ImageButton button) { - this.profileName = name; - this.button = button; - } - - public Profile getProfile() { - return profile; - } - - public void setProfile(Profile profile) { - if (profile == null) { - return; - } - - if (profile.getName().equals(profileName)) { - this.profile = profile; - } - } - - public ImageButton getButton() { - return button; - } - - public String getProfileName() { - return profileName; - } - - public Image getIcon() { - return icon; - } - - public void setIcon(Image icon) { - this.icon = icon; - } - - public Image getSelectedIcon() { - return selectedIcon; - } - - public void setSelectedIcon(Image selectedIcon) { - this.selectedIcon = selectedIcon; - } -} - public class ProfileButtonList { private final static int WIDTH = 32; private final static int HEIGHT = 26; @@ -104,6 +52,7 @@ public class ProfileButtonList { profileButton = new ProfileButton(name, button); profileButton.setIcon(ImageResources.ICON_TYPE_MOBILE.getImage()); profileButton.setSelectedIcon(ImageResources.ICON_SELECTED_MOBILE.getImage()); + profileButton.setCreateIcon(ImageResources.ICON_CREATE_MOBILE.getImage()); } } else if (name.equals("tv")){ button = makeTVButton(comp); @@ -111,6 +60,7 @@ public class ProfileButtonList { profileButton = new ProfileButton(name, button); profileButton.setIcon(ImageResources.ICON_TYPE_TV.getImage()); profileButton.setSelectedIcon(ImageResources.ICON_SELECTED_TV.getImage()); + profileButton.setCreateIcon(ImageResources.ICON_CREATE_TV.getImage()); } } else if (name.equals("wearable")) { button = makeWearableButton(comp); @@ -118,6 +68,7 @@ public class ProfileButtonList { profileButton = new ProfileButton(name, button); profileButton.setIcon(ImageResources.ICON_TYPE_WEARABLE.getImage()); profileButton.setSelectedIcon(ImageResources.ICON_SELECTED_WEARABLE_SQUARE.getImage()); + profileButton.setCreateIcon(ImageResources.ICON_CREATE_WEARABLE.getImage()); } } else { Profile profile = ProfileList.getProfile(name); @@ -130,6 +81,8 @@ public class ProfileButtonList { profileButton = new ProfileButton(name, button); profileButton.setIcon(PluginImageResources.ICON_TYPE.getImage(p.getName())); profileButton.setSelectedIcon(PluginImageResources.ICON_SELECTED_TYPE.getImage(p.getName())); + // TODO + profileButton.setSelectedIcon(PluginImageResources.ICON_CREATE_TYPE.getImage(p.getName())); } } } -- 2.7.4