137 return true; |
137 return true; |
138 } |
138 } |
139 |
139 |
140 private void saveConnectedServicesEnabledState() { |
140 private void saveConnectedServicesEnabledState() { |
141 Collection<IConnectedService> connectedServices = Registry.instance().getConnectedServices(connectionToEdit); |
141 Collection<IConnectedService> connectedServices = Registry.instance().getConnectedServices(connectionToEdit); |
142 if (connectedServices == null) |
142 if (connectedServices.isEmpty()) |
143 return; |
143 return; |
144 if (savedEnabledStates == null) |
144 if (savedEnabledStates == null) |
145 savedEnabledStates = new HashMap<IConnectedService, Boolean>(); |
145 savedEnabledStates = new HashMap<IConnectedService, Boolean>(); |
146 for (IConnectedService connectedService : connectedServices) { |
146 for (IConnectedService connectedService : connectedServices) { |
147 savedEnabledStates.put(connectedService, connectedService.isEnabled()); |
147 savedEnabledStates.put(connectedService, connectedService.isEnabled()); |
148 } |
148 } |
149 } |
149 } |
150 |
150 |
151 private void enableConnectedServices(boolean enabled) { |
151 private void enableConnectedServices(boolean enabled) { |
152 Collection<IConnectedService> connectedServices = Registry.instance().getConnectedServices(connectionToEdit); |
152 Collection<IConnectedService> connectedServices = Registry.instance().getConnectedServices(connectionToEdit); |
153 if (connectedServices == null || savedEnabledStates == null) |
153 if (connectedServices.isEmpty() || savedEnabledStates == null) |
154 return; |
154 return; |
155 for (IConnectedService connectedService : connectedServices) { |
155 for (IConnectedService connectedService : connectedServices) { |
156 if (!enabled) // disable when asked |
156 if (!enabled) // disable when asked |
157 connectedService.setEnabled(false); |
157 connectedService.setEnabled(false); |
158 else { |
158 else { |