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
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
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
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
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
}\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
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
}\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
\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
\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
return retItem;\r
}\r
}\r
-\r