String url = "";
if (selectedNode.category.equals(UPnPDeviceTreeNode.DEVICE)){
UPnPDeviceTreeNode parent = (UPnPDeviceTreeNode)selectedNode.getParent();
while (parent.category!=UPnPDeviceTreeNode.ROOT_DEVICE)
parent = (UPnPDeviceTreeNode)parent.getParent();
DeviceNode device = (DeviceNode) parent.getUserObject();
String udn = (String)device.getReference().getProperty(UPnPDevice.UDN);
url = Mediator.getDriverProxy().getDeviceDescriptionURI(udn);
}
else if (selectedNode.category.equals(UPnPDeviceTreeNode.ROOT_DEVICE))
{
DeviceNode node = (DeviceNode) selectedNode.getUserObject();
String udn = (String)node.getReference().getProperty(UPnPDevice.UDN);
url = Mediator.getDriverProxy().getDeviceDescriptionURI(udn);
}
else if (selectedNode.category.equals(UPnPDeviceTreeNode.SERVICE))
{
UPnPDeviceTreeNode parent = (UPnPDeviceTreeNode)selectedNode.getParent();
while (parent.category!=UPnPDeviceTreeNode.ROOT_DEVICE)
parent = (UPnPDeviceTreeNode)parent.getParent();
DeviceNode device = (DeviceNode) parent.getUserObject();
String udn = (String)device.getReference().getProperty(UPnPDevice.UDN);
UPnPService service = (UPnPService) selectedNode.getUserObject();
url = Mediator.getDriverProxy().getServiceDescriptionURI(udn,service.getId());
}
Util.openUrl(url);
}