2026-03-17 13:31:18 -07:00

145 lines
4.7 KiB
Java

/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.sys.BAbsTime
* javax.baja.sys.BValue
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.ui.BButton
* javax.baja.ui.BDialog
* javax.baja.ui.BWidget
* javax.baja.ui.Command
* javax.baja.ui.CommandArtifact
* javax.baja.ui.enums.BHalign
* javax.baja.ui.event.BWindowEvent
* javax.baja.ui.pane.BBorderPane
* javax.baja.ui.pane.BEdgePane
* javax.baja.ui.pane.BGridPane
* javax.baja.ui.pane.BTextEditorPane
* javax.baja.ui.util.UiLexicon
* javax.baja.util.Lexicon
*/
package com.tridium.alarm.ui;
import javax.baja.sys.BAbsTime;
import javax.baja.sys.BValue;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.ui.BButton;
import javax.baja.ui.BDialog;
import javax.baja.ui.BWidget;
import javax.baja.ui.Command;
import javax.baja.ui.CommandArtifact;
import javax.baja.ui.enums.BHalign;
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.pane.BTextEditorPane;
import javax.baja.ui.util.UiLexicon;
import javax.baja.util.Lexicon;
public class BNotesDialog
extends BDialog {
public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BNotesDialog == null ? (class$com$tridium$alarm$ui$BNotesDialog = BNotesDialog.class$("com.tridium.alarm.ui.BNotesDialog")) : class$com$tridium$alarm$ui$BNotesDialog));
BWidget widget;
String username;
BTextEditorPane historyPane;
BTextEditorPane addPane;
Command addCmd;
Command closeCmd;
boolean newNotes = false;
public static final UiLexicon lexicon = new UiLexicon(class$com$tridium$alarm$ui$BNotesDialog == null ? (class$com$tridium$alarm$ui$BNotesDialog = BNotesDialog.class$("com.tridium.alarm.ui.BNotesDialog")) : class$com$tridium$alarm$ui$BNotesDialog);
static /* synthetic */ Class class$com$tridium$alarm$ui$BNotesDialog;
public Type getType() {
return TYPE;
}
public BNotesDialog() {
throw new IllegalStateException();
}
public BNotesDialog(BWidget bWidget, String string, String string2, boolean bl) {
super(bWidget, lexicon.getText("alarm.notes"), true);
this.widget = bWidget;
this.username = string2;
this.historyPane = new BTextEditorPane(string, 12, 80, false);
this.addPane = new BTextEditorPane("", 6, 80, true);
this.addCmd = new AddCmd((BWidget)this);
if (!bl) {
this.addCmd.setEnabled(false);
}
this.closeCmd = new CloseCmd((BWidget)this);
BButton bButton = new BButton(this.addCmd, true, true);
BButton bButton2 = new BButton(this.closeCmd, true, true);
BGridPane bGridPane = new BGridPane(2);
bGridPane.setColumnAlign(BHalign.fill);
bGridPane.setUniformColumnWidth(true);
bGridPane.add("add", (BValue)bButton);
bGridPane.add("close", (BValue)bButton2);
BEdgePane bEdgePane = new BEdgePane();
bEdgePane.setTop((BWidget)new BBorderPane((BWidget)this.historyPane));
bEdgePane.setCenter((BWidget)new BBorderPane((BWidget)this.addPane));
bEdgePane.setBottom((BWidget)new BBorderPane((BWidget)bGridPane));
this.setContent((BWidget)bEdgePane);
}
public void open() {
this.newNotes = false;
this.addPane.getEditor().requestFocus();
super.open();
}
public void windowClosing(BWindowEvent bWindowEvent) {
this.close();
}
public String getNewNotes() {
if (!this.newNotes) {
return null;
}
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("## " + BAbsTime.now() + " - " + this.username + " ##\n");
stringBuffer.append(this.addPane.getText());
stringBuffer.append("\n\n");
return stringBuffer.toString();
}
static /* synthetic */ Class class$(String string) {
try {
return Class.forName(string);
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
class CloseCmd
extends Command {
CloseCmd(BWidget bWidget) {
super(bWidget, (Lexicon)UiLexicon.bajaui, "commands.close");
}
public CommandArtifact doInvoke() {
BNotesDialog.this.close();
return null;
}
}
class AddCmd
extends Command {
AddCmd(BWidget bWidget) {
super(bWidget, (Lexicon)lexicon, "commands.addNote");
}
public CommandArtifact doInvoke() {
BNotesDialog.this.newNotes = true;
BNotesDialog.this.close();
return null;
}
}
}