private void loadStations() { try { List<BitPoolServerModelBitStationEntity> stations = conn.poolsApi.poolsGetStations(node.getAttribute("Pool key").getString()); for (BitPoolServerModelBitStationEntity station : stations) { if (node.getChild(station.getStationName()) == null) { Node child = node.createChild(station.getStationName()).build(); final BitpoolStation bs = makeStationObj(station, child); bs.init(); // child.getListener().setOnListHandler(new Handler<Node>() { // private boolean loaded = false; // public void handle(Node event) { // if (!loaded) bs.init(); // loaded = true; // } // }); } } } catch (ApiException e) { // TODO Auto-generated catch block } }
public void handle(ActionResult event) { String name = event.getParameter("Station name", ValueType.STRING).getString(); BitPoolServerModelBitStationEntity station; try { station = conn.poolsApi.poolsRegisterStation(node.getAttribute("Pool key").getString(), name); } catch (ApiException e) { // TODO Auto-generated catch block return; } if (station == null) return; Node child = node.createChild(station.getStationName()).build(); BitpoolStation bs = makeStationObj(station, child); bs.init(); }