Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

invalid node fixed

searcher fixed
  • Loading branch information...
commit 89b858486139f7d20921c7aeba9a8acdb90ff3de 1 parent c249c27
@fearfall fearfall authored
Showing with 299 additions and 426 deletions.
  1. +107 −161 .idea/workspace.xml
  2. +0 −1  src/patch/ReviewCommitHandlerFactory.java
  3. +0 −4 src/patch/ReviewPatchExtensionPoint.java
  4. +2 −2 src/reviewresult/Review.java
  5. +27 −26 src/reviewresult/ReviewManager.java
  6. +0 −3  src/reviewresult/ReviewsChangedListener.java
  7. +0 −3  src/reviewresult/persistent/ReviewBean.java
  8. +0 −1  src/reviewresult/persistent/ReviewItem.java
  9. +0 −12 src/ui/actions/AddReviewAction.java
  10. +3 −6 src/ui/actions/DeleteReviewAction.java
  11. +0 −8 src/ui/actions/EditReviewAction.java
  12. +46 −33 src/ui/actions/ReviewActionManager.java
  13. +6 −12 src/ui/forms/EditReviewForm.java
  14. +8 −6 src/ui/reviewpoint/ReviewPoint.java
  15. +7 −6 src/ui/reviewpoint/ReviewPointManager.java
  16. +21 −16 src/ui/reviewtoolwindow/ReviewPanel.java
  17. +0 −2  src/ui/reviewtoolwindow/ReviewToolWindowActionManager.java
  18. +0 −26 src/ui/reviewtoolwindow/ReviewToolWindowSettings.java
  19. +1 −1  src/ui/reviewtoolwindow/ReviewTreeStructure.java
  20. +0 −11 src/ui/reviewtoolwindow/ReviewView.java
  21. +10 −5 src/ui/reviewtoolwindow/ReviewsPreviewPanel.java
  22. +37 −18 src/ui/reviewtoolwindow/Searcher.java
  23. +15 −20 src/ui/reviewtoolwindow/nodes/FileNode.java
  24. +3 −14 src/ui/reviewtoolwindow/nodes/ModuleNode.java
  25. +3 −6 src/ui/reviewtoolwindow/nodes/PlainNode.java
  26. +3 −20 src/ui/reviewtoolwindow/nodes/ReviewNode.java
  27. +0 −3  src/ui/reviewtoolwindow/nodes/RootNode.java
View
268 .idea/workspace.xml
@@ -1,23 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
- <list default="true" id="79011e2a-efca-420a-a259-2c0cb35195ed" name="Default" comment="preview panel added">
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/tests/ReviewTreeStructureTest.java" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewToolWindowActionManager.java" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
+ <list default="true" id="79011e2a-efca-420a-a259-2c0cb35195ed" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/patch/ReviewCommitHandlerFactory.java" afterPath="$PROJECT_DIR$/src/patch/ReviewCommitHandlerFactory.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/patch/ReviewPatchExtensionPoint.java" afterPath="$PROJECT_DIR$/src/patch/ReviewPatchExtensionPoint.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/reviewresult/Review.java" afterPath="$PROJECT_DIR$/src/reviewresult/Review.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/reviewresult/ReviewManager.java" afterPath="$PROJECT_DIR$/src/reviewresult/ReviewManager.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/reviewresult/ReviewsChangedListener.java" afterPath="$PROJECT_DIR$/src/reviewresult/ReviewsChangedListener.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/reviewresult/persistent/ReviewBean.java" afterPath="$PROJECT_DIR$/src/reviewresult/persistent/ReviewBean.java" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/tests/ReviewManagerTest.java" afterPath="$PROJECT_DIR$/src/tests/ReviewManagerTest.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/reviewresult/persistent/ReviewItem.java" afterPath="$PROJECT_DIR$/src/reviewresult/persistent/ReviewItem.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/actions/AddReviewAction.java" afterPath="$PROJECT_DIR$/src/ui/actions/AddReviewAction.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/actions/DeleteReviewAction.java" afterPath="$PROJECT_DIR$/src/ui/actions/DeleteReviewAction.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/actions/EditReviewAction.java" afterPath="$PROJECT_DIR$/src/ui/actions/EditReviewAction.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/actions/ReviewActionManager.java" afterPath="$PROJECT_DIR$/src/ui/actions/ReviewActionManager.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/forms/EditReviewForm.java" afterPath="$PROJECT_DIR$/src/ui/forms/EditReviewForm.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/reviewpoint/ReviewPoint.java" afterPath="$PROJECT_DIR$/src/ui/reviewpoint/ReviewPoint.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/reviewpoint/ReviewPointManager.java" afterPath="$PROJECT_DIR$/src/ui/reviewpoint/ReviewPointManager.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewPanel.java" afterPath="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewPanel.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewToolWindowActionManager.java" afterPath="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewToolWindowActionManager.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewToolWindowSettings.java" afterPath="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewToolWindowSettings.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewTreeStructure.java" afterPath="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewTreeStructure.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewView.java" afterPath="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewView.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewsPreviewPanel.java" afterPath="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewsPreviewPanel.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/reviewtoolwindow/Searcher.java" afterPath="$PROJECT_DIR$/src/ui/reviewtoolwindow/Searcher.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/FileNode.java" afterPath="$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/FileNode.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/ModuleNode.java" afterPath="$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/ModuleNode.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/PlainNode.java" afterPath="$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/PlainNode.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/ReviewNode.java" afterPath="$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/ReviewNode.java" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/RootNode.java" afterPath="$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/RootNode.java" />
</list>
<ignored path="codereview4intellij.iws" />
<ignored path=".idea/workspace.xml" />
@@ -137,8 +148,8 @@
<property name="field_breakpoints_groupByClasses" value="true" />
<property name="method_breakpoints_groupByClasses" value="true" />
<property name="exception_breakpoints_viewId" value="TABLE" />
- <property name="field_breakpoints_viewId" value="TABLE" />
<property name="exception_breakpoints_groupByClasses" value="true" />
+ <property name="field_breakpoints_viewId" value="TABLE" />
<property name="method_breakpoints_groupByMethods" value="false" />
</ui_properties>
</component>
@@ -147,77 +158,19 @@
</component>
<component name="FileEditorManager">
<leaf>
- <file leaf-file-name="ReviewTreeStructure.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewTreeStructure.java">
- <provider selected="true" editor-type-id="text-editor">
- <state line="130" column="37" selection-start="4530" selection-end="4530" vertical-scroll-proportion="0.0">
- <folding>
- <element signature="method#removeReview#0;class#ReviewTreeStructure#0" expanded="false" />
- <element signature="method#findAncestorNode#0;class#ReviewTreeStructure#0" expanded="false" />
- <element signature="method#findInvalidAncestorNode#0;class#ReviewTreeStructure#0" expanded="false" />
- </folding>
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="ReviewPanel.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewPanel.java">
- <provider selected="true" editor-type-id="text-editor">
- <state line="284" column="0" selection-start="11001" selection-end="11001" vertical-scroll-proportion="0.0">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="ReviewManager.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/reviewresult/ReviewManager.java">
- <provider selected="true" editor-type-id="text-editor">
- <state line="55" column="48" selection-start="1812" selection-end="1812" vertical-scroll-proportion="0.0">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="Review.java" pinned="false" current="true" current-in-tab="true">
- <entry file="file://$PROJECT_DIR$/src/reviewresult/Review.java">
- <provider selected="true" editor-type-id="text-editor">
- <state line="72" column="26" selection-start="2336" selection-end="2336" vertical-scroll-proportion="0.41025642">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="ReviewBean.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/reviewresult/persistent/ReviewBean.java">
- <provider selected="true" editor-type-id="text-editor">
- <state line="120" column="10" selection-start="2577" selection-end="2577" vertical-scroll-proportion="0.0">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="testReview.xml" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/testReview.xml">
- <provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="PlainNode.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/PlainNode.java">
+ <file leaf-file-name="ReviewNode.java" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/ReviewNode.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="19" column="11" selection-start="512" selection-end="512" vertical-scroll-proportion="0.0">
+ <state line="29" column="28" selection-start="962" selection-end="962" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="ReviewTreeStructureTest.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/src/tests/ReviewTreeStructureTest.java">
+ <file leaf-file-name="ReviewPanel.java" pinned="false" current="true" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewPanel.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="93" column="75" selection-start="3321" selection-end="3321" vertical-scroll-proportion="0.0">
+ <state line="245" column="64" selection-start="9700" selection-end="9700" vertical-scroll-proportion="0.35095447">
<folding />
</state>
</provider>
@@ -237,22 +190,22 @@
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
- <option value="$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/FileNode.java" />
- <option value="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewsPreviewPanel.java" />
- <option value="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewToolWindowActionManager.java" />
- <option value="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewToolWindowSettings.java" />
- <option value="$PROJECT_DIR$/src/tests/ReviewManagerTest.java" />
- <option value="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewPanel.java" />
- <option value="$PROJECT_DIR$/src/ui/forms/EditReviewForm.java" />
- <option value="$PROJECT_DIR$/src/ui/actions/ReviewActionManager.java" />
- <option value="$PROJECT_DIR$/src/patch/ReviewCommitHandlerFactory.java" />
- <option value="$PROJECT_DIR$/src/patch/ReviewPatchExtensionPoint.java" />
<option value="$PROJECT_DIR$/src/reviewresult/persistent/ReviewItem.java" />
- <option value="$PROJECT_DIR$/src/tests/ReviewTreeStructureTest.java" />
+ <option value="$PROJECT_DIR$/src/ui/actions/EditReviewAction.java" />
+ <option value="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewView.java" />
<option value="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewTreeStructure.java" />
- <option value="$PROJECT_DIR$/src/reviewresult/persistent/ReviewBean.java" />
+ <option value="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewsPreviewPanel.java" />
+ <option value="$PROJECT_DIR$/src/ui/actions/ReviewActionManager.java" />
+ <option value="$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/PlainNode.java" />
+ <option value="$PROJECT_DIR$/src/ui/reviewpoint/ReviewPointManager.java" />
<option value="$PROJECT_DIR$/src/reviewresult/ReviewManager.java" />
+ <option value="$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/FileNode.java" />
+ <option value="$PROJECT_DIR$/src/ui/actions/DeleteReviewAction.java" />
<option value="$PROJECT_DIR$/src/reviewresult/Review.java" />
+ <option value="$PROJECT_DIR$/src/ui/reviewpoint/ReviewPoint.java" />
+ <option value="$PROJECT_DIR$/src/ui/forms/EditReviewForm.java" />
+ <option value="$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewPanel.java" />
+ <option value="$PROJECT_DIR$/src/ui/reviewtoolwindow/Searcher.java" />
</list>
</option>
</component>
@@ -296,7 +249,7 @@
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectReloadState">
- <option name="STATE" value="1" />
+ <option name="STATE" value="0" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
@@ -311,6 +264,16 @@
<sortByType />
</navigator>
<panes>
+ <pane id="PackagesPane">
+ <subPane>
+ <PATH>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="codereview4intellij" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewProjectNode" />
+ </PATH_ELEMENT>
+ </PATH>
+ </subPane>
+ </pane>
<pane id="ProjectPane">
<subPane>
<PATH>
@@ -383,7 +346,11 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="reviewpoint" />
+ <option name="myItemId" value="reviewtoolwindow" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="nodes" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -405,7 +372,7 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="forms" />
+ <option name="myItemId" value="reviewpoint" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -427,7 +394,7 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="actions" />
+ <option name="myItemId" value="forms" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -445,7 +412,11 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="reviewresult" />
+ <option name="myItemId" value="ui" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="actions" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -463,11 +434,7 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="reviewresult" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="persistent" />
+ <option name="myItemId" value="patch" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -481,11 +448,7 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="src" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="patch" />
+ <option name="myItemId" value="META-INF" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -499,24 +462,14 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="META-INF" />
+ <option name="myItemId" value=".idea" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
- <pane id="Scope" />
<pane id="Favorites" />
- <pane id="PackagesPane">
- <subPane>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="codereview4intellij" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewProjectNode" />
- </PATH_ELEMENT>
- </PATH>
- </subPane>
- </pane>
+ <pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
@@ -537,9 +490,9 @@
<property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLanguage" value="Java" />
<property name="MemberChooser.showClasses" value="true" />
<property name="GoToClass.includeLibraries" value="false" />
- <property name="options.splitter.details.proportions" value="0.2" />
- <property name="options.searchVisible" value="true" />
<property name="dynamic.classpath" value="false" />
+ <property name="options.searchVisible" value="true" />
+ <property name="options.splitter.details.proportions" value="0.2" />
</component>
<component name="RecentsManager">
<key name="CreateTestDialog.RecentsKey">
@@ -807,16 +760,16 @@
<layout>
<window_info id="Changes" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.17974971" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.18653691" sideWeight="0.7201365" order="3" side_tool="false" content_ui="tabs" />
- <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.34015927" sideWeight="0.4935275" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
- <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4175199" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33788395" sideWeight="0.487055" order="1" side_tool="false" content_ui="tabs" />
+ <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.40159273" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3287827" sideWeight="0.5" order="14" side_tool="false" content_ui="tabs" />
- <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32992035" sideWeight="0.4935275" order="9" side_tool="false" content_ui="tabs" />
+ <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32902467" sideWeight="0.487055" order="9" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32764506" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33819953" sideWeight="0.19681457" order="1" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32927817" sideWeight="0.71786124" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32765612" sideWeight="0.8202503" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32278994" sideWeight="0.8202503" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32992035" sideWeight="0.5" order="12" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.37883958" sideWeight="0.5" order="13" side_tool="false" content_ui="tabs" />
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32927817" sideWeight="0.7201365" order="2" side_tool="false" content_ui="tabs" />
@@ -825,7 +778,7 @@
<window_info id="Analyze Dataflow to" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32992035" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Analyze Dataflow from" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="11" side_tool="true" content_ui="tabs" />
- <window_info id="Code review" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.33019978" sideWeight="0.5" order="8" side_tool="true" content_ui="tabs" />
+ <window_info id="Code review" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.33842537" sideWeight="0.50647247" order="8" side_tool="true" content_ui="tabs" />
<window_info id="Sample Calendar" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="4" side_tool="true" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24979724" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3993174" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
@@ -856,7 +809,7 @@
<option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
<option name="DEFAULT_PATCH_EXTENSION" value="patch" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
- <option name="LAST_COMMIT_MESSAGE" value="preview panel added" />
+ <option name="LAST_COMMIT_MESSAGE" value="tree structure fixed&#10;keyStrokes for balloon added&#10;wrong reviewFiles are handled&#10;" />
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
@@ -876,6 +829,7 @@
<MESSAGE value="export/import to file added&#10;tree partially broken&#10;all buttons work fine&#10;DoubleClick on selected node shows balloon with comments for it&#10;" />
<MESSAGE value="tree structure listeners added&#10;" />
<MESSAGE value="preview panel added" />
+ <MESSAGE value="tree structure fixed&#10;keyStrokes for balloon added&#10;wrong reviewFiles are handled&#10;" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
@@ -885,114 +839,106 @@
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="editorHistoryManager">
- <entry file="file://$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/ReviewNode.java">
+ <entry file="file://$PROJECT_DIR$/testReview.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="77" column="30" selection-start="3074" selection-end="3074" vertical-scroll-proportion="0.33205375" />
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/ui/reviewpoint/ReviewPoint.java">
+ <entry file="file://$PROJECT_DIR$/src/ui/actions/DeleteReviewAction.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="55" column="34" selection-start="2181" selection-end="2181" vertical-scroll-proportion="0.33205375" />
+ <state line="44" column="35" selection-start="1500" selection-end="1500" vertical-scroll-proportion="0.66865313" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/reviewresult/ReviewChangedTopics.java">
+ <entry file="file://$PROJECT_DIR$/src/reviewresult/persistent/ReviewItem.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="5" column="0" selection-start="69" selection-end="69" vertical-scroll-proportion="0.18763797">
- <folding />
- </state>
+ <state line="15" column="13" selection-start="292" selection-end="292" vertical-scroll-proportion="0.0" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/reviewresult/ReviewStatus.java">
+ <entry file="file://$USER_HOME$/idea/platform/platform-api/src/com/intellij/ide/util/treeView/PresentableNodeDescriptor.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="11" column="0" selection-start="138" selection-end="138" vertical-scroll-proportion="0.38636363">
- <folding />
- </state>
+ <state line="88" column="0" selection-start="2925" selection-end="2925" vertical-scroll-proportion="0.29580152" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/patch/ReviewCommitHandlerFactory.java">
+ <entry file="file://$PROJECT_DIR$/src/ui/reviewpoint/ReviewPoint.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="45" column="75" selection-start="1437" selection-end="1437" vertical-scroll-proportion="1.0">
- <folding>
- <element signature="method#getBeforeCheckinConfigurationPanel#0;class#ReviewCommitHandler#0;class#ReviewCommitHandlerFactory#0" expanded="false" />
- </folding>
+ <state line="134" column="46" selection-start="5260" selection-end="5260" vertical-scroll-proportion="0.31059682">
+ <folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/ui/forms/EditReviewForm.java">
+ <entry file="file://$PROJECT_DIR$/src/ui/actions/ReviewActionManager.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="84" column="51" selection-start="2935" selection-end="2935" vertical-scroll-proportion="0.53518516">
+ <state line="93" column="23" selection-start="3974" selection-end="3974" vertical-scroll-proportion="0.020706456">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/ModuleNode.java">
+ <entry file="file://$PROJECT_DIR$/src/reviewresult/persistent/ReviewBean.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="46" column="11" selection-start="1632" selection-end="1632" vertical-scroll-proportion="0.3677686" />
+ <state line="116" column="19" selection-start="2434" selection-end="2434" vertical-scroll-proportion="0.1438849">
+ <folding />
+ </state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/PlainNode.java">
+ <entry file="file://$PROJECT_DIR$/src/reviewresult/Review.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="19" column="11" selection-start="512" selection-end="512" vertical-scroll-proportion="0.0">
+ <state line="131" column="20" selection-start="3822" selection-end="3822" vertical-scroll-proportion="0.79293543">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/tests/ReviewTreeStructureTest.java">
+ <entry file="file://$PROJECT_DIR$/src/reviewresult/ReviewManager.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="93" column="75" selection-start="3321" selection-end="3321" vertical-scroll-proportion="0.0">
+ <state line="141" column="22" selection-start="5057" selection-end="5057" vertical-scroll-proportion="0.020262217">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/testReview.xml">
+ <entry file="file://$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewView.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="25" column="22" selection-start="744" selection-end="744" vertical-scroll-proportion="0.44576877">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/reviewresult/persistent/ReviewBean.java">
+ <entry file="file://$PROJECT_DIR$/src/tests/ReviewManagerTest.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="120" column="10" selection-start="2577" selection-end="2577" vertical-scroll-proportion="0.0">
+ <state line="318" column="15" selection-start="13724" selection-end="13724" vertical-scroll-proportion="0.73659116">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewTreeStructure.java">
+ <entry file="file://$PROJECT_DIR$/src/ui/forms/EditReviewForm.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="130" column="37" selection-start="4530" selection-end="4530" vertical-scroll-proportion="0.0">
- <folding>
- <element signature="method#removeReview#0;class#ReviewTreeStructure#0" expanded="false" />
- <element signature="method#findAncestorNode#0;class#ReviewTreeStructure#0" expanded="false" />
- <element signature="method#findInvalidAncestorNode#0;class#ReviewTreeStructure#0" expanded="false" />
- </folding>
+ <state line="89" column="63" selection-start="3161" selection-end="3161" vertical-scroll-proportion="1.7345679">
+ <folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewPanel.java">
+ <entry file="file://$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewToolWindowActionManager.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="284" column="0" selection-start="11001" selection-end="11001" vertical-scroll-proportion="0.0">
+ <state line="0" column="24" selection-start="24" selection-end="24" vertical-scroll-proportion="-0.4704797">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/ui/reviewpoint/ReviewPointManager.java">
+ <entry file="file://$PROJECT_DIR$/src/ui/reviewtoolwindow/nodes/ReviewNode.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="17" column="13" selection-start="440" selection-end="440" vertical-scroll-proportion="0.32762313">
+ <state line="29" column="28" selection-start="962" selection-end="962" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/reviewresult/ReviewManager.java">
+ <entry file="file://$PROJECT_DIR$/src/ui/reviewtoolwindow/Searcher.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="55" column="48" selection-start="1812" selection-end="1812" vertical-scroll-proportion="0.0">
+ <state line="117" column="31" selection-start="4409" selection-end="4409" vertical-scroll-proportion="0.7274549">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/src/reviewresult/Review.java">
+ <entry file="file://$PROJECT_DIR$/src/ui/reviewtoolwindow/ReviewPanel.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="72" column="26" selection-start="2336" selection-end="2336" vertical-scroll-proportion="0.41025642">
+ <state line="245" column="64" selection-start="9700" selection-end="9700" vertical-scroll-proportion="0.35095447">
<folding />
</state>
</provider>
View
1  src/patch/ReviewCommitHandlerFactory.java
@@ -1,6 +1,5 @@
package patch;
-import com.intellij.openapi.Disposable;
import com.intellij.openapi.vcs.CheckinProjectPanel;
import com.intellij.openapi.vcs.checkin.CheckinHandler;
import com.intellij.openapi.vcs.checkin.CheckinHandlerFactory;
View
4 src/patch/ReviewPatchExtensionPoint.java
@@ -4,18 +4,14 @@
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.util.xmlb.XmlSerializer;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
-import org.jdom.output.Format;
-import org.jdom.output.XMLOutputter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import reviewresult.ReviewManager;
import reviewresult.persistent.ReviewsState;
-import ui.reviewpoint.ReviewPointManager;
import java.io.IOException;
import java.io.StringReader;
View
4 src/reviewresult/Review.java
@@ -5,7 +5,6 @@
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
import com.intellij.openapi.project.Project;
-import com.intellij.openapi.project.ProjectManager;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
@@ -36,6 +35,7 @@ public Review(@NotNull ReviewBean reviewBean, @NotNull Project project){
this.virtualFile = VirtualFileManager.getInstance().refreshAndFindFileByUrl(reviewBean.getFilePath());
if(virtualFile == null) {reviewBean.setValid(false); return;}
+
this.reviewBean.checkValid(virtualFile.getLength(), virtualFile.isValid());
}
@@ -77,7 +77,7 @@ public OpenFileDescriptor getElement() {
public boolean isValid() {
return reviewBean.isValid()
- && ReviewManager.getInstance(project).getRootManager().getFileIndex().isInContent(virtualFile);
+ && ProjectRootManager.getInstance(project).getFileIndex().isInContent(virtualFile);
}
public int getLine() {
View
53 src/reviewresult/ReviewManager.java
@@ -1,10 +1,11 @@
package reviewresult;
-import com.intellij.openapi.components.*;
+import com.intellij.ide.startup.StartupManagerEx;
+import com.intellij.openapi.components.AbstractProjectComponent;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
-import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.openapi.roots.ProjectRootManager;
+import com.intellij.openapi.startup.StartupManager;
import com.intellij.openapi.vfs.*;
import com.intellij.util.xmlb.XmlSerializer;
import org.jdom.Element;
@@ -13,10 +14,8 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import reviewresult.persistent.ReviewBean;
-import reviewresult.persistent.ReviewItem;
import reviewresult.persistent.ReviewsState;
import ui.reviewpoint.ReviewPointManager;
-import utils.Util;
import java.util.*;
@@ -30,7 +29,8 @@
private Map<String, List<Review>> filePath2reviews = new HashMap<String, List<Review>>();
- private Set<String> exportedFiles = new HashSet<String>();
+ //exported files = files, which already were exported in patch file
+ // private Set<String> exportedFiles = new HashSet<String>();
private boolean saveReviewsToPatch;
@@ -38,12 +38,12 @@
private static final Logger LOG = Logger.getInstance(ReviewManager.class.getName());
- private ProjectRootManager rootManager;
+ private final StartupManagerEx startupManager;
- public ReviewManager(@NotNull Project project, final ProjectRootManager rootManager) {
+ public ReviewManager(@NotNull Project project, final StartupManager startupManager) {
super(project);
- this.rootManager = rootManager;
+ this.startupManager = (StartupManagerEx)startupManager;
VirtualFileManager.getInstance().addVirtualFileListener(new ReviewVirtualFileListener(), project);
eventPublisher = project.getMessageBus().syncPublisher(ReviewChangedTopics.REVIEW_STATUS);
@@ -53,9 +53,6 @@ public static ReviewManager getInstance(@NotNull Project project) {
return project.getComponent(ReviewManager.class);
}
- public ProjectRootManager getRootManager() {
- return rootManager;
- }
public List<ReviewBean> getState() {
List<ReviewBean> result = new ArrayList<ReviewBean>();
@@ -75,16 +72,25 @@ public void loadReviewsForFile(List<ReviewBean> reviewBeans) {
loadReviews(reviewBeans, true);
}
- public void loadReviews(List<ReviewBean> reviewBeans, boolean part) {
- if(!part) {
+ public void loadReviews(List<ReviewBean> reviewBeans, boolean isPartOfState) {
+ if(!isPartOfState) {
filePath2reviews = new HashMap<String, List<Review>>();
}
for (ReviewBean reviewBean : reviewBeans) {
- Review review = new Review(reviewBean, myProject);
- addReview(review);
-
+ final Review review = new Review(reviewBean, myProject);
+ Runnable runnable = new Runnable() {
+ public void run() {
+ addReview(review);
+ }
+ };
+ if (startupManager.startupActivityPassed()) {
+ runnable.run();
+ }
+ else {
+ startupManager.registerPostStartupActivity(runnable);
+ }
}
- ReviewPointManager.getInstance(myProject).updateUI();
+ //ReviewPointManager.getInstance(myProject).updateUI();
}
@@ -140,12 +146,11 @@ public void addReview(Review newReview) {
return reviewsList;
}
+ @Nullable
public Set<String> getFileNames() {
return filePath2reviews.keySet();
}
-
-
@NotNull
@Override
public String getComponentName() {
@@ -211,16 +216,12 @@ public boolean isSaveReviewsToPatch() {
return saveReviewsToPatch;
}
- public List<ReviewBean> getReviewsToExport() {
- return getReviewsToExport("");
- }
-
-
@Nullable
public List<ReviewBean> getReviewsToExport(String filepath) {
- if(exportedFiles.isEmpty()) {
+ /*if(exportedFiles.isEmpty()) {
exportedFiles = filePath2reviews.keySet();
}
+ */
List<ReviewBean> result = new ArrayList<ReviewBean>();
if("".equals(filepath)) {
for(String path : filePath2reviews.keySet()) {
@@ -228,7 +229,7 @@ public boolean isSaveReviewsToPatch() {
}
return result;
}
- exportedFiles.remove(filepath);
+// exportedFiles.add(filepath);
return getAddedForFile(filepath);
}
View
3  src/reviewresult/ReviewsChangedListener.java
@@ -1,8 +1,5 @@
package reviewresult;
-import com.intellij.util.messages.Topic;
-import reviewresult.Review;
-
import java.util.EventListener;
/**
View
3  src/reviewresult/persistent/ReviewBean.java
@@ -3,9 +3,6 @@
import com.intellij.util.xmlb.annotations.AbstractCollection;
import com.intellij.util.xmlb.annotations.Attribute;
import com.intellij.util.xmlb.annotations.Tag;
-import org.apache.commons.lang.Validate;
-import org.jetbrains.annotations.NotNull;
-import ui.actions.DeleteReviewAction;
import java.util.ArrayList;
import java.util.List;
View
1  src/reviewresult/persistent/ReviewItem.java
@@ -3,7 +3,6 @@
import com.intellij.util.xmlb.annotations.Attribute;
import com.intellij.util.xmlb.annotations.Tag;
-import com.intellij.util.xmlb.annotations.Transient;
import reviewresult.ReviewStatus;
import java.util.Date;
View
12 src/ui/actions/AddReviewAction.java
@@ -6,29 +6,17 @@
import com.intellij.openapi.editor.CaretModel;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
-import com.intellij.openapi.editor.event.CaretEvent;
-import com.intellij.openapi.editor.event.CaretListener;
-import com.intellij.openapi.editor.ex.EditorEx;
-import com.intellij.openapi.editor.ex.EditorGutterComponentEx;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
-import com.intellij.openapi.ui.popup.Balloon;
-import com.intellij.openapi.ui.popup.BalloonBuilder;
-import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
-import com.intellij.ui.awt.RelativePoint;
import reviewresult.Review;
import reviewresult.ReviewManager;
-import ui.forms.EditReviewForm;
import ui.reviewpoint.ReviewPoint;
import ui.reviewpoint.ReviewPointManager;
-import javax.swing.*;
-import java.awt.*;
-
/**
* User: Alisa.Afonina
* Date: 7/12/11
View
9 src/ui/actions/DeleteReviewAction.java
@@ -3,7 +3,6 @@
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
-import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
@@ -11,9 +10,6 @@
import com.intellij.openapi.vfs.VirtualFile;
import reviewresult.Review;
import reviewresult.ReviewManager;
-import sun.misc.resources.Messages_es;
-import ui.reviewpoint.ReviewPoint;
-import ui.reviewtoolwindow.ReviewView;
import javax.swing.*;
@@ -44,7 +40,7 @@ public void actionPerformed(AnActionEvent e) {
if(review == null) review = e.getData(Review.REVIEW_DATA_KEY);
if(review != null) {
if(Messages.showOkCancelDialog(project, "Are you sure you want to delete review?",
- "Delete review", null) == Messages.OK) {
+ "Delete Review", null) == Messages.OK) {
instance.removeReview(review);
review = null;
}
@@ -52,7 +48,8 @@ public void actionPerformed(AnActionEvent e) {
VirtualFile file = PlatformDataKeys.VIRTUAL_FILE.getData(e.getDataContext());
if(file != null) {
if(Messages.showOkCancelDialog(project, "Are you sure you want to delete all reviews in this file?",
- "Delete reviews", null) == Messages.OK) {
+ "Delete Reviews", null) == Messages.OK) {
+
instance.removeAll(file);
}
}
View
8 src/ui/actions/EditReviewAction.java
@@ -5,20 +5,12 @@
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.editor.Editor;
-import com.intellij.openapi.editor.ex.EditorEx;
-import com.intellij.openapi.editor.ex.EditorGutterComponentEx;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
-import com.intellij.openapi.ui.popup.Balloon;
-import com.intellij.openapi.ui.popup.BalloonBuilder;
-import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.util.IconLoader;
-import com.intellij.ui.awt.RelativePoint;
-import ui.forms.EditReviewForm;
import ui.reviewpoint.ReviewPoint;
import javax.swing.*;
-import java.awt.*;
/**
* User: Alisa.Afonina
View
79 src/ui/actions/ReviewActionManager.java
@@ -5,9 +5,7 @@
import com.intellij.openapi.editor.ex.EditorGutterComponentEx;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.ui.popup.*;
-import com.intellij.openapi.util.ActionCallback;
import com.intellij.openapi.wm.IdeFocusManager;
-import com.intellij.ui.BalloonImpl;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.util.ui.PositionTracker;
import reviewresult.Review;
@@ -26,7 +24,7 @@
* Time: 1:14 PM
*/
public class ReviewActionManager implements DumbAware {
- private static Balloon activeBalloon = null;
+ private Balloon activeBalloon = null;
private BalloonBuilder balloonBuilder;
private EditReviewForm editReviewForm;
private static ReviewActionManager instance;
@@ -39,12 +37,12 @@ public static ReviewActionManager getInstance(Review review) {
if(instance == null) {
instance = new ReviewActionManager();
}
- instance.review = review;
+ instance.setReview(review);
return instance;
}
public void addToExistingComments(final Editor editor) {
- ReviewPoint reviewPoint = ReviewPointManager.getInstance(review.getProject()).findReviewPoint(review);
+ ReviewPoint reviewPoint = ReviewPointManager.getInstance(getReview().getProject()).findReviewPoint(getReview());
if(reviewPoint == null) return;
final EditorGutterComponentEx gutterComponent = ((EditorEx)editor).getGutterComponentEx();
final Point point = gutterComponent.getPoint(reviewPoint.getGutterIconRenderer());
@@ -59,13 +57,13 @@ public void addToExistingComments(final Editor editor) {
public void addNewComment(final Editor editor) {
final Point point = editor.visualPositionToXY(editor.getCaretModel().getVisualPosition());
- editReviewForm = new EditReviewForm(review, true);
+ editReviewForm = new EditReviewForm(getReview(), true);
JComponent content = editReviewForm.getContent();
showBalloon(editor, point, content, editor.getContentComponent());
}
private void showBalloon(final Editor editor, final Point point, JComponent content, final JComponent contentComponent) {
- if(!review.isValid()) return;
+ if(!getReview().isValid()) return;
content.getInputMap(JPanel.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, KeyEvent.CTRL_DOWN_MASK), "saveReview");
content.getInputMap(JPanel.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "exitReview");
@@ -78,60 +76,75 @@ public void actionPerformed(ActionEvent e) {
content.getActionMap().put("exitReview", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
- activeBalloon.hide();
+ getActiveBalloon().hide();
}
});
balloonBuilder = JBPopupFactory.getInstance().createDialogBalloonBuilder(content, "Add Comment");
balloonBuilder.setHideOnClickOutside(true);
balloonBuilder.setHideOnKeyOutside(true);
- activeBalloon = balloonBuilder.createBalloon();
- activeBalloon.addListener(new JBPopupAdapter() {
+ setActiveBalloon(balloonBuilder.createBalloon());
+ getActiveBalloon().addListener(new JBPopupAdapter() {
@Override
public void onClosed(LightweightWindowEvent event) {
- review.setActivated(false);
+ getReview().setActivated(false);
}
});
- editReviewForm.setBalloon(activeBalloon);
- if(activeBalloon == null) return;
- activeBalloon.show(
- new PositionTracker<Balloon>(editor.getContentComponent()){
- @Override
- public RelativePoint recalculateLocation(Balloon object) {
- if(editor.getScrollingModel().getVisibleArea().contains(point)) {
- if(object.isDisposed()) activeBalloon = balloonBuilder.createBalloon();
- object = activeBalloon;
- editReviewForm.setBalloon(activeBalloon);
- return new RelativePoint(contentComponent, point);
+ editReviewForm.setBalloon(getActiveBalloon());
+ if(getActiveBalloon() == null) return;
+ getActiveBalloon().show(
+ new PositionTracker<Balloon>(editor.getContentComponent()) {
+ @Override
+ public RelativePoint recalculateLocation(Balloon object) {
+ if (editor.getScrollingModel().getVisibleArea().contains(point)) {
+ if (object.isDisposed()) setActiveBalloon(balloonBuilder.createBalloon());
+ //object = getActiveBalloon();
+ editReviewForm.setBalloon(getActiveBalloon());
+ return new RelativePoint(contentComponent, point);
+ } else {
+ object.hide();
+ return null;
+ }
}
- else {
- object.hide();
- return null;
- }
- }
- }, Balloon.Position.atRight);
+ }, Balloon.Position.atRight);
- ActionCallback callback = IdeFocusManager.getInstance(review.getProject()).requestFocus(editReviewForm.getNameTextField(), true);
+ /*ActionCallback callback = */IdeFocusManager.getInstance(getReview().getProject()).requestFocus(editReviewForm.getNameTextField(), true);
}
public static void disposeActiveBalloon() {
- if(activeBalloon != null) {
- activeBalloon.dispose();
+ if(instance.getActiveBalloon() != null) {
+ instance.getActiveBalloon().dispose();
}
}
public void showExistingComments(final Editor editor) {
- ReviewPoint reviewPoint = ReviewPointManager.getInstance(review.getProject()).findReviewPoint(review);
+ ReviewPoint reviewPoint = ReviewPointManager.getInstance(getReview().getProject()).findReviewPoint(getReview());
if(reviewPoint == null) return;
final EditorGutterComponentEx gutterComponent = ((EditorEx)editor).getGutterComponentEx();
final Point point = gutterComponent.getPoint(reviewPoint.getGutterIconRenderer());
if (point != null) {
final Icon icon = reviewPoint.getGutterIconRenderer().getIcon();
editReviewForm = new EditReviewForm(reviewPoint.getReview(), false);
- JComponent content = editReviewForm.getItemsContent(true);
+ JComponent content = editReviewForm.getItemsContent();
final Point centerIconPoint = new Point(point.x + icon.getIconWidth() / 2 + gutterComponent.getIconsAreaWidth(), point.y + icon.getIconHeight() / 2);
showBalloon(editor, centerIconPoint, content, gutterComponent);
}
}
+
+ private Review getReview() {
+ return review;
+ }
+
+ private void setReview(Review review) {
+ this.review = review;
+ }
+
+ private Balloon getActiveBalloon() {
+ return activeBalloon;
+ }
+
+ private void setActiveBalloon(Balloon activeBalloon) {
+ this.activeBalloon = activeBalloon;
+ }
}
View
18 src/ui/forms/EditReviewForm.java
@@ -4,10 +4,9 @@
import com.intellij.openapi.ui.popup.Balloon;
import com.intellij.ui.ScrollPaneFactory;
import reviewresult.Review;
-import reviewresult.persistent.ReviewItem;
import reviewresult.ReviewManager;
import reviewresult.ReviewStatus;
-import ui.reviewpoint.ReviewPointManager;
+import reviewresult.persistent.ReviewItem;
import ui.reviewtoolwindow.ReviewView;
import ui.reviewtoolwindow.Searcher;
@@ -17,8 +16,8 @@
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
-import java.util.List;
import java.util.ArrayList;
+import java.util.List;
/**
* User: Alisa.Afonina
@@ -33,7 +32,7 @@
private JPanel itemsPanel = new JPanel(new BorderLayout());
private List<ReviewItemForm> reviewItemFormsList;
- private JTextArea newReviewItemText = new JTextArea();
+ private JTextArea newReviewItemText = new JTextArea(3, 2);
private Balloon balloon;
@@ -44,7 +43,7 @@ public EditReviewForm(final Review review, boolean showNewItem) {
this.review = review;
review.setActivated(true);
- JPanel contentPanel = new JPanel(new GridLayout(2, 1));
+ JPanel contentPanel = new JPanel(new BorderLayout()/*new GridLayout(2, 1)*/);
resetItemsContent(true);
contentPanel.add(panel);
reviewName.addKeyListener(new KeyAdapter() {
@@ -71,7 +70,7 @@ public void keyTyped(KeyEvent e) {
newReviewItemPanel.add(newReviewItemText);
JScrollPane newItemScrollPane = ScrollPaneFactory.createScrollPane(newReviewItemPanel);
- contentPanel.add(newItemScrollPane);
+ contentPanel.add(newItemScrollPane, BorderLayout.SOUTH);
JPanel OKCancelPanel = new JPanel(new GridLayout(1,2));
JButton OKButton = new JButton("OK");
@@ -135,7 +134,7 @@ public void setBalloon(Balloon balloon) {
this.balloon = balloon;
}
- public JPanel getItemsContent(boolean editable) {
+ public JPanel getItemsContent() {
panel.setFocusable(true);
return panel;
}
@@ -166,11 +165,6 @@ private void resetItemsContent(boolean editable) {
}
}
- public Component getItemTextField() {
- //newReviewItemText.setFont(new Font("Verdana", Font.PLAIN, 14));
- return newReviewItemText;
- }
-
public Component getNameTextField() {
return reviewName;
}
View
14 src/ui/reviewpoint/ReviewPoint.java
@@ -6,7 +6,6 @@
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.editor.Document;
-import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.event.DocumentAdapter;
import com.intellij.openapi.editor.event.DocumentEvent;
import com.intellij.openapi.editor.ex.MarkupModelEx;
@@ -14,13 +13,14 @@
import com.intellij.openapi.editor.markup.HighlighterLayer;
import com.intellij.openapi.editor.markup.RangeHighlighter;
import com.intellij.openapi.fileEditor.FileDocumentManager;
+import com.intellij.openapi.fileEditor.OpenFileDescriptor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.IconLoader;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import reviewresult.Review;
-import reviewresult.persistent.ReviewItem;
import reviewresult.ReviewManager;
+import reviewresult.persistent.ReviewItem;
import ui.actions.DeleteReviewAction;
import ui.actions.EditReviewAction;
import ui.actions.ReviewActionManager;
@@ -36,7 +36,7 @@
* Time: 4:54 PM
*/
public class ReviewPoint {
- private Review review;
+ private final Review review;
private GutterIconRenderer gutterIconRenderer;
private RangeHighlighter highlighter = null;
@@ -46,11 +46,13 @@ public ReviewPoint(Review review) {
public void updateUI() {
final Project project = review.getProject();
+ if(project == null) return;
final ReviewView reviewView = ServiceManager.getService(project, ReviewView.class);
if(review.isValid()) {
if(highlighter == null) {
- Document document = FileDocumentManager.getInstance().getDocument(review.getElement().getFile());
- if(project == null) return;
+ OpenFileDescriptor element = review.getElement();
+ if(element == null) return;
+ Document document = FileDocumentManager.getInstance().getDocument(element.getFile());
if(document == null) return;
MarkupModelEx markup = (MarkupModelEx) document.getMarkupModel(project);
int line = review.getLine();
@@ -65,7 +67,7 @@ public void documentChanged(DocumentEvent event) {
int newStart = highlighter.getStartOffset();
int newEnd = highlighter.getEndOffset();
- if(newStart >= review.getReviewBean().getEnd() || !highlighter.isValid()) {
+ if(/*newStart >= review.getReviewBean().getEnd() ||*/ !highlighter.isValid()) {
review.setValid(false);
}
else {
View
13 src/ui/reviewpoint/ReviewPointManager.java
@@ -2,11 +2,11 @@
import com.intellij.ide.startup.StartupManagerEx;
import com.intellij.openapi.components.AbstractProjectComponent;
-import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.startup.StartupManager;
import reviewresult.Review;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -17,7 +17,7 @@
*/
public class ReviewPointManager extends AbstractProjectComponent {
private Map<Review, ReviewPoint> reviewPoints = new HashMap<Review, ReviewPoint>();
- private StartupManagerEx startupManager;
+ private final StartupManagerEx startupManager;
public ReviewPointManager(Project project, final StartupManager startupManager) {
super(project);
@@ -29,17 +29,18 @@ public static ReviewPointManager getInstance(Project project) {
}
public Map<Review, ReviewPoint> getReviewPoints() {
- return reviewPoints;
+ return Collections.unmodifiableMap(reviewPoints);
}
public void updateUI() {
for (ReviewPoint point : reviewPoints.values()) {
- updateUI(point);
+ //updateUI(point);
+ point.updateUI();
}
}
public void updateUI(final ReviewPoint point) {
- Runnable runnable = new Runnable() {
+ /*Runnable runnable = new Runnable() {
public void run() {
point.updateUI();
}
@@ -49,7 +50,7 @@ public void run() {
}
else {
startupManager.registerPostStartupActivity(runnable);
- }
+ }*/
}
public ReviewPoint findReviewPoint(Review review) {
View
37 src/ui/reviewtoolwindow/ReviewPanel.java
@@ -29,7 +29,6 @@
import reviewresult.ReviewManager;
import reviewresult.ReviewsChangedListener;
import ui.actions.ReviewActionManager;
-import ui.forms.EditReviewForm;
import ui.reviewtoolwindow.nodes.FileNode;
import ui.reviewtoolwindow.nodes.ModuleNode;
import ui.reviewtoolwindow.nodes.ReviewNode;
@@ -57,7 +56,6 @@
private SimpleTree reviewTree;
private AbstractTreeBuilder reviewTreeBuilder;
- //private JScrollPane previewScrollPane;
private ReviewsPreviewPanel previewPanel = new ReviewsPreviewPanel();
@Nullable
@@ -66,7 +64,6 @@
private SimpleTreeStructure reviewTreeStructure;
private ReviewToolWindowSettings settings;
- private EditReviewForm editReviewForm;
@@ -94,7 +91,7 @@ public void actionPerformed(ActionEvent e) {
createTreeStructure();
updateUI();
if(settings.isShowPreview()) {
- editReviewForm.updateSelection();
+ previewPanel.updateSelection();
}
}
});
@@ -121,7 +118,9 @@ public void mouseClicked(MouseEvent e) {
Project project = PlatformDataKeys.PROJECT.getData(dataContext);
if (project == null) return;
OpenSourceUtil.openSourcesFrom(dataContext, true);
- SimpleNode node = (SimpleNode)reviewTree.getSelectedNode().getElement();
+ SimpleNode selectedNode = reviewTree.getSelectedNode();
+ if(selectedNode == null) return;
+ SimpleNode node = (SimpleNode) selectedNode.getElement();
if(node instanceof ReviewNode) {
Review review = ((ReviewNode) node).getReview();
Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor();
@@ -140,14 +139,7 @@ public void keyPressed(KeyEvent e) {
}
}
});
- reviewTree.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent e) {
- if(e.getButton() == MouseEvent.BUTTON3) {
- }
- }
- });
reviewTree.addTreeSelectionListener(new TreeSelectionListener() {
@Override
public void valueChanged(TreeSelectionEvent e) {
@@ -249,13 +241,17 @@ public String getPreviousOccurenceActionName() {
public void updateUI() {
super.updateUI();
if(settings != null) {
+ reviewTree.updateUI();
searchLine.setVisible(settings.isSearchEnabled());
+ searchLine.setText(Searcher.getInstance(project).getFilter());
if(reviewTreeBuilder == null) return;
reviewTreeBuilder.getUi().doUpdateFromRoot();
Set<String> fileNames = ReviewManager.getInstance(project).getFileNames();
Set<String> filteredFileNames = Searcher.getInstance(project).getFilteredFileNames();
- previewPanel.setVisible(!(fileNames.isEmpty() && filteredFileNames.isEmpty())
- && settings.isShowPreview());
+ if(fileNames == null) return;
+ boolean visible = !(fileNames.isEmpty() && filteredFileNames.isEmpty())
+ && settings.isShowPreview();
+ previewPanel.setVisible(visible);
}
}
@@ -278,7 +274,7 @@ public void dispose() {
reviewTreeBuilder.dispose();
}
- public class ReviewsListener implements ReviewsChangedListener{
+ public class ReviewsListener implements ReviewsChangedListener {
@Override
public void reviewAdded(Review review) {
@@ -288,14 +284,23 @@ public void reviewAdded(Review review) {
@Override
public void reviewDeleted(Review review) {
+
+
+
((ReviewTreeStructure)reviewTreeStructure).removeReview(review);
+
reviewTreeBuilder.getUi().doUpdateFromRoot();
}
+
@Override
public void reviewChanged(Review review) {
reviewTreeBuilder.getUi().doUpdateFromRoot();
+
+
+ }
+
+
}
- }
}
View
2  src/ui/reviewtoolwindow/ReviewToolWindowActionManager.java
@@ -13,10 +13,8 @@
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
-import reviewresult.Review;
import reviewresult.ReviewManager;
import reviewresult.persistent.ReviewsState;
-import sun.plugin2.message.transport.SerializingTransport;
import javax.swing.*;
import java.awt.*;
View
26 src/ui/reviewtoolwindow/ReviewToolWindowSettings.java
@@ -1,31 +1,5 @@
package ui.reviewtoolwindow;
-import com.intellij.ide.actions.NextOccurenceToolbarAction;
-import com.intellij.ide.actions.PreviousOccurenceToolbarAction;
-import com.intellij.openapi.actionSystem.*;
-import com.intellij.openapi.editor.Editor;
-import com.intellij.openapi.fileChooser.*;
-import com.intellij.openapi.fileEditor.FileDocumentManager;
-import com.intellij.openapi.project.DumbAware;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.ui.Messages;
-import com.intellij.openapi.util.IconLoader;
-import com.intellij.openapi.util.io.FileUtil;
-import com.intellij.openapi.vfs.*;
-import com.intellij.psi.impl.file.impl.FileManager;
-import com.intellij.util.xmlb.XmlSerializer;
-import com.sun.imageio.plugins.common.InputStreamAdapter;
-import org.jdom.Element;
-import org.jdom.JDOMException;
-import org.jdom.input.SAXBuilder;
-import reviewresult.ReviewManager;
-import reviewresult.persistent.ReviewsState;
-import utils.Util;
-
-import javax.swing.*;
-import java.awt.*;
-import java.io.*;
-
/**
* User: Alisa.Afonina
* Date: 8/3/11
View
2  src/ui/reviewtoolwindow/ReviewTreeStructure.java
@@ -1,7 +1,6 @@
package ui.reviewtoolwindow;
import com.intellij.openapi.module.Module;
-import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.roots.ProjectRootManager;
@@ -37,6 +36,7 @@ public ReviewTreeStructure(Project project, ReviewToolWindowSettings settings) {
Set<String> filesWithReview = Searcher.getInstance(project).getFilteredFileNames();
for (String virtualFileName : filesWithReview) {
List<Review> validReviews = ReviewManager.getInstance(project).getValidReviews(virtualFileName);
+ if(validReviews == null) return;
for (Review review : validReviews)
addReview(review);
}
View
11 src/ui/reviewtoolwindow/ReviewView.java
@@ -1,18 +1,9 @@
package ui.reviewtoolwindow;
import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.Pair;
import com.intellij.openapi.wm.ToolWindow;
-import com.intellij.psi.PsiFile;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentFactory;
-import org.junit.Test;
-import reviewresult.Review;
-import reviewresult.ReviewManager;
-import reviewresult.persistent.ReviewItem;
-import utils.Util;
-
-import java.util.*;
/**
@@ -23,10 +14,8 @@
public class ReviewView {
private ReviewPanel reviewPanel;
- private static Project project;
public void initToolWindow(Project project, ToolWindow toolWindow ) {
- this.project = project;
reviewPanel = new ReviewPanel(project);
Content allReviewsContent= ContentFactory.SERVICE.getInstance().createContent(reviewPanel, "Reviews" ,false);
toolWindow.getContentManager().addContent(allReviewsContent);
View
15 src/ui/reviewtoolwindow/ReviewsPreviewPanel.java
@@ -1,7 +1,5 @@
package ui.reviewtoolwindow;
-import com.intellij.execution.impl.JarProgramPatcher;
-import com.intellij.ui.ScrollPaneFactory;
import reviewresult.Review;
import ui.forms.EditReviewForm;
@@ -14,6 +12,9 @@
* Time: 11:32 AM
*/
public class ReviewsPreviewPanel extends JPanel {
+
+ private EditReviewForm editReviewForm;
+
public ReviewsPreviewPanel() {
super(new BorderLayout());
add(new JLabel("Select element to preview from a tree"));
@@ -22,9 +23,9 @@ public ReviewsPreviewPanel() {
public void update(Review review) {
removeAll();
if(review.isValid()) {
- EditReviewForm editReviewForm = new EditReviewForm(review, false);
- JScrollPane previewScrollPane = ScrollPaneFactory.createScrollPane();
- /*previewScrollPane.*/add(editReviewForm.getItemsContent(false));
+ editReviewForm = new EditReviewForm(review, false);
+ //JScrollPane previewScrollPane = ScrollPaneFactory.createScrollPane();
+ /*previewScrollPane.*/add(editReviewForm.getItemsContent());
//add(previewScrollPane);
//this.revalidate();
//this.repaint();
@@ -33,4 +34,8 @@ public void update(Review review) {
}
revalidate();
}
+
+ public void updateSelection() {
+ editReviewForm.updateSelection();
+ }
}
View
55 src/ui/reviewtoolwindow/Searcher.java
@@ -1,6 +1,7 @@
package ui.reviewtoolwindow;
import com.intellij.openapi.components.AbstractProjectComponent;
+import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Pair;
import org.jetbrains.annotations.NotNull;
@@ -9,10 +10,8 @@
import reviewresult.persistent.ReviewItem;
import utils.Util;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
+import javax.print.attribute.TextSyntax;
+import java.util.*;
/**
* User: Alisa.Afonina
@@ -20,13 +19,15 @@
* Time: 7:40 PM
*/
public class Searcher extends AbstractProjectComponent {
- private Map<Review, Pair<Integer, Integer>> reviews2searchresult = new HashMap<Review, Pair<Integer, Integer>>();
+ private Map<Review, Pair<Integer, Integer>> review2searchresult = new HashMap<Review, Pair<Integer, Integer>>();
private Map<ReviewItem, Pair<Integer, Integer>> reviewitem2searchresult = new HashMap<ReviewItem, Pair<Integer, Integer>>();
private Set<String> filteredFileNames = new HashSet<String>();
private String filter;
+ private Project project;
protected Searcher(Project project) {
super(project);
+ this.project = project;
}
public static Searcher getInstance(@NotNull Project project) {
@@ -34,37 +35,40 @@ public static Searcher getInstance(@NotNull Project project) {
}
public Set<String> getFilteredFileNames() {
- return filteredFileNames;
+ return Collections.unmodifiableSet(filteredFileNames);
}
public boolean filterIsSet(){
- return "".equals(filter);
+ return !("".equals(filter));
}
public void createFilter(String text) {
filter = text;
ReviewManager instance = ReviewManager.getInstance(myProject);
+ Set<String> fileNames = instance.getFileNames();
+ if(fileNames == null) return;
+
if(text == null || "".equals(text)) {
- filter = "";
- filteredFileNames = new HashSet<String>();
- filteredFileNames.addAll(instance.getFileNames());
+ emptyFilter();
}
else {
- for(String url : instance.getFileNames()) {
+ for(String url : fileNames) {
boolean contains = false;
- for(Review review : instance.getValidReviews(url)) {
+ List<Review> validReviews = instance.getValidReviews(url);
+ if(validReviews == null) return;
+ for(Review review : validReviews) {
int reviewStart = Util.find(review.getName(), text);
- int reviewEnd = -1;
+ int reviewEnd;
if(reviewStart >= 0) {
contains = true;
reviewEnd = reviewStart + text.length();
Pair<Integer, Integer> reviewResult = new Pair<Integer, Integer>(reviewStart, reviewEnd);
- reviews2searchresult.put(review, reviewResult);
+ review2searchresult.put(review, reviewResult);
}
for(ReviewItem item : review.getReviewItems()) {
int itemStart = Util.find(item.getText(), text);
- int itemEnd = -1;
+ int itemEnd;
if(itemStart != -1) {
contains = true;
if(itemStart >= 0) {
@@ -81,9 +85,12 @@ public void createFilter(String text) {
}
public void emptyFilter() {
- reviews2searchresult = new HashMap<Review, Pair<Integer, Integer>>();
+ filter = "";
+ review2searchresult = new HashMap<Review, Pair<Integer, Integer>>();
reviewitem2searchresult = new HashMap<ReviewItem, Pair<Integer, Integer>>();
filteredFileNames = new HashSet<String>();
+ ReviewView reviewView = ServiceManager.getService(project, ReviewView.class);
+ reviewView.updateUI();
}
public Pair<Integer, Integer> getItemSearchResult(ReviewItem item) {
@@ -94,9 +101,21 @@ public void emptyFilter() {
}
public Pair<Integer, Integer> getReviewSearchResult(Review review) {
- if(reviews2searchresult.containsKey(review)) {
- return reviews2searchresult.get(review);
+ if(review2searchresult.containsKey(review)) {
+ return review2searchresult.get(review);
}
return new Pair<Integer, Integer>(-1,-1);
}
+
+ public boolean containsReview(Review review) {
+ return !filterIsSet() || review2searchresult.containsKey(review);
+ }
+
+ public boolean containsReviewItem(ReviewItem reviewItem) {
+ return !filterIsSet() || reviewitem2searchresult.containsKey(reviewItem);
+ }
+
+ public String getFilter() {
+ return filter;
+ }
}
View
35 src/ui/reviewtoolwindow/nodes/FileNode.java
@@ -17,6 +17,7 @@
import reviewresult.Review;
import reviewresult.ReviewManager;
import ui.reviewtoolwindow.ReviewToolWindowSettings;
+import ui.reviewtoolwindow.Searcher;
import javax.swing.*;
import java.util.ArrayList;
@@ -38,15 +39,6 @@ public FileNode(Project project, VirtualFile value, ReviewToolWindowSettings set
this.project = project;
this.settings = settings;
file = value;
- /* if(!file.isDirectory()) {
- List<Review> reviews = ReviewManager.getInstance(project).getValidReviews(file.getUrl());
- if(reviews.isEmpty())return;
- for(Review review : reviews) {
- ReviewNode reviewNode = new ReviewNode(project, review);
- reviewNode.setPlainParent(this);
- children.add(reviewNode);
- }
- }*/
}
@Override
@@ -59,21 +51,24 @@ public FileNode(Project project, VirtualFile value, ReviewToolWindowSettings set
@NotNull
@Override
public SimpleNode[] getChildren() {
- if(!settings.isGroupByFile()) {
- List<SimpleNode> newChildren = new ArrayList<SimpleNode>();
- for (PlainNode child : children) {
- if(child instanceof ReviewNode) {
- for (SimpleNode oldChild : children) {
- newChildren.add(oldChild);
- }
- break;
- } else {
+ List<SimpleNode> newChildren = new ArrayList<SimpleNode>();
+ for (PlainNode child : children) {
+ if(child instanceof ReviewNode) {
+ if(Searcher.getInstance(project).containsReview(((ReviewNode)child).getReview())) {
+ newChildren.add(child);
+ }
+ } else {
+ if(!settings.isGroupByFile()) {
newChildren.addAll(Arrays.asList(child.getChildren()));
}
+ else {
+ if(child.getChildren().length != 0) {
+ newChildren.add(child);
+ }
+ }
}
- return newChildren.toArray(new SimpleNode[newChildren.size()]);
}
- return children.toArray(new SimpleNode[children.size()]);
+ return newChildren.toArray(new SimpleNode[newChildren.size()]);
}
@Override
View
17 src/ui/reviewtoolwindow/nodes/ModuleNode.java
@@ -5,33 +5,20 @@
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.module.Module;
-import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.Project;
-import com.intellij.openapi.roots.ModuleRootManager;
-import com.intellij.openapi.roots.ProjectFileIndex;
-import com.intellij.openapi.roots.ProjectRootManager;
-import com.intellij.openapi.roots.impl.ProjectFileIndexImpl;
-import com.intellij.openapi.util.Iconable;
-import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.pom.Navigatable;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiFile;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.ui.treeStructure.SimpleNode;
-import com.intellij.util.IconUtil;
import org.jetbrains.annotations.NotNull;
-import reviewresult.Review;
-import reviewresult.ReviewManager;
import ui.reviewtoolwindow.ReviewToolWindowSettings;
-import ui.reviewtoolwindow.Searcher;
import javax.swing.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import java.util.Set;
/**
* User: Alisa.Afonina
@@ -87,7 +74,9 @@ public void update(PresentationData data) {
@Override
public void navigate(boolean requestFocus) {
- Document document = FileDocumentManager.getInstance().getDocument(module.getModuleFile());
+ VirtualFile moduleFile = module.getModuleFile();
+ if(moduleFile == null) return;
+ Document document = FileDocumentManager.getInstance().getDocument(moduleFile);
if(document == null) return;
PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document);
if (psiFile == null) return;
View
9 src/ui/reviewtoolwindow/nodes/PlainNode.java
@@ -1,12 +1,11 @@
package ui.reviewtoolwindow.nodes;
-import com.intellij.ide.util.treeView.NodeDescriptor;
import com.intellij.openapi.project.Project;
-import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.treeStructure.SimpleNode;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
@@ -16,13 +15,13 @@
*/
public abstract class PlainNode extends SimpleNode {
protected List<PlainNode> children = new ArrayList<PlainNode>();
- protected PlainNode parent;
+ private PlainNode parent;
public PlainNode(Project project) {
super(project);
}
public List<PlainNode> getPlainChildren() {
- return children;
+ return Collections.unmodifiableList(children);
}
public void removeChild(PlainNode child) {
@@ -45,6 +44,4 @@ public PlainNode getPlainParent() {
public void setPlainParent(PlainNode parent) {
this.parent = parent;
}
-
-
}
View
23 src/ui/reviewtoolwindow/nodes/ReviewNode.java
@@ -1,35 +1,18 @@
package ui.reviewtoolwindow.nodes;
-import com.intellij.codeInsight.highlighting.HighlightManager;
-import com.intellij.find.findUsages.FindUsagesManager;
import com.intellij.ide.projectView.PresentationData;
-import com.intellij.ide.util.treeView.AbstractTreeNode;
-import com.intellij.ide.util.treeView.NodeDescriptor;
-import com.intellij.openapi.editor.Document;
-import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.colors.EditorColors;
import com.intellij.openapi.editor.colors.EditorColorsManager;
import com.intellij.openapi.editor.markup.TextAttributes;
-import com.intellij.openapi.fileEditor.FileDocumentManager;
-import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
import com.intellij.openapi.project.Project;
-import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.pom.Navigatable;
-import com.intellij.psi.PsiDocumentManager;
-import com.intellij.psi.PsiFile;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.ui.treeStructure.SimpleNode;
-import org.apache.xmlbeans.xml.stream.events.ElementTypeNames;
import org.jetbrains.annotations.NotNull;
import reviewresult.Review;
-import ui.actions.ReviewActionManager;
import ui.reviewtoolwindow.Searcher;
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
import java.util.List;
<