From: jihye424.kim Date: Mon, 11 May 2015 05:18:23 +0000 (+0900) Subject: Tab Item : change tab item to profile from platform X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb25971b2355f0a3787e1592013aa62a9c7fde4a;p=sdk%2Femulator%2Femulator-manager.git Tab Item : change tab item to profile from platform - make tab item using profile list - item view work normally - tree view does not work Change-Id: I603392182e9fa158994b4d16d0d74d5594af60a0 Signed-off-by: jihye424.kim --- diff --git a/common-project/src/org/tizen/emulator/manager/ui/MainDialog.java b/common-project/src/org/tizen/emulator/manager/ui/MainDialog.java index 1e60aee..f1c3237 100644 --- a/common-project/src/org/tizen/emulator/manager/ui/MainDialog.java +++ b/common-project/src/org/tizen/emulator/manager/ui/MainDialog.java @@ -50,15 +50,15 @@ import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.Shell; import org.tizen.emulator.manager.EmulatorManager.ManagerModeType; import org.tizen.emulator.manager.logging.EMLogger; -import org.tizen.emulator.manager.platform.CustomPlatform; -import org.tizen.emulator.manager.platform.Platform; import org.tizen.emulator.manager.platform.PlatformList; +import org.tizen.emulator.manager.platform.Profile; +import org.tizen.emulator.manager.platform.ProfileList; import org.tizen.emulator.manager.resources.ColorResources; import org.tizen.emulator.manager.resources.ImageResources; import org.tizen.emulator.manager.resources.StringResources; import org.tizen.emulator.manager.ui.dialog.AboutDialog; -import org.tizen.emulator.manager.ui.tabfolder.PlatformTabFolder; -import org.tizen.emulator.manager.ui.tabfolder.PlatformTabItem; +import org.tizen.emulator.manager.ui.tabfolder.ProfileTabFolder; +import org.tizen.emulator.manager.ui.tabfolder.ProfileTabItem; import org.tizen.emulator.manager.ui.widgets.ImageButton; import org.tizen.emulator.manager.vms.helper.CheckingRunningEmulator; import org.tizen.emulator.manager.vms.helper.RefreshWorker; @@ -129,8 +129,8 @@ public class MainDialog { } } - private ArrayList platformItems = new ArrayList(10); - private static PlatformTabFolder tabFolder = null; + private ArrayList profileItems = new ArrayList(10); + private static ProfileTabFolder tabFolder = null; private ImageButton resetButton = null; private ImageButton infoButton = null; private static StatusBar statusBar = null; @@ -163,7 +163,7 @@ public class MainDialog { } }); - tabFolder = new PlatformTabFolder(mainComposite); + tabFolder = new ProfileTabFolder(mainComposite); statusBar = new StatusBar(mainComposite); Composite tabComposite = tabFolder.getComposite(); @@ -185,19 +185,13 @@ public class MainDialog { barComposite.setLayoutData(data); // add platform tab item - for (Platform p : PlatformList.getPlatformList()) { - platformItems.add(new PlatformTabItem(p, tabFolder, SWT.CENTER)); + for (Profile p : ProfileList.getProfileList()) { + profileItems.add(new ProfileTabItem(p, tabFolder)); } - - // add custom tab - for (CustomPlatform p : PlatformList.getCustomPlatform()) { - platformItems.add(new PlatformTabItem(p, tabFolder, SWT.CENTER)); - } - +/* // add all tab (tree view) - platformItems.add(new PlatformTabItem(PlatformList.getTotalPlatform(), - tabFolder, SWT.CENTER)); - + profileItems.add(new ProfileTabItem(ProfileList.getTotalProfile(), tabFolder)); +*/ resetButton = new ImageButton(tabFolder.getTabComposite(), SWT.PUSH); resetButton.setImages(ImageResources.RESET_ICON_NOMAL.getImage(), ImageResources.RESET_ICON_HOVER.getImage(), @@ -241,7 +235,7 @@ public class MainDialog { } public static void refreshVMPropertyList(boolean isClear) { - PlatformList.settingVMPropertyList(); + ProfileList.settingVMPropertyList(); CheckingRunningEmulator.refreshVMPropertyList(); RefreshWorker.refreshVMConnect(); diff --git a/common-project/src/org/tizen/emulator/manager/ui/VMsDetailView.java b/common-project/src/org/tizen/emulator/manager/ui/VMsDetailView.java index 96f7d6f..dac0d70 100644 --- a/common-project/src/org/tizen/emulator/manager/ui/VMsDetailView.java +++ b/common-project/src/org/tizen/emulator/manager/ui/VMsDetailView.java @@ -63,11 +63,11 @@ public class VMsDetailView { static final StackLayout stackLayout = new StackLayout(); static DetailViewPage topViewPage; private void setTopControl(DetailViewPage page) { - if (isChnagePlatform || stackLayout.topControl != page.getComposite()) { + if (isChangeProfile || stackLayout.topControl != page.getComposite()) { stackLayout.topControl = page.getComposite(); topViewPage = page; page.resize(HEIGHT); - isChnagePlatform = false; + isChangeProfile = false; } mainView.layout(); // mainView.layout(true,true); diff --git a/common-project/src/org/tizen/emulator/manager/ui/VMsListView.java b/common-project/src/org/tizen/emulator/manager/ui/VMsListView.java index d883872..7e21760 100644 --- a/common-project/src/org/tizen/emulator/manager/ui/VMsListView.java +++ b/common-project/src/org/tizen/emulator/manager/ui/VMsListView.java @@ -157,7 +157,7 @@ public class VMsListView { public void widgetSelected(SelectionEvent e) { if (itemButton.isSelection() && isTreeViewSelect) { selectRadioButton(false); - VMsMainView.getInstance().drawVMList(VMsMainView.getInstance().getCurrentImage()); + VMsMainView.getInstance().drawVMList(VMsMainView.getInstance().getProfile()); } } @@ -176,7 +176,7 @@ public class VMsListView { public void widgetSelected(SelectionEvent e) { if (treeButton.isSelection() && !isTreeViewSelect) { selectRadioButton(true); - VMsMainView.getInstance().drawVMList(VMsMainView.getInstance().getCurrentImage()); + VMsMainView.getInstance().drawVMList(VMsMainView.getInstance().getProfile()); } } diff --git a/common-project/src/org/tizen/emulator/manager/ui/VMsMainView.java b/common-project/src/org/tizen/emulator/manager/ui/VMsMainView.java index 66be492..dbdb32f 100644 --- a/common-project/src/org/tizen/emulator/manager/ui/VMsMainView.java +++ b/common-project/src/org/tizen/emulator/manager/ui/VMsMainView.java @@ -41,7 +41,6 @@ import org.tizen.emulator.manager.logging.EMLogger; import org.tizen.emulator.manager.platform.BaseImage; import org.tizen.emulator.manager.platform.Platform; import org.tizen.emulator.manager.platform.Profile; -import org.tizen.emulator.manager.platform.TotalPlatform; import org.tizen.emulator.manager.resources.ColorResources; import org.tizen.emulator.manager.resources.StringResources; import org.tizen.emulator.manager.ui.dialog.MessageDialog; @@ -175,11 +174,10 @@ public class VMsMainView { } this.currentProfile = profile; - // TODO - /* - detailView.changeProfile(); + + detailView.changeProfile(); // TODO listView.drawProfile(profile, isRefresh); - */ + } public void resetProfile() { @@ -260,11 +258,11 @@ public class VMsMainView { } public void drawVMList(int index) { - if (currentPlatform == null) { + if (currentProfile == null) { return; } else { - currentPlatform.setCurrentImageIndex(index); // for Tab switching - drawVMList(currentPlatform.getImageList().get(index)); + //currentPlatform.setCurrentImageIndex(index); // for Tab switching + drawVMList(currentProfile); } } @@ -273,11 +271,9 @@ public class VMsMainView { if (profile.getEmulatorList().isEmpty()) { drawEmptyVMList(); } else { - /* TODO listView.drawVMList((currentProperty == null ? 0 - : profile.getEmulatorList().indexOf(currentProperty), - false)); - */ + : profile.getEmulatorList().indexOf(currentProperty)), + false); } } @@ -309,11 +305,11 @@ public class VMsMainView { // for launch emulator public void drawDetailVM(int index) { if (index < 0 - || index > currentImage.getVmsList().size()) { + || index > currentProfile.getEmulatorList().size()) { return; } - drawDetailVM(currentImage.getVmsList().get(index), index); + drawDetailVM(currentProfile.getEmulatorList().get(index), index); } public void drawModifyVM(VMProperty property) { @@ -344,14 +340,12 @@ public class VMsMainView { } public void drawCreateVM(boolean setFocus) { - if (currentImage.getVmsList().isEmpty()) { - listView.drawVMList(currentImage, -1, true); + if (currentProfile.getEmulatorList().isEmpty()) { + listView.drawVMList(-1, true); } - /* - BaseImage image = (currentPlatform.getName().equals("custom")) - ? null : currentImage; - */ - drawCreateVM(currentImage, setFocus); + + // TODO + drawCreateVM(currentProfile.getImageList().get(0), setFocus); } public void drawCreateVM(BaseImage image, boolean setFocus) { @@ -368,14 +362,15 @@ public class VMsMainView { public void drawCancelCreaetVM() { isCreateMode = false; - if (currentImage.getVmsList().isEmpty()) { + if (currentProfile.getEmulatorList().isEmpty()) { listView.cancelModify(-1); - if (currentPlatform == null || !(currentPlatform instanceof TotalPlatform)) { - drawEmptyVMList(); - } + //TODO + //if (currentPlatform == null || !(currentPlatform instanceof TotalPlatform)) { + //drawEmptyVMList(); + //} } else { if (currentProperty != null) { - int i = currentImage.getVmsList().indexOf(currentProperty); + int i = currentProfile.getEmulatorList().indexOf(currentProperty); listView.cancelModify(i); //detailView.drawDetailVM(currentProperty); } else { diff --git a/common-project/src/org/tizen/emulator/manager/ui/detail/PInfoViewPage.java b/common-project/src/org/tizen/emulator/manager/ui/detail/PInfoViewPage.java index d2c7b20..3e7ae60 100644 --- a/common-project/src/org/tizen/emulator/manager/ui/detail/PInfoViewPage.java +++ b/common-project/src/org/tizen/emulator/manager/ui/detail/PInfoViewPage.java @@ -43,7 +43,8 @@ import org.eclipse.swt.widgets.Composite; import org.tizen.emulator.manager.logging.EMLogger; import org.tizen.emulator.manager.platform.BaseImage; import org.tizen.emulator.manager.platform.Platform; -import org.tizen.emulator.manager.platform.PlatformList; +import org.tizen.emulator.manager.platform.Profile; +import org.tizen.emulator.manager.platform.ProfileList; import org.tizen.emulator.manager.plugin.ExtensionItem; import org.tizen.emulator.manager.plugin.PluginStringResources; import org.tizen.emulator.manager.resources.ImageResources; @@ -190,26 +191,34 @@ public class PInfoViewPage extends DetailViewPage { infoItemList = new ArrayList(); ExtensionItem item = null; - for (Platform platform : PlatformList.getPlatformList()) { - if (platform.getPlugin() != null) { - item = platform.getPlugin().getExtensionItem(PluginStringResources.ItemFactory); - if (item != null) { - List templateList = new ArrayList(); - for (BaseImage image : platform.getImageList()) { - ItemList template = image.getItemList(); - if (template != null) { - templateList.add(template); - infoItemList.add(new InfoViewItemList(item, this.getItemListComposite(), - template, platform.getProfile(), image.getName(), false)); + for (Profile profile : ProfileList.getProfileList()) { + for (Platform platform : profile.getPlatformList()) { + if (platform.getPlugin() != null) { + item = platform.getPlugin().getExtensionItem(PluginStringResources.ItemFactory); + if (item != null) { + List templateList = new ArrayList(); + for (BaseImage image : profile.getImageList()) { + if (!image.getPlatform().equals(platform)) { + continue; + } + ItemList template = image.getItemList(); + if (template != null) { + templateList.add(template); + infoItemList.add(new InfoViewItemList(item, this.getItemListComposite(), + template, platform.getProfile(), image.getName(), false)); + } } - } - // add itemlist for custom. - for (Platform custom : PlatformList.getCustomPlatform()) { - if (custom.getProfile().equals(platform.getProfile())) { - infoItemList.add(new InfoViewItemList(item, this.getItemListComposite(), - custom.getImageList().get(0).getItemList(), custom.getProfile(), null, true)); + // TODO + // add itemlist for custom. + /* + for (Platform custom : PlatformList.getCustomPlatform()) { + if (custom.getProfile().equals(platform.getProfile())) { + infoItemList.add(new InfoViewItemList(item, this.getItemListComposite(), + custom.getImageList().get(0).getItemList(), custom.getProfile(), null, true)); + } } + */ } } } diff --git a/common-project/src/org/tizen/emulator/manager/ui/detail/PModifyViewPage.java b/common-project/src/org/tizen/emulator/manager/ui/detail/PModifyViewPage.java index 4db981c..957dc4c 100644 --- a/common-project/src/org/tizen/emulator/manager/ui/detail/PModifyViewPage.java +++ b/common-project/src/org/tizen/emulator/manager/ui/detail/PModifyViewPage.java @@ -44,6 +44,8 @@ import org.tizen.emulator.manager.logging.EMLogger; import org.tizen.emulator.manager.platform.BaseImage; import org.tizen.emulator.manager.platform.Platform; import org.tizen.emulator.manager.platform.PlatformList; +import org.tizen.emulator.manager.platform.Profile; +import org.tizen.emulator.manager.platform.ProfileList; import org.tizen.emulator.manager.plugin.ExtensionItem; import org.tizen.emulator.manager.plugin.PluginStringResources; import org.tizen.emulator.manager.resources.ImageResources; @@ -168,26 +170,34 @@ public class PModifyViewPage extends DetailViewPage "Failed to load template"); modifyItemList = new ArrayList(); ExtensionItem item = null; - for (Platform platform : PlatformList.getPlatformList()) { - if (platform.getPlugin() != null) { - item = platform.getPlugin().getExtensionItem(PluginStringResources.ItemFactory); - if (item != null) { - List templateList = new ArrayList(); - for (BaseImage image : platform.getImageList()) { - ItemList template = image.getItemList(); - if (template != null) { - templateList.add(template); - modifyItemList.add(new ModifyViewItemList(item, this, - template, platform.getProfile(), image.getName(), false)); + for(Profile profile : ProfileList.getProfileList()) { + for (Platform platform : profile.getPlatformList()) { + if (platform.getPlugin() != null) { + item = platform.getPlugin().getExtensionItem(PluginStringResources.ItemFactory); + if (item != null) { + List templateList = new ArrayList(); + for (BaseImage image : profile.getImageList()) { + if (!image.getPlatform().equals(platform)) { + continue; + } + ItemList template = image.getItemList(); + if (template != null) { + templateList.add(template); + modifyItemList.add(new ModifyViewItemList(item, this, + template, platform.getProfile(), image.getName(), false)); + } } - } - // add itemlist for custom. - for (Platform custom : PlatformList.getCustomPlatform()) { - if (custom.getProfile().equals(platform.getProfile())) { - modifyItemList.add(new ModifyViewItemList(item, this, - custom.getImageList().get(0).getItemList(), custom.getProfile(), null, true)); + // TODO + // add itemlist for custom. + /* + for (Platform custom : PlatformList.getCustomPlatform()) { + if (custom.getProfile().equals(platform.getProfile())) { + modifyItemList.add(new ModifyViewItemList(item, this, + custom.getImageList().get(0).getItemList(), custom.getProfile(), null, true)); + } } + */ } } } diff --git a/common-project/src/org/tizen/emulator/manager/ui/list/ItemListVew.java b/common-project/src/org/tizen/emulator/manager/ui/list/ItemListVew.java index e4ca0b7..9449c83 100644 --- a/common-project/src/org/tizen/emulator/manager/ui/list/ItemListVew.java +++ b/common-project/src/org/tizen/emulator/manager/ui/list/ItemListVew.java @@ -339,7 +339,7 @@ public class ItemListVew extends AbstractListView { createButton = null; } - resetPopupMenu(VMsMainView.getInstance().getCurrentImage().getSortType()); + resetPopupMenu(VMsMainView.getInstance().getProfile().getSortType()); // clear VMButtonFactory.clear(); diff --git a/common-project/src/org/tizen/emulator/manager/ui/list/TreeListView.java b/common-project/src/org/tizen/emulator/manager/ui/list/TreeListView.java index d3a4fec..c9d152d 100644 --- a/common-project/src/org/tizen/emulator/manager/ui/list/TreeListView.java +++ b/common-project/src/org/tizen/emulator/manager/ui/list/TreeListView.java @@ -320,7 +320,7 @@ public class TreeListView extends AbstractListView { @Override public void drawEmptyVMList() { - drawVMList(VMsMainView.getInstance().getCurrentImage(), 0, false); + drawVMList(0, false); } @Override