use of si.ijs.acs.objectexplorer.engine.NonStickyConnectFailedRemoteException in project ACS by ACS-Community.
the class TreeHandlerBean method connect.
/**
* @author Miha Kadunc
* @author rbertoncelj
*/
public void connect() {
//System.out.println("Connecting to "+clicked);
try {
clicked.connect();
} catch (NonStickyConnectFailedRemoteException nscfre) {
// return from method gracefully
return;
}
((DefaultTreeModel) tree.getModel()).reload((TreeNode) clicked);
if ((tree.getSelectionPath() != null) && (tree.getSelectionPath().getLastPathComponent() == clicked)) {
this.selectedNode = null;
handler.setObject(clicked);
}
if (clicked instanceof BACIRemoteNode) {
BACIRemoteNode myNode = (BACIRemoteNode) clicked;
RemoteNodeCouple rnc;
String curl;
if (myNode.getUserObject() instanceof String) {
curl = (String) myNode.getUserObject();
rnc = (RemoteNodeCouple) devices.get(curl);
} else {
myNode.getParent();
curl = (String) ((OETreeNode) myNode.getParent()).getUserObject() + ":" + myNode.toString();
RemoteNodeCouple newRnc = (RemoteNodeCouple) devices.get(curl);
rnc = newRnc;
}
if (rnc == null) {
clicked = null;
//System.out.println("DEBUG: thb connect - null rnc.");
return;
}
((DefaultTreeModel) treeByName.getModel()).reload((TreeNode) rnc.deviceByName);
}
clicked = null;
tree.repaint();
treeByName.repaint();
}
Aggregations