Object val = smdiManagerTable.getRowHeader().getValueAt(sr, 0);
if (val == null || !(val instanceof SmdiTarget)) {
JOptionPane.showMessageDialog(ZSmdiManagerDialog.this, "Not a SMDI target", "Error", JOptionPane.ERROR_MESSAGE);
return;
}
SmdiTarget st = ((SmdiTarget) val);
List l = Zoeos.getInstance().getDeviceManager().getRunningList();
if (l.size() > 0) {
int res = JOptionPane.showOptionDialog(ZSmdiManagerDialog.this, "Choose a device for the coupling:", "Choose Device", JOptionPane.OK_OPTION, JOptionPane.QUESTION_MESSAGE, null, l.toArray(), l.get(0));
if (res != JOptionPane.CLOSED_OPTION && res != JOptionPane.CANCEL_OPTION)
if (l.get(res) instanceof ZExternalDevice)
try {
SMDIAgent.setSmdiTargetCoupling(st.getHA_Id(), st.getSCSI_Id(), ((ZExternalDevice) l.get(res)).getDeviceIdentityMessage());
} catch (TargetNotSMDIException e1) {
e1.printStackTrace();
} catch (SmdiUnavailableException e1) {
e1.printStackTrace();
}