in src/main/java/org/apache/openwhisk/intellij/explorer/toolwindow/action/DeleteEndpointAction.java [55:80]
public void actionPerformed(@NotNull AnActionEvent e) {
if (whiskEndpoint != null) {
final Project project = e.getProject();
DeleteEndpointDialog dialog = new DeleteEndpointDialog(project, whiskEndpoint);
if (dialog.showAndGet()) {
/**
* Load endpoints
*/
WhiskService whiskService = ServiceManager.getService(project, WhiskService.class);
List<WhiskEndpoint> endpoints = new ArrayList<>();
try {
endpoints = new ArrayList<>(JsonParserUtils.parseWhiskEndpoints(whiskService.getEndpoints())); // make mutable
} catch (IOException ex) {
LOG.error("Endpoint parsing failed", ex);
}
List<WhiskEndpoint> updatedEndpoints = removeEndpoint(endpoints, whiskEndpoint);
saveEndpoints(whiskService, updatedEndpoints);
// Update action tree
EventUtils.publish(project, RefreshWhiskTreeListener.TOPIC, RefreshWhiskTreeListener::refreshWhiskTree);
NOTIFIER.notify(project, whiskEndpoint.getAlias() + " deleted successfully.", NotificationType.INFORMATION);
}
}
}