From 5942892ddb08957e61935401be0748a81916d29e Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Wed, 7 Oct 2020 15:44:40 +0200 Subject: [PATCH] Cleanup code_samples JavaDocs --- .../sdk/action/CustomDefaultActionGroup.java | 4 +- .../sdk/action/DynamicActionGroup.java | 13 +++--- .../sdk/action/PopupDialogAction.java | 7 ++-- .../ComparingReferencesInspection.java | 39 ++++++++---------- .../ComparingReferencesInspectionTest.java | 8 ++-- .../ConditionalOperatorConverter.java | 40 ++++++++----------- .../ConditionalOperatorConverterTest.java | 4 +- .../sdk/editor/EditorAreaIllustration.java | 11 ++--- .../sdk/editor/EditorHandlerIllustration.java | 10 +++-- .../sdk/editor/EditorIllustrationAction.java | 10 +++-- .../intellij/sdk/editor/MyTypedHandler.java | 3 +- .../sdk/facet/DemoFacetConfiguration.java | 5 +-- .../sdk/facet/DemoFacetEditorTab.java | 24 +++++------ .../intellij/sdk/facet/DemoFacetState.java | 1 - .../org/intellij/sdk/facet/DemoFacetType.java | 6 +-- .../sdk/inspection/DemoCodeInspection.java | 4 +- .../ProjectCountingService.java | 12 ++++-- .../ProjectOpenCloseListener.java | 2 +- .../sdk/pycharm/PopupDialogAction.java | 3 +- .../sdk/view/pane/ImagesProjectNode.java | 1 - .../DemoConfigurationFactory.java | 2 + .../DemoRunConfiguration.java | 2 + .../DemoRunConfigurationOptions.java | 2 + .../DemoRunConfigurationType.java | 2 + .../runConfiguration/DemoSettingsEditor.java | 2 + .../sdk/settings/AppSettingsComponent.java | 2 +- .../sdk/settings/AppSettingsState.java | 2 +- .../SimpleCodeStyleSettingsProvider.java | 1 - .../sdk/language/SimpleFileTypeFactory.java | 2 +- .../org/intellij/sdk/language/SimpleUtil.java | 8 +++- .../sdk/language/SimpleCodeInsightTest.java | 2 +- .../sdk/language/SimpleParsingTest.java | 3 +- .../sdk/toolWindow/MyToolWindowFactory.java | 7 +++- 33 files changed, 125 insertions(+), 119 deletions(-) diff --git a/action_basics/src/main/java/org/intellij/sdk/action/CustomDefaultActionGroup.java b/action_basics/src/main/java/org/intellij/sdk/action/CustomDefaultActionGroup.java index b50e92be8..1488e13c6 100644 --- a/action_basics/src/main/java/org/intellij/sdk/action/CustomDefaultActionGroup.java +++ b/action_basics/src/main/java/org/intellij/sdk/action/CustomDefaultActionGroup.java @@ -14,8 +14,8 @@ import icons.SdkIcons; public class CustomDefaultActionGroup extends DefaultActionGroup { /** - * Given CustomDefaultActionGroup is derived from ActionGroup, in this context - * update() determines whether the action group itself should be enabled or disabled. + * Given {@link CustomDefaultActionGroup} is derived from {@link com.intellij.openapi.actionSystem.ActionGroup}, + * in this context {@code update()} determines whether the action group itself should be enabled or disabled. * Requires an editor to be active in order to enable the group functionality. * * @param event Event received when the associated group-id menu is chosen. diff --git a/action_basics/src/main/java/org/intellij/sdk/action/DynamicActionGroup.java b/action_basics/src/main/java/org/intellij/sdk/action/DynamicActionGroup.java index 3def613cb..a45ed701d 100644 --- a/action_basics/src/main/java/org/intellij/sdk/action/DynamicActionGroup.java +++ b/action_basics/src/main/java/org/intellij/sdk/action/DynamicActionGroup.java @@ -9,11 +9,10 @@ import icons.SdkIcons; import org.jetbrains.annotations.NotNull; /** - * Demonstrates adding an action group to a menu statically in plugin.xml, and then creating a menu item - * within the group at runtime. See plugin.xml for the declaration of DynamicActionGroup, - * and note the group declaration does not contain an action. - * DynamicActionGroup is based on ActionGroup because menu children are determined - * on rules other than just positional constraints. + * Demonstrates adding an action group to a menu statically in plugin.xml, and then creating a menu item within + * the group at runtime. See plugin.xml for the declaration of {@link DynamicActionGroup}, and note the group + * declaration does not contain an action. {@link DynamicActionGroup} is based on {@link ActionGroup} because menu + * children are determined on rules other than just positional constraints. * * @see ActionGroup */ @@ -23,8 +22,8 @@ public class DynamicActionGroup extends ActionGroup { * Returns an array of menu actions for the group. * * @param e 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 - * PopupDialogAction class. + * @return AnAction[] An instance of {@link AnAction}, in this case containing a single instance of the + * {@link PopupDialogAction} class. */ @NotNull @Override diff --git a/action_basics/src/main/java/org/intellij/sdk/action/PopupDialogAction.java b/action_basics/src/main/java/org/intellij/sdk/action/PopupDialogAction.java index edf7b1db5..41d362000 100644 --- a/action_basics/src/main/java/org/intellij/sdk/action/PopupDialogAction.java +++ b/action_basics/src/main/java/org/intellij/sdk/action/PopupDialogAction.java @@ -22,9 +22,8 @@ import javax.swing.*; public class PopupDialogAction extends AnAction { /** - * This default constructor is used by the IntelliJ Platform framework to - * instantiate this class based on plugin.xml declarations. Only needed in PopupDialogAction - * class because a second constructor is overridden. + * This default constructor is used by the IntelliJ Platform framework to instantiate this class based on plugin.xml + * declarations. Only needed in {@link PopupDialogAction} class because a second constructor is overridden. * * @see AnAction#AnAction() */ @@ -48,7 +47,7 @@ public class PopupDialogAction extends AnAction { /** * Gives the user feedback when the dynamic action menu is chosen. * Pops a simple message dialog. See the psi_demo plugin for an - * example of how to use AnActionEvent to access data. + * example of how to use {@link AnActionEvent} to access data. * * @param event Event received when the associated menu item is chosen. */ diff --git a/comparing_references_inspection/src/main/java/org/intellij/sdk/codeInspection/ComparingReferencesInspection.java b/comparing_references_inspection/src/main/java/org/intellij/sdk/codeInspection/ComparingReferencesInspection.java index ea64e0a18..edf845249 100644 --- a/comparing_references_inspection/src/main/java/org/intellij/sdk/codeInspection/ComparingReferencesInspection.java +++ b/comparing_references_inspection/src/main/java/org/intellij/sdk/codeInspection/ComparingReferencesInspection.java @@ -20,7 +20,7 @@ import java.util.StringTokenizer; import static com.siyeh.ig.psiutils.ExpressionUtils.isNullLiteral; /** - * Implements an inspection to detect when object references are compared using 'a==b' or 'a!=b' + * Implements an inspection to detect when object references are compared using 'a==b' or 'a!=b'. * The quick fix converts these comparisons to 'a.equals(b) or '!a.equals(b)' respectively. */ public class ComparingReferencesInspection extends AbstractBaseJavaLocalInspectionTool { @@ -38,8 +38,7 @@ public class ComparingReferencesInspection extends AbstractBaseJavaLocalInspecti /** * This method is called to get the panel describing the inspection. * It is called every time the user selects the inspection in preferences. - * The user has the option to edit the list of CHECKED_CLASSES. - * Adds a document listener to see if + * The user has the option to edit the list of {@link #CHECKED_CLASSES}. * * @return panel to display inspection information. */ @@ -57,8 +56,8 @@ public class ComparingReferencesInspection extends AbstractBaseJavaLocalInspecti } /** - * This method is overridden to provide a custom visitor - * that inspects expressions with relational operators '==' and '!=' + * This method is overridden to provide a custom visitor. + * that inspects expressions with relational operators '==' and '!='. * The visitor must not be recursive and must be thread-safe. * * @param holder object for visitor to register problems found. @@ -72,8 +71,8 @@ public class ComparingReferencesInspection extends AbstractBaseJavaLocalInspecti return new JavaElementVisitor() { /** - * This string defines the short message shown to a user signaling the inspection - * found a problem. It reuses a string from the inspections bundle. + * This string defines the short message shown to a user signaling the inspection found a problem. + * It reuses a string from the inspections bundle. */ @NonNls private final String DESCRIPTION_TEMPLATE = "SDK " + @@ -82,21 +81,18 @@ public class ComparingReferencesInspection extends AbstractBaseJavaLocalInspecti /** * Avoid defining visitors for both Reference and Binary expressions. * - * @param psiReferenceExpression The expression to be evaluated. + * @param psiReferenceExpression The expression to be evaluated. */ @Override public void visitReferenceExpression(PsiReferenceExpression psiReferenceExpression) { } /** - * Evaluate binary psi expressions to see if they contain - * relational operators '==' and '!=', AND they contain - * classes contained in CHECKED_CLASSES. The evaluation - * ignores expressions comparing an object to null. - * IF this criteria is met, add the expression to the - * problems list. + * Evaluate binary psi expressions to see if they contain relational operators '==' and '!=', AND they contain + * classes contained in CHECKED_CLASSES. The evaluation ignores expressions comparing an object to null. + * IF this criteria is met, add the expression to the problems list. * - * @param expression The binary expression to be evaluated. + * @param expression The binary expression to be evaluated. */ @Override public void visitBinaryExpression(PsiBinaryExpression expression) { @@ -123,9 +119,9 @@ public class ComparingReferencesInspection extends AbstractBaseJavaLocalInspecti /** * Verifies the input is the correct {@code PsiType} for this inspection. * - * @param type The {@code PsiType} to be examined for a match - * @return {@code true} if input is {@code PsiClassType} and matches - * one of the classes in the CHECKED_CLASSES list. + * @param type The {@code PsiType} to be examined for a match + * @return {@code true} if input is {@code PsiClassType} and matches one of the classes + * in the {@link ComparingReferencesInspection#CHECKED_CLASSES} list. */ private boolean isCheckedType(PsiType type) { if (!(type instanceof PsiClassType)) { @@ -145,8 +141,8 @@ public class ComparingReferencesInspection extends AbstractBaseJavaLocalInspecti } /** - * This class provides a solution to inspection problem expressions by manipulating - * the PSI tree to use a.equals(b) instead of '==' or '!=' + * This class provides a solution to inspection problem expressions by manipulating the PSI tree to use 'a.equals(b)' + * instead of '==' or '!='. */ private static class CriQuickFix implements LocalQuickFix { @@ -163,8 +159,7 @@ public class ComparingReferencesInspection extends AbstractBaseJavaLocalInspecti } /** - * This method manipulates the PSI tree to replace 'a==b' with 'a.equals(b) - * or 'a!=b' with '!a.equals(b)' + * This method manipulates the PSI tree to replace 'a==b' with 'a.equals(b)' or 'a!=b' with '!a.equals(b)'. * * @param project The project that contains the file being edited. * @param descriptor A problem found by this inspection. diff --git a/comparing_references_inspection/src/test/java/org/intellij/sdk/codeInspection/ComparingReferencesInspectionTest.java b/comparing_references_inspection/src/test/java/org/intellij/sdk/codeInspection/ComparingReferencesInspectionTest.java index cae4f7c24..d817dc8ba 100644 --- a/comparing_references_inspection/src/test/java/org/intellij/sdk/codeInspection/ComparingReferencesInspectionTest.java +++ b/comparing_references_inspection/src/test/java/org/intellij/sdk/codeInspection/ComparingReferencesInspectionTest.java @@ -11,13 +11,13 @@ import java.util.List; /** * Class for testing ComparingReferencesInspection. - * Requires idea.home.path to be set in build.gradle + * Requires {@code idea.home.path} to be set in build.gradle. * doTest() does the work for individual test cases. */ public class ComparingReferencesInspectionTest extends LightJavaCodeInsightFixtureTestCase { /** - * Defines path to files used for running tests + * Defines path to files used for running tests. * * @return The path from this module's root directory ($MODULE_WORKING_DIR$) to the * directory containing files for these tests. @@ -50,14 +50,14 @@ public class ComparingReferencesInspectionTest extends LightJavaCodeInsightFixtu } /** - * Test the "==" case + * Test the '==' case. */ public void testRelationalEq() { doTest("Eq"); } /** - * Test the "!=" case + * Test the '!=' case. */ public void testRelationalNeq() { doTest("Neq"); diff --git a/conditional_operator_intention/src/main/java/org/intellij/sdk/intention/ConditionalOperatorConverter.java b/conditional_operator_intention/src/main/java/org/intellij/sdk/intention/ConditionalOperatorConverter.java index d64e2e974..675bcfdfd 100644 --- a/conditional_operator_intention/src/main/java/org/intellij/sdk/intention/ConditionalOperatorConverter.java +++ b/conditional_operator_intention/src/main/java/org/intellij/sdk/intention/ConditionalOperatorConverter.java @@ -15,14 +15,13 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** - * Implements an intention action to replace a ternary statement with if-then-else + * Implements an intention action to replace a ternary statement with if-then-else. */ @NonNls public class ConditionalOperatorConverter extends PsiElementBaseIntentionAction implements IntentionAction { /** - * If this action is applicable, returns the text to be shown in the list of - * intention actions available. + * If this action is applicable, returns the text to be shown in the list of intention actions available. */ @NotNull public String getText() { @@ -30,8 +29,8 @@ public class ConditionalOperatorConverter extends PsiElementBaseIntentionAction } /** - * Returns text for name of this family of intentions. It is used to externalize - * "auto-show" state of intentions. + * Returns text for name of this family of intentions. + * It is used to externalize "auto-show" state of intentions. * It is also the directory name for the descriptions. * * @return the intention family name. @@ -42,20 +41,17 @@ public class ConditionalOperatorConverter extends PsiElementBaseIntentionAction } /** - * Checks whether this intention is available at the caret offset in file - the caret - * must sit just before a "?" character in a ternary statement. If this condition is met, - * this intention's entry is shown in the available intentions list. - *

- * Note: this method must do its checks quickly and return. + * Checks whether this intention is available at the caret offset in file - the caret must sit just before a "?" + * character in a ternary statement. If this condition is met, this intention's entry is shown in the available + * intentions list. + * + *

Note: this method must do its checks quickly and return.

* * @param project a reference to the Project object being edited. * @param editor a reference to the object editing the project source * @param element a reference to the PSI element currently under the caret - * @return + * @return {@code true} if the caret is in a literal string element, so this functionality should be added to the + * intention menu or {@code false} for all other types of caret positions */ public boolean isAvailable(@NotNull Project project, Editor editor, @Nullable PsiElement element) { // Quick sanity check @@ -82,9 +78,8 @@ public class ConditionalOperatorConverter extends PsiElementBaseIntentionAction /** * Modifies the Psi to change a ternary expression to an if-then-else statement. - * If the ternary is part of a declaration, the declaration is separated and - * moved above the if-then-else statement. Called when user selects this intention action - * from the available intentions list. + * If the ternary is part of a declaration, the declaration is separated and moved above the if-then-else statement. + * Called when user selects this intention action from the available intentions list. * * @param project a reference to the Project object being edited. * @param editor a reference to the object editing the project source @@ -195,13 +190,10 @@ public class ConditionalOperatorConverter extends PsiElementBaseIntentionAction } /** - * Indicates this intention action expects the Psi framework to provide the write action - * context for any changes. + * Indicates this intention action expects the Psi framework to provide the write action context for any changes. * - * @return + * @return {@code true} if the intention requires a write action context to be provided or {@code false} if this + * intention action will start a write action */ public boolean startInWriteAction() { return true; diff --git a/conditional_operator_intention/src/test/java/org/intellij/sdk/intention/ConditionalOperatorConverterTest.java b/conditional_operator_intention/src/test/java/org/intellij/sdk/intention/ConditionalOperatorConverterTest.java index 670b33ac9..7baf95ec6 100644 --- a/conditional_operator_intention/src/test/java/org/intellij/sdk/intention/ConditionalOperatorConverterTest.java +++ b/conditional_operator_intention/src/test/java/org/intellij/sdk/intention/ConditionalOperatorConverterTest.java @@ -8,9 +8,9 @@ import org.junit.Assert; public class ConditionalOperatorConverterTest extends LightJavaCodeInsightFixtureTestCase { /** - * Defines path to files used for running tests + * Defines path to files used for running tests. * - * @return The path from this module's root directory ($MODULE_WORKING_DIR$) to the + * @return The path from this module's root directory ({@code $MODULE_WORKING_DIR$}) to the * directory containing files for these tests. */ @Override diff --git a/editor_basics/src/main/java/org/intellij/sdk/editor/EditorAreaIllustration.java b/editor_basics/src/main/java/org/intellij/sdk/editor/EditorAreaIllustration.java index 9cbe8cc9b..9ac17489b 100644 --- a/editor_basics/src/main/java/org/intellij/sdk/editor/EditorAreaIllustration.java +++ b/editor_basics/src/main/java/org/intellij/sdk/editor/EditorAreaIllustration.java @@ -11,10 +11,9 @@ import com.intellij.openapi.ui.Messages; import org.jetbrains.annotations.NotNull; /** - * If conditions support it, makes a menu visible to display information - * about the caret. + * If conditions support it, makes a menu visible to display information about the caret. * - * @see com.intellij.openapi.actionSystem.AnAction + * @see AnAction */ public class EditorAreaIllustration extends AnAction { @@ -42,8 +41,10 @@ public class EditorAreaIllustration extends AnAction { /** * Sets visibility and enables this action menu item if: - * A project is open, - * An editor is active, + * * * @param e Event related to this action */ diff --git a/editor_basics/src/main/java/org/intellij/sdk/editor/EditorHandlerIllustration.java b/editor_basics/src/main/java/org/intellij/sdk/editor/EditorHandlerIllustration.java index 8972312d2..b1c2ca153 100644 --- a/editor_basics/src/main/java/org/intellij/sdk/editor/EditorHandlerIllustration.java +++ b/editor_basics/src/main/java/org/intellij/sdk/editor/EditorHandlerIllustration.java @@ -15,7 +15,7 @@ import org.jetbrains.annotations.NotNull; /** * Menu action to clone a new caret based on an existing one. * - * @see com.intellij.openapi.actionSystem.AnAction + * @see AnAction */ public class EditorHandlerIllustration extends AnAction { @@ -39,9 +39,11 @@ public class EditorHandlerIllustration extends AnAction { /** * Enables and sets visibility of this action menu item if: - * A project is open, - * An editor is active, - * At least one caret exists + * * * @param e Event related to this action */ diff --git a/editor_basics/src/main/java/org/intellij/sdk/editor/EditorIllustrationAction.java b/editor_basics/src/main/java/org/intellij/sdk/editor/EditorIllustrationAction.java index 8361750e7..5039ae956 100644 --- a/editor_basics/src/main/java/org/intellij/sdk/editor/EditorIllustrationAction.java +++ b/editor_basics/src/main/java/org/intellij/sdk/editor/EditorIllustrationAction.java @@ -15,7 +15,7 @@ import org.jetbrains.annotations.NotNull; /** * Menu action to replace a selection of characters with a fixed string. * - * @see com.intellij.openapi.actionSystem.AnAction + * @see AnAction */ public class EditorIllustrationAction extends AnAction { @@ -46,9 +46,11 @@ public class EditorIllustrationAction extends AnAction { /** * Sets visibility and enables this action menu item if: - * A project is open, - * An editor is active, - * Some characters are selected + * * * @param e Event related to this action */ diff --git a/editor_basics/src/main/java/org/intellij/sdk/editor/MyTypedHandler.java b/editor_basics/src/main/java/org/intellij/sdk/editor/MyTypedHandler.java index f872ab6ef..04680ccd5 100644 --- a/editor_basics/src/main/java/org/intellij/sdk/editor/MyTypedHandler.java +++ b/editor_basics/src/main/java/org/intellij/sdk/editor/MyTypedHandler.java @@ -11,8 +11,7 @@ import com.intellij.psi.PsiFile; import org.jetbrains.annotations.NotNull; /** - * This is a custom TypedHandlerDelegate that handles actions activated - * keystrokes in the editor. + * This is a custom {@link TypedHandlerDelegate} that handles actions activated keystrokes in the editor. * The execute method inserts a fixed string at Offset 0 of the document. * Document changes are made in the context of a write action. */ diff --git a/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetConfiguration.java b/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetConfiguration.java index 3b1ce7a15..21c7111c6 100644 --- a/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetConfiguration.java +++ b/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetConfiguration.java @@ -34,8 +34,7 @@ public class DemoFacetConfiguration implements FacetConfiguration, PersistentSta /** * Called by the IntelliJ Platform when this facet's state is loaded. - * The method can and will be called several times, if - * config files were externally changed while IDEA running. + * The method can and will be called several times, if config files were externally changed while IDEA running. */ @Override public void loadState(@NotNull DemoFacetState state) { @@ -47,7 +46,7 @@ public class DemoFacetConfiguration implements FacetConfiguration, PersistentSta * * @param context The context in which a facet is being added/deleted, or modified. * @param manager The manager which can be used to access custom validators. - * @return Array of DemoFacetEditorTabs. In this case size is always 1. + * @return Array of {@link DemoFacetEditorTab}. In this case size is always 1. */ @Override public FacetEditorTab[] createEditorTabs(FacetEditorContext context, FacetValidatorsManager manager) { diff --git a/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetEditorTab.java b/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetEditorTab.java index 910b44763..8daed50d5 100644 --- a/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetEditorTab.java +++ b/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetEditorTab.java @@ -24,13 +24,11 @@ public class DemoFacetEditorTab extends FacetEditorTab { private final JTextField myPath; /** - * Only org.intellij.sdk.facet.DemoFacetState is captured so it can be updated per user changes - * in the EditorTab. + * Only org.intellij.sdk.facet.DemoFacetState is captured so it can be updated per user changes in the EditorTab. * - * @param state org.intellij.sdk.facet.DemoFacetState object persisting org.intellij.sdk.facet.DemoFacet state. + * @param state {@link DemoFacetState} object persisting {@link DemoFacet} state. * @param context Facet editor context, can be used to get e.g. the current project module. - * @param validator Facet validator manager, can be used to get and apply a custom validator for - * this facet. + * @param validator Facet validator manager, can be used to get and apply a custom validator for this facet. */ public DemoFacetEditorTab(@NotNull DemoFacetState state, @NotNull FacetEditorContext context, @NotNull FacetValidatorsManager validator) { @@ -39,9 +37,9 @@ public class DemoFacetEditorTab extends FacetEditorTab { } /** - * Provides the JPanel displayed in the Preferences | Facet UI + * Provides the {@link JPanel} displayed in the Preferences | Facet UI * - * @return JPanel to be displayed in the org.intellij.sdk.facet.DemoFacetEditorTab. + * @return {@link JPanel} to be displayed in the {@link DemoFacetEditorTab}. */ @NotNull @Override @@ -54,7 +52,6 @@ public class DemoFacetEditorTab extends FacetEditorTab { return facetPanel; } - /** * @return the name of this facet for display in this editor tab. */ @@ -65,12 +62,10 @@ public class DemoFacetEditorTab extends FacetEditorTab { } /** - * Determines if the facet state entered in the UI differs - * from the currently stored state. - * Called when user changes text in myPath. + * Determines if the facet state entered in the UI differs from the currently stored state. + * Called when user changes text in {@link #myPath}. * - * @return {@code true} if the state returned from the panel's UI - * differs from the stored facet state. + * @return {@code true} if the state returned from the panel's UI differs from the stored facet state. */ @Override public boolean isModified() { @@ -80,6 +75,7 @@ public class DemoFacetEditorTab extends FacetEditorTab { /** * Stores new facet state (text) entered by the user. * Called when {@link #isModified()} returns true. + * * @throws ConfigurationException if anything generates an exception. */ @Override @@ -94,7 +90,7 @@ public class DemoFacetEditorTab extends FacetEditorTab { } /** - * Copies current org.intellij.sdk.facet.DemoFacetState into the myPath UI element. + * Copies current {@link DemoFacetState} into the {@link #myPath} UI element. * This method is called each time this editor tab is needed for display. */ @Override diff --git a/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetState.java b/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetState.java index 58b2bc275..fbfa1768f 100644 --- a/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetState.java +++ b/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetState.java @@ -27,5 +27,4 @@ public class DemoFacetState { myPathToSdk = newPath; } - } diff --git a/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetType.java b/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetType.java index 2ad43f971..387e87aaf 100644 --- a/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetType.java +++ b/facet_basics/src/main/java/org/intellij/sdk/facet/DemoFacetType.java @@ -14,9 +14,9 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; /** - * Defines the type, id, and name of the {@link DemoFacet}. Provides creation of DemoFacet - * and associated Configuration. - * Allows application of this facet to all ModuleTypes. + * Defines the type, id, and name of the {@link DemoFacet}. + * Provides creation of {@link DemoFacet} and associated Configuration. + * Allows application of this facet to all {@link ModuleType} instances. */ public class DemoFacetType extends FacetType { diff --git a/inspection_basics/src/main/java/org/intellij/sdk/inspection/DemoCodeInspection.java b/inspection_basics/src/main/java/org/intellij/sdk/inspection/DemoCodeInspection.java index dff347146..0abd98c2d 100644 --- a/inspection_basics/src/main/java/org/intellij/sdk/inspection/DemoCodeInspection.java +++ b/inspection_basics/src/main/java/org/intellij/sdk/inspection/DemoCodeInspection.java @@ -9,12 +9,12 @@ import org.jetbrains.annotations.NotNull; public class DemoCodeInspection extends LocalInspectionTool { /** - * This method is overridden to provide a custom visitor + * This method is overridden to provide a custom visitor. * The visitor must not be recursive and must be thread-safe. * * @param holder object for visitor to register problems found. * @param isOnTheFly true if inspection was run in non-batch mode - * @return DemoInspectionVisitor. + * @return {@link DemoInspectionVisitor} instance */ @NotNull @Override diff --git a/max_opened_projects/src/main/java/org/intellij/sdk/maxOpenProjects/ProjectCountingService.java b/max_opened_projects/src/main/java/org/intellij/sdk/maxOpenProjects/ProjectCountingService.java index 886cfb062..ca1df4dca 100644 --- a/max_opened_projects/src/main/java/org/intellij/sdk/maxOpenProjects/ProjectCountingService.java +++ b/max_opened_projects/src/main/java/org/intellij/sdk/maxOpenProjects/ProjectCountingService.java @@ -3,14 +3,18 @@ package org.intellij.sdk.maxOpenProjects; /** - * Application service implementation to keep a running count of - * how many projects are open at a given time. + * Application service implementation to keep a running count of how many projects are open at a given time. */ public class ProjectCountingService { - // Sets the maximum allowed number of opened projects. + /** + * Sets the maximum allowed number of opened projects. + */ private final static int MAX_OPEN_PRJ_LIMIT = 3; - // The count of open projects must always be >= 0 + + /** + * The count of open projects must always be >= 0. + */ private int myOpenProjectCount = 0; public void incrProjectCount() { diff --git a/max_opened_projects/src/main/java/org/intellij/sdk/maxOpenProjects/ProjectOpenCloseListener.java b/max_opened_projects/src/main/java/org/intellij/sdk/maxOpenProjects/ProjectOpenCloseListener.java index 288a6f8c6..ddedbd3f0 100644 --- a/max_opened_projects/src/main/java/org/intellij/sdk/maxOpenProjects/ProjectOpenCloseListener.java +++ b/max_opened_projects/src/main/java/org/intellij/sdk/maxOpenProjects/ProjectOpenCloseListener.java @@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull; /** * Listener to detect project open and close. - * Depends on org.intellij.sdk.maxOpenProjects.ProjectCountingService + * Depends on {@link ProjectCountingService} */ public class ProjectOpenCloseListener implements ProjectManagerListener { diff --git a/product_specific/pycharm_basics/src/main/java/org/intellij/sdk/pycharm/PopupDialogAction.java b/product_specific/pycharm_basics/src/main/java/org/intellij/sdk/pycharm/PopupDialogAction.java index a85f8d51b..afbd2b8aa 100644 --- a/product_specific/pycharm_basics/src/main/java/org/intellij/sdk/pycharm/PopupDialogAction.java +++ b/product_specific/pycharm_basics/src/main/java/org/intellij/sdk/pycharm/PopupDialogAction.java @@ -18,8 +18,7 @@ public class PopupDialogAction extends AnAction { /** * Gives the user feedback when the dynamic action menu is chosen. - * Pops a simple message dialog. See the psi_demo plugin for an - * example of how to use AnActionEvent to access data. + * Pops a simple message dialog. See the psi_demo plugin for an example of how to use AnActionEvent to access data. * * @param event Event received when the associated menu item is chosen. */ diff --git a/project_view_pane/src/main/java/org/intellij/sdk/view/pane/ImagesProjectNode.java b/project_view_pane/src/main/java/org/intellij/sdk/view/pane/ImagesProjectNode.java index d599fa1b0..5f7ffd8a2 100644 --- a/project_view_pane/src/main/java/org/intellij/sdk/view/pane/ImagesProjectNode.java +++ b/project_view_pane/src/main/java/org/intellij/sdk/view/pane/ImagesProjectNode.java @@ -120,7 +120,6 @@ public class ImagesProjectNode extends AbstractTreeNode { data.setPresentableText(getValue().getName()); } - @Override public boolean canNavigate() { return !getValue().isDirectory(); diff --git a/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoConfigurationFactory.java b/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoConfigurationFactory.java index 5c6852512..0281ef33a 100644 --- a/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoConfigurationFactory.java +++ b/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoConfigurationFactory.java @@ -9,6 +9,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public class DemoConfigurationFactory extends ConfigurationFactory { + private static final String FACTORY_NAME = "Demo configuration factory"; protected DemoConfigurationFactory(ConfigurationType type) { @@ -32,4 +33,5 @@ public class DemoConfigurationFactory extends ConfigurationFactory { public Class getOptionsClass() { return DemoRunConfigurationOptions.class; } + } diff --git a/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoRunConfiguration.java b/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoRunConfiguration.java index 766d25ea5..adaa31700 100644 --- a/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoRunConfiguration.java +++ b/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoRunConfiguration.java @@ -16,6 +16,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public class DemoRunConfiguration extends RunConfigurationBase { + protected DemoRunConfiguration(Project project, ConfigurationFactory factory, String name) { super(project, factory, name); } @@ -58,4 +59,5 @@ public class DemoRunConfiguration extends RunConfigurationBase myScriptName = string("").provideDelegate(this, "scriptName"); public String getScriptName() { @@ -15,4 +16,5 @@ public class DemoRunConfigurationOptions extends RunConfigurationOptions { public void setScriptName(String scriptName) { myScriptName.setValue(this, scriptName); } + } diff --git a/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoRunConfigurationType.java b/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoRunConfigurationType.java index d3554fd1f..b269cd2f4 100644 --- a/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoRunConfigurationType.java +++ b/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoRunConfigurationType.java @@ -10,6 +10,7 @@ import org.jetbrains.annotations.NotNull; import javax.swing.*; public class DemoRunConfigurationType implements ConfigurationType { + @NotNull @Override public String getDisplayName() { @@ -36,4 +37,5 @@ public class DemoRunConfigurationType implements ConfigurationType { public ConfigurationFactory[] getConfigurationFactories() { return new ConfigurationFactory[]{new DemoConfigurationFactory(this)}; } + } diff --git a/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoSettingsEditor.java b/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoSettingsEditor.java index 247be2aef..4e6f05203 100644 --- a/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoSettingsEditor.java +++ b/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoSettingsEditor.java @@ -10,6 +10,7 @@ import org.jetbrains.annotations.NotNull; import javax.swing.*; public class DemoSettingsEditor extends SettingsEditor { + private JPanel myPanel; private LabeledComponent myScriptName; @@ -33,4 +34,5 @@ public class DemoSettingsEditor extends SettingsEditor { myScriptName = new LabeledComponent<>(); myScriptName.setComponent(new TextFieldWithBrowseButton()); } + } diff --git a/settings/src/main/java/org/intellij/sdk/settings/AppSettingsComponent.java b/settings/src/main/java/org/intellij/sdk/settings/AppSettingsComponent.java index 6f2b9c663..ef7a37788 100644 --- a/settings/src/main/java/org/intellij/sdk/settings/AppSettingsComponent.java +++ b/settings/src/main/java/org/intellij/sdk/settings/AppSettingsComponent.java @@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull; import javax.swing.*; /** - * Supports creating and managing a JPanel for the Settings Dialog. + * Supports creating and managing a {@link JPanel} for the Settings Dialog. */ public class AppSettingsComponent { diff --git a/settings/src/main/java/org/intellij/sdk/settings/AppSettingsState.java b/settings/src/main/java/org/intellij/sdk/settings/AppSettingsState.java index 2578a8669..7cec81693 100644 --- a/settings/src/main/java/org/intellij/sdk/settings/AppSettingsState.java +++ b/settings/src/main/java/org/intellij/sdk/settings/AppSettingsState.java @@ -12,7 +12,7 @@ import org.jetbrains.annotations.Nullable; /** * Supports storing the application settings in a persistent way. - * The State and Storage annotations define the name of the data and the file name where + * The {@link State} and {@link Storage} annotations define the name of the data and the file name where * these persistent application settings are stored. */ @State( diff --git a/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleCodeStyleSettingsProvider.java b/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleCodeStyleSettingsProvider.java index f58602cd4..db3d0556b 100644 --- a/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleCodeStyleSettingsProvider.java +++ b/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleCodeStyleSettingsProvider.java @@ -25,7 +25,6 @@ public class SimpleCodeStyleSettingsProvider extends CodeStyleSettingsProvider { return "Simple"; } - @NotNull public CodeStyleConfigurable createConfigurable(@NotNull CodeStyleSettings settings, @NotNull CodeStyleSettings modelSettings) { return new CodeStyleAbstractConfigurable(settings, modelSettings, this.getConfigurableDisplayName()) { diff --git a/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleFileTypeFactory.java b/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleFileTypeFactory.java index dfa15cdf6..ffdb377e8 100644 --- a/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleFileTypeFactory.java +++ b/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleFileTypeFactory.java @@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull; /** * Note: This class is only used with the fileTypeFactory extension point - * for versions of the IntelliJ Platform prior to v2019.2 + * for versions of the IntelliJ Platform prior to v2019.2. */ public class SimpleFileTypeFactory extends FileTypeFactory { diff --git a/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleUtil.java b/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleUtil.java index 764b3377c..8341323d7 100644 --- a/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleUtil.java +++ b/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleUtil.java @@ -18,7 +18,13 @@ import java.util.List; public class SimpleUtil { - // Searches the entire project for Simple language files with instances of the Simple property with the given key + /** + * Searches the entire project for Simple language files with instances of the Simple property with the given key. + * + * @param project current project + * @param key to check + * @return matching properties + */ public static List findProperties(Project project, String key) { List result = new ArrayList<>(); Collection virtualFiles = diff --git a/simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleCodeInsightTest.java b/simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleCodeInsightTest.java index 1142c668b..46ebefef4 100644 --- a/simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleCodeInsightTest.java +++ b/simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleCodeInsightTest.java @@ -20,7 +20,6 @@ import java.util.List; public class SimpleCodeInsightTest extends LightJavaCodeInsightFixtureTestCase { /** - * * @return path to test data file directory relative to working directory in the run configuration for this test. */ @Override @@ -84,4 +83,5 @@ public class SimpleCodeInsightTest extends LightJavaCodeInsightFixtureTestCase { PsiElement element = myFixture.getFile().findElementAt(myFixture.getCaretOffset()).getParent(); assertEquals("https://en.wikipedia.org/", ((SimpleProperty) element.getReferences()[0].resolve()).getValue()); } + } diff --git a/simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleParsingTest.java b/simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleParsingTest.java index b98d4ee52..964daf503 100644 --- a/simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleParsingTest.java +++ b/simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleParsingTest.java @@ -5,6 +5,7 @@ package org.intellij.sdk.language; import com.intellij.testFramework.ParsingTestCase; public class SimpleParsingTest extends ParsingTestCase { + public SimpleParsingTest() { super("", "simple", new SimpleParserDefinition()); } @@ -14,7 +15,6 @@ public class SimpleParsingTest extends ParsingTestCase { } /** - * * @return path to test data file directory relative to root of this module. */ @Override @@ -31,4 +31,5 @@ public class SimpleParsingTest extends ParsingTestCase { protected boolean includeRanges() { return true; } + } diff --git a/tool_window/src/main/java/org/intellij/sdk/toolWindow/MyToolWindowFactory.java b/tool_window/src/main/java/org/intellij/sdk/toolWindow/MyToolWindowFactory.java index 529b11b47..56dd5a1f4 100644 --- a/tool_window/src/main/java/org/intellij/sdk/toolWindow/MyToolWindowFactory.java +++ b/tool_window/src/main/java/org/intellij/sdk/toolWindow/MyToolWindowFactory.java @@ -11,7 +11,12 @@ import org.jetbrains.annotations.NotNull; public class MyToolWindowFactory implements ToolWindowFactory { - // Create the tool window content. + /** + * Create the tool window content. + * + * @param project current project + * @param toolWindow current tool window + */ public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) { MyToolWindow myToolWindow = new MyToolWindow(toolWindow); ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();