Display the information for a suite.
StringBuffer label = new StringBuffer(40);
StringBuffer value = new StringBuffer(40);
Item item;
String[] authPath;
String temp;
MIDletSuiteImpl midletSuite = null;
try {
midletSuite = midletSuiteStorage.getMIDletSuite(suiteId, false);
initMidletSuiteInfo(midletSuite);
label.append(Resource.getString(ResourceConstants.INFO));
label.append(": ");
label.append(displayName);
setTitle(label.toString());
append(
new ImageItem(null, icon, ImageItem.LAYOUT_NEWLINE_BEFORE +
ImageItem.LAYOUT_CENTER +
ImageItem.LAYOUT_NEWLINE_AFTER, null));
if (!midletSuite.isEnabled()) {
item = new StringItem(null, Resource.getString(
ResourceConstants.AMS_SUITE_DISABLED_NOTE));
item.setLayout(Item.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_2);
append(item);
}
// round up the size to a Kilobyte
label.setLength(0);
label.append(Resource.getString(ResourceConstants.AMS_SIZE));
label.append(": ");
value.append(
Integer.toString((MIDletSuiteStorage.getMIDletSuiteStorage().
getStorageUsed(midletSuite.getID()) +
1023) / 1024));
value.append(" K");
item = new StringItem(label.toString(), value.toString());
item.setLayout(Item.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_2);
append(item);
label.setLength(0);
label.append(Resource.getString(ResourceConstants.AMS_VERSION));
label.append(": ");
item = new StringItem(label.toString(),
midletSuite.getProperty(MIDletSuite.VERSION_PROP));
item.setLayout(Item.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_2);
append(item);
label.setLength(0);
if (midletSuite.isTrusted()) {
temp = Resource.getString
(ResourceConstants.AMS_MGR_AUTH_VENDOR);
} else {
temp = Resource.getString
(ResourceConstants.AMS_MGR_VENDOR);
}
label.append(temp);
label.append(": ");
item = new StringItem(label.toString(),
midletSuite.getProperty(MIDletSuite.VENDOR_PROP));
item.setLayout(Item.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_2);
append(item);
temp = midletSuite.getProperty(MIDletSuite.DESC_PROP);
if (temp != null) {
label.setLength(0);
label.append(Resource.getString
(ResourceConstants.AMS_DESCRIPTION));
label.append(": ");
item = new StringItem(label.toString(), temp);
item.setLayout(Item.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_2);
append(item);
}
if (numberOfMidlets != 1) {
label.setLength(0);
label.append(Resource.getString
(ResourceConstants.AMS_CONTENTS));
label.append(":");
item = new StringItem(label.toString(), "");
item.setLayout(Item.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_2);
append(item);
appendMIDletsToForm(midletSuite);
}
label.setLength(0);
label.append(Resource.getString(ResourceConstants.AMS_WEBSITE));
label.append(": ");
item = new StringItem(label.toString(),
installInfo.getDownloadUrl());
item.setLayout(Item.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_2);
append(item);
label.setLength(0);
label.append(Resource.getString(ResourceConstants.AMS_ADVANCED));
label.append(": ");
item = new StringItem(label.toString(), "");
item.setLayout(Item.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_2);
append(item);
if (midletSuite.isTrusted()) {
append(new ImageItem(null, TrustedMIDletIcon.getIcon(),
ImageItem.LAYOUT_DEFAULT, null));
temp = Resource.getString
(ResourceConstants.AMS_MGR_TRUSTED);
} else {
temp = Resource.getString
(ResourceConstants.AMS_MGR_UNTRUSTED);
}
item = new StringItem(null, temp);
item.setLayout(Item.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_2);
append(item);
// Append classes verification state to advanced section
if (Constants.VERIFY_ONCE && midletSuite.isVerified()) {
item = new StringItem(null, Resource.getString(
ResourceConstants.AMS_VERIFIED_CLASSES));
item.setLayout(Item.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_2);
append(item);
}
authPath = installInfo.getAuthPath();
if (authPath != null) {
label.setLength(0);
label.append(Resource.getString
(ResourceConstants.AMS_AUTHORIZED_BY));
label.append(": ");
temp = label.toString();
for (int i = 0; i < authPath.length; i++) {
item = new StringItem(temp, authPath[i]);
item.setLayout(Item.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_2);
append(item);
temp = null;
}
}
temp = PushRegistryInternal.listConnections(
midletSuite.getID(), false);
if (temp != null) {
label.setLength(0);
label.append(Resource.getString
(ResourceConstants.AMS_AUTO_START_CONN));
label.append(": ");
item = new StringItem(label.toString(), temp);
item.setLayout(Item.LAYOUT_NEWLINE_AFTER | Item.LAYOUT_2);
append(item);
}
} catch (Throwable t) {
throw t;
} finally {
if (midletSuite != null) {
midletSuite.close();
}
}