Revert "[INST] Modified profile selection UX." 32/21032/1
authorYongsung Kim <yongsung1.kim@samsung.com>
Wed, 14 May 2014 14:10:58 +0000 (07:10 -0700)
committerYongsung Kim <yongsung1.kim@samsung.com>
Wed, 14 May 2014 14:10:58 +0000 (07:10 -0700)
This reverts commit c96066c746c0e1c8f49ee99a1d237396f2443631.

Change-Id: I403ec6bb4593c7a3fb2661bd4c3b87e58e298f6a

InstallManager_java/src/org/tizen/installmanager/ui/page/PackageListPage.java

index 3c84bec..bfcb080 100644 (file)
@@ -33,7 +33,9 @@ import java.util.ArrayList;
 import java.util.Collection;\r
 import java.util.Collections;\r
 import java.util.HashMap;\r
+import java.util.HashSet;\r
 import java.util.List;\r
+import java.util.Set;\r
 \r
 import org.eclipse.jface.viewers.CheckStateChangedEvent;\r
 import org.eclipse.jface.viewers.CheckboxTreeViewer;\r
@@ -51,13 +53,15 @@ import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.Font;\r
 import org.eclipse.swt.graphics.FontData;\r
 import org.eclipse.swt.graphics.Point;\r
+import org.eclipse.swt.layout.FillLayout;\r
 import org.eclipse.swt.layout.GridData;\r
 import org.eclipse.swt.widgets.Button;\r
 import org.eclipse.swt.widgets.Composite;\r
 import org.eclipse.swt.widgets.Display;\r
-import org.eclipse.swt.widgets.Group;\r
 import org.eclipse.swt.widgets.Label;\r
 import org.eclipse.swt.widgets.Table;\r
+import org.eclipse.swt.widgets.TableColumn;\r
+import org.eclipse.swt.widgets.TableItem;\r
 import org.eclipse.swt.widgets.Tree;\r
 import org.eclipse.swt.widgets.TreeColumn;\r
 import org.eclipse.swt.widgets.TreeItem;\r
@@ -65,6 +69,7 @@ import org.tizen.installmanager.core.Config;
 import org.tizen.installmanager.core.InstallManager;\r
 import org.tizen.installmanager.lib.Log;\r
 import org.tizen.installmanager.lib.Platform;\r
+import org.tizen.installmanager.pkg.lib.PackageManager;\r
 import org.tizen.installmanager.pkg.model.Package;\r
 import org.tizen.installmanager.pkg.model.PackageSet;\r
 import org.tizen.installmanager.ui.InstallManagerWindow;\r
@@ -76,6 +81,8 @@ import org.tizen.installmanager.ui.model.ItemTreeContentProvider;
 import org.tizen.installmanager.ui.model.Item.CheckState;\r
 import org.tizen.installmanager.ui.model.Item.InstallState;\r
 \r
+import sun.net.www.protocol.http.AuthCacheValue.Type;\r
+\r
 /**\r
  * Display install or uninstall package lists via tree view.\r
  * \r
@@ -102,13 +109,14 @@ public abstract class PackageListPage extends PageTemplate {
        protected Label presetLabel;\r
        protected Table presetTable;\r
 \r
-       protected Group profileGroup;\r
+       private Composite profileComposite;\r
        protected Button profileButton;\r
        private Package selectedProfile = null;\r
 \r
        ViewController viewController = InstallManagerWindow.getInstallManagerWindow().getViewController();;\r
        \r
        private ArrayList<String> profileList = null;\r
+       private ArrayList<String> profileLabelList = null;\r
        protected Package defaultSelectionProfile = null;\r
        private HashMap<Package, String> profileSet = new HashMap<Package, String>();\r
 \r
@@ -130,6 +138,7 @@ public abstract class PackageListPage extends PageTemplate {
        }\r
        \r
        protected InstallTypeStatus installTypeStatus = null;\r
+       private ArrayList<String> currentProfile= new ArrayList<String>();\r
        \r
        /**\r
         * Set environments for packagelist page, such as style, adding listener.\r
@@ -141,14 +150,14 @@ public abstract class PackageListPage extends PageTemplate {
                super(parent, style, true);\r
 \r
                profileList = new ArrayList<String>();\r
+               profileLabelList = new ArrayList<String>();\r
                customTreeItems = new ArrayList<Item>();\r
                \r
                setTitleLabel(getCustomComposite());\r
                setDescriptionText(getCustomComposite());\r
-               if (type == Type.INSTALL) {\r
-                       if (!Config.isOldPackageServer) {\r
-                               setProfileButton(getCustomComposite(), InstallType.TYPICAL.name());\r
-                       }\r
+               if (!Config.isOldPackageServer) {\r
+                       setProfileLabel(getCustomComposite());\r
+                       setProfileButton(getCustomComposite(), InstallType.TYPICAL.name());\r
                }\r
                \r
                setTree(getCustomComposite(), type);\r
@@ -172,64 +181,62 @@ public abstract class PackageListPage extends PageTemplate {
                }\r
        }\r
        \r
+       private void setProfileLabel(Composite composite) {\r
+               profileLabel = new Label(composite, SWT.NONE);\r
+               profileLabel.setBounds(150, 31, 468, 20);\r
+               profileLabel.setText("Profile");\r
+               profileLabel.setBackground(InstallManagerWindow.getBackgroundColor());\r
+       }\r
+       \r
        protected void setProfileButton(Composite composite, String installType) {\r
                // contain default license\r
                int height = 25;\r
                int width = 250;\r
-               int defaultHeight = 35;\r
+               int defaultHeight = 53;\r
                int defaultGap = 3;\r
                \r
-               if (profileGroup != null) {\r
-                       profileGroup.dispose();\r
+               if (profileComposite != null) {\r
+                       profileComposite.dispose();\r
                }\r
-               profileGroup = new Group(composite, SWT.SHADOW_ETCHED_IN);\r
-               profileGroup.setBounds(150, defaultHeight, 458, 250);\r
-               profileGroup.setText("Profiles");\r
-               if (Platform.isUbuntu()) {\r
-                       profileGroup.setFont((new Font(Display.getCurrent(), new FontData("Dejavu Sans", 10, SWT.BOLD))));\r
-               } else if (Platform.isWindows()) {\r
-                       profileGroup.setFont((new Font(Display.getCurrent(), new FontData("Verdana", 10, SWT.BOLD))));                  \r
-               } else {\r
-                       profileGroup.setFont((new Font(Display.getCurrent(), new FontData("Lucida Grande", 12, SWT.BOLD))));\r
-               }\r
-               profileGroup.setBackground(InstallManagerWindow.getBackgroundColor());\r
-\r
-               if (profileList.size() != 0) {\r
-                       // add license of items\r
-                       int yCoordinate = 20;\r
-                       for (String profileName : profileList) {\r
-                               profileButton = new Button(profileGroup, SWT.RADIO);                            \r
-                               profileButton.setBounds(15, yCoordinate, width, height);\r
-                               Package profile = InstallManager.getInstance().getPackageManager().getPackageByName(profileName);\r
-                               String label = profileSet.get(profile);\r
-                               profileButton.setText(label);\r
-                               profileButton.setBackground(InstallManagerWindow.getBackgroundColor());\r
-\r
-                               if (selectedProfile == null) {\r
-                                       if (profileName.equalsIgnoreCase(defaultSelectionProfile.getPackageName())) {\r
-                                               profileButton.setSelection(true);\r
-                                       }\r
-                               } else {\r
-                                       if (profileName.equalsIgnoreCase(selectedProfile.getPackageName())) {\r
-                                               profileButton.setSelection(true);\r
-                                       }\r
+               \r
+               profileComposite = new Composite(composite, SWT.NONE);\r
+               profileComposite.setBounds(150, defaultHeight, 468, 280);\r
+               profileComposite.setBackground(InstallManagerWindow.getBackgroundColor());\r
+               \r
+               // add license of items\r
+               int yCoordinate = 0;\r
+               for (String profileName : profileList) {\r
+                       profileButton = new Button(profileComposite, SWT.RADIO);                                \r
+                       profileButton.setBounds(0, yCoordinate, width, height);\r
+                       Package profile = InstallManager.getInstance().getPackageManager().getPackageByName(profileName);\r
+                       String label = profileSet.get(profile);\r
+                       profileButton.setText(label);\r
+                       profileButton.setBackground(InstallManagerWindow.getBackgroundColor());\r
+\r
+                       if (selectedProfile == null) {\r
+                               if (profileName.equalsIgnoreCase(defaultSelectionProfile.getPackageName())) {\r
+                                       profileButton.setSelection(true);\r
                                }\r
-                               \r
-                               profileButton.addSelectionListener(new SelectionAdapter() {\r
-                                       @Override\r
-                                       public void widgetSelected(SelectionEvent e) {\r
-                                               Button button = (Button) e.widget;\r
-                                               for (Package pkg : profileSet.keySet()) {\r
-                                                       if (pkg.getLabel().equalsIgnoreCase(button.getText())) {\r
-                                                               refreshByType(pkg.getPackageName());\r
-                                                               setSelectedProfile(pkg);\r
-                                                       }\r
+                       } else {\r
+                               if (profileName.equalsIgnoreCase(selectedProfile.getPackageName())) {\r
+                                       profileButton.setSelection(true);\r
+                               }\r
+                       }\r
+                       \r
+                       profileButton.addSelectionListener(new SelectionAdapter() {\r
+                               @Override\r
+                               public void widgetSelected(SelectionEvent e) {\r
+                                       Button button = (Button) e.widget;\r
+                                       for (Package pkg : profileSet.keySet()) {\r
+                                               if (pkg.getLabel().equalsIgnoreCase(button.getText())) {\r
+                                                       refreshByType(pkg.getPackageName());\r
+                                                       setSelectedProfile(pkg);\r
                                                }\r
                                        }\r
-                               });\r
+                               }\r
+                       });\r
 \r
-                               yCoordinate = yCoordinate + height + defaultGap;\r
-                       }\r
+                       yCoordinate = yCoordinate + height + defaultGap;\r
                }\r
        }\r
 \r
@@ -516,7 +523,6 @@ public abstract class PackageListPage extends PageTemplate {
        \r
        protected void setTitleLabelText(String title) {\r
                titleLabel.setText(title);\r
-               titleLabel.setBackground(InstallManagerWindow.getBackgroundColor());\r
        }\r
 \r
        // set next button to be enabled by checked item count condition.\r
@@ -1011,17 +1017,15 @@ public abstract class PackageListPage extends PageTemplate {
        \r
        protected void changeTableVisibleStatus(InstallType type) {\r
                if (type == InstallType.TYPICAL) {\r
-//                     profileLabel.setVisible(true);\r
-//                     profileComposite.setVisible(true);\r
-                       profileGroup.setVisible(true);\r
+                       profileLabel.setVisible(true);\r
+                       profileComposite.setVisible(true);\r
                        tree.setVisible(false);\r
                        tree.setEnabled(false);\r
                        mDescriptionText.setVisible(false);\r
                } else if (type == InstallType.CUSTOM) {\r
                        if (!Config.isOldPackageServer) {\r
-//                             profileLabel.setVisible(false);\r
-//                             profileComposite.setVisible(false);\r
-                               profileGroup.setVisible(false);\r
+                               profileLabel.setVisible(false);\r
+                               profileComposite.setVisible(false);\r
                        }\r
                        tree.setVisible(true);\r
                        tree.setEnabled(true);\r
@@ -1116,4 +1120,3 @@ public abstract class PackageListPage extends PageTemplate {
                return retItem;\r
        }\r
 }\r
-\r