108 lines
3.9 KiB
Java
108 lines
3.9 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.baja.log.Log
|
|
* javax.baja.sys.BBoolean
|
|
* javax.baja.sys.BComponent
|
|
* javax.baja.sys.BObject
|
|
* javax.baja.sys.BValue
|
|
* javax.baja.sys.Context
|
|
* javax.baja.sys.Slot
|
|
* javax.baja.sys.Sys
|
|
* javax.baja.sys.Type
|
|
* javax.baja.ui.BCheckBox
|
|
* javax.baja.ui.BWidget
|
|
* javax.baja.ui.pane.BGridPane
|
|
* javax.baja.util.Lexicon
|
|
* javax.baja.workbench.BWbPlugin
|
|
* javax.baja.workbench.fieldeditor.BWbFieldEditor
|
|
*/
|
|
package com.tridium.alarm.ui;
|
|
|
|
import javax.baja.alarm.ext.BLimitEnable;
|
|
import javax.baja.log.Log;
|
|
import javax.baja.sys.BBoolean;
|
|
import javax.baja.sys.BComponent;
|
|
import javax.baja.sys.BObject;
|
|
import javax.baja.sys.BValue;
|
|
import javax.baja.sys.Context;
|
|
import javax.baja.sys.Slot;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
import javax.baja.ui.BCheckBox;
|
|
import javax.baja.ui.BWidget;
|
|
import javax.baja.ui.pane.BGridPane;
|
|
import javax.baja.util.Lexicon;
|
|
import javax.baja.workbench.BWbPlugin;
|
|
import javax.baja.workbench.fieldeditor.BWbFieldEditor;
|
|
|
|
public class BLimitEnableFE
|
|
extends BWbFieldEditor {
|
|
public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BLimitEnableFE == null ? (class$com$tridium$alarm$ui$BLimitEnableFE = BLimitEnableFE.class$("com.tridium.alarm.ui.BLimitEnableFE")) : class$com$tridium$alarm$ui$BLimitEnableFE));
|
|
private static Log log = Log.getLog((String)"control");
|
|
private static Lexicon lex = Lexicon.make((String)"alarm");
|
|
private boolean init = false;
|
|
private BCheckBox low;
|
|
private BCheckBox high;
|
|
static /* synthetic */ Class class$com$tridium$alarm$ui$BLimitEnableFE;
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
protected void doSetReadonly(boolean bl) {
|
|
this.init = false;
|
|
}
|
|
|
|
protected void doLoadValue(BObject bObject, Context context) {
|
|
BLimitEnable bLimitEnable = (BLimitEnable)bObject;
|
|
if (!this.init) {
|
|
this.initUi(bLimitEnable);
|
|
}
|
|
this.low.setSelected(bLimitEnable.getLowLimitEnable());
|
|
this.high.setSelected(bLimitEnable.getHighLimitEnable());
|
|
this.low.setEnabled(!this.isReadonly());
|
|
this.high.setEnabled(!this.isReadonly());
|
|
this.linkTo((BComponent)this.low, (Slot)BWbPlugin.actionPerformed, (Slot)actionPerformed);
|
|
this.linkTo((BComponent)this.high, (Slot)BWbPlugin.actionPerformed, (Slot)actionPerformed);
|
|
}
|
|
|
|
protected BObject doSaveValue(BObject bObject, Context context) {
|
|
BLimitEnable bLimitEnable = (BLimitEnable)bObject;
|
|
try {
|
|
boolean bl = this.low.getSelected();
|
|
bLimitEnable.set(BLimitEnable.lowLimitEnable, (BValue)BBoolean.make((boolean)bl), context);
|
|
boolean bl2 = this.high.getSelected();
|
|
bLimitEnable.set(BLimitEnable.highLimitEnable, (BValue)BBoolean.make((boolean)bl2), context);
|
|
}
|
|
catch (Exception exception) {
|
|
log.error("BLimitEnable SaveValue Failed: ", (Throwable)exception);
|
|
}
|
|
return bLimitEnable;
|
|
}
|
|
|
|
private void initUi(BLimitEnable bLimitEnable) {
|
|
this.init = true;
|
|
BGridPane bGridPane = new BGridPane(2);
|
|
bGridPane.setColumnGap(6.0);
|
|
this.low = new BCheckBox(lex.getText("lowLimit.enable"));
|
|
bGridPane.add("low", (BValue)this.low);
|
|
this.high = new BCheckBox(lex.getText("highLimit.enable"));
|
|
bGridPane.add("high", (BValue)this.high);
|
|
this.setContent((BWidget)bGridPane);
|
|
this.linkTo("lk0", (BComponent)this.low, (Slot)BCheckBox.actionPerformed, (Slot)setModified);
|
|
this.linkTo("lk1", (BComponent)this.high, (Slot)BCheckBox.actionPerformed, (Slot)setModified);
|
|
}
|
|
|
|
static /* synthetic */ Class class$(String string) {
|
|
try {
|
|
return Class.forName(string);
|
|
}
|
|
catch (ClassNotFoundException classNotFoundException) {
|
|
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
|
}
|
|
}
|
|
}
|
|
|