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