Skip to content

Commit

Permalink
Adding Show AWS Settings action to the explorer gear (#1982)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiiadi committed Aug 12, 2020
1 parent 51b3d62 commit 94746a4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions jetbrains-core/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@
<action class="software.aws.toolkits.jetbrains.core.credentials.RefreshConnectionAction" id="aws.settings.refresh" icon="AllIcons.Actions.Refresh"/>
<action class="software.aws.toolkits.jetbrains.core.credentials.CreateOrUpdateCredentialProfilesAction" id="aws.settings.upsertCredentials" icon="AwsIcons.Logos.AWS"/>
<action class="software.aws.toolkits.jetbrains.services.lambda.actions.DeployServerlessApplicationAction" id="serverless.application.deploy" />
<action class="software.aws.toolkits.jetbrains.settings.ShowSettingsAction" id="aws.settings.show" icon="AllIcons.General.Settings"/>

<group id="aws.toolkit.serverless.template">
<add-to-group group-id="ProjectViewPopupMenu" anchor="last"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ class AwsExplorerFactory : ToolWindowFactory, DumbAware {
toolWindow.component.parent.add(explorer)
toolWindow.helpId = HelpIds.EXPLORER_WINDOW.id
if (toolWindow is ToolWindowEx) {
val actionManager = ActionManager.getInstance()
toolWindow.setTitleActions(
ActionManager.getInstance().getAction("aws.settings.refresh"),
actionManager.getAction("aws.settings.refresh"),
Separator.create(),
FeedbackDialog.getAction(project)
)
Expand All @@ -52,6 +53,7 @@ class AwsExplorerFactory : ToolWindowFactory, DumbAware {
)
)
add(FeedbackDialog.getAction(project))
add(actionManager.getAction("aws.settings.show"))
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@

package software.aws.toolkits.jetbrains.settings

import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.LangDataKeys
import com.intellij.openapi.components.PersistentStateComponent
import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage
import com.intellij.openapi.options.ShowSettingsUtil
import com.intellij.openapi.project.DumbAware
import software.aws.toolkits.jetbrains.services.telemetry.TelemetryService
import software.aws.toolkits.resources.message
import java.util.UUID
Expand Down Expand Up @@ -77,3 +82,9 @@ data class AwsConfiguration(
var promptedForTelemetry: Boolean? = null,
var useDefaultCredentialRegion: String? = null
)

class ShowSettingsAction : AnAction(message("aws.settings.show.label")), DumbAware {
override fun actionPerformed(e: AnActionEvent) {
ShowSettingsUtil.getInstance().showSettingsDialog(e.getRequiredData(LangDataKeys.PROJECT), AwsSettingsConfigurable::class.java)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ aws.settings.sam.location=SAM CLI executable:
aws.settings.sam.show_all_gutter_icons=Show gutter icons for all potential AWS Lambda handlers
aws.settings.sam.show_all_gutter_icons_tooltip=When enabled, show gutter icons in source files for all potential Lambda handlers, even if they are not defined in a template or remotely.
aws.settings.serverless_label=Serverless settings
aws.settings.show.label=Show AWS Settings
aws.settings.telemetry.description=Help us improve our product! Allow us to collect basic usage data.
aws.settings.telemetry.option=Send usage metrics to AWS
aws.settings.telemetry.prompt.message=Usage metrics are collected by default. Click <a href="">here</a> to adjust this behavior.
Expand Down

0 comments on commit 94746a4

Please sign in to comment.