/* * Decompiled with CFR 0.152. * * Could not load the following classes: * com.tridium.crypto.core.cert.CertUtils * com.tridium.crypto.core.io.ICoreCryptoManager * com.tridium.platform.daemon.BDaemonSession * com.tridium.platform.ui.util.BButtonPane * com.tridium.platform.ui.util.BCommandBoundTable * com.tridium.ui.theme.Theme * com.tridium.workbench.shell.BScrollingWidgetPane * com.tridium.workbench.shell.WbMain * javax.baja.gx.BImage * javax.baja.gx.BInsets * javax.baja.sys.BComponent * javax.baja.sys.BObject * javax.baja.sys.BValue * javax.baja.sys.Context * javax.baja.sys.Sys * javax.baja.sys.Type * javax.baja.ui.BDialog * javax.baja.ui.BLabel * javax.baja.ui.BWidget * javax.baja.ui.Command * javax.baja.ui.enums.BHalign * javax.baja.ui.pane.BBorderPane * javax.baja.ui.pane.BEdgePane * javax.baja.ui.pane.BGridPane * javax.baja.ui.pane.BTabbedPane * javax.baja.ui.table.BTable * javax.baja.ui.util.BTitlePane * javax.baja.util.Lexicon * javax.baja.util.LexiconText * javax.baja.workbench.tool.BWbTool * javax.baja.workbench.view.BWbComponentView */ package com.tridium.platcrypto.ui; import com.tridium.crypto.core.cert.CertUtils; import com.tridium.crypto.core.io.ICoreCryptoManager; import com.tridium.platcrypto.core.BCertManagerService; import com.tridium.platcrypto.core.ICryptoManagerProvider; import com.tridium.platcrypto.daemon.BPlatCryptoManager; import com.tridium.platcrypto.ui.BCertsTable; import com.tridium.platcrypto.ui.BExemptionTable; import com.tridium.platcrypto.ui.BLocalCertsTable; import com.tridium.platcrypto.ui.BTrustCertsTable; import com.tridium.platform.daemon.BDaemonSession; import com.tridium.platform.ui.util.BButtonPane; import com.tridium.platform.ui.util.BCommandBoundTable; import com.tridium.ui.theme.Theme; import com.tridium.workbench.shell.BScrollingWidgetPane; import com.tridium.workbench.shell.WbMain; import javax.baja.gx.BImage; import javax.baja.gx.BInsets; import javax.baja.sys.BComponent; import javax.baja.sys.BObject; import javax.baja.sys.BValue; import javax.baja.sys.Context; import javax.baja.sys.Sys; import javax.baja.sys.Type; import javax.baja.ui.BDialog; import javax.baja.ui.BLabel; import javax.baja.ui.BWidget; import javax.baja.ui.Command; import javax.baja.ui.enums.BHalign; import javax.baja.ui.pane.BBorderPane; import javax.baja.ui.pane.BEdgePane; import javax.baja.ui.pane.BGridPane; import javax.baja.ui.pane.BTabbedPane; import javax.baja.ui.table.BTable; import javax.baja.ui.util.BTitlePane; import javax.baja.util.Lexicon; import javax.baja.util.LexiconText; import javax.baja.workbench.tool.BWbTool; import javax.baja.workbench.view.BWbComponentView; /* * Illegal identifiers - consider using --renameillegalidents true */ public class BCertManagerView extends BWbComponentView { public static final Type TYPE; private static final int BUTTONS_PER_ROW = 4; public static final Lexicon lex; protected BLabel titleLabel; protected BLabel caDescription; protected BEdgePane caCertsPane; protected BGridPane caCertsButtons; protected BLabel serverCertsDescription; protected BEdgePane serverCertsPane; protected BGridPane serverCertsButtons; protected BEdgePane exemptionsPane; protected BLabel exemptionsDescription; protected BGridPane exemptionsButtons; protected BLabel clientKeysDescription; protected BEdgePane clientKeysPane; protected BGridPane clientKeysButtons; protected BTabbedPane tabbedPane; ICoreCryptoManager mgr; static /* synthetic */ Class class$com$tridium$platcrypto$ui$BCertManagerView; public Type getType() { return TYPE; } protected void doLoadValue(BObject bObject, Context context) throws Exception { int n; Object object; Object object2; String string = ""; if (bObject instanceof ICryptoManagerProvider) { object2 = (ICryptoManagerProvider)bObject; this.mgr = object2.getCoreCryptoManager(); if (bObject instanceof BCertManagerService) { ((BCertManagerService)bObject).poll(); } if (object2 instanceof BWbTool) { string = lex.get("CertManagerView.longTitle") + ' ' + WbMain.brandTitle; } else if (object2 instanceof BComponent) { object = ((BComponent)object2).getSession(); string = lex.get("CertManagerView.longTitle") + " \"" + object.getHost() + '\"'; } else { string = lex.get("CertManagerView.shortTitle"); } } else if (bObject instanceof BDaemonSession) { this.mgr = new BPlatCryptoManager((BDaemonSession)bObject); string = lex.get("CertManagerView.longTitle") + " \"" + ((BDaemonSession)bObject).getHost() + '\"'; } if (!this.mgr.isSecure() && (n = BDialog.open((BWidget)this, (String)lex.getText("nonsecure.warning.dialog.title"), (Object)lex.getText("nonsecure.warning.dialog.msg"), (int)12, (BImage)BDialog.WARNING_ICON, null)) == 8) { throw new Exception("non-secure connection aborted"); } if (!CertUtils.hasUnrestrictedPolicyFiles()) { BDialog.warning((BWidget)this, (String)lex.getText("unlimited.strength.title"), (Object)lex.getText("unlimited.strength.msg")); } this.titleLabel.setText(string); object2 = new BLocalCertsTable(this.mgr.getKeyStore()); this.loadPane(this.serverCertsPane, (BCommandBoundTable)object2, this.serverCertsButtons, this.tabbedPane, "cert.view.tab.title", context); ((BCertsTable)((Object)object2)).load(); object = new BTrustCertsTable(this.mgr.getTrustStore()); this.loadPane(this.caCertsPane, (BCommandBoundTable)object, this.caCertsButtons, this.tabbedPane, "cacert.view.tab.title", context); ((BCertsTable)((Object)object)).load(); BExemptionTable bExemptionTable = new BExemptionTable(this.mgr.getExemptionStore()); this.loadPane(this.exemptionsPane, bExemptionTable, this.exemptionsButtons, this.tabbedPane, "exempt.view.tab.title", context); bExemptionTable.load(); } private final void loadPane(BEdgePane bEdgePane, BCommandBoundTable bCommandBoundTable, BGridPane bGridPane, BTabbedPane bTabbedPane, String string, Context context) throws Exception { BGridPane bGridPane2 = this.buildCommandPane(bGridPane, bCommandBoundTable.getCommands()); BTitlePane bTitlePane = BTitlePane.makePane((String)lex.getText(string), (BTable)bCommandBoundTable); this.makeButtonBorder(bTitlePane, bGridPane2); bEdgePane.setCenter((BWidget)new BBorderPane((BWidget)bTitlePane, BInsets.make((double)0.0, (double)7.0, (double)7.0, (double)7.0))); this.addTab(bTabbedPane, (BWidget)bEdgePane, string, context); } private final void addTab(BTabbedPane bTabbedPane, BWidget bWidget, String string, Context context) { bTabbedPane.addPane(new BLabel(LexiconText.make((Type)TYPE, (String)string).getText(context), Theme.widget().getBoldText()), bWidget); } private final void makeButtonBorder(BTitlePane bTitlePane, BGridPane bGridPane) { BBorderPane bBorderPane = new BBorderPane((BWidget)bGridPane); bBorderPane.setPadding(BInsets.make((double)5, (double)0.0, (double)5, (double)0.0)); bTitlePane.setBottom((BWidget)new BScrollingWidgetPane((BWidget)bBorderPane)); } private final BGridPane buildCommandPane(BGridPane bGridPane, Command[] commandArray) { bGridPane.removeAll(); BButtonPane bButtonPane = new BButtonPane(); bGridPane.setColumnAlign(BHalign.center); bGridPane.add("buttons0", (BValue)bButtonPane); int n = 0; while (n < commandArray.length) { if (n > 0 && n % 4 == 0) { bButtonPane = new BButtonPane(); bGridPane.add("buttons" + n, (BValue)bButtonPane); } bButtonPane.add(commandArray[n]); ++n; } return bGridPane; } private final BWidget left(BWidget bWidget) { BGridPane bGridPane = new BGridPane(1); bGridPane.setHalign(BHalign.left); bGridPane.setColumnAlign(BHalign.left); bGridPane.add(null, (BValue)bWidget); return bGridPane; } 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.tabbedPane = null; this.mgr = null; } public BCertManagerView() { this.this(); this.tabbedPane = new BTabbedPane(); this.caCertsButtons = new BGridPane(1); this.serverCertsButtons = new BGridPane(1); this.exemptionsButtons = new BGridPane(1); this.caDescription = new BLabel(lex.getText("cacert.view.tab.description"), Theme.widget().getBoldText()); this.caCertsPane = new BEdgePane(); this.caCertsPane.setTop((BWidget)new BBorderPane(this.left((BWidget)this.caDescription))); this.serverCertsDescription = new BLabel(lex.getText("cert.view.tab.description"), Theme.widget().getBoldText()); this.serverCertsPane = new BEdgePane(); this.serverCertsPane.setTop((BWidget)new BBorderPane(this.left((BWidget)this.serverCertsDescription))); this.exemptionsDescription = new BLabel(lex.getText("exempt.view.tab.description"), Theme.widget().getBoldText()); this.exemptionsPane = new BEdgePane(); this.exemptionsPane.setTop((BWidget)new BBorderPane(this.left((BWidget)this.exemptionsDescription))); BEdgePane bEdgePane = new BEdgePane(); this.titleLabel = new BLabel("", BHalign.left); bEdgePane.setTop((BWidget)new BBorderPane((BWidget)this.titleLabel, 0.0, 0.0, 10.0, 0.0)); this.titleLabel.setFont(Theme.label().getLargeBoldFont()); bEdgePane.setCenter((BWidget)this.tabbedPane); this.setContent((BWidget)new BBorderPane((BWidget)bEdgePane)); } static { Class clazz = class$com$tridium$platcrypto$ui$BCertManagerView; if (clazz == null) { clazz = class$com$tridium$platcrypto$ui$BCertManagerView = BCertManagerView.class("[Lcom.tridium.platcrypto.ui.BCertManagerView;", false); } TYPE = Sys.loadType((Class)clazz); lex = Lexicon.make((String)"platCrypto"); } }