196 lines
7.1 KiB
Java
196 lines
7.1 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.tridium.file.types.text.BCertificateFile
|
|
* com.tridium.file.types.text.BLicenseFile
|
|
* javax.baja.file.BIFile
|
|
* javax.baja.hx.HxOp
|
|
* javax.baja.hx.table.Table
|
|
* javax.baja.hx.table.TableModel
|
|
* javax.baja.hx.table.TableRenderer
|
|
* javax.baja.io.HtmlWriter
|
|
* javax.baja.naming.BOrd
|
|
* javax.baja.naming.OrdTarget
|
|
* javax.baja.nre.util.Array
|
|
* javax.baja.sys.BObject
|
|
* javax.baja.sys.Context
|
|
* javax.baja.util.LexiconText
|
|
*/
|
|
package com.tridium.platform.hx;
|
|
|
|
import com.tridium.file.types.text.BCertificateFile;
|
|
import com.tridium.file.types.text.BLicenseFile;
|
|
import com.tridium.platform.license.CertificateInfo;
|
|
import com.tridium.platform.license.IFileInfo;
|
|
import com.tridium.platform.license.LicenseInfo;
|
|
import javax.baja.file.BIFile;
|
|
import javax.baja.hx.HxOp;
|
|
import javax.baja.hx.table.Table;
|
|
import javax.baja.hx.table.TableModel;
|
|
import javax.baja.hx.table.TableRenderer;
|
|
import javax.baja.io.HtmlWriter;
|
|
import javax.baja.naming.BOrd;
|
|
import javax.baja.naming.OrdTarget;
|
|
import javax.baja.nre.util.Array;
|
|
import javax.baja.sys.BObject;
|
|
import javax.baja.sys.Context;
|
|
import javax.baja.util.LexiconText;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class FileInfoTable {
|
|
protected String fieldName;
|
|
protected Renderer renderer;
|
|
static /* synthetic */ Class class$com$tridium$platform$license$IFileInfo;
|
|
|
|
public void write(BObject bObject, HxOp hxOp) throws Exception {
|
|
HxOp hxOp2 = hxOp.make(this.fieldName, new OrdTarget((OrdTarget)hxOp, bObject));
|
|
Table table = new Table((TableModel)new Model());
|
|
table.setHeaderVisible(false);
|
|
table.setRenderer((TableRenderer)this.renderer);
|
|
table.write(hxOp2);
|
|
}
|
|
|
|
public IFileInfo[] getSelected(HxOp hxOp) throws Exception {
|
|
HxOp hxOp2 = hxOp.make(this.fieldName, new OrdTarget((OrdTarget)hxOp, hxOp.get()));
|
|
String[] stringArray = hxOp2.getFormKeys();
|
|
Class clazz = class$com$tridium$platform$license$IFileInfo;
|
|
if (clazz == null) {
|
|
clazz = class$com$tridium$platform$license$IFileInfo = FileInfoTable.class("[Lcom.tridium.platform.license.IFileInfo;", false);
|
|
}
|
|
Array array = new Array(clazz);
|
|
int n = 0;
|
|
while (n < stringArray.length) {
|
|
BIFile bIFile;
|
|
if (stringArray[n].startsWith("_") && (bIFile = (BIFile)BOrd.make((String)hxOp2.getFormValue(stringArray[n])).get()) != null) {
|
|
if (bIFile instanceof BLicenseFile) {
|
|
array.add((Object)new LicenseInfo(bIFile));
|
|
} else if (bIFile instanceof BCertificateFile) {
|
|
array.add((Object)new CertificateInfo(bIFile));
|
|
}
|
|
}
|
|
++n;
|
|
}
|
|
return (IFileInfo[])array.trim();
|
|
}
|
|
|
|
static /* synthetic */ Class class(String string, boolean bl) {
|
|
try {
|
|
Class<?> clazz = Class.forName(string);
|
|
if (!bl) {
|
|
clazz = clazz.getComponentType();
|
|
}
|
|
return clazz;
|
|
}
|
|
catch (ClassNotFoundException classNotFoundException) {
|
|
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
|
}
|
|
}
|
|
|
|
private final /* synthetic */ void this() {
|
|
this.renderer = new Renderer();
|
|
}
|
|
|
|
public FileInfoTable(String string) {
|
|
this.this();
|
|
this.fieldName = string;
|
|
}
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public static class Model
|
|
extends TableModel {
|
|
private Array[] rows;
|
|
private LexiconText[] groupHeaders;
|
|
static /* synthetic */ Class class$com$tridium$platform$license$LicenseInfo;
|
|
static /* synthetic */ Class class$com$tridium$platform$license$CertificateInfo;
|
|
|
|
public boolean getGroupHeaderVisible() {
|
|
return false;
|
|
}
|
|
|
|
public int getGroupCount() {
|
|
return 2;
|
|
}
|
|
|
|
public String getGroupName(int n, HxOp hxOp) {
|
|
return this.groupHeaders[n].getText((Context)hxOp);
|
|
}
|
|
|
|
public int getColumnCount() {
|
|
return 2;
|
|
}
|
|
|
|
public String getColumnName(int n, HxOp hxOp) {
|
|
return " ";
|
|
}
|
|
|
|
public int getRowCount(int n) {
|
|
return this.rows[n].size();
|
|
}
|
|
|
|
public IFileInfo getInfoAt(int n, int n2) {
|
|
return (IFileInfo)this.rows[n].get(n2);
|
|
}
|
|
|
|
public Object getValueAt(int n, int n2, int n3, HxOp hxOp) {
|
|
return this.getInfoAt(n, n2).toString((Context)hxOp);
|
|
}
|
|
|
|
static /* synthetic */ Class class(String string, boolean bl) {
|
|
try {
|
|
Class<?> clazz = Class.forName(string);
|
|
if (!bl) {
|
|
clazz = clazz.getComponentType();
|
|
}
|
|
return clazz;
|
|
}
|
|
catch (ClassNotFoundException classNotFoundException) {
|
|
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
|
}
|
|
}
|
|
|
|
private final /* synthetic */ void this() {
|
|
Array[] arrayArray = new Array[2];
|
|
Class clazz = class$com$tridium$platform$license$LicenseInfo;
|
|
if (clazz == null) {
|
|
clazz = class$com$tridium$platform$license$LicenseInfo = Model.class("[Lcom.tridium.platform.license.LicenseInfo;", false);
|
|
}
|
|
arrayArray[0] = new Array(clazz);
|
|
Class clazz2 = class$com$tridium$platform$license$CertificateInfo;
|
|
if (clazz2 == null) {
|
|
clazz2 = class$com$tridium$platform$license$CertificateInfo = Model.class("[Lcom.tridium.platform.license.CertificateInfo;", false);
|
|
}
|
|
arrayArray[1] = new Array(clazz2);
|
|
this.rows = arrayArray;
|
|
this.groupHeaders = new LexiconText[]{LexiconText.make((String)"platform", (String)"LicensePlatformServicePlugin.licenseList.header"), LexiconText.make((String)"platform", (String)"LicensePlatformServicePlugin.certList.header")};
|
|
}
|
|
|
|
public Model() {
|
|
this.this();
|
|
this.rows[0].addAll((Object[])LicenseInfo.listLocal());
|
|
this.rows[1].addAll((Object[])CertificateInfo.listLocal());
|
|
}
|
|
}
|
|
|
|
public static class Renderer
|
|
extends TableRenderer {
|
|
public void writeCellValue(Object object, int n, int n2, int n3, HxOp hxOp) throws Exception {
|
|
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
|
|
IFileInfo iFileInfo = ((Model)this.getModel()).getInfoAt(n, n2);
|
|
if (n3 == 0) {
|
|
htmlWriter.w((Object)"<input type='checkbox' ").attr("name", hxOp.scope("_" + n2)).w((Object)"'");
|
|
htmlWriter.w((Object)" value='").w((Object)iFileInfo.getFile().getFilePath()).w((Object)"'/>");
|
|
} else {
|
|
htmlWriter.w((Object)"<a href='").w((Object)iFileInfo.getFile().getNavOrd()).w((Object)"'>");
|
|
super.writeCellValue(object, n, n2, n3, hxOp);
|
|
htmlWriter.w((Object)"</a>");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|