Permalink
Browse files

Aman - Plugin is now built on and supports IntelliJ IDEA 11.0.1. Upda…

…ted license information to include 2012. Corrected typo in menu action for creating new story file Issue #5.
  • Loading branch information...
1 parent 4b5e424 commit a53ce945a2d9012e6f67984f355feaa7aac2b299 @kumaraman21 committed Jan 15, 2012
Showing with 44 additions and 65 deletions.
  1. +1 −1 IntelliJBehave.iml
  2. +1 −1 LICENSE.txt
  3. +2 −2 META-INF/plugin.xml
  4. +1 −1 src/com/github/kumaraman21/intellijbehave/codeInspector/UndefinedStepsInspection.java
  5. +1 −1 src/com/github/kumaraman21/intellijbehave/codeInspector/UndefinedStepsInspectionProvider.java
  6. +1 −1 src/com/github/kumaraman21/intellijbehave/codeInspector/UnusedStepsInspection.java
  7. +1 −1 src/com/github/kumaraman21/intellijbehave/codeInspector/UnusedStepsInspectionProvider.java
  8. +1 −1 src/com/github/kumaraman21/intellijbehave/commenter/StoryCommenter.java
  9. +6 −15 src/com/github/kumaraman21/intellijbehave/creator/CreateStoryAction.java
  10. +1 −1 src/com/github/kumaraman21/intellijbehave/highlighter/StoryLexer.java
  11. +1 −1 src/com/github/kumaraman21/intellijbehave/highlighter/StorySyntaxHighlighter.java
  12. +1 −1 src/com/github/kumaraman21/intellijbehave/highlighter/StorySyntaxHighlightingLexer.java
  13. +1 −1 src/com/github/kumaraman21/intellijbehave/highlighter/StoryTokenType.java
  14. +1 −1 src/com/github/kumaraman21/intellijbehave/language/StoryFileType.java
  15. +1 −1 src/com/github/kumaraman21/intellijbehave/language/StoryFileTypeFactory.java
  16. +1 −1 src/com/github/kumaraman21/intellijbehave/language/StoryLanguage.java
  17. +1 −1 src/com/github/kumaraman21/intellijbehave/parser/StepPsiElement.java
  18. +1 −1 src/com/github/kumaraman21/intellijbehave/parser/StoryElementType.java
  19. +1 −1 src/com/github/kumaraman21/intellijbehave/parser/StoryFileImpl.java
  20. +1 −1 src/com/github/kumaraman21/intellijbehave/parser/StoryParser.java
  21. +1 −1 src/com/github/kumaraman21/intellijbehave/parser/StoryParserDefinition.java
  22. +1 −1 src/com/github/kumaraman21/intellijbehave/resolver/DeclaredAnnotationSet.java
  23. +1 −1 src/com/github/kumaraman21/intellijbehave/resolver/StepPsiReference.java
  24. +1 −1 src/com/github/kumaraman21/intellijbehave/resolver/StoryAnnotator.java
  25. +1 −1 src/com/github/kumaraman21/intellijbehave/runner/RunStoryAction.java
  26. +1 −1 src/com/github/kumaraman21/intellijbehave/runner/StoryRunnerConfigurationType.java
  27. +1 −1 src/com/github/kumaraman21/intellijbehave/settings/JBehaveConfigurable.java
  28. +1 −1 src/com/github/kumaraman21/intellijbehave/settings/JBehaveSettings.java
  29. +1 −1 src/com/github/kumaraman21/intellijbehave/settings/JBehaveSettingsPanel.java
  30. +1 −1 src/com/github/kumaraman21/intellijbehave/template/JBehaveTemplateLoaderComponent.java
  31. +1 −1 src/com/github/kumaraman21/intellijbehave/utility/NodeToPsiElement.java
  32. +1 −1 src/com/github/kumaraman21/intellijbehave/utility/NodeToStepPsiElement.java
  33. +3 −15 src/com/github/kumaraman21/intellijbehave/utility/ProjectFinder.java
  34. +1 −1 src/com/github/kumaraman21/intellijbehave/utility/StepTypeMappings.java
  35. +1 −1 src/inspectionDescriptions/UndefinedStep.html
  36. +1 −1 src/inspectionDescriptions/UnusedStepDeclaration.html
View
@@ -9,7 +9,7 @@
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/resources" isTestSource="false" />
</content>
- <orderEntry type="jdk" jdkName="IDEA IC-107.587" jdkType="IDEA JDK" />
+ <orderEntry type="jdk" jdkName="IDEA IC-111.167" jdkType="IDEA JDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
View
@@ -1,4 +1,4 @@
-Copyright 2011 Aman Kumar
+Copyright 2011-12 Aman Kumar
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
View
@@ -1,5 +1,5 @@
<!--
- ~ Copyright 2011 Aman Kumar
+ ~ Copyright 2011-12 Aman Kumar
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@
<actions>
<action id="IntelliJBehave.NewJBehaveStory" class="com.github.kumaraman21.intellijbehave.creator.CreateStoryAction"
- text="JBhehave Story" description="Create New JBehave Story">
+ text="JBehave Story" description="Create New JBehave Story">
<add-to-group group-id="NewGroup1" anchor="after" relative-to-action="NewClass"/>
<keyboard-shortcut keymap="$default" first-keystroke="ctrl alt S"/>
</action>
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,33 +34,24 @@
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiFileFactory;
import com.intellij.psi.codeStyle.CodeStyleManager;
-import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;
import static com.github.kumaraman21.intellijbehave.language.StoryFileType.STORY_FILE_TYPE;
public class CreateStoryAction extends CreateElementActionBase {
public CreateStoryAction() {
- super(IdeBundle.message("action.create.new.filetype", STORY_FILE_TYPE.getName()),
- STORY_FILE_TYPE.getDescription(), STORY_FILE_TYPE.getIcon());
+ super("Create New Story File", STORY_FILE_TYPE.getDescription(), STORY_FILE_TYPE.getIcon());
}
@NotNull
@Override
protected PsiElement[] invokeDialog(Project project, PsiDirectory directory) {
CreateElementActionBase.MyInputValidator validator = new CreateElementActionBase.MyInputValidator(project, directory);
- Messages.showInputDialog(project, IdeBundle.message("prompt.enter.new.filetype.name", STORY_FILE_TYPE.getName()),
- IdeBundle.message("title.new.filetype", STORY_FILE_TYPE.getName()), Messages.getQuestionIcon(), "", validator);
+ Messages.showInputDialog(project, "Enter a new file name:", "New Story File", Messages.getQuestionIcon(), "", validator);
return validator.getCreatedElements();
}
- @Override
- protected void checkBeforeCreate(String newName, PsiDirectory directory) throws IncorrectOperationException {
- newName = getFileName(newName);
- directory.checkCreateFile(newName);
- }
-
@NotNull
@Override
protected PsiElement[] create(String newName, PsiDirectory directory) throws Exception {
@@ -86,17 +77,17 @@ protected void checkBeforeCreate(String newName, PsiDirectory directory) throws
@Override
protected String getErrorTitle() {
- return IdeBundle.message("title.cannot.create.filetype", STORY_FILE_TYPE.getName());
+ return "Cannot Create Story File";
}
@Override
protected String getCommandName() {
- return IdeBundle.message("command.name.create.new.file", STORY_FILE_TYPE.getName());
+ return "Create Story File";
}
@Override
protected String getActionName(PsiDirectory directory, String newName) {
- return IdeBundle.message("progress.creating.filetype.in.directory", STORY_FILE_TYPE.getName(), newName, directory.getName());
+ return IdeBundle.message("progress.creating.file", STORY_FILE_TYPE.getName(), newName, directory.getName());
}
public void update(final AnActionEvent e) {
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,26 +15,14 @@
*/
package com.github.kumaraman21.intellijbehave.utility;
-import com.intellij.ide.DataManager;
-import com.intellij.openapi.actionSystem.DataContext;
-import com.intellij.openapi.actionSystem.DataKeys;
import com.intellij.openapi.project.Project;
+import com.intellij.openapi.project.ProjectManager;
import org.jetbrains.annotations.NotNull;
public class ProjectFinder {
@NotNull
public static Project getCurrentProject() {
- Project project = null;
-
- // Perhaps because of using deprecated API here, project is null sometimes
- // Keep trying till we get non null project
- while(project == null) {
- //Todo: remove deprecated api use
- DataContext dataContext = DataManager.getInstance().getDataContext();
- project = DataKeys.PROJECT.getData(dataContext);
- }
-
- return project;
+ return ProjectManager.getInstance().getOpenProjects()[0];
}
}
@@ -1,5 +1,5 @@
/*
- * Copyright 2011 Aman Kumar
+ * Copyright 2011-12 Aman Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
<!--
- ~ Copyright 2011 Aman Kumar
+ ~ Copyright 2011-12 Aman Kumar
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
<!--
- ~ Copyright 2011 Aman Kumar
+ ~ Copyright 2011-12 Aman Kumar
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.

0 comments on commit a53ce94

Please sign in to comment.