summaryrefslogtreecommitdiff
path: root/javainstaller2
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-04-15 13:52:36 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-04-15 13:52:36 +0000
commit78ced9bff1538035932ec57c5e1944529b49e80d (patch)
tree698356635d6efad43783833d1b81902a38a5bcda /javainstaller2
parentd113a720c12be93ecd3ded258c836a3e87b104b7 (diff)
INTEGRATION: CWS native141 (1.3.18); FILE MERGED
2008/04/09 16:40:39 is 1.3.18.1: #i88109# no packages at nodes in java installer and new install order
Diffstat (limited to 'javainstaller2')
-rwxr-xr-xjavainstaller2/src/JavaSetup/org/openoffice/setup/Util/PackageCollector.java42
1 files changed, 41 insertions, 1 deletions
diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Util/PackageCollector.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Util/PackageCollector.java
index 6e080e398..84687f2dc 100755
--- a/javainstaller2/src/JavaSetup/org/openoffice/setup/Util/PackageCollector.java
+++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Util/PackageCollector.java
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: PackageCollector.java,v $
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
* This file is part of OpenOffice.org.
*
@@ -82,4 +82,44 @@ public class PackageCollector {
}
}
+ static public void sortPackages(Vector allPackages, Vector sortedPackages, String mode) {
+ for (int i = 0; i < allPackages.size(); i++) {
+ boolean integrated = false;
+ PackageDescription packageData = (PackageDescription) allPackages.get(i);
+
+ if ( i == 0 ) {
+ sortedPackages.add(packageData);
+ integrated = true;
+ } else {
+ int position = packageData.getOrder();
+ for (int j = 0; j < sortedPackages.size(); j++) {
+ PackageDescription sortedPackageData = (PackageDescription) sortedPackages.get(j);
+ int compare = sortedPackageData.getOrder();
+
+ if ( position < compare ) {
+ sortedPackages.add(j, packageData);
+ integrated = true;
+ break;
+ }
+ }
+
+ // no break used -> adding at the end
+ if ( ! integrated ) {
+ sortedPackages.add(packageData);
+ }
+ }
+ }
+
+ // reverse order for uninstallation
+ if ( mode.equalsIgnoreCase("uninstall")) {
+ int number = sortedPackages.size();
+ for (int i = 0; i < number; i++) {
+ if ( i > 0 ) {
+ PackageDescription sortPackageData = (PackageDescription) sortedPackages.remove(i);
+ sortedPackages.add(0,sortPackageData);
+ }
+ }
+ }
+ }
+
}