[Title] Support sort by name in tree and some refactoring
authorsyeon.hwang <syeon.hwang@samsung.com>
Fri, 23 Mar 2012 11:02:19 +0000 (20:02 +0900)
committersyeon.hwang <syeon.hwang@samsung.com>
Fri, 23 Mar 2012 11:02:19 +0000 (20:02 +0900)
[Type]
[Module] Emulator/
[Priority]
[CQ#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

13 files changed:
.classpath
src/org/tizen/emulator/manager/EmulatorManager.java
src/org/tizen/emulator/manager/ui/MainDialog.java
src/org/tizen/emulator/manager/ui/ResourceRegistry.java
src/org/tizen/emulator/manager/ui/detail/DetailTableView.java
src/org/tizen/emulator/manager/ui/detail/VMPropertyView.java
src/org/tizen/emulator/manager/ui/vmstree/ColumnContentHelper.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/vmstree/ColumnSortListner.java [new file with mode: 0644]
src/org/tizen/emulator/manager/ui/vmstree/ContentProvider.java [deleted file]
src/org/tizen/emulator/manager/ui/vmstree/ContextMenu.java
src/org/tizen/emulator/manager/ui/vmstree/RowItem.java
src/org/tizen/emulator/manager/ui/vmstree/VMsTable.java
src/org/tizen/emulator/manager/vms/VMsProperty.java

index 7e81c76..c1f5691 100644 (file)
@@ -3,7 +3,7 @@
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="src" path="jaxb_src"/>
        <classpathentry kind="src" path="resource"/>
-       <classpathentry kind="lib" path="lib/swt/gtk-linux/swt-debug.jar"/>
+       <classpathentry kind="lib" path="lib/swt/gtk-linux/swt-debug.jar" sourcepath="lib/swt/gtk-linux/src.zip"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>
index cbf0163..ced7884 100644 (file)
@@ -13,6 +13,8 @@ import org.tizen.emulator.manager.vms.EmulatorVMs;
 import org.tizen.emulator.manager.vms.VMsProperty;
 
 public class EmulatorManager {
+       private static final String ICON_FILE_NAME = "res/em.ico";
+                       
        private static EmulatorManager instance;
 
        Display display;
@@ -32,7 +34,7 @@ public class EmulatorManager {
                shell.setText("Emulator Manager");
                shell.setLayout(new FillLayout());
 
-               InputStream is = this.getClass().getClassLoader().getResourceAsStream("res/em.ico");
+               InputStream is = this.getClass().getClassLoader().getResourceAsStream(ICON_FILE_NAME);
                if(is != null) {
                        icon = new Image(display, is);
                        shell.setImage(icon);
index c1f509d..7732d47 100644 (file)
@@ -87,16 +87,8 @@ public class MainDialog {
                        // Left : VMs Table
                        {
                                final Composite leftView = new Composite(sashForm, SWT.FILL);
-                               GridLayout gl = new GridLayout(1, false);
-                               gl.horizontalSpacing = 0;
-                               gl.verticalSpacing = 0;
-                               gl.marginBottom = 0;
-                               gl.marginHeight = 0;
-                               gl.marginLeft = 0;
-                               gl.marginRight = 0;
-                               gl.marginTop = 0;
-                               gl.marginWidth = 0;
-                               leftView.setLayout(gl);
+                               GridLayout layout = getNopaddedGridLayout();
+                               leftView.setLayout(layout);
 
                                imageListTable = new VMsTable(this, leftView);
                                SelectionListener archSelectionListener = new SelectionListener() {
@@ -173,16 +165,8 @@ public class MainDialog {
                        // LEFT : detail table
                        {
                                final Composite rightView = new Composite(sashForm, SWT.FILL);
-                               GridLayout gl = new GridLayout(1, false);
-                               gl.horizontalSpacing = 0;
-                               gl.verticalSpacing = 0;
-                               gl.marginBottom = 0;
-                               gl.marginHeight = 0;
-                               gl.marginLeft = 0;
-                               gl.marginRight = 0;
-                               gl.marginTop = 0;
-                               gl.marginWidth = 0;
-                               rightView.setLayout(gl);
+                               GridLayout layout = getNopaddedGridLayout();
+                               rightView.setLayout(layout);
 
                                detailView = new DetailTableView(this);
                                detailView.createDetailView(shell, rightView);
@@ -321,9 +305,13 @@ public class MainDialog {
                EmulatorVMs.getInstance().refreshProperties();
                imageListTable.refreshTableList();
        }
+       
+       public int[] getSashFormWeight() {
+               return sashForm.getWeights();
+       }
 
-       public void setDetailViewWeights(int weight) {
-               sashForm.setWeights(new int[] {100-weight, weight});
+       public void setDetailViewWeights(int[] weight) {
+               sashForm.setWeights(weight);
        }
 
        public void openDetailView(VMsProperty property) {
@@ -341,7 +329,7 @@ public class MainDialog {
        }
 
        public void closeDetailView() {
-               if (imageListTable.getCountSelectionItem() > 1) {
+               if (imageListTable.getSelectionContentCount() > 1) {
                        deleteButton.setEnabled(true);
                } else {
                        deleteButton.setEnabled(false);
@@ -408,4 +396,18 @@ public class MainDialog {
        public void dispose() {
                ResourceRegistry.dispose();
        }
+       
+       private GridLayout getNopaddedGridLayout() {
+               GridLayout layout = new GridLayout(1, false);
+               layout.horizontalSpacing = 0;
+               layout.verticalSpacing = 0;
+               layout.marginBottom = 0;
+               layout.marginHeight = 0;
+               layout.marginLeft = 0;
+               layout.marginRight = 0;
+               layout.marginTop = 0;
+               layout.marginWidth = 0;
+               
+               return layout;
+       }
 }
index 440ec8b..7e9a323 100644 (file)
@@ -4,6 +4,7 @@ import java.io.InputStream;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.Image;
 import org.tizen.emulator.manager.EmulatorManager;
 
@@ -24,6 +25,21 @@ public class ResourceRegistry {
                }
        }
 
+       public enum FontType {
+               BOLD("bold");
+
+               String name;
+
+               FontType(String name) {
+                       this.name = name;
+               }
+
+               @Override
+               public String toString() {
+                       return name;
+               }
+       }
+
        private static ResourceRegistry instance;
 
        Map<ImageName, Image> imagesMap = new HashMap<ImageName, Image>();
@@ -44,14 +60,28 @@ public class ResourceRegistry {
                }
        }
 
-       public static Image getImage(ImageName imageName) {
-               return instance.imagesMap.get(imageName);
+       Map<Integer, Font> fontsMap = new HashMap<Integer, Font>();
+       
+       public static Image getImage(ImageName imagename) {
+               return instance.imagesMap.get(imagename);
+       }
+       
+       public static void addFont(int fontStyle, Font font) {
+               instance.fontsMap.put(fontStyle, font);
+       }
+       
+       public static Font getFont(int fonttype) {
+               return instance.fontsMap.get(fonttype);
        }
 
        public static void dispose() {
                for(Image image : instance.imagesMap.values()) {
                        image.dispose();
                }
+               
+               for(Font font : instance.fontsMap.values()) {
+                       font.dispose();
+               }
        }
 
        private ResourceRegistry() {}
index 951a59e..7a0dffc 100644 (file)
@@ -13,6 +13,8 @@ import org.tizen.emulator.manager.ui.MainDialog;
 import org.tizen.emulator.manager.vms.VMsProperty;
 
 public class DetailTableView {
+       static final int[] DEFAULT_WEIGHT = new int[] { 60, 40 };
+       
        private static String Modify  = "Modify";
        private static String Create  = "Create";
        private static String Detail  = "Datail";
@@ -29,6 +31,7 @@ public class DetailTableView {
 
        private VMsProperty currentProperty;
        private VMPropertyView vmView = null;
+       private int[] weight = new int[] { 60, 40 };
 
        public DetailTableView(MainDialog mainDialog) {
                this.mainDialog = mainDialog;
@@ -88,7 +91,7 @@ public class DetailTableView {
                detailTable.getColumn(1).pack();
 
                if(!isDetailOpened) {
-                       mainDialog.setDetailViewWeights(40);
+                       mainDialog.setDetailViewWeights(weight);
                        isDetailOpened = true;
                }
        }
@@ -100,9 +103,12 @@ public class DetailTableView {
                } else if (isCreateState) {
                        closeCreateView();
                }
-
-               mainDialog.setDetailViewWeights(0);
-               isDetailOpened = false;
+               
+               if(isDetailOpened) {
+                       weight = mainDialog.getSashFormWeight();
+                       mainDialog.setDetailViewWeights(new int[] { 100, 0 });
+                       isDetailOpened = false;
+               }
        }
 
        public void openModifyView(VMsProperty property, Button confirmButton)
@@ -148,7 +154,7 @@ public class DetailTableView {
 
                detailTable.setEnabled(false);
                if (!isDetailOpened) {
-                       mainDialog.setDetailViewWeights(40);
+                       mainDialog.setDetailViewWeights(weight);
                        isDetailOpened = true;
                }
        }
index f6d9a1c..95bb944 100644 (file)
@@ -22,7 +22,6 @@ import org.eclipse.swt.widgets.TableItem;
 import org.eclipse.swt.widgets.Text;
 import org.tizen.emulator.manager.ui.ResourceRegistry;
 import org.tizen.emulator.manager.ui.ResourceRegistry.ImageName;
-import org.tizen.emulator.manager.vms.EmulatorVMs;
 import org.tizen.emulator.manager.vms.VMCreateHelper;
 import org.tizen.emulator.manager.vms.VMProcess;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
diff --git a/src/org/tizen/emulator/manager/ui/vmstree/ColumnContentHelper.java b/src/org/tizen/emulator/manager/ui/vmstree/ColumnContentHelper.java
new file mode 100644 (file)
index 0000000..f41f891
--- /dev/null
@@ -0,0 +1,92 @@
+package org.tizen.emulator.manager.ui.vmstree;
+
+import org.tizen.emulator.manager.vms.VMsProperty;
+import org.tizen.emulator.manager.vms.xml.DeviceType;
+import org.tizen.emulator.manager.vms.xml.DisplayType;
+
+
+// TODO: Support dynamic column editing...
+public abstract class ColumnContentHelper {
+       static final int numberOfColumns = 4;
+       static final String[] columnTitles = new String[] { "Name", "Resolution", "Density", "RAM size", };
+       static final ColumnContentHelper[] helpers = new ColumnContentHelper[] {
+               new NameContentHelper(0),
+               new ResolutionContentHelper(1),
+               new DensityContentHelper(2),
+               new RAMSizeContentHelper(3),
+       };
+               
+       int index;
+       
+       protected ColumnContentHelper(int index) {
+               this.index = index;
+       }
+       
+       public String getTitle() {
+               return columnTitles[index];
+       }
+       
+       public int getIndex() {
+               return index;
+       }
+
+       public abstract String getContent(VMsProperty property);
+
+       public static int getContentCount() {
+               return numberOfColumns;
+       }
+       
+       public static ColumnContentHelper[] getContentHelpers() {
+               return helpers;
+       }
+
+}
+
+class NameContentHelper extends ColumnContentHelper {
+       public NameContentHelper(int index) {
+               super(index);
+       }
+       
+       @Override
+       public String getContent(VMsProperty property) {
+               return property.getName();
+       }
+}
+
+class ResolutionContentHelper extends ColumnContentHelper {
+       public ResolutionContentHelper(int index) {
+               super(index);
+       }
+       
+       @Override
+       public String getContent(VMsProperty property) {
+               DisplayType displayType = property.getConfiguration().getDevice().getDisplay();
+               
+               return displayType.getResolution().getWidth()
+                               + " x " + displayType.getResolution().getHeight();
+       }
+}
+
+class DensityContentHelper extends ColumnContentHelper {
+       public DensityContentHelper(int index) {
+               super(index);
+       }
+
+       @Override
+       public String getContent(VMsProperty property) {
+               DisplayType displayType = property.getConfiguration().getDevice().getDisplay();
+               return displayType.getDensity().getValue() + "";
+       }
+}
+
+class RAMSizeContentHelper extends ColumnContentHelper {
+       public RAMSizeContentHelper(int index) {
+               super(index);
+       }
+
+       @Override
+       public String getContent(VMsProperty property) {
+               DeviceType deviceType = property.getConfiguration().getDevice();
+               return deviceType.getRAM().getSize().getValue() + "";
+       }
+}
diff --git a/src/org/tizen/emulator/manager/ui/vmstree/ColumnSortListner.java b/src/org/tizen/emulator/manager/ui/vmstree/ColumnSortListner.java
new file mode 100644 (file)
index 0000000..b42f2f7
--- /dev/null
@@ -0,0 +1,74 @@
+package org.tizen.emulator.manager.ui.vmstree;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+
+public class ColumnSortListner implements SelectionListener {
+       @Override
+       public void widgetSelected(SelectionEvent event) {
+               TreeColumn column = (TreeColumn)event.widget;
+               Tree tree = column.getParent();
+
+               tree.setSortColumn(column);
+               if(tree.getSortDirection() == SWT.NONE)
+                       tree.setSortDirection(SWT.UP);
+               else if(tree.getSortDirection() == SWT.UP)
+                       tree.setSortDirection(SWT.DOWN);
+               else if(tree.getSortDirection() == SWT.DOWN)
+                       tree.setSortDirection(SWT.UP);
+
+               for(TreeItem item : tree.getItems()) {
+                       if(!(item.getData() instanceof Container)) // double checking...
+                               continue;
+
+                       int count = item.getItemCount();
+
+                       for(int i = 0; i < count - 1; ++i) {
+                               TreeItem subItem0 = item.getItem(i);
+                               if(subItem0.getData() instanceof TreeMarker)
+                                       continue;
+
+                               for(int j = i + 1; j < count; ++j) {
+                                       TreeItem subItem1 = item.getItem(j);
+
+                                       if(subItem1.getData() instanceof TreeMarker)
+                                               continue;
+
+                                       if(tree.getSortDirection() == SWT.UP) {
+                                               if(subItem0.getText().compareTo(subItem1.getText()) > 0) {
+                                                       PropertyContent content0 = (PropertyContent)subItem0.getData();
+                                                       PropertyContent content1 = (PropertyContent)subItem1.getData();
+
+                                                       RowItem rowItem = new PropertyContent(content1.getProperty(), subItem0);
+                                                       subItem0.setData(rowItem);
+                                                       rowItem = new PropertyContent(content0.getProperty(), subItem1);
+                                                       subItem1.setData(rowItem);
+                                               }
+                                       }
+                                       else if(tree.getSortDirection() == SWT.DOWN) {
+                                               if(subItem0.getText().compareTo(subItem1.getText()) < 0) {
+                                                       PropertyContent content0 = (PropertyContent)subItem0.getData();
+                                                       PropertyContent content1 = (PropertyContent)subItem1.getData();
+
+                                                       RowItem rowItem = new PropertyContent(content1.getProperty(), subItem0);
+                                                       subItem0.setData(rowItem);
+                                                       rowItem = new PropertyContent(content0.getProperty(), subItem1);
+                                                       subItem1.setData(rowItem);
+                                               }                                                                               
+                                       }
+                               }
+                       }
+                       tree.redraw();
+               }
+       }
+       
+       @Override
+       public void widgetDefaultSelected(SelectionEvent event) {
+               // TODO Auto-generated method stub
+       }
+
+}
diff --git a/src/org/tizen/emulator/manager/ui/vmstree/ContentProvider.java b/src/org/tizen/emulator/manager/ui/vmstree/ContentProvider.java
deleted file mode 100644 (file)
index b35082a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.tizen.emulator.manager.ui.vmstree;
-
-import org.tizen.emulator.manager.vms.VMsProperty;
-import org.tizen.emulator.manager.vms.xml.DeviceType;
-import org.tizen.emulator.manager.vms.xml.DisplayType;
-
-
-// TODO: Support dynamic column editing...
-public class ContentProvider {
-       static final int numberOfColumns = 4;
-
-       String[] columnTitles = new String[] { "Name", "Resolution", "Density", "RAM size" };
-       
-       public String[] getColumnTitles() {
-               return columnTitles;
-       }
-
-       public int getNumberOfColumns() {
-               return numberOfColumns;
-       }
-       
-       public String[] getColumnContents(VMsProperty property) {
-               String[] texts = new String[numberOfColumns];
-
-               texts[0] = property.getName();
-               
-               DeviceType deviceType = property.getConfiguration().getDevice();
-               DisplayType displayType = deviceType.getDisplay();
-               texts[1] = displayType.getResolution().getWidth()
-                               + " x " + displayType.getResolution().getHeight();
-
-               texts[2] = displayType.getDensity().getValue() + "";
-               texts[3] = deviceType.getRAM().getSize().getValue() + "";
-
-               return texts;
-       }
-
-}
index 17a9e46..75d695a 100644 (file)
@@ -10,6 +10,8 @@ import org.eclipse.swt.widgets.MenuItem;
 import org.eclipse.swt.widgets.Tree;
 import org.eclipse.swt.widgets.TreeItem;
 import org.tizen.emulator.manager.EmulatorManager;
+import org.tizen.emulator.manager.ui.ResourceRegistry;
+import org.tizen.emulator.manager.ui.ResourceRegistry.ImageName;
 import org.tizen.emulator.manager.vms.VMsProperty;
 
 public class ContextMenu {
@@ -24,6 +26,7 @@ public class ContextMenu {
 
                final MenuItem launchItem = new MenuItem(treeMenu, SWT.NONE);
                launchItem.setText("Launch");
+               launchItem.setImage(ResourceRegistry.getImage(ImageName.LAUNCH));
                launchItem.addSelectionListener(new SelectionListener() {
                        @Override
                        public void widgetSelected(SelectionEvent e) {
@@ -39,6 +42,7 @@ public class ContextMenu {
                });
                final MenuItem modifyItem = new MenuItem(treeMenu, SWT.NONE);
                modifyItem.setText("Modify");
+               modifyItem.setImage(ResourceRegistry.getImage(ImageName.MODIFY));
                modifyItem.addSelectionListener(new SelectionListener(){
                        @Override
                        public void widgetDefaultSelected(SelectionEvent arg0) {
@@ -51,6 +55,7 @@ public class ContextMenu {
                });
                final MenuItem deleteItem = new MenuItem(treeMenu, SWT.NONE);
                deleteItem.setText("Delete");
+               deleteItem.setImage(ResourceRegistry.getImage(ImageName.DELETE));
                deleteItem.addSelectionListener(new SelectionListener() {
                        @Override
                        public void widgetDefaultSelected(SelectionEvent arg0) {
@@ -62,6 +67,7 @@ public class ContextMenu {
                });
                final MenuItem resetItem = new MenuItem(treeMenu, SWT.NONE);
                resetItem.setText("Reset");
+               resetItem.setImage(ResourceRegistry.getImage(ImageName.RESET));
                resetItem.addSelectionListener(new SelectionListener() {
                        @Override
                        public void widgetDefaultSelected(SelectionEvent arg0) {
index e1120d3..aa82a51 100644 (file)
@@ -5,44 +5,63 @@ import org.eclipse.swt.graphics.Font;
 import org.eclipse.swt.graphics.FontData;
 import org.eclipse.swt.widgets.TreeItem;
 import org.tizen.emulator.manager.EmulatorManager;
+import org.tizen.emulator.manager.ui.ResourceRegistry;
 import org.tizen.emulator.manager.vms.VMsProperty;
 
-public abstract class RowItem {}
+public interface RowItem {}
 
-class PropertyContent extends RowItem {
+interface TreeMarker extends RowItem {}
+
+interface TreeContent extends RowItem {}
+
+
+class PropertyContent implements TreeContent {
        VMsProperty property;
 
-       public PropertyContent(VMsProperty property, ContentProvider provider, TreeItem item) {
+       public PropertyContent(VMsProperty property, TreeItem item) {
                this.property = property;
-               item.setText(provider.getColumnContents(property));
+
+               for(ColumnContentHelper helper : ColumnContentHelper.getContentHelpers()) {
+                       item.setText(helper.getIndex(), helper.getContent(property));
+               }
+       }
+       
+       public VMsProperty getProperty() {
+               return property;
        }
 }
 
-abstract class TreeMarker extends RowItem {
-       public TreeMarker(String text, TreeItem item) {
-               item.setText(text);
+class CreateMarker implements TreeMarker {
+       public CreateMarker(TreeItem item) {
+               item.setText("<< Create new... >>       ");
+               
+               Font font = ResourceRegistry.getFont(SWT.BOLD);
+               if(font == null) {
+                       FontData[] fontData = item.getFont().getFontData();
+                       fontData[0].setStyle(SWT.BOLD);
+                       font = new Font(EmulatorManager.getInstance().getDisplay(), fontData);
+                       ResourceRegistry.addFont(SWT.BOLD, font);
+               }
+               item.setFont(font);
        }
 }
 
-class CreateMarker extends TreeMarker {
-       public CreateMarker(TreeItem item) {
-               super("<< Create new... >>\t", item);
-               FontData[] fontData = item.getFont().getFontData();
-               fontData[0].setStyle(SWT.BOLD);
-               Font boldFont = new Font(EmulatorManager.getInstance().getDisplay(), fontData);
-               item.setFont(boldFont);
-               boldFont.dispose();
+
+abstract class Container {
+       public Container(String text, TreeItem item) {
+               item.setText(text);
        }
 }
 
-class StandardVMsMarker extends TreeMarker {
+class StandardVMsMarker extends Container implements TreeMarker {
        public StandardVMsMarker(String version, TreeItem item) {
                super(version, item);
        }
 }
 
-class CustomVMsMarker extends TreeMarker {
+class CustomVMsMarker extends Container implements TreeMarker {
        public CustomVMsMarker(TreeItem item) {
                super("Custom", item);
        }
 }
\ No newline at end of file
index f6e776a..4a2ddae 100644 (file)
@@ -24,7 +24,6 @@ public class VMsTable {
        MainDialog mainDialog;
 
        Tree vmsTree;
-       ContentProvider contentProvider = new ContentProvider();
        ContextMenu contextMenu = new ContextMenu();
 
        EmulatorVMs fsImage = EmulatorVMs.getInstance();
@@ -39,9 +38,13 @@ public class VMsTable {
                vmsTree.setHeaderVisible(true);
                vmsTree.setLinesVisible(true);
 
-               for(String columnTitle : contentProvider.getColumnTitles()) {
+               for(ColumnContentHelper helper : ColumnContentHelper.getContentHelpers()) {
                        TreeColumn treeColumn = new TreeColumn(vmsTree, SWT.NONE);
-                       treeColumn.setText(columnTitle);
+                       treeColumn.setText(helper.getTitle());
+
+                       if("Name".equalsIgnoreCase(treeColumn.getText())) {
+                               treeColumn.addSelectionListener(new ColumnSortListner());
+                       }
                }
 
                refreshTableList();
@@ -127,7 +130,7 @@ public class VMsTable {
                TreeItem createItem = new TreeItem(customItem, SWT.NONE);
                rowItem = new CreateMarker(createItem);
                createItem.setData(rowItem);
-               
+
                Map<String, TreeItem> itemsMap = new HashMap<String, TreeItem>();
 
                // FIXME !!
@@ -159,9 +162,9 @@ public class VMsTable {
                                                propertyItem = new TreeItem(vmsTree, SWT.NONE);
                                                rowItem = new StandardVMsMarker(version, propertyItem);
                                                propertyItem.setData(rowItem);
-                                               
+
                                                itemsMap.put(version, propertyItem);
-                                               
+
                                                createItem = new TreeItem(propertyItem, SWT.NONE);
                                                rowItem = new CreateMarker(createItem);
                                                createItem.setData(rowItem);
@@ -172,7 +175,7 @@ public class VMsTable {
                                        propertyItem = new TreeItem(customItem, SWT.NONE);
                                }
 
-                               rowItem = new PropertyContent(properties[i], contentProvider, propertyItem);
+                               rowItem = new PropertyContent(properties[i], propertyItem);
                                propertyItem.setData(rowItem);
                        }
                }
@@ -182,18 +185,15 @@ public class VMsTable {
                for(TreeItem item : itemsMap.values()) {
                        item.setExpanded(true);
                }
-               
+
        }
 
-       public int getCountSelectionItem() {
+       public int getSelectionContentCount() {
                int count = 0;
                Object data;
                for (int i = 0; i < vmsTree.getSelectionCount(); i++) {
-                        data = vmsTree.getSelection()[i].getData();
-                       if(!(data instanceof RowItem))
-                               continue;
-
-                       if (data instanceof CreateMarker || data instanceof TreeMarker) {
+                       data = vmsTree.getSelection()[i].getData();
+                       if (data instanceof TreeMarker) {
                                return 0;
                        }
 
index d3e6610..76f1c83 100644 (file)
@@ -7,36 +7,36 @@ import org.tizen.emulator.manager.vms.xml.EmulatorConfiguration;
 public class VMsProperty {
        File configFile;
 
-       EmulatorConfiguration rootElement;
+       EmulatorConfiguration configuration;
 
        public VMsProperty(File configFile, EmulatorConfiguration element) {
                this.configFile = configFile;
-               this.rootElement = element;
+               this.configuration = element;
        }
 
        public String getName() {
-               if(rootElement.getBaseInformation() == null)
+               if(configuration.getBaseInformation() == null)
                        return null;
 
-               return rootElement.getBaseInformation().getName();
+               return configuration.getBaseInformation().getName();
        }
        public Architecture getArch() {
-               if(rootElement.getBaseInformation() == null)
+               if(configuration.getBaseInformation() == null)
                        return null;
                
-               return Architecture.x86.toString().equals(rootElement.getBaseInformation().getArchitecture()) ? 
+               return Architecture.x86.toString().equals(configuration.getBaseInformation().getArchitecture()) ? 
                                Architecture.x86 : Architecture.ARM;
        }
        public FSImageType getImageType() {
-               if(rootElement.getBaseInformation() == null || rootElement.getBaseInformation().getDiskImage() == null)
+               if(configuration.getBaseInformation() == null || configuration.getBaseInformation().getDiskImage() == null)
                        return null;
 
-               return FSImageType.standard.toString().equals(rootElement.getBaseInformation().getDiskImage().getType()) ?
+               return FSImageType.standard.toString().equals(configuration.getBaseInformation().getDiskImage().getType()) ?
                                FSImageType.standard : FSImageType.custom;
        }
 
        public EmulatorConfiguration getConfiguration() {
-               return rootElement;
+               return configuration;
        }
 
        public enum Architecture {