Skip to content

Commit 8ab3258

Browse files
authored
Merge pull request #35 from z8dn/feature/customize-tree-view
Feature: add Customize Android Tree View action
2 parents 27a3776 + 2fe47dd commit 8ab3258

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.z8dn.plugins.a2pt.actions
2+
3+
import com.intellij.ide.actions.ShowSettingsUtilImpl
4+
import com.intellij.openapi.actionSystem.ActionUpdateThread
5+
import com.intellij.openapi.actionSystem.AnActionEvent
6+
import com.intellij.openapi.project.DumbAwareAction
7+
import com.z8dn.plugins.a2pt.AndroidViewBundle
8+
import org.jetbrains.annotations.ApiStatus.Internal
9+
10+
@Internal
11+
class CustomizeAndroidTreeViewAction : DumbAwareAction() {
12+
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT
13+
14+
override fun actionPerformed(e: AnActionEvent) {
15+
ShowSettingsUtilImpl.showSettingsDialog(
16+
e.project,
17+
"com.z8dn.plugins.a2pt.settings",
18+
AndroidViewBundle.message("settings.DisplayName.text")
19+
)
20+
}
21+
}

src/main/resources/META-INF/plugin.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,15 @@
4444
<add-to-group group-id="ProjectView.ToolWindow.Appearance.Actions"
4545
relative-to-action="ShowBuildFilesInModuleAction"
4646
anchor="after"/>
47+
<separator/>
4748
<action id="com.z8dn.plugins.a2pt.ShowBuildDirectoryAction"
4849
class="com.z8dn.plugins.a2pt.actions.ShowBuildDirectoryAction"/>
4950
<action id="com.z8dn.plugins.a2pt.ShowProjectFilesInModuleAction"
5051
class="com.z8dn.plugins.a2pt.actions.ShowProjectFilesInModuleAction"/>
52+
<action id="CustomizeAndroidTreeViewAction"
53+
class="com.z8dn.plugins.a2pt.actions.CustomizeAndroidTreeViewAction"
54+
text="Customize Android Tree View..."
55+
description="Open Advanced Android Project View settings"/>
5156
</group>
5257
</actions>
5358
</idea-plugin>

src/main/resources/messages/AndroidViewBundle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Project View Actions
22
action.ProjectView.ShowBuildDirectoryAction.text=Display Build Directory
33
action.ProjectView.ShowProjectFilesInModuleAction.text=Display Project Files in Modules
4+
action.ProjectView.CustomizeAndroidTreeViewAction.text=Customize Android Tree View...
5+
action.ProjectView.CustomizeAndroidTreeViewAction.description=Open Advanced Android Project View settings
46

57
# Settings
68
settings.DisplayName.text=Advanced Android Project View

0 commit comments

Comments
 (0)