public void actionPerformed()

in src/main/java/org/apache/openwhisk/intellij/explorer/toolwindow/action/DeleteNamespaceAction.java [56:81]


    public void actionPerformed(@NotNull AnActionEvent e) {
        if (whiskNamespace != null) {
            final Project project = e.getProject();
            DeleteNamespaceDialog dialog = new DeleteNamespaceDialog(project, whiskNamespace);
            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 = removeNamespace(endpoints, whiskNamespace);
                saveEndpoints(whiskService, updatedEndpoints);

                // Update action tree
                EventUtils.publish(project, RefreshWhiskTreeListener.TOPIC, RefreshWhiskTreeListener::refreshWhiskTree);
                NOTIFIER.notify(project, whiskNamespace.getPath() + " deleted successfully.", NotificationType.INFORMATION);
            }
        }
    }