Search in sources :

Example 1 with PropertiesFileFlagReader

use of com.google.cloud.tools.intellij.flags.PropertiesFileFlagReader in project google-cloud-intellij by GoogleCloudPlatform.

the class CloudSdkServiceManager method showCloudSdkNotification.

@VisibleForTesting
void showCloudSdkNotification(String notificationMessage, NotificationType notificationType) {
    if (!CloudSdkValidator.getInstance().isValidCloudSdk()) {
        Notification invalidSdkWarning = new Notification(new PropertiesFileFlagReader().getFlagString("notifications.plugin.groupdisplayid"), GctBundle.message("settings.menu.item.cloud.sdk.text"), notificationMessage, notificationType);
        // add a link to SDK settings for a quick fix.
        invalidSdkWarning.addAction(new AnAction(GctBundle.message("appengine.deployment.error.sdk.settings.action")) {

            @Override
            public void actionPerformed(AnActionEvent e) {
                ShowSettingsUtil.getInstance().showSettingsDialog(null, CloudSdkConfigurable.class);
                // expire if action has been called to avoid error hanging out forever.
                invalidSdkWarning.expire();
            }
        });
        Notifications.Bus.notify(invalidSdkWarning);
    }
}
Also used : PropertiesFileFlagReader(com.google.cloud.tools.intellij.flags.PropertiesFileFlagReader) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) AnAction(com.intellij.openapi.actionSystem.AnAction) Notification(com.intellij.notification.Notification) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Aggregations

PropertiesFileFlagReader (com.google.cloud.tools.intellij.flags.PropertiesFileFlagReader)1 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 Notification (com.intellij.notification.Notification)1 AnAction (com.intellij.openapi.actionSystem.AnAction)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1