/* * Decompiled with CFR 0.152. * * Could not load the following classes: * com.tridium.crypto.core.cert.CertValidationResult * com.tridium.ui.theme.custom.nss.StyleUtils * javax.baja.gx.BImage * javax.baja.sys.Action * javax.baja.sys.BComponent * javax.baja.sys.BValue * javax.baja.sys.Slot * javax.baja.sys.Sys * javax.baja.sys.Type * javax.baja.ui.BButton * javax.baja.ui.BLabel * javax.baja.ui.BWidget * javax.baja.ui.enums.BHalign * javax.baja.ui.event.BWidgetEvent * javax.baja.ui.event.BWindowEvent * javax.baja.ui.pane.BBorderPane * javax.baja.ui.pane.BEdgePane * javax.baja.ui.pane.BGridPane * javax.baja.ui.style.IStylable * javax.baja.ui.wizard.BWizardHeader */ package com.tridium.platcrypto.ui; import com.tridium.crypto.core.cert.CertValidationResult; import com.tridium.platcrypto.ui.BCertViewDialog; import com.tridium.ui.theme.custom.nss.StyleUtils; import javax.baja.gx.BImage; import javax.baja.sys.Action; import javax.baja.sys.BComponent; import javax.baja.sys.BValue; import javax.baja.sys.Slot; import javax.baja.sys.Sys; import javax.baja.sys.Type; import javax.baja.ui.BButton; import javax.baja.ui.BLabel; import javax.baja.ui.BWidget; import javax.baja.ui.enums.BHalign; import javax.baja.ui.event.BWidgetEvent; import javax.baja.ui.event.BWindowEvent; import javax.baja.ui.pane.BBorderPane; import javax.baja.ui.pane.BEdgePane; import javax.baja.ui.pane.BGridPane; import javax.baja.ui.style.IStylable; import javax.baja.ui.wizard.BWizardHeader; /* * Illegal identifiers - consider using --renameillegalidents true */ public class BExemptionPromptDialog extends BCertViewDialog { public static final Action cancelButtonPressed = BExemptionPromptDialog.newAction((int)0, (BValue)new BWidgetEvent(), null); public static final Type TYPE; protected static BImage logo; protected boolean hostNameMismatch; protected boolean unknownIdentity; protected boolean certExpired; protected BButton cancelButton; protected boolean closeResult; static /* synthetic */ Class class$com$tridium$platcrypto$ui$BExemptionPromptDialog; public void cancelButtonPressed(BWidgetEvent bWidgetEvent) { this.invoke(cancelButtonPressed, (BValue)bWidgetEvent, null); } public Type getType() { return TYPE; } public static boolean show(BWidget bWidget, CertValidationResult certValidationResult) throws Exception { BExemptionPromptDialog bExemptionPromptDialog = new BExemptionPromptDialog(bWidget, certValidationResult); bExemptionPromptDialog.setBoundsCenteredOnOwner(); bExemptionPromptDialog.setResizable(false); bExemptionPromptDialog.open(); return bExemptionPromptDialog.getResult(); } protected BWidget buildHeader() { return new BWizardHeader(logo, this.cert.getSubject(), lex.getText("exempt.prompt.dialog.info", new Object[]{this.cert.getSubject()})); } protected BWidget buildContent() throws Exception { BEdgePane bEdgePane = new BEdgePane(); bEdgePane.setTop(this.buildInfo()); bEdgePane.setCenter(super.buildContent()); return bEdgePane; } private final BWidget buildInfo() { StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append(lex.getText("exempt.prompt.dialog.msg.untrusted")).append(":").append("\n"); if (this.hostNameMismatch) { stringBuffer.append("\n - ").append(lex.getText("exempt.prompt.dialog.msg.mismatch")); } if (this.unknownIdentity) { stringBuffer.append("\n - ").append(lex.getText("exempt.prompt.dialog.msg.identity")); } if (this.certExpired) { stringBuffer.append("\n - ").append(lex.getText("exempt.prompt.dialog.msg.expired")); } BLabel bLabel = new BLabel(stringBuffer.toString(), BHalign.left); StyleUtils.addStyleClass((IStylable)bLabel, (String)"strong"); return new BBorderPane((BWidget)bLabel, 10.0, 10.0, (double)5, 10.0); } protected BWidget buildButtons() { BGridPane bGridPane = new BGridPane(2); bGridPane.setColumnAlign(BHalign.fill); bGridPane.setUniformColumnWidth(true); this.okButton = new BButton(lex.getText("exempt.prompt.dialog.accept")); bGridPane.add(null, (BValue)this.okButton); this.linkTo("linkA", (BComponent)this.okButton, (Slot)BButton.actionPerformed, (Slot)okButtonPressed); this.okButton.setEnabled(true); this.cancelButton = new BButton(lex.getText("exempt.prompt.dialog.reject")); bGridPane.add(null, (BValue)this.cancelButton); this.linkTo("linkB", (BComponent)this.cancelButton, (Slot)BButton.actionPerformed, (Slot)cancelButtonPressed); this.cancelButton.setEnabled(true); return new BBorderPane((BWidget)bGridPane, 7.0, 0.0, 0.0, 0.0); } public void windowClosing(BWindowEvent bWindowEvent) { this.close(); } public void doOkButtonPressed(BWidgetEvent bWidgetEvent) { this.closeResult = true; this.close(); } public void doCancelButtonPressed(BWidgetEvent bWidgetEvent) { this.closeResult = false; this.close(); } public boolean getResult() { return this.closeResult; } 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.hostNameMismatch = false; this.unknownIdentity = false; this.certExpired = false; this.closeResult = false; } private BExemptionPromptDialog(BWidget bWidget, CertValidationResult certValidationResult) throws Exception { super(bWidget, lex.getText("exempt.prompt.dialog.title")); this.this(); this.cert = certValidationResult.getNewCert(); this.hostNameMismatch = certValidationResult.isHostnameVerified() ^ true; this.unknownIdentity = certValidationResult.isValidCertChain() ^ true; this.certExpired = certValidationResult.isCertExpired(); this.setContent(this.buildDialog()); this.setDefaultButton(this.okButton); } static { Class clazz = class$com$tridium$platcrypto$ui$BExemptionPromptDialog; if (clazz == null) { clazz = class$com$tridium$platcrypto$ui$BExemptionPromptDialog = BExemptionPromptDialog.class("[Lcom.tridium.platcrypto.ui.BExemptionPromptDialog;", false); } TYPE = Sys.loadType((Class)clazz); logo = BImage.make((String)lex.get("cert.warning.x32.icon", "module://icons/x32/warning.png")); } }