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