190 lines
6.7 KiB
Java
190 lines
6.7 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.baja.gx.BImage
|
|
* javax.baja.security.BPassword
|
|
* 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.BDialog
|
|
* 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.util.UiLexicon
|
|
* javax.baja.ui.wizard.BWizardHeader
|
|
* javax.baja.util.Lexicon
|
|
*/
|
|
package com.tridium.platcrypto.ui;
|
|
|
|
import com.tridium.platcrypto.ui.BPasswordField;
|
|
import javax.baja.gx.BImage;
|
|
import javax.baja.security.BPassword;
|
|
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.BDialog;
|
|
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.util.UiLexicon;
|
|
import javax.baja.ui.wizard.BWizardHeader;
|
|
import javax.baja.util.Lexicon;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class BPasswordPromptDialog
|
|
extends BDialog {
|
|
public static final Action okButtonPressed = BPasswordPromptDialog.newAction((int)0, (BValue)new BWidgetEvent(), null);
|
|
public static final Action cancelButtonPressed = BPasswordPromptDialog.newAction((int)0, (BValue)new BWidgetEvent(), null);
|
|
public static final Type TYPE;
|
|
private static Lexicon lex;
|
|
private static final BImage logo;
|
|
protected BButton okButton;
|
|
protected BButton cancelButton;
|
|
private BPasswordField passwordField;
|
|
private BPassword response;
|
|
private String msg;
|
|
static /* synthetic */ Class class$com$tridium$platcrypto$ui$BPasswordPromptDialog;
|
|
|
|
public void okButtonPressed(BWidgetEvent bWidgetEvent) {
|
|
this.invoke(okButtonPressed, (BValue)bWidgetEvent, null);
|
|
}
|
|
|
|
public void cancelButtonPressed(BWidgetEvent bWidgetEvent) {
|
|
this.invoke(cancelButtonPressed, (BValue)bWidgetEvent, null);
|
|
}
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public static BPassword open(BWidget bWidget, String string, String string2) {
|
|
BPasswordPromptDialog bPasswordPromptDialog = new BPasswordPromptDialog(bWidget, string, string2);
|
|
bPasswordPromptDialog.setBoundsCenteredOnOwner();
|
|
bPasswordPromptDialog.setResizable(false);
|
|
bPasswordPromptDialog.open();
|
|
return bPasswordPromptDialog.getPassword();
|
|
}
|
|
|
|
private final BWidget buildDialog() {
|
|
BEdgePane bEdgePane = new BEdgePane();
|
|
bEdgePane.setTop(this.buildHeader());
|
|
bEdgePane.setCenter(this.buildContent());
|
|
return bEdgePane;
|
|
}
|
|
|
|
private final BWidget buildHeader() {
|
|
return new BWizardHeader(logo, this.getTitle(), this.msg);
|
|
}
|
|
|
|
private final BWidget buildContent() {
|
|
BGridPane bGridPane = new BGridPane(1);
|
|
bGridPane.setHalign(BHalign.center);
|
|
bGridPane.setColumnAlign(BHalign.center);
|
|
bGridPane.add(null, (BValue)this.buildBody());
|
|
bGridPane.add(null, (BValue)this.buildButtons());
|
|
return new BBorderPane((BWidget)bGridPane, 17.0, 7.0, 7.0, 7.0);
|
|
}
|
|
|
|
private final BWidget buildBody() {
|
|
BEdgePane bEdgePane = new BEdgePane();
|
|
bEdgePane.setLeft((BWidget)new BLabel(lex.get("password.field.password")));
|
|
this.passwordField = new BPasswordField();
|
|
bEdgePane.setCenter((BWidget)new BBorderPane((BWidget)this.passwordField, (double)4, (double)4, (double)4, (double)4));
|
|
return bEdgePane;
|
|
}
|
|
|
|
private final BWidget buildButtons() {
|
|
BGridPane bGridPane = new BGridPane(2);
|
|
bGridPane.setColumnAlign(BHalign.fill);
|
|
bGridPane.setUniformColumnWidth(true);
|
|
this.okButton = new BButton(UiLexicon.bajaui().getText("dialog.ok"));
|
|
bGridPane.add(null, (BValue)this.okButton);
|
|
this.okButton.setPreferredSize(50.0, this.okButton.getPreferredHeight());
|
|
this.linkTo("linkA", (BComponent)this.okButton, (Slot)BButton.actionPerformed, (Slot)okButtonPressed);
|
|
this.okButton.setEnabled(false);
|
|
this.cancelButton = new BButton(UiLexicon.bajaui().getText("dialog.cancel"));
|
|
bGridPane.add(null, (BValue)this.cancelButton);
|
|
this.cancelButton.setPreferredSize(50.0, this.cancelButton.getPreferredHeight());
|
|
this.linkTo("linkC", (BComponent)this.cancelButton, (Slot)BButton.actionPerformed, (Slot)cancelButtonPressed);
|
|
return new BBorderPane((BWidget)bGridPane, 7.0, 0.0, 0.0, 0.0);
|
|
}
|
|
|
|
public void windowClosing(BWindowEvent bWindowEvent) {
|
|
this.close();
|
|
}
|
|
|
|
public BPassword getPassword() {
|
|
return this.response;
|
|
}
|
|
|
|
public void doOkButtonPressed(BWidgetEvent bWidgetEvent) throws Exception {
|
|
this.response = this.passwordField.getPassword();
|
|
this.close();
|
|
}
|
|
|
|
public void doCancelButtonPressed(BWidgetEvent bWidgetEvent) throws Exception {
|
|
this.response = null;
|
|
this.close();
|
|
}
|
|
|
|
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.passwordField = null;
|
|
this.response = null;
|
|
this.msg = null;
|
|
}
|
|
|
|
private BPasswordPromptDialog(BWidget bWidget, String string, String string2) {
|
|
super(bWidget, string, true);
|
|
this.this();
|
|
this.msg = string2;
|
|
this.setContent(this.buildDialog());
|
|
this.setDefaultButton(this.okButton);
|
|
this.okButton.setEnabled(true);
|
|
}
|
|
|
|
static {
|
|
Class clazz = class$com$tridium$platcrypto$ui$BPasswordPromptDialog;
|
|
if (clazz == null) {
|
|
clazz = class$com$tridium$platcrypto$ui$BPasswordPromptDialog = BPasswordPromptDialog.class("[Lcom.tridium.platcrypto.ui.BPasswordPromptDialog;", false);
|
|
}
|
|
TYPE = Sys.loadType((Class)clazz);
|
|
lex = Lexicon.make((String)"platCrypto");
|
|
logo = BImage.make((String)lex.get("cert.x32.icon", "module://icons/x32/lock.png"));
|
|
}
|
|
}
|
|
|