- switch(choice)\r
- {\r
- case 0: amendLocal(false); break;\r
- case 1:\r
- localSources.remove(nickname);\r
- selectedSources.remove(nickname);\r
- Object[][] data = new Object[dasSources.length-1][2];\r
- DasSource [] tmp = new DasSource[dasSources.length-1];\r
- int index = 0;\r
- for (int i = 0; i < dasSources.length; i++)\r
+ String nickname = table.getValueAt(selectedRow, 0).toString();\r
+\r
+ if (!localSources.containsKey(nickname))\r
+ {\r
+ JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
+ "You can only edit or remove local DAS Sources!",\r
+ "Public DAS source - not editable",\r
+ JOptionPane.WARNING_MESSAGE);\r
+ return;\r
+ }\r
+\r
+ Object[] options =\r
+ {\r
+ "Edit", "Remove", "Cancel"};\r
+ int choice = JOptionPane.showInternalOptionDialog(Desktop.desktop,\r
+ "Do you want to edit or remove " + nickname + "?",\r
+ "Edit / Remove Local DAS Source",\r
+ JOptionPane.YES_NO_CANCEL_OPTION,\r
+ JOptionPane.QUESTION_MESSAGE,\r
+ null,\r
+ options,\r
+ options[2]);\r
+\r
+ switch (choice)\r
+ {\r
+ case 0:\r
+ amendLocal(false);\r
+ break;\r
+ case 1:\r
+ localSources.remove(nickname);\r
+ selectedSources.remove(nickname);\r
+ Object[][] data = new Object[dasSources.length - 1][2];\r
+ DasSource[] tmp = new DasSource[dasSources.length - 1];\r
+ int index = 0;\r
+ for (int i = 0; i < dasSources.length; i++)\r
+ {\r
+ if (dasSources[i].getNickname().equals(nickname))\r
+ {\r
+ continue;\r
+ }\r
+ else\r