VMList Table: add reloading emulator list function
authorjihye424.kim <jihye424.kim@samsung.com>
Mon, 31 Aug 2015 04:40:40 +0000 (13:40 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 1 Sep 2015 04:58:19 +0000 (13:58 +0900)
Change-Id: I83f189305e14cd4a6c427094a49e649f2e8022c9
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
src/org/tizen/emulator/manager/renewal/resources/ColorResources.java
src/org/tizen/emulator/manager/ui/renewal/tableviewer/AbstractTableViewer.java
src/org/tizen/emulator/manager/ui/renewal/tableviewer/VMListTable.java
src/org/tizen/emulator/manager/ui/renewal/tableviewer/VMListTableViewer.java
src/org/tizen/emulator/manager/ui/table/Table.java

index 755dadb..ca62f0b 100644 (file)
@@ -44,6 +44,7 @@ public enum ColorResources {
        GRAY_BTN_PUSH(100, 110, 144),
        GRAY_BTN_DISABLE(208, 208, 208),
 
+       TABLE_VIEWER_BG(240, 240, 240),
        MESSAGE_BOX_TITLE_BG(111, 125, 149),
        MESSAGE_BOX_TITLE_FONT(255, 255, 255),
        MESSAGE_BOX_CONTENTS_BG(255, 255, 255),
index 26c8183..19ff24d 100644 (file)
@@ -102,7 +102,7 @@ public abstract class AbstractTableViewer {
                makeTopComposite();
                makeTableComposite();
 
-               tableComp.setBackground(ColorResources.RED.getColor());
+               tableComp.setBackground(ColorResources.TABLE_VIEWER_BG.getColor());
 
                settingLayout();
 
index 4fd1f10..6ba95a0 100644 (file)
@@ -51,6 +51,8 @@ import org.tizen.emulator.manager.ui.table.TableItem;
 import org.tizen.emulator.manager.vms.SKIN_SHAPE;
 import org.tizen.emulator.manager.vms.VMProperty;
 import org.tizen.emulator.manager.vms.VMPropertyValue;
+import org.tizen.emulator.manager.vms.helper.CheckingRunningEmulator;
+import org.tizen.emulator.manager.vms.helper.RefreshWorker;
 import org.tizen.emulator.manager.vms.helper.VMWorkerException;
 
 public class VMListTable {
@@ -188,7 +190,9 @@ public class VMListTable {
                        if (pButton.getProfile() == null) {
                                continue;
                        }
-                       makeTableItem(pButton);
+                       if (!pButton.getButton().isSelection()) {
+                               makeTableItem(pButton);
+                       }
                }
 
                table.getColumn(0).setWidth(30);
@@ -207,10 +211,10 @@ public class VMListTable {
                addTableItem(pButton, property, -1);
        }
 
-       private void addTableItem(VMProperty property) {
-               ProfileButton pButton = findProfileButton(property.getImageProfile());
-               addTableItem(pButton, property, 0);
-       }
+//     private void addTableItem(VMProperty property) {
+//             ProfileButton pButton = findProfileButton(property.getImageProfile());
+//             addTableItem(pButton, property, 0);
+//     }
 
        private void addTableItem(ProfileButton pButton, VMProperty property, int index) {
                if (pButton == null) {
@@ -351,6 +355,7 @@ public class VMListTable {
                        }
                } catch (VMWorkerException e) {
                        if (e.isNeedRefresh()) {
+                               refreshVMPropertyList();
                        }
                }
        }
@@ -367,7 +372,7 @@ public class VMListTable {
                        }
                } catch (VMWorkerException e) {
                        if (e.isNeedRefresh()) {
-                               //MainDialog.refreshVMPropertyList(false);
+                               refreshVMPropertyList();
                        }
                }
        }
@@ -401,7 +406,7 @@ public class VMListTable {
                        }
                } catch (VMWorkerException e) {
                        if (e.isNeedRefresh()) {
-                               //
+                               refreshVMPropertyList();
                        }
                }
        }
@@ -435,7 +440,7 @@ public class VMListTable {
                        }
                } catch (VMWorkerException e) {
                        if (e.isNeedRefresh()) {
-                               //
+                               refreshVMPropertyList();
                        }
                }
        }
@@ -559,4 +564,12 @@ public class VMListTable {
                        }
                }
        }
+
+       public void refreshVMPropertyList() {
+               ProfileList.settingVMPropertyList();
+               CheckingRunningEmulator.refreshVMPropertyList();
+               RefreshWorker.refreshVMConnect();
+
+               setVMList();
+       }
 }
index 50c9538..8274781 100644 (file)
@@ -106,10 +106,10 @@ public class VMListTableViewer extends AbstractTableViewer {
 
                        @Override
                        public void widgetSelected(SelectionEvent arg0) {
+                               table.refreshVMPropertyList();
                        }
                });
 
                addIconMenu(refreshButton);
        }
-
 }
index 8b7e815..589e87f 100644 (file)
@@ -1318,19 +1318,20 @@ public class Table extends TableScrolledComposite {
                        int height = getItemHeight();
                        for (int i = 0; top < rect.height; i++, top += height) {
                                Rectangle drawingRect = new Rectangle(0, top, rect.width, height);
-                               gc.setClipping(drawingRect);
+                               //gc.setClipping(drawingRect);
                                if ((i%2) == 0) {
                                        gc.setBackground(ColorResources.ITEM_BG_COLOR_EVEN);
                                } else {
                                        gc.setBackground(ColorResources.ITEM_BG_COLOR_ODD);
                                }
-                               gc.fillRectangle(drawingRect);
+                               //gc.fillRectangle(drawingRect);
+                               gc.drawRectangle(drawingRect);
                        }
 
                        gc.setForeground(ColorResources.DEFAULT_STROKE);
                        gc.setLineWidth(1);
                        int leftOffset = isCheck ? checkBoxWidth : 0;
-                       gc.setClipping(rect);
+                       //gc.setClipping(rect);
                        if (isCheck) {
                                gc.drawLine(checkBoxWidth -1, 0, checkBoxWidth - 1, rect.height);
                        }