Ongoing support for existing 0.3 release of scripting framework, removed hard coded check for valid versions of office and staroffice, now displays any version in sversion[rc]ini file that supports pkgchk

This commit is contained in:
Noel Power
2003-09-16 07:37:21 +00:00
parent 1fc4b51c81
commit 5990f47baf

View File

@@ -242,28 +242,42 @@ class MyTableModel extends AbstractTableModel {
MyTableModel (Properties properties, String [] validVersions) {
data = new ArrayList();
//System.out.println(properties);
boolean isWindows =
(System.getProperty("os.name").indexOf("Windows") != -1);
int len = validVersions.length;
for (int i = 0; i < len; i++) {
String key = validVersions[i];
for (Enumeration e = properties.propertyNames(); e.hasMoreElements() ;) {
String key = (String)e.nextElement();
String path = null;
if ((path = properties.getProperty(key)) != null) {
ArrayList row = new ArrayList();
row.add(0, new Boolean(false));
row.add(1, key);
if (key.length() > ((String)longValues[1]).length()) {
longValues[1] = key;
if ( !( key.startsWith("#") ) &&
( path = properties.getProperty(key)) != null) {
String pkgChkPath = path + File.separator + "program" + File.separator;
if ( isWindows )
{
pkgChkPath += "pkgchk.exe";
}
row.add(2, path);
if (path.length() > ((String)longValues[2]).length()) {
longValues[2] = path;
else
{
pkgChkPath += "pkgchk";
}
File pkgChk = new File( pkgChkPath );
if ( pkgChk.exists() )
{
ArrayList row = new ArrayList();
row.add(0, new Boolean(false));
row.add(1, key);
if (key.length() > ((String)longValues[1]).length()) {
longValues[1] = key;
}
row.add(2, path);
if (path.length() > ((String)longValues[2]).length()) {
longValues[2] = path;
}
data.add(row);
}
}
}
}// MyTableModel