|
35 | 35 | import com.intellij.openapi.editor.EditorFactory; |
36 | 36 | import com.intellij.openapi.fileTypes.FileTypeManager; |
37 | 37 | import com.intellij.openapi.keymap.KeymapManager; |
| 38 | +import com.intellij.openapi.options.ShowSettingsUtil; |
38 | 39 | import com.intellij.openapi.project.Project; |
39 | 40 | import com.intellij.openapi.ui.SimpleToolWindowPanel; |
40 | 41 | import com.intellij.openapi.util.IconLoader; |
|
43 | 44 | import com.intellij.psi.PsiFile; |
44 | 45 | import com.intellij.psi.PsiFileFactory; |
45 | 46 | import com.intellij.ui.PopupHandler; |
| 47 | +import org.objectweb.asm.idea.config.ASMPluginComponent; |
46 | 48 |
|
47 | 49 | import javax.swing.*; |
48 | 50 | import java.awt.*; |
@@ -92,6 +94,8 @@ private void setupUI() { |
92 | 94 | final AnAction diffAction = createShowDiffAction(); |
93 | 95 | DefaultActionGroup group = new DefaultActionGroup(); |
94 | 96 | group.add(diffAction); |
| 97 | + group.add(new ShowSettingsAction()); |
| 98 | + |
95 | 99 | final ActionManager actionManager = ActionManager.getInstance(); |
96 | 100 | final ActionToolbar actionToolBar = actionManager.createActionToolbar("ASM", group, true); |
97 | 101 | final JPanel buttonsPanel = new JPanel(new BorderLayout()); |
@@ -125,6 +129,22 @@ private AnAction createShowDiffAction() { |
125 | 129 | return new ShowDiffAction(); |
126 | 130 | } |
127 | 131 |
|
| 132 | + private class ShowSettingsAction extends AnAction { |
| 133 | + |
| 134 | + private ShowSettingsAction() { |
| 135 | + super("Settings", "Show settings for ASM plugin", IconLoader.getIcon("/general/projectSettings.png")); |
| 136 | + } |
| 137 | + |
| 138 | + @Override |
| 139 | + public boolean displayTextInToolbar() { |
| 140 | + return true; |
| 141 | + } |
| 142 | + |
| 143 | + @Override |
| 144 | + public void actionPerformed(final AnActionEvent e) { |
| 145 | + ShowSettingsUtil.getInstance().showSettingsDialog(project, project.getComponent(ASMPluginComponent.class)); |
| 146 | + } |
| 147 | + } |
128 | 148 | private class ShowDiffAction extends AnAction { |
129 | 149 |
|
130 | 150 | public ShowDiffAction() { |
|
0 commit comments