129 lines
4.8 KiB
Java
129 lines
4.8 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.tridium.fox.sys.BFoxSession
|
|
* com.tridium.fox.sys.NiagaraStation
|
|
* javax.baja.naming.BOrd
|
|
* javax.baja.naming.OrdTarget
|
|
* javax.baja.sys.BComponent
|
|
* javax.baja.sys.BObject
|
|
* javax.baja.sys.BString
|
|
* javax.baja.sys.Context
|
|
* javax.baja.sys.Slot
|
|
* javax.baja.sys.Sys
|
|
* javax.baja.sys.Type
|
|
* javax.baja.ui.BTextDropDown
|
|
* javax.baja.ui.BTextField
|
|
* javax.baja.ui.BWidget
|
|
* javax.baja.ui.list.BList
|
|
* javax.baja.ui.util.UiLexicon
|
|
* javax.baja.util.BFolder
|
|
* javax.baja.workbench.BWbShell
|
|
* javax.baja.workbench.fieldeditor.BWbFieldEditor
|
|
*/
|
|
package com.tridium.alarm.ui;
|
|
|
|
import com.tridium.fox.sys.BFoxSession;
|
|
import com.tridium.fox.sys.NiagaraStation;
|
|
import javax.baja.naming.BOrd;
|
|
import javax.baja.naming.OrdTarget;
|
|
import javax.baja.sys.BComponent;
|
|
import javax.baja.sys.BObject;
|
|
import javax.baja.sys.BString;
|
|
import javax.baja.sys.Context;
|
|
import javax.baja.sys.Slot;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
import javax.baja.ui.BTextDropDown;
|
|
import javax.baja.ui.BTextField;
|
|
import javax.baja.ui.BWidget;
|
|
import javax.baja.ui.list.BList;
|
|
import javax.baja.ui.util.UiLexicon;
|
|
import javax.baja.util.BFolder;
|
|
import javax.baja.workbench.BWbShell;
|
|
import javax.baja.workbench.fieldeditor.BWbFieldEditor;
|
|
|
|
public class BRemoteStationFE
|
|
extends BWbFieldEditor {
|
|
public static final Type TYPE = Sys.loadType((Class)(class$com$tridium$alarm$ui$BRemoteStationFE == null ? (class$com$tridium$alarm$ui$BRemoteStationFE = BRemoteStationFE.class$("com.tridium.alarm.ui.BRemoteStationFE")) : class$com$tridium$alarm$ui$BRemoteStationFE));
|
|
private static UiLexicon lex = new UiLexicon(class$com$tridium$alarm$ui$BAlarmDbView == null ? (class$com$tridium$alarm$ui$BAlarmDbView = BRemoteStationFE.class$("com.tridium.alarm.ui.BAlarmDbView")) : class$com$tridium$alarm$ui$BAlarmDbView);
|
|
private BTextDropDown remoteStation;
|
|
private boolean loaded = false;
|
|
static /* synthetic */ Class class$com$tridium$alarm$ui$BRemoteStationFE;
|
|
static /* synthetic */ Class class$com$tridium$alarm$ui$BAlarmDbView;
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
protected void doSetReadonly(boolean bl) {
|
|
if (bl) {
|
|
this.setContent((BWidget)new BTextField("", 45, false));
|
|
}
|
|
}
|
|
|
|
protected void doLoadValue(BObject bObject, Context context) {
|
|
if (this.loaded) {
|
|
return;
|
|
}
|
|
this.init();
|
|
BString bString = (BString)bObject;
|
|
if (bString == null || bString.isNull() || bString.toString().equals("")) {
|
|
((BTextDropDown)this.getContent()).setText(lex.getText("stationRecipient.selectStation"));
|
|
} else {
|
|
((BTextDropDown)this.getContent()).setText(bString.toString());
|
|
}
|
|
try {
|
|
BWbShell bWbShell = this.getWbShell();
|
|
OrdTarget ordTarget = bWbShell.getActiveOrdTarget();
|
|
BFoxSession bFoxSession = (BFoxSession)BOrd.toSession((BObject)ordTarget.get());
|
|
BOrd bOrd = BOrd.make((BOrd)bWbShell.getActiveOrd(), (String)"service:niagaraDriver:NiagaraNetwork");
|
|
BComponent bComponent = (BComponent)bOrd.get();
|
|
BList bList = this.remoteStation.getList();
|
|
this.loadStations(bComponent, bList);
|
|
}
|
|
catch (Exception exception) {
|
|
exception.printStackTrace();
|
|
}
|
|
this.loaded = true;
|
|
}
|
|
|
|
private void loadStations(BComponent bComponent, BList bList) {
|
|
bComponent.lease();
|
|
BComponent[] bComponentArray = bComponent.getChildComponents();
|
|
for (int i = 0; i < bComponentArray.length; ++i) {
|
|
BComponent bComponent2 = bComponentArray[i];
|
|
if (bComponent2 instanceof NiagaraStation) {
|
|
bList.addItem((Object)bComponent2.getName());
|
|
continue;
|
|
}
|
|
if (!(bComponent2 instanceof BFolder)) continue;
|
|
this.loadStations(bComponent2, bList);
|
|
}
|
|
}
|
|
|
|
protected BObject doSaveValue(BObject bObject, Context context) {
|
|
if (this.remoteStation.getText().equals(lex.getText("stationRecipient.selectStation"))) {
|
|
return BString.make((String)"");
|
|
}
|
|
return BString.make((String)this.remoteStation.getText());
|
|
}
|
|
|
|
private void init() {
|
|
this.remoteStation = new BTextDropDown();
|
|
this.setContent((BWidget)this.remoteStation);
|
|
this.linkTo("l0", (BComponent)this.remoteStation, (Slot)BTextDropDown.valueModified, (Slot)setModified);
|
|
}
|
|
|
|
static /* synthetic */ Class class$(String string) {
|
|
try {
|
|
return Class.forName(string);
|
|
}
|
|
catch (ClassNotFoundException classNotFoundException) {
|
|
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
|
}
|
|
}
|
|
}
|
|
|