From 9f9925a2aef72e095cd543629ed48d105799d4f1 Mon Sep 17 00:00:00 2001 From: JohnHake Date: Mon, 13 Aug 2018 18:26:44 -0700 Subject: [PATCH] Refactoring and documentation updates complete. Still needs testing --- .../actions/CustomGroupedAction.java | 10 ---- .../tutorials/actions/DynamicActionGroup.java | 2 +- .../tutorials/actions/SimpleAction.java | 50 ------------------- 3 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 register_actions/src/org/jetbrains/tutorials/actions/CustomGroupedAction.java delete mode 100644 register_actions/src/org/jetbrains/tutorials/actions/SimpleAction.java diff --git a/register_actions/src/org/jetbrains/tutorials/actions/CustomGroupedAction.java b/register_actions/src/org/jetbrains/tutorials/actions/CustomGroupedAction.java deleted file mode 100644 index 15b309a6a..000000000 --- a/register_actions/src/org/jetbrains/tutorials/actions/CustomGroupedAction.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.jetbrains.tutorials.actions; - -import com.intellij.openapi.actionSystem.*; - -public class CustomGroupedAction extends AnAction { - @Override - public void actionPerformed(AnActionEvent anActionEvent) { - //Does nothing - } -} diff --git a/register_actions/src/org/jetbrains/tutorials/actions/DynamicActionGroup.java b/register_actions/src/org/jetbrains/tutorials/actions/DynamicActionGroup.java index c46df3fc2..f2e521dc4 100644 --- a/register_actions/src/org/jetbrains/tutorials/actions/DynamicActionGroup.java +++ b/register_actions/src/org/jetbrains/tutorials/actions/DynamicActionGroup.java @@ -25,7 +25,7 @@ public class DynamicActionGroup extends ActionGroup { * Returns an array of menu actions for the group. * * @param anActionEvent Event received when the associated group-id menu is chosen. - * @return: AnAction[] An instance of AnAction, in this case containing a single instance of the + * @return AnAction[] An instance of AnAction, in this case containing a single instance of the * SimplePopDialogAction class. */ @NotNull diff --git a/register_actions/src/org/jetbrains/tutorials/actions/SimpleAction.java b/register_actions/src/org/jetbrains/tutorials/actions/SimpleAction.java deleted file mode 100644 index 04cbe0074..000000000 --- a/register_actions/src/org/jetbrains/tutorials/actions/SimpleAction.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - */ - -package org.jetbrains.tutorials.actions; - -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.CommonDataKeys; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.ui.Messages; -import com.intellij.pom.Navigatable; - - -/** - * Action class to demonstrate how to interact with the IntelliJ Platform when a menu entry is chosen. - * The association between this Java class and the menu structure is declared in this module's plugin.xml file - * @see com.intellij.openapi.actionSystem.AnAction - * @see com.intellij.openapi.actionSystem.AnActionEvent - */ -public class SimpleAction extends AnAction { - - /** - * Takes action based on the user choosing the menu item. - * @param anActionEvent Event received when the associated menu item is chosen. - */ - @Override - public void actionPerformed(AnActionEvent anActionEvent) { - // Using the event, get the project and navigatable objects - Project project = anActionEvent.getProject(); - Navigatable navigatable = anActionEvent.getData(CommonDataKeys.NAVIGATABLE); - if (project != null && navigatable != null) { - // Pop a small dialog - Messages.showMessageDialog(project, navigatable.toString(), "Selected Element", Messages.getInformationIcon()); - } - } - - /** - * Determines whether this menu item is suitable for the current context. - * @param anActionEvent Event received when the associated group-id menu is chosen. - */ - @Override - public void update(AnActionEvent anActionEvent) { - // Using the event, get the project and navigatable objects - they will be needed in actionPerformed() - Project project = anActionEvent.getProject(); - Navigatable navigatable = anActionEvent.getData(CommonDataKeys.NAVIGATABLE); - // Make the associated menu item both visible and enabled - anActionEvent.getPresentation().setEnabledAndVisible(project != null && navigatable != null); - } -}