base image view item: add image version to tool tip
authorjihye424.kim <jihye424.kim@samsung.com>
Thu, 24 Dec 2015 08:31:57 +0000 (17:31 +0900)
committerjihye424.kim <jihye424.kim@samsung.com>
Thu, 24 Dec 2015 08:31:57 +0000 (17:31 +0900)
Change-Id: Ie36b1dd17a1256a8ea6c737e31cf7219639703b5
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
src/org/tizen/emulator/manager/ui/detail/item/property/BaseImageViewItem.java

index c1fe320..8360fc8 100644 (file)
@@ -108,9 +108,7 @@ public class BaseImageViewItem extends ComboViewItem {
        public boolean settingDetailItem(VMPropertyValue value) {
                if (valueLabel != null) {
                        valueLabel.setText(value.baseImage.getName());
-                       if (!value.baseImage.isStandard()) {
-                               valueLabel.setToolTipText(value.baseImage.getPath());
-                       }
+                       valueLabel.setToolTipText(getToolTip(value.baseImage));
                }
                return true;
        }
@@ -284,7 +282,7 @@ public class BaseImageViewItem extends ComboViewItem {
                        combo.setVisible(false);
 
                        filePathLabel.setText(value.baseImage.getName());
-                       filePathLabel.setToolTipText(currentBaseImage.getPath());
+                       filePathLabel.setToolTipText(getToolTip(currentBaseImage));
                        filePathLabel.setVisible(true);
                        filePathLabel.setEnabled(false);
                        filePathLabel.redraw();
@@ -371,6 +369,7 @@ public class BaseImageViewItem extends ComboViewItem {
                        isSelected = true;
                }
                combo.setEnabled(true);
+               combo.setToolTipText(getToolTip(currentBaseImage));
        }
 
 
@@ -408,7 +407,7 @@ public class BaseImageViewItem extends ComboViewItem {
                }
                String fileSplit[] = pathSplit[pathSplit.length - 1].split("\\."); //$NON-NLS-1$
                String extension = fileSplit[fileSplit.length - 1];
-               if (!Architecture.isSupported(extension)) { //$NON-NLS-1$
+               if (!Architecture.isSupported(extension)) {
                        return false;
                }
                // Check whether file is exist.
@@ -420,4 +419,16 @@ public class BaseImageViewItem extends ComboViewItem {
                return true;
        }
 
+       private String getToolTip(BaseImage image) {
+               if (image == null) {
+                       return "";
+               }
+               String toolTip = "Image Version: " + image.getBinaryVersion();
+               if (!image.isStandard()) {
+                       toolTip += StringResources.NEW_LINE
+                                       +"Image Path: " + image.getPath();
+               }
+               return toolTip;
+       }
+
 }
\ No newline at end of file