base image list: add reloading base image function
authorjihye424.kim <jihye424.kim@samsung.com>
Fri, 27 Nov 2015 08:57:32 +0000 (17:57 +0900)
committerjihye424.kim <jihye424.kim@samsung.com>
Fri, 27 Nov 2015 08:57:32 +0000 (17:57 +0900)
- reloading base image list from base image list configure

Change-Id: I7d70d74d7d7679ff83af6e42fe87625e1e7e4ced
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
src/org/tizen/emulator/manager/platform/Profile.java
src/org/tizen/emulator/manager/platform/ProfileList.java
src/org/tizen/emulator/manager/ui/renewal/tableviewer/BaseImageTableViewer.java

index a19bed4..7ffbe10 100644 (file)
@@ -64,6 +64,8 @@ public class Profile {
        private boolean isSortTemplateList = false;
        private DeviceTemplate defaultTemplate = null;
 
+       private boolean isSortBaseImageList = false;
+
        public Profile(String name) {
                this.name = name;
                initLastCreatedPropertyPath();
@@ -258,6 +260,9 @@ public class Profile {
        }
 
        public List<BaseImage> getImageList() {
+               if (!isSortBaseImageList) {
+                       sortBaseImageList();
+               }
                return imageList;
        }
 
@@ -265,6 +270,11 @@ public class Profile {
                this.imageList = imageList;
        }
 
+       public void clearBaseImageList() {
+               imageList.clear();
+               isSortBaseImageList = false;
+       }
+
        public void sortPlatformList() {
                isSortPlatformList = true;
                PlatformPair[] pairs = new PlatformPair[platformList.size()];
@@ -280,6 +290,7 @@ public class Profile {
        }
 
        public void sortBaseImageList() {
+               isSortBaseImageList = true;
                ImagePair[] pairs = new ImagePair[imageList.size()];
                for (int i = 0; i < imageList.size(); i++) {
                        pairs[i] = new ImagePair(imageList.get(i));
index dcc7794..679c7a9 100644 (file)
@@ -93,6 +93,22 @@ public class ProfileList {
                settingDeviceTemplateListInternal(true);
        }
 
+       public static void reloadingBaseImageList() {
+               for (Profile profile : profileList) {
+                       profile.clearBaseImageList();
+               }
+
+               for (Profile profile : profileList) {
+                       for (Platform platform : profile.getPlatformList()) {
+                               ProfileList.makeBaesImageList(profile, platform, platform.getPlatformPath());
+                       }
+               }
+
+               ProfileList.makeCustomBaseImageList();
+
+               ProfileList.settingVMPropertyListInternal();
+       }
+
        private static void initProfileList() {
                File platforms = new File(FilePathResources.getPlatformsPath());
                if (!platforms.exists() || !platforms.isDirectory()) {
index a83860e..14f7c06 100644 (file)
@@ -95,7 +95,9 @@ public class BaseImageTableViewer extends AbstractTableViewer {
        }
 
        public void refreshBaseImageList() {
-               // TODO
+                ProfileList.reloadingBaseImageList();
+                // reset base image list table
+                setBaseImageListTable();
        }
 
        @Override