[tracklink commit] r60 - in trunk: . modules/plugin modules/plugin/META-INF modules/sample modules/sample/src module...

0 views
Skip to first unread message

codesite...@google.com

unread,
Aug 24, 2007, 5:03:01 AM8/24/07
to tracklink...@googlegroups.com
Author: sereda
Date: Fri Aug 24 01:57:18 2007
New Revision: 60

Added:
trunk/modules/sample/
trunk/modules/sample/SampleDeskzillaPlugin.iml
trunk/modules/sample/src/
trunk/modules/sample/src/deskzilla/
trunk/modules/sample/src/deskzilla/plugin/
trunk/modules/sample/src/deskzilla/plugin/ArtifactCache.java
trunk/modules/sample/src/deskzilla/plugin/CollectionMonitor.java
trunk/modules/sample/src/deskzilla/plugin/Form.form
trunk/modules/sample/src/deskzilla/plugin/Form.java
trunk/modules/sample/src/deskzilla/plugin/Main.java
trunk/modules/sample/src/deskzilla/plugin/MainFrame.java
trunk/modules/tracklink/src/com/almworks/tracklink/popup/ArtifactInfoList.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/ToolPanel.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/LoadStackTraceAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/table/
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/table/IssueTableController.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/table/PluginBaseComponents.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/table/model/
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/table/model/ArtifactCollectionRow.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/table/model/ArtifactInfoRow.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/table/model/FilteringCache.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/table/model/IssueTableModel.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/table/model/TableAbstractRow.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/table/model/TableCollectionRow.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/table/model/TableFilteringRow.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/table/view/
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/table/view/IssueTable.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/table/view/IssueTableCellRenderer.java
trunk/modules/tracklink/src/com/almworks/util/ui/
trunk/modules/tracklink/src/com/almworks/util/ui/ColorUtil.java
trunk/modules/tracklink/src/com/almworks/util/ui/SpeedSearchPopup.java
trunk/modules/tracklink/tests/com/almworks/dashboard/
trunk/modules/tracklink/tests/com/almworks/dashboard/MockBugTableModel.java
trunk/modules/tracklink/tests/com/almworks/dashboard/TestBugTable.java
trunk/modules/tracklink/tests/com/almworks/util/regexp/
trunk/modules/tracklink/tests/com/almworks/util/regexp/RegexpTests.java
Removed:
trunk/modules/tracklink/rc/com/almworks/tracklink/icons/associate.png
trunk/modules/tracklink/rc/com/almworks/tracklink/icons/bug.png
trunk/modules/tracklink/rc/com/almworks/tracklink/icons/bug_stacktrace.png
trunk/modules/tracklink/rc/com/almworks/tracklink/icons/dissociate.png
trunk/modules/tracklink/rc/com/almworks/tracklink/icons/linked.png
trunk/modules/tracklink/rc/com/almworks/tracklink/icons/start_work.png
trunk/modules/tracklink/rc/com/almworks/tracklink/icons/stop_work.png
trunk/modules/tracklink/src/com/almworks/tracklink/checkin/IconColumnInfo.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/ArtifactPresentationColumnInfo.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/AssociationsController.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/ColumnConfigurator.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/DashboardNodeController.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/DashboardTableCellRenderer.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/ArtifactInfoNodeCollectionAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/AssociationsHistoryAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/AssosiateWithIssueAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/DeassociateWithIssueAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/FilterAssociatedAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/PrintStackTraceAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/RedoAssociationAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/StartWorkAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/StopWorkAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/SwitchViewAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/UndoAssociationAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/details/
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/tree/
trunk/tracklink6.ipr
Modified:
trunk/build7.xml
trunk/modules/plugin/META-INF/plugin.xml
trunk/modules/plugin/plugin.iml
trunk/modules/selena/selena.iml
trunk/modules/selena/src/com/almworks/tracklink/vcslinks/VCSUtil.java
trunk/modules/selena/src/com/almworks/tracklink/vcslinks/cache/impl/VCSCacheImpl.java
trunk/modules/tracklink/src/com/almworks/tracklink/ModelCache.java
trunk/modules/tracklink/src/com/almworks/tracklink/PatternIndexer.java
trunk/modules/tracklink/src/com/almworks/tracklink/TrackLinkCaches.java
trunk/modules/tracklink/src/com/almworks/tracklink/TrackLinkPlugin.java
trunk/modules/tracklink/src/com/almworks/tracklink/actions/OpenArtifactsAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/actions/OpenArtifactsInBrowserAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/actions/SearchAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/actions/ShowArtifactInfoAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/actions/ShowDiffDialogAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/actions/ShowSameCodeLinksAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/checkin/ArtifactColumnInfo.java
trunk/modules/tracklink/src/com/almworks/tracklink/checkin/BeforeCheckinDialog.java
trunk/modules/tracklink/src/com/almworks/tracklink/checkin/CheckBoxColumnInfo.java
trunk/modules/tracklink/src/com/almworks/tracklink/checkin/MessageOptionsForm.form
trunk/modules/tracklink/src/com/almworks/tracklink/checkin/TracklinkCheckinHandler.java
trunk/modules/tracklink/src/com/almworks/tracklink/checkin/TracklinkCheckinHandlerFactory.java
trunk/modules/tracklink/src/com/almworks/tracklink/checkin/actions/FilterByWorkedOnAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/cache/ArtifactInfoCache.java
trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/cache/impl/ArtifactInfoCacheImpl.java
trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/highlight/CodeParser.java
trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/highlight/EditorInputHandler.java
trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/highlight/URLTextRange.java
trunk/modules/tracklink/src/com/almworks/tracklink/collections/CollectionsCacheImpl.java
trunk/modules/tracklink/src/com/almworks/tracklink/dialogs/DialogWrapperImpl.java
trunk/modules/tracklink/src/com/almworks/tracklink/filemonitoring/FileEditorWatcherImpl.java
trunk/modules/tracklink/src/com/almworks/tracklink/filemonitoring/FileMapper.java
trunk/modules/tracklink/src/com/almworks/tracklink/filemonitoring/FileMapperImpl.java
trunk/modules/tracklink/src/com/almworks/tracklink/filemonitoring/FileMapperManager.java
trunk/modules/tracklink/src/com/almworks/tracklink/findusages/CodeLinkUsage.java
trunk/modules/tracklink/src/com/almworks/tracklink/findusages/CodeLinkUsageGroup.java
trunk/modules/tracklink/src/com/almworks/tracklink/findusages/CodelinkTypeGroupingRuleProvider.java
trunk/modules/tracklink/src/com/almworks/tracklink/findusages/FindUsagesActionUtil.java
trunk/modules/tracklink/src/com/almworks/tracklink/findusages/FindUtils.java
trunk/modules/tracklink/src/com/almworks/tracklink/findusages/URLUsageTarget.java
trunk/modules/tracklink/src/com/almworks/tracklink/findusages/VCSLinkUsage.java
trunk/modules/tracklink/src/com/almworks/tracklink/findusages/VCSLinkUsageGroup.java
trunk/modules/tracklink/src/com/almworks/tracklink/popup/ArtifactInfoDialogWrapper.java
trunk/modules/tracklink/src/com/almworks/tracklink/popup/HTMLPane.java
trunk/modules/tracklink/src/com/almworks/tracklink/popup/PopupConstants.java
trunk/modules/tracklink/src/com/almworks/tracklink/popup/ToolbarPanel.java
trunk/modules/tracklink/src/com/almworks/tracklink/popup/actions/CreateConnectionAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/popup/actions/DownloadIssueAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/settings/RefTypeEditForm.java
trunk/modules/tracklink/src/com/almworks/tracklink/settings/ReferenceSettingsPanelForm.java
trunk/modules/tracklink/src/com/almworks/tracklink/settings/ReferencesSettingsForm.form
trunk/modules/tracklink/src/com/almworks/tracklink/settings/forms/JIRAForm.form
trunk/modules/tracklink/src/com/almworks/tracklink/settings/wizards/impl/BugzillaSettingsWizard.java
trunk/modules/tracklink/src/com/almworks/tracklink/settings/wizards/impl/JIRASettingsWizard.java
trunk/modules/tracklink/src/com/almworks/tracklink/settings/wizards/impl/MantisSettingsWizard.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/Dashboard.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/IssueMonitor.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/AddIssueCollectionAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/DataKey.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/RemoveIssueCollectionAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/ShowSettingsDialogAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/toolwindow/actions/StartDeskzillaAction.java
trunk/modules/tracklink/src/com/almworks/tracklink/util/PluginDataConstants.java
trunk/modules/tracklink/src/com/almworks/tracklink/util/PluginIcons.java
trunk/modules/tracklink/src/com/almworks/tracklink/util/StringBundle.properties
trunk/modules/tracklink/src/com/almworks/tracklink/util/Utils.java
trunk/modules/tracklink/src/com/almworks/tracklink/vcslinks/VcsFileRevisionWrapper.java
trunk/modules/tracklink/tests/com/almworks/tracklink/util/UtilsTests.java
trunk/modules/tracklink/tests/com/almworks/tracklink/vcslinks/comments/CommentMakerParserTests.java
trunk/modules/tracklink/tracklink.iml
trunk/tracklink7.ipr

Log:
merge from repa

Modified: trunk/build7.xml
==============================================================================
--- trunk/build7.xml (original)
+++ trunk/build7.xml Fri Aug 24 01:57:18 2007
@@ -1,5 +1,6 @@
<project default="dist" basedir="." name="TrackLink">
- <target name="dist" depends="prepare, setupCM, copyResources, copyRedist, doCompile, doTests, makeVersion, makeClassesJar, makeZIP"/>
+ <target name="dist"
+ depends="prepare, setupCM, copyResources, copyRedist, doCompile, doTests, makeVersion, makeClassesJar, makeZIP"/>
<target name="integrate" depends="setupCM, setupCMWritable, dist, commitCM"/>

<property name="dir.build" value="build"/>
@@ -28,6 +29,7 @@
</presetdef>

<target name="prepare">
+ <fail unless="idea.home" message="no idea.home"/>
<mkdir dir="${dir.build}"/>
<delete>
<fileset dir="${dir.build}" includes="**/**"/>
@@ -87,7 +89,7 @@
<fileset dir="${dir.dist}" includes="*.jar"/>
</move>
<copy todir="${dir.dist}/tracklink">
- <fileset dir="distimage" excludes="**/CVS/**/*"/>
+ <fileset dir="distimage" excludes="**/.svn/**/*"/>
</copy>
</target>

@@ -108,7 +110,7 @@
<target name="makeVersion" depends="updateCM, incrementCM, loadCM, updateFilesWithCM" if="cm.available"/>

<target name="updateCM" if="cm.writable">
- <cvs command="update -P" dest="${dir.cm}" failonerror="true" quiet="true"/>
+ <exec command="svn -q update" failonerror="true" dir="${dir.cm}"/>
</target>

<target name="incrementCM" if="cm.writable">
@@ -142,4 +144,7 @@
<exec command="svn commit -mbuild.${tracklink.build} ${build.properties}" dir="${dir.cm}" failonerror="true"/>
</target>

+ <target name="copyToIdea">
+ <copydir src="${dir.dist}/tracklink" dest="${idea.home}/plugins"/>
+ </target>
</project>

Modified: trunk/modules/plugin/META-INF/plugin.xml
==============================================================================
--- trunk/modules/plugin/META-INF/plugin.xml (original)
+++ trunk/modules/plugin/META-INF/plugin.xml Fri Aug 24 01:57:18 2007
@@ -10,28 +10,30 @@
<![CDATA[<html>
TrackLink (build #BUILD#) offers integrated issue tracking with <a href="http://bugzilla.org">Bugzilla</a> or
<a href="http://www.atlassian.com/software/jira/">Atlassian JIRA</a>.
- TrackLink allows to monitor queries in IDEA, start/stop work on issues, generate VCS commit message,
- link VCS commit to issues and more.
+ TrackLink allows to monitor issues in IDEA, analyze stack traces contained in issues,
+ generate VCS commit message and more.
A corresponding
- desktop issue tracking client from ALM Works is required - Deskzilla (for Bugzilla) or JIRA Client (for JIRA).
+ desktop issue tracking client from ALM Works is required -
+ <a href="http://almworks.com/deskzilla">Deskzilla</a> (for Bugzilla) or
+ <a href="http://almworks.com/jiraclient">JIRA Client</a> (for JIRA).
</html>]]>
</description>
<change-notes>
<![CDATA[<html>
- New in TrackLink 1.1:
+ New in TrackLink 2.0:
<ul>
- <li>TrackLink tool window shows files that have been associated with selected issues;</li>
- <li>Pre-commit dialog and commit message format are improved;</li>
- <li>Stripe tooltip to the right of the editor shows issue summary for code links;</li>
- <li>Updated configuration dialog;</li>
- <li>Commit message is displayed in Find Usages result when VCS links are found;</li>
- <li>Other improvements and fixes.</li>
+ <li>Revamped TrackLink tool window with better look and feel;</li>
+ <li>Analyze stacktrace from issue;</li>
+ <li>Quick search through issues;</li>
+ <li>Multiline tooltips showing issue content;</li>
+ <li>Removed buggy functionality for automatic association of issues and code;</li>
+ <li>Fixed a few bugs.</li>
</ul>
</html>]]>
</change-notes>

<version>#VERSION#.#BUILD#</version>
- <idea-version since-build="6500"/>
+ <idea-version since-build="6900"/>

<project-components>
<component>
@@ -61,54 +63,93 @@
<component>
<implementation-class>com.almworks.tracklink.MigrationConfig</implementation-class>
</component>
- </application-components>
+ </application-components>
<actions>
- <action id="TrackLink.OpenIssue" class="com.almworks.tracklink.actions.OpenArtifactsAction"
+ <action id="TrackLink.OpenIssueInPanel" class="com.almworks.tracklink.actions.OpenArtifactsAction"
text="Open Issue in Tracker"
- description="Open issue in integrated Deskzilla or JIRA Client">
- <mouse-shortcut keystroke="ctrl button1" keymap="$default"/>
+ description="Open issue in integrated Deskzilla or JIRA Client"
+ >
+ <mouse-shortcut keystroke="shift button1" keymap="$default"/>
+ <keyboard-shortcut first-keystroke="shift ENTER" keymap="$default"/>
+ </action>
+
+ <action id="TrackLink.OpenIssueInEditor" class="com.almworks.tracklink.actions.OpenArtifactsAction"
+ text="Open Issue in Tracker"
+ description="Open issue in integrated Deskzilla or JIRA Client"
+ >
<keyboard-shortcut first-keystroke="ctrl alt shift T" keymap="$default"/>
- <keyboard-shortcut first-keystroke="alt ENTER" keymap="$default"/>
</action>
- <action id="TrackLink.OpenIssueInBrowser" class="com.almworks.tracklink.actions.OpenArtifactsInBrowserAction"
+
+ <action id="TrackLink.OpenIssueInBrowserInEditor" class="com.almworks.tracklink.actions.OpenArtifactsInBrowserAction"
text="Open Issue in Browser"
- description="Open issue in a browser">
- <mouse-shortcut keystroke="ctrl alt button1" keymap="$default"/>
+ description="Open issue in browser">
+
<keyboard-shortcut first-keystroke="ctrl alt shift O" keymap="$default"/>
</action>
+
+
+ <action id="TrackLink.OpenIssueInBrowserInPanel" class="com.almworks.tracklink.actions.OpenArtifactsInBrowserAction"
+ text="Open Issue in Browser"
+ description="Open issue in browser">
+
+ <mouse-shortcut keystroke="alt button1" keymap="$default"/>
+ <keyboard-shortcut first-keystroke="alt ENTER" keymap="$default"/>
+ </action>
+
+
<action class="com.almworks.tracklink.actions.ShowArtifactInfoAction"
text="View Issue"
- id="TrackLink.ShowIssueLocally" description="View issue details in a pop-up window">
- <keyboard-shortcut first-keystroke="ctrl alt shift I" keymap="$default"/>
+ id="TrackLink.ShowIssueLocallyInPanel" description="View issue details in a pop-up window">
<keyboard-shortcut first-keystroke="ENTER" keymap="$default"/>
- <mouse-shortcut keystroke="alt button1" keymap="$default"/>
+ <mouse-shortcut keystroke="button1 doubleClick" keymap="$default"/>
</action>
- <action id="TrackLink.ShowSameCodeLinks" class="com.almworks.tracklink.actions.ShowSameCodeLinksAction"
+
+ <action class="com.almworks.tracklink.actions.ShowArtifactInfoAction"
+ text="View Issue"
+ id="TrackLink.ShowIssueLocallyInEditor" description="View issue details in a pop-up window">
+ <keyboard-shortcut first-keystroke="ctrl alt shift I" keymap="$default"/>
+ </action>
+
+ <action id="TrackLink.ShowSameCodeLinksInPanel" class="com.almworks.tracklink.actions.ShowSameCodeLinksAction"
+ text="Find Issue Usages"
+ description="Find links to issue in the source code and in VCS"
+ icon="/actions/find.png"
+ >
+ <keyboard-shortcut keymap="$default" first-keystroke="alt F7"/>
+ </action>
+
+ <action id="TrackLink.ShowSameCodeLinksInEditor" class="com.almworks.tracklink.actions.ShowSameCodeLinksAction"
text="Find Issue Usages"
- description="Find links to issue in the source code and in VCS">
- <keyboard-shortcut keymap="$default" first-keystroke="ctrl alt F7"/>
+ description="Find links to issue in the source code and in VCS"
+ icon="/actions/find.png"
+ >
+ <keyboard-shortcut keymap="$default" first-keystroke="ctrl alt shift F7"/>
</action>
- <action id="TrackLink.SwitchView" class="com.almworks.tracklink.toolwindow.actions.SwitchViewAction"
- text="Show as Tree" description="Switch tree/list view mode" icon="/_cvs/showAsTree.png"/>
- <action id="TrackLink.StartWork" class="com.almworks.tracklink.toolwindow.actions.StartWorkAction"
+ <!--
+ <action id="TrackLink.StartWork" class="com.almworks.tracklink.toolwindow.actions.depricated.StartWorkAction"
text="Start Work"
description="Make selected issues active. Active issues are associated with changes made in the editor."
icon="/com/almworks/tracklink/icons/start_work.png">
- <!--<mouse-shortcut keystroke="button1 doubleClick" keymap="$default"/>-->
- </action>
- <action id="TrackLink.StopWork" class="com.almworks.tracklink.toolwindow.actions.StopWorkAction"
+
+ </action>-->
+ <!--<action id="TrackLink.StopWork" class="com.almworks.tracklink.toolwindow.actions.depricated.StopWorkAction"
text="Stop Work"
description="Make selected issues not active. Any associations with changes will remain until committed to VCS."
icon="/com/almworks/tracklink/icons/stop_work.png">
- <!--<mouse-shortcut keystroke="button1 doubleClick" keymap="$default"/>-->
- </action>
+ <mouse-shortcut keystroke="button1 doubleClick" keymap="$default"/>
+ </action-->
<action id="TrackLink.AddIssueCollection" class="com.almworks.tracklink.toolwindow.actions.AddIssueCollectionAction"
text="Add Query" description="Monitor Deskzilla/JIRA Client query or issue collection"
- icon="/general/add.png"/>
+ icon="/general/add.png">
+ <keyboard-shortcut first-keystroke="INSERT" keymap="$default"/>
+ </action>
+
<action id="TrackLink.RemoveIssueCollection"
class="com.almworks.tracklink.toolwindow.actions.RemoveIssueCollectionAction"
text="Remove Query" description="Stop monitoring query or issue collection"
- icon="/general/remove.png"/>
+ icon="/general/remove.png">
+ <keyboard-shortcut first-keystroke="DELETE" keymap="$default"/>
+ </action>
<action id="TrackLink.StartDeskzilla" class="com.almworks.tracklink.toolwindow.actions.StartDeskzillaAction"
text="Start Deskzilla/JIRA Client" description="Start Deskzilla/JIRA Client"
icon="/com/almworks/tracklink/icons/start_deskzilla.png"/>
@@ -120,36 +161,36 @@
description="Find issue usages by issue URL"
icon="/actions/find.png">
</action>
-<!--
- <action id="TrackLink.PrintStackTrace" class="com.almworks.tracklink.toolwindow.actions.PrintStackTraceAction"
- text="Print Stacktrace to Console"
- description="Print Stacktrace to System console"
- icon="/com/almworks/tracklink/icons/bug_stacktrace.png"/>
--->
<action class="com.almworks.tracklink.actions.ShowDiffDialogAction" text="Show Difference"
id="TracklinkShowDifference" icon="/actions/diff.png">
<mouse-shortcut keystroke="button1 doubleClick" keymap="$default"/>
<add-to-group group-id="UsageView.Popup" anchor="first"/>
</action>
- <action class="com.almworks.tracklink.toolwindow.actions.AssosiateWithIssueAction"
+ <action id="TrackLink.LoadStackTrace" class="com.almworks.tracklink.toolwindow.actions.LoadStackTraceAction"
+ text="Analyze Stacktrace"
+ description="Analyze stack trace from issue contents"
+ icon="/debugger/db_exception_breakpoint.png">
+ <keyboard-shortcut keymap="$default" first-keystroke="ctrl ENTER"/>
+ <mouse-shortcut keystroke="ctrl button1" keymap="$default"/>
+ </action>
+ <!--<action class="com.almworks.tracklink.toolwindow.actions.associations.AssosiateWithIssueAction"
text="Associate selected issues with changes in selected files"
id="TracklinkAssociateWithIssue"/>
- <action class="com.almworks.tracklink.toolwindow.actions.DeassociateWithIssueAction"
+ <action class="com.almworks.tracklink.toolwindow.actions.associations.DeassociateWithIssueAction"
text="Remove associations between selected issues and selected files"
id="TracklinkDeassociateWithIssue"/>
- <group id="TrackLinkPopupMenu">
- <reference id="TrackLink.ShowIssueLocally"/>
- <reference id="TrackLink.OpenIssue"/>
- <reference id="TrackLink.OpenIssueInBrowser"/>
- <reference id="TrackLink.ShowSameCodeLinks"/>
+ -->
+ <group id="TrackLinkPopupMenu" popup="false">
+ <reference id="TrackLink.ShowIssueLocallyInEditor"/>
+ <reference id="TrackLink.OpenIssueInEditor"/>
+ <reference id="TrackLink.OpenIssueInBrowserInEditor"/>
+ <reference id="TrackLink.ShowSameCodeLinksInEditor"/>
<separator/>
<add-to-group anchor="first" group-id="EditorPopupMenu"/>
</group>
+
+
<group id="DashboardToolbar" popup="false">
- <reference id="TrackLink.SwitchView"/>
- <!--<separator/>-->
- <reference id="TrackLink.StartWork"/>
- <reference id="TrackLink.StopWork"/>
<reference id="TrackLink.AddIssueCollection"/>
<reference id="TrackLink.RemoveIssueCollection"/>
<reference id="TrackLink.StartDeskzilla"/>
@@ -157,24 +198,24 @@
<!--<separator/>-->
<reference id="TrackLink.ShowSettings"/>
</group>
+
<group id="DashboardPopup" popup="true">
- <reference id="TrackLink.ShowIssueLocally"/>
- <reference id="TrackLink.OpenIssue"/>
- <reference id="TrackLink.OpenIssueInBrowser"/>
- <reference id="TrackLink.ShowSameCodeLinks"/>
- <separator/>
- <reference id="TrackLink.StartWork"/>
- <reference id="TrackLink.StopWork"/>
+ <reference id="TrackLink.ShowIssueLocallyInPanel"/>
+ <reference id="TrackLink.OpenIssueInPanel"/>
+ <reference id="TrackLink.OpenIssueInBrowserInPanel"/>
+ <reference id="TrackLink.ShowSameCodeLinksInPanel"/>
+ <reference id="TrackLink.LoadStackTrace"/>
+
<reference id="TrackLink.RemoveIssueCollection"/>
- <!--<separator/>-->
- <!--<reference id="TrackLink.PrintStackTrace"/>-->
</group>

+
<action class="com.almworks.tracklink.checkin.actions.FilterByWorkedOnAction"
text="Show only issues that are associated with changes"
id="TrackLink.FilterByWorked"
icon="/ant/filter.png"/>
- <action class="com.almworks.tracklink.checkin.actions.SetAllAction" text="Link all issues with the change set" id="TrackLink.SetAll"
+ <action class="com.almworks.tracklink.checkin.actions.SetAllAction" text="Link all issues with the change set"
+ id="TrackLink.SetAll"
icon="/com/almworks/tracklink/icons/setall.png"/>
<action class="com.almworks.tracklink.checkin.actions.ClearAllAction"
text="Link no issues"
@@ -185,24 +226,24 @@
id="TrackLink.SetSelection" icon="/com/almworks/tracklink/icons/setselected.png"/>
<action class="com.almworks.tracklink.checkin.actions.ClearSelectionAction" text="Do not link selected issues"
id="TrackLink.ClearSelection" icon="/com/almworks/tracklink/icons/clearselected.png"/>
-
- <action class="com.almworks.tracklink.toolwindow.actions.UndoAssociationAction"
+ <!--
+ <action class="com.almworks.tracklink.toolwindow.actions.associations.UndoAssociationAction"
text="Undo associate"
description="Undo last associate/unassociate action"
id="TrackLink.UndoAssociate" icon="/actions/undo.png">
<keyboard-shortcut first-keystroke="ctrl Z" keymap="$default"/>
</action>
- <action class="com.almworks.tracklink.toolwindow.actions.RedoAssociationAction"
+ <action class="com.almworks.tracklink.toolwindow.actions.associations.RedoAssociationAction"
text="Redo associate"
description="Redo associate/unassociate action that has been undone last"
id="TrackLink.RedoAssociate" icon="/actions/redo.png">
<keyboard-shortcut first-keystroke="ctrl shift Z" keymap="$default"/>
</action>
- <action class="com.almworks.tracklink.toolwindow.actions.FilterAssociatedAction"
+ <action class="com.almworks.tracklink.toolwindow.actions.associations.FilterAssociatedAction"
text="Show associated files only"
description="Show only files associated with selected issues" id="Tracklink.FilterAssociatedAction"
icon="/ant/filter.png"/>
-
+ -->
<group id="CheckinDialog.Toolbar" popup="false">
<reference id="TrackLink.FilterByWorked"/>
<separator/>
@@ -220,11 +261,14 @@
text="Create Connection"
description="Create missing connection in Deskzilla/JIRA Client"
id="TrackLink.CreateConnection" icon="/com/almworks/tracklink/icons/addConnection.png"/>
+
<group id="Tracklink.Popup.Toolbar" popup="false">
<reference id="TrackLink.StartDeskzilla"/>
<reference id="TrackLink.DownloadIssue"/>
<reference id="TrackLink.CreateConnection"/>
</group>
+
+ <!--
<group id="Tracklink.Details.Toolbar" popup="false">
<reference id="Tracklink.FilterAssociatedAction"/>
<reference id="TracklinkAssociateWithIssue"/>
@@ -232,6 +276,7 @@
<reference id="TrackLink.UndoAssociate"/>
<reference id="TrackLink.RedoAssociate"/>
</group>
+
<group id="Tracklink.Details.PopupMenu" popup="false">
<reference id="TracklinkAssociateWithIssue"/>
<reference id="TracklinkDeassociateWithIssue"/>
@@ -240,6 +285,7 @@
<separator/>
<reference id="EditSource"/>
</group>
+ -->
</actions>
<extensions xmlns="com.intellij">
<indexPatternProvider implementation="com.almworks.tracklink.PatternIndexer"/>

Modified: trunk/modules/plugin/plugin.iml
==============================================================================
--- trunk/modules/plugin/plugin.iml (original)
+++ trunk/modules/plugin/plugin.iml Fri Aug 24 01:57:18 2007
@@ -1,15 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module relativePaths="true" type="PLUGIN_MODULE" version="4">
<component name="DevKit.ModuleBuildProperties" url="file://$MODULE_DIR$/META-INF/plugin.xml" />
- <component name="ModuleRootManager" />
- <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/../../build/class" />
<exclude-output />
+ <output-test url="file://$MODULE_DIR$/../../build/class" />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="demetra" />
- <orderEntry type="module" module-name="tracklink" />
- <orderEntry type="module" module-name="selena" />
+ <orderEntry type="module" module-name="tracklink" exported="" />
<orderEntryProperties />
</component>
</module>

Added: trunk/modules/sample/SampleDeskzillaPlugin.iml
==============================================================================
--- (empty file)
+++ trunk/modules/sample/SampleDeskzillaPlugin.iml Fri Aug 24 01:57:18 2007
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/../build.idea/SampleDeskzillaPlugin/classes" />
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="almworks-tracker-api" level="project" />
+ <orderEntry type="library" name="commons-codec" level="project" />
+ <orderEntry type="library" name="xmlrpc" level="project" />
+ <orderEntryProperties />
+ </component>
+</module>
+

Added: trunk/modules/sample/src/deskzilla/plugin/ArtifactCache.java
==============================================================================
--- (empty file)
+++ trunk/modules/sample/src/deskzilla/plugin/ArtifactCache.java Fri Aug 24 01:57:18 2007
@@ -0,0 +1,98 @@
+package deskzilla.plugin;
+
+import com.almworks.dup.util.EventListener;
+import com.almworks.dup.util.Lifespan;
+import com.almworks.tracker.eapi.alpha.*;
+
+import javax.swing.*;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.*;
+
+//#971 , #345656
+public class ArtifactCache implements EventListener<ArtifactInfoEvent> {
+ private final TrackerConnector myConnector;
+ private final Form myForm;
+ private final Map<String, ArtifactInfo> myCache = new LinkedHashMap<String, ArtifactInfo>();
+ private final DefaultListModel myUrlListModel = new DefaultListModel(); // of ArtifactInfo
+
+ public ArtifactCache(TrackerConnector connector, Form form) {
+ myConnector = connector;
+ myForm = form;
+ init();
+ }
+
+ private void init() {
+ myConnector.getArtifactLoader().events().addListener(Lifespan.FOREVER, ArtifactInfoEvent.class, this);
+ myForm.setArtifactCacheListModel(myUrlListModel);
+ myForm.setArtifactCacheListRenderer(new MyArtifactInfoRenderer());
+ final ListSelectionModel selectionModel = myForm.getArtifactCacheSelectionModel();
+ selectionModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ selectionModel.addListSelectionListener(new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent e) {
+ int index = selectionModel.getMinSelectionIndex();
+ if (index >= 0 && index < myUrlListModel.size()) {
+ ArtifactInfo info = (ArtifactInfo) myUrlListModel.get(index);
+ updateDetails(info);
+ }
+ }
+ });
+ myForm.addClearCacheButtonListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ myCache.clear();
+ myUrlListModel.clear();
+ }
+ });
+ }
+
+ public void onEvent(ArtifactInfoEvent event) {
+ ArtifactInfo info = event.getArtifactInfo();
+ String url = info.getUrl();
+ myCache.put(url, info);
+ int i;
+ int size = myUrlListModel.size();
+ for (i = 0; i < size; i++) {
+ ArtifactInfo ai = (ArtifactInfo) myUrlListModel.get(i);
+ if (ai.getUrl().equals(url)) {
+ myUrlListModel.set(i, info);
+ int selection = myForm.getArtifactCacheSelectionModel().getMinSelectionIndex();
+ if (selection == i) {
+ updateDetails(info);
+ }
+ break;
+ }
+ }
+ if (i == size) {
+ myUrlListModel.addElement(info);
+ }
+ }
+
+ private void updateDetails(ArtifactInfo info) {
+ Collection<ArtifactPresentationKey> keys = info.getApplicableKeys();
+ Map<ArtifactPresentationKey, Object> props = new HashMap<ArtifactPresentationKey, Object>();
+ for (ArtifactPresentationKey key : keys) {
+ Object presentation = info.getPresentation(key);
+ props.put(key, presentation);
+ }
+ myForm.setArtifactCacheSelectedProps(props);
+ }
+
+ private static class MyArtifactInfoRenderer extends DefaultListCellRenderer {
+ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
+ boolean cellHasFocus)
+ {
+ ArtifactInfo info = (ArtifactInfo) value;
+ String url = info.getUrl();
+ ArtifactInfoStatus status = info.getStatus();
+ long timestamp = info.getTimestamp();
+ String v = url + " (" + status.getExternalName();
+ if (timestamp > 0)
+ v = v + ", updated " + new Date(timestamp);
+ v = v + ")";
+ return super.getListCellRendererComponent(list, v, index, isSelected, cellHasFocus);
+ }
+ }
+}

Added: trunk/modules/sample/src/deskzilla/plugin/CollectionMonitor.java
==============================================================================
--- (empty file)
+++ trunk/modules/sample/src/deskzilla/plugin/CollectionMonitor.java Fri Aug 24 01:57:18 2007
@@ -0,0 +1,151 @@
+package deskzilla.plugin;
+
+import com.almworks.dup.util.DetachComposite;
+import com.almworks.dup.util.EventListener;
+import com.almworks.dup.util.Lifespan;
+import com.almworks.tracker.eapi.alpha.CollectionData;
+import com.almworks.tracker.eapi.alpha.CollectionUpdateEvent;
+import com.almworks.tracker.eapi.alpha.TrackerConnector;
+
+import javax.swing.*;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.*;
+
+public class CollectionMonitor {
+ private final TrackerConnector myConnector;
+ private final Form myForm;
+ private final Map<String, Watched> myWatched = new LinkedHashMap<String, Watched>();
+ private final DefaultListModel myCollectionListModel = new DefaultListModel();
+ private final Map<String, Set<String>> myReportedUrls = new HashMap<String, Set<String>>();
+
+ private boolean mySubsribed = false;
+
+ public CollectionMonitor(TrackerConnector connector, Form form) {
+ myConnector = connector;
+ myForm = form;
+ myForm.setCollectionListModel(myCollectionListModel);
+ myForm.setCollectionListRenderer(new MyRenderer());
+ final ListSelectionModel selectionModel = myForm.getWatchedCollectionSelectionModel();
+ selectionModel.addListSelectionListener(new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent e) {
+ int index = selectionModel.getMinSelectionIndex();
+ displayUrlInfo(index);
+ }
+ });
+ myForm.addUnsubscribeButtonListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ int index = selectionModel.getMinSelectionIndex();
+ if (index >= 0 && index < myCollectionListModel.size()) {
+ CollectionData data = (CollectionData) myCollectionListModel.remove(index);
+ Watched watched = myWatched.remove(data.getCollectionId());
+ assert watched != null;
+ watched.detach.detach();
+ }
+ }
+ });
+ }
+
+ private void displayUrlInfo(int index) {
+ if (index < 0 || index >= myCollectionListModel.size() ||
+ !myForm.getWatchedCollectionSelectionModel().isSelectedIndex(index))
+ return;
+ CollectionData collection = (CollectionData) myCollectionListModel.get(index);
+ String id = collection.getCollectionId();
+ Set<String> urls = myReportedUrls.get(id);
+ if (urls == null || urls.size() == 0) {
+ myForm.setCollectionContent("-- empty collection --");
+ } else {
+ StringBuffer sb = new StringBuffer();
+ for (String url : urls) {
+ if (sb.length() > 0)
+ sb.append('\n');
+ sb.append(url);
+ }
+ myForm.setCollectionContent(sb.toString());
+ }
+ }
+
+ public void addCollection(CollectionData collection) {
+ subcribe();
+ updateCollection(collection);
+ }
+
+ private int updateCollection(CollectionData collection) {
+ String cid = collection.getCollectionId();
+ if (!myWatched.containsKey(cid)) {
+ Watched watched = new Watched();
+ watched.data = collection;
+ watched.detach = new DetachComposite();
+ myWatched.put(cid, watched);
+ myConnector.getArtifactCollectionMonitor().watchCollection(this, watched.detach, cid);
+ myCollectionListModel.addElement(collection);
+ return myCollectionListModel.size() - 1;
+ } else {
+ Watched old = myWatched.get(cid);
+ CollectionData oldCollection = old.data;
+ if (!oldCollection.equals(collection)) {
+ old.data = collection;
+ int k = myCollectionListModel.indexOf(oldCollection);
+ if (k == -1) {
+ myCollectionListModel.addElement(collection);
+ } else {
+ ListSelectionModel selectionModel = myForm.getWatchedCollectionSelectionModel();
+ int selected = selectionModel.getMinSelectionIndex();
+ myCollectionListModel.remove(k);
+ myCollectionListModel.add(k, collection);
+ if (selected == k) {
+ selectionModel.setSelectionInterval(k, k);
+ }
+ }
+ return k;
+ } else {
+ return -1;
+ }
+ }
+ }
+
+ private void subcribe() {
+ if (mySubsribed)
+ return;
+ mySubsribed = true;
+ myConnector.getArtifactCollectionMonitor().events()
+ .addListener(Lifespan.FOREVER, CollectionUpdateEvent.class, new EventListener<CollectionUpdateEvent>() {
+ public void onEvent(CollectionUpdateEvent event) {
+ CollectionData collectionData = event.getCollectionData();
+ int index = updateCollection(collectionData);
+ Collection<String> urls = event.getArtifactUrls();
+ myReportedUrls.put(collectionData.getCollectionId(), new LinkedHashSet<String>(urls));
+ displayUrlInfo(index);
+ }
+ });
+ }
+
+ public void addCollection(String id) {
+ if (myWatched.containsKey(id))
+ return;
+ CollectionData data = new CollectionData(id, false, null);
+ addCollection(data);
+ }
+
+ private static class MyRenderer extends DefaultListCellRenderer {
+ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
+ boolean cellHasFocus)
+ {
+ CollectionData data = (CollectionData) value;
+ String id = data.getCollectionId();
+ String name = data.getProperty(CollectionData.COLLECTION_NAME);
+ if (name != null)
+ id = id + " : " + name;
+ return super.getListCellRendererComponent(list, id, index, isSelected, cellHasFocus);
+ }
+ }
+
+ private static class Watched {
+ public CollectionData data;
+ public DetachComposite detach;
+ }
+}

Added: trunk/modules/sample/src/deskzilla/plugin/Form.form
==============================================================================
--- (empty file)
+++ trunk/modules/sample/src/deskzilla/plugin/Form.form Fri Aug 24 01:57:18 2007
@@ -0,0 +1,573 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="deskzilla.plugin.Form">
+ <grid id="9293c" binding="myWholePanel" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <xy x="41" y="17" width="552" height="495"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <grid id="17da0" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="1d0e4" class="javax.swing.JLabel" binding="myConnectionStatus">
+ <constraints>
+ <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Status: Not Connected"/>
+ </properties>
+ </component>
+ <hspacer id="f9533">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+ </constraints>
+ </hspacer>
+ </children>
+ </grid>
+ <tabbedpane id="c464c" binding="myTabbed">
+ <constraints>
+ <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
+ <preferred-size width="200" height="200"/>
+ </grid>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <grid id="9ebe1" layout-manager="GridLayoutManager" row-count="6" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <tabbedpane title="Issues"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <scrollpane id="7db9c">
+ <constraints>
+ <grid row="5" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
+ <preferred-size width="-1" height="100"/>
+ </grid>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="1f8e8" class="javax.swing.JTextArea" binding="myHtml">
+ <constraints/>
+ <properties/>
+ </component>
+ </children>
+ </scrollpane>
+ <scrollpane id="76d7e">
+ <constraints>
+ <grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
+ <preferred-size width="-1" height="100"/>
+ </grid>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="2a651" class="javax.swing.JTextArea" binding="myStylesheet">
+ <constraints/>
+ <properties/>
+ </component>
+ </children>
+ </scrollpane>
+ <scrollpane id="ffbc0">
+ <constraints>
+ <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
+ <preferred-size width="-1" height="200"/>
+ </grid>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="945ed" class="javax.swing.JEditorPane" binding="myBugInfo">
+ <constraints/>
+ <properties>
+ <contentType value="text/html"/>
+ <editable value="false"/>
+ </properties>
+ </component>
+ </children>
+ </scrollpane>
+ <grid id="88111" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="94f5" class="javax.swing.JButton" binding="myRequest">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Request!"/>
+ </properties>
+ </component>
+ <hspacer id="1bc66">
+ <constraints>
+ <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+ </constraints>
+ </hspacer>
+ <component id="72869" class="javax.swing.JLabel" binding="myRequestStatus">
+ <constraints>
+ <grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Status: not requested"/>
+ </properties>
+ </component>
+ </children>
+ </grid>
+ <grid id="aee1" layout-manager="GridLayoutManager" row-count="1" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="58ba9" class="javax.swing.JLabel">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="URL (ID):"/>
+ </properties>
+ </component>
+ <component id="8bb58" class="javax.swing.JTextField" binding="myUrlSuffix">
+ <constraints>
+ <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <columns value="4"/>
+ <text value="100"/>
+ </properties>
+ </component>
+ <component id="da9b3" class="javax.swing.JCheckBox" binding="myDownloadIfMissing">
+ <constraints>
+ <grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <selected value="true"/>
+ <text value="Download If Missing"/>
+ </properties>
+ </component>
+ <component id="fb3b" class="javax.swing.JCheckBox" binding="myCreateConnection">
+ <constraints>
+ <grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Create Connection If Not Connected"/>
+ </properties>
+ </component>
+ </children>
+ </grid>
+ <grid id="1ee69" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="79812" class="javax.swing.JLabel">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="URL Prefix:"/>
+ </properties>
+ </component>
+ <component id="3b775" class="javax.swing.JTextField" binding="myUrlPrefix">
+ <constraints>
+ <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="http://bugs.deskzilla.com/show_bug.cgi?id="/>
+ </properties>
+ </component>
+ </children>
+ </grid>
+ </children>
+ </grid>
+ <grid id="fa45a" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <tabbedpane title="Find Usages"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="d2c32" class="javax.swing.JCheckBox" binding="myRegisterForInboundFindUsages">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Register for inbound find usages command"/>
+ </properties>
+ </component>
+ <scrollpane id="b0de2">
+ <constraints>
+ <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="4f5f2" class="javax.swing.JTextPane" binding="myInboundFindUsageCommands">
+ <constraints/>
+ <properties/>
+ </component>
+ </children>
+ </scrollpane>
+ </children>
+ </grid>
+ <grid id="2b8dd" layout-manager="GridLayoutManager" row-count="6" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <tabbedpane title="Collections"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="dfc8" class="javax.swing.JCheckBox" binding="myListenForAddCollectionRequest">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Listen For Add Collection From Deskzilla"/>
+ </properties>
+ </component>
+ <component id="fbb15" class="javax.swing.JButton" binding="myRequestAddCollection">
+ <constraints>
+ <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Request Add Collection From Deskzilla"/>
+ </properties>
+ </component>
+ <scrollpane id="b0ef">
+ <constraints>
+ <grid row="3" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
+ <preferred-size width="-1" height="150"/>
+ </grid>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="6017d" class="javax.swing.JList" binding="myWatchedCollections">
+ <constraints/>
+ <properties/>
+ </component>
+ </children>
+ </scrollpane>
+ <scrollpane id="76797">
+ <constraints>
+ <grid row="5" column="0" row-span="1" col-span="2" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="ad13f" class="javax.swing.JTextArea" binding="mySelectedCollectionArtifacts">
+ <constraints/>
+ <properties/>
+ </component>
+ </children>
+ </scrollpane>
+ <grid id="5015a" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <grid row="2" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="76dd5" class="javax.swing.JTextField" binding="myCollectionId">
+ <constraints>
+ <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+ <preferred-size width="150" height="-1"/>
+ </grid>
+ </constraints>
+ <properties/>
+ </component>
+ <component id="6f135" class="javax.swing.JButton" binding="myAddCollection">
+ <constraints>
+ <grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Add Collection Manually"/>
+ </properties>
+ </component>
+ <component id="96365" class="javax.swing.JLabel">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Collection ID:"/>
+ </properties>
+ </component>
+ </children>
+ </grid>
+ <component id="78481" class="javax.swing.JButton" binding="myUnsubscribe">
+ <constraints>
+ <grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Unsubscribe"/>
+ </properties>
+ </component>
+ <component id="5087d" class="javax.swing.JButton" binding="myRequestAddDefaultCollections">
+ <constraints>
+ <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Request Add Default Collections"/>
+ </properties>
+ </component>
+ </children>
+ </grid>
+ <grid id="f3d89" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <tabbedpane title="Artifact Cache"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <splitpane id="b639c">
+ <constraints>
+ <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
+ <preferred-size width="200" height="200"/>
+ </grid>
+ </constraints>
+ <properties>
+ <dividerLocation value="128"/>
+ <orientation value="0"/>
+ </properties>
+ <border type="none"/>
+ <children>
+ <scrollpane id="f7047">
+ <constraints>
+ <splitpane position="left"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="bfb7a" class="javax.swing.JList" binding="myCacheUrlList">
+ <constraints/>
+ <properties/>
+ </component>
+ </children>
+ </scrollpane>
+ <splitpane id="a1e1d">
+ <constraints>
+ <splitpane position="right"/>
+ </constraints>
+ <properties>
+ <dividerLocation value="256"/>
+ </properties>
+ <border type="none"/>
+ <children>
+ <scrollpane id="94099">
+ <constraints>
+ <splitpane position="left"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="f8250" class="javax.swing.JList" binding="myCacheKeys">
+ <constraints/>
+ <properties/>
+ </component>
+ </children>
+ </scrollpane>
+ <scrollpane id="347ec" binding="myCacheKeyView">
+ <constraints>
+ <splitpane position="right"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children/>
+ </scrollpane>
+ </children>
+ </splitpane>
+ </children>
+ </splitpane>
+ <component id="dc70b" class="javax.swing.JButton" binding="myClearCacheButton">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="ClearCache"/>
+ </properties>
+ </component>
+ </children>
+ </grid>
+ <grid id="15fc4" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <tabbedpane title="Launch &amp; Connect"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <grid id="6b8f9" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties/>
+ <border type="none"/>
+ <children>
+ <component id="3f684" class="javax.swing.JRadioButton" binding="myAppDeskzilla">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Deskzilla"/>
+ </properties>
+ </component>
+ <component id="fee7b" class="javax.swing.JRadioButton" binding="myAppJiraClient">
+ <constraints>
+ <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="JIRA Client"/>
+ </properties>
+ </component>
+ <hspacer id="a5223">
+ <constraints>
+ <grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+ </constraints>
+ </hspacer>
+ </children>
+ </grid>
+ <grid id="978b1" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties/>
+ <border type="etched" title="Launch"/>
+ <children>
+ <component id="38002" class="javax.swing.JCheckBox" binding="myDebugVersion">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <selected value="true"/>
+ <text value="Prefer Debug Version"/>
+ </properties>
+ </component>
+ <component id="293e2" class="javax.swing.JButton" binding="myLaunchDeskzilla">
+ <constraints>
+ <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Launch Deskzilla"/>
+ </properties>
+ </component>
+ <component id="c239f" class="javax.swing.JTextField" binding="myLaunchWorkspace">
+ <constraints>
+ <grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+ <preferred-size width="150" height="-1"/>
+ </grid>
+ </constraints>
+ <properties/>
+ </component>
+ <component id="41cee" class="javax.swing.JCheckBox" binding="myLaunchUseWorkspace">
+ <constraints>
+ <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Select Workspace:"/>
+ </properties>
+ </component>
+ </children>
+ </grid>
+ <grid id="cc4a4" layout-manager="GridLayoutManager" row-count="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <margin top="0" left="0" bottom="0" right="0"/>
+ <constraints>
+ <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties/>
+ <border type="etched" title="Connect"/>
+ <children>
+ <component id="b931f" class="javax.swing.JLabel">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Select Deskzilla connect method:"/>
+ </properties>
+ </component>
+ <component id="bd89" class="javax.swing.JRadioButton" binding="myUseDiscovery">
+ <constraints>
+ <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Use discovery"/>
+ </properties>
+ </component>
+ <component id="70ddd" class="javax.swing.JRadioButton" binding="myUseWorkspace">
+ <constraints>
+ <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="By workspace"/>
+ </properties>
+ </component>
+ <component id="6bae5" class="javax.swing.JTextField" binding="myWorkspace">
+ <constraints>
+ <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+ <preferred-size width="150" height="-1"/>
+ </grid>
+ </constraints>
+ <properties/>
+ </component>
+ <component id="37da2" class="javax.swing.JRadioButton" binding="myUsePort">
+ <constraints>
+ <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="By port"/>
+ </properties>
+ </component>
+ <component id="8e44c" class="javax.swing.JTextField" binding="myPort">
+ <constraints>
+ <grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+ <preferred-size width="150" height="-1"/>
+ </grid>
+ </constraints>
+ <properties/>
+ </component>
+ <component id="b66c4" class="javax.swing.JButton" binding="myApplyConnectMethod">
+ <constraints>
+ <grid row="4" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text value="Reconnect!"/>
+ </properties>
+ </component>
+ </children>
+ </grid>
+ <vspacer id="e48b3">
+ <constraints>
+ <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+ </constraints>
+ </vspacer>
+ </children>
+ </grid>
+ </children>
+ </tabbedpane>
+ </children>
+ </grid>
+</form>

Added: trunk/modules/sample/src/deskzilla/plugin/Form.java
==============================================================================
--- (empty file)
+++ trunk/modules/sample/src/deskzilla/plugin/Form.java Fri Aug 24 01:57:18 2007
@@ -0,0 +1,348 @@
+package deskzilla.plugin;
+
+import com.almworks.tracker.eapi.alpha.ArtifactPresentationKey;
+import com.almworks.tracker.eapi.alpha.TrackerApplication;
+
+import javax.swing.*;
+import javax.swing.border.CompoundBorder;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.LineBorder;
+import javax.swing.event.DocumentListener;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.text.html.HTMLEditorKit;
+import javax.swing.text.html.StyleSheet;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.io.File;
+import java.util.Map;
+
+public class Form {
+ private JButton myLaunchDeskzilla;
+ private JTextField myUrlPrefix;
+ private JTextField myUrlSuffix;
+ private JCheckBox myDownloadIfMissing;
+ private JCheckBox myCreateConnection;
+ private JButton myRequest;
+ private JEditorPane myBugInfo;
+ private JTextArea myStylesheet;
+ private JCheckBox myDebugVersion;
+ private JLabel myConnectionStatus;
+ private JLabel myRequestStatus;
+ private JTextArea myHtml;
+ private JPanel myWholePanel;
+ private JTabbedPane myTabbed;
+ private JCheckBox myRegisterForInboundFindUsages;
+ private JTextPane myInboundFindUsageCommands;
+ private JCheckBox myListenForAddCollectionRequest;
+ private JButton myRequestAddCollection;
+ private JList myWatchedCollections;
+ private JTextArea mySelectedCollectionArtifacts;
+ private JTextField myCollectionId;
+ private JButton myAddCollection;
+ private JButton myUnsubscribe;
+ private JList myCacheKeys;
+ private JList myCacheUrlList;
+ private JScrollPane myCacheKeyView;
+ private JButton myClearCacheButton;
+
+ private final DefaultListModel myCacheKeysModel = new DefaultListModel();
+ private Map<ArtifactPresentationKey, Object> myLastCacheProps;
+ private JButton myRequestAddDefaultCollections;
+ private JRadioButton myUseDiscovery;
+ private JRadioButton myUseWorkspace;
+ private JTextField myWorkspace;
+ private JRadioButton myUsePort;
+ private JTextField myPort;
+ private JButton myApplyConnectMethod;
+ private JCheckBox myLaunchUseWorkspace;
+ private JTextField myLaunchWorkspace;
+ private JRadioButton myAppDeskzilla;
+ private JRadioButton myAppJiraClient;
+
+ public Form() {
+ initVisual();
+ setupFirstPanel();
+ myWatchedCollections.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ setupCachePanel();
+ setupFifthPanel();
+ setupLaunchPanel();
+ setupAppSelection();
+ }
+
+ private void setupAppSelection() {
+ ButtonGroup group = new ButtonGroup();
+ group.add(myAppDeskzilla);
+ group.add(myAppJiraClient);
+ myAppDeskzilla.setSelected(true);
+ }
+
+ private void setupLaunchPanel() {
+ ActionListener listener = new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ myLaunchWorkspace.setEnabled(myLaunchUseWorkspace.isSelected());
+ }
+ };
+ myLaunchUseWorkspace.addActionListener(listener);
+ listener.actionPerformed(null);
+ }
+
+ private void setupFifthPanel() {
+ ButtonGroup g = new ButtonGroup();
+ g.add(myUseDiscovery);
+ g.add(myUsePort);
+ g.add(myUseWorkspace);
+ myUseDiscovery.setSelected(true);
+ }
+
+ private void setupCachePanel() {
+ myCacheKeys.setModel(myCacheKeysModel);
+ myCacheKeys.setCellRenderer(new DefaultListCellRenderer() {
+ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
+ boolean cellHasFocus)
+ {
+ ArtifactPresentationKey key = (ArtifactPresentationKey) value;
+ String v = key.getName() + " (" + key.getValueClass().getName() + ")";
+ return super.getListCellRendererComponent(list, v, index, isSelected, cellHasFocus);
+ }
+ });
+ final ListSelectionModel selectionModel = myCacheKeys.getSelectionModel();
+ selectionModel.addListSelectionListener(new ListSelectionListener() {
+ public void valueChanged(ListSelectionEvent e) {
+ Map<ArtifactPresentationKey, Object> props = myLastCacheProps;
+ if (props != null) {
+ int index = selectionModel.getMinSelectionIndex();
+ if (index >= 0 && index < myCacheKeysModel.size()) {
+ ArtifactPresentationKey key = (ArtifactPresentationKey) myCacheKeysModel.get(index);
+ Object value = props.get(key);
+ updateCacheValue(value);
+ return;
+ }
+ }
+ updateCacheValue(null);
+ }
+ });
+ }
+
+ private void updateCacheValue(Object value) {
+ if (value == null) {
+ myCacheKeyView.setViewportView(new JLabel("no key selected"));
+ } else {
+ if (value instanceof String) {
+ Component view = myCacheKeyView.getViewport().getView();
+ if (!(view instanceof JTextArea)) {
+ view = new JTextArea();
+ myCacheKeyView.getViewport().setView(view);
+ }
+ ((JTextArea) view).setText((String) value);
+ } else {
+ updateCacheValue("value of unsupported type: " + value.getClass().getName());
+ }
+ }
+ }
+
+ private void setupFirstPanel() {
+ myUrlSuffix.addKeyListener(new KeyAdapter() {
+ public void keyPressed(KeyEvent e) {
+ if (e.getKeyCode() == KeyEvent.VK_ENTER && e.getModifiers() == 0) {
+ myRequest.doClick();
+ }
+ }
+ });
+ }
+
+ private void initVisual() {
+ myWholePanel.setBorder(new EmptyBorder(5, 5, 5, 5));
+ initStatusLabel(myConnectionStatus);
+ initStatusLabel(myRequestStatus);
+ }
+
+ private void initStatusLabel(JLabel label) {
+ label.setBorder(new CompoundBorder(new LineBorder(Color.black, 1), new EmptyBorder(0, 5, 0, 5)));
+ label.setBackground(Color.white);
+ label.setOpaque(true);
+ }
+
+ public JComponent getWholePanel() {
+ return myWholePanel;
+ }
+
+ public void addRequestButtonListener(ActionListener actionListener) {
+ myRequest.addActionListener(actionListener);
+ }
+
+ public boolean isDownloadRequested() {
+ return myDownloadIfMissing.isSelected();
+ }
+
+ public boolean isCreateConnectionRequested() {
+ return myCreateConnection.isSelected();
+ }
+
+ public void addHtmlDocumentListener(DocumentListener listener) {
+ myHtml.getDocument().addDocumentListener(listener);
+ }
+
+ public void addStylesheetDocumentListener(DocumentListener listener) {
+ myStylesheet.getDocument().addDocumentListener(listener);
+ }
+
+ public void setStylesheet(String stylesheet) {
+ myStylesheet.setText(stylesheet);
+ }
+
+ public void addStartButtonListener(ActionListener actionListener) {
+ myLaunchDeskzilla.addActionListener(actionListener);
+ }
+
+ public void updateBugView() {
+ String text = myStylesheet.getText() + "\n" + myHtml.getText();
+ ((HTMLEditorKit) myBugInfo.getEditorKit()).setStyleSheet(new StyleSheet());
+ myBugInfo.setText(text);
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ myBugInfo.scrollRectToVisible(new Rectangle(0, 0, 1, 1));
+ }
+ });
+ }
+
+ public String getUrl() {
+ return myUrlPrefix.getText().trim() + myUrlSuffix.getText().trim();
+ }
+
+ public void setRequestStatus(String status) {
+ myRequestStatus.setText(status);
+ }
+
+ public void setHtml(String html) {
+ myHtml.setText(html);
+ }
+
+ public void setConnectionStatus(String status) {
+ myConnectionStatus.setText(status);
+ }
+
+ public boolean isDebugVersionPreferred() {
+ return myDebugVersion.isSelected();
+ }
+
+ public void addRequestForInboundFindUsagesCheckboxListener(ActionListener actionListener) {
+ myRegisterForInboundFindUsages.addActionListener(actionListener);
+ }
+
+ public void showRequestForInboundFindUsages(String message) {
+ myInboundFindUsageCommands.setText(message);
+ }
+
+ public void addListenForAddCollectionRequestListener(ActionListener actionListener) {
+ myListenForAddCollectionRequest.addActionListener(actionListener);
+ }
+
+ public void setCollectionListModel(ListModel model) {
+ myWatchedCollections.setModel(model);
+ }
+
+ public void setCollectionListRenderer(ListCellRenderer renderer) {
+ myWatchedCollections.setCellRenderer(renderer);
+ }
+
+ public void addRequestCollectionSelectionFromDeskzillaListener(ActionListener actionListener) {
+ myRequestAddCollection.addActionListener(actionListener);
+ }
+
+ public void addRequestDefaultCollectionsListener(ActionListener actionListener) {
+ myRequestAddDefaultCollections.addActionListener(actionListener);
+ }
+
+ public void addAddCollectionManuallyListener(ActionListener actionListener) {
+ myAddCollection.addActionListener(actionListener);
+ }
+
+ public String getEditedCollectionId() {
+ return myCollectionId.getText().trim();
+ }
+
+ public ListSelectionModel getWatchedCollectionSelectionModel() {
+ return myWatchedCollections.getSelectionModel();
+ }
+
+ public void setCollectionContent(String text) {
+ mySelectedCollectionArtifacts.setText(text);
+ }
+
+ public void addUnsubscribeButtonListener(ActionListener actionListener) {
+ myUnsubscribe.addActionListener(actionListener);
+ }
+
+ public void setArtifactCacheListModel(DefaultListModel listModel) {
+ myCacheUrlList.setModel(listModel);
+ }
+
+ public void setArtifactCacheListRenderer(ListCellRenderer renderer) {
+ myCacheUrlList.setCellRenderer(renderer);
+ }
+
+ public ListSelectionModel getArtifactCacheSelectionModel() {
+ return myCacheUrlList.getSelectionModel();
+ }
+
+ public void setArtifactCacheSelectedProps(Map<ArtifactPresentationKey, Object> props) {
+ ListSelectionModel selectionModel = myCacheKeys.getSelectionModel();
+ int index = selectionModel.getMinSelectionIndex();
+ ArtifactPresentationKey lastSelection = index < 0 ? null : (ArtifactPresentationKey) myCacheKeysModel.get(index);
+ myLastCacheProps = props;
+ myCacheKeysModel.removeAllElements();
+ for (ArtifactPresentationKey key : props.keySet()) {
+ myCacheKeysModel.addElement(key);
+ if (key.equals(lastSelection)) {
+ int i = myCacheKeysModel.size() - 1;
+ selectionModel.setSelectionInterval(i, i);
+ }
+ }
+ }
+
+ public void addClearCacheButtonListener(ActionListener actionListener) {
+ myClearCacheButton.addActionListener(actionListener);
+ }
+
+ public void addApplyConnectMethodListener(ActionListener actionListener) {
+ myApplyConnectMethod.addActionListener(actionListener);
+ }
+
+ public int getSelectedConnectMethod() {
+ if (myUseDiscovery.isSelected())
+ return 0;
+ else if (myUseWorkspace.isSelected())
+ return 1;
+ else if (myUsePort.isSelected())
+ return 2;
+ else {
+ assert false;
+ return 0;
+ }
+ }
+
+ public File getUseWorkspace() {
+ return new File(myWorkspace.getText().trim());
+ }
+
+ public int getUsePort() {
+ try {
+ return Integer.parseInt(myPort.getText().trim());
+ } catch (NumberFormatException e) {
+ return 0;
+ }
+ }
+
+ public String getLaunchWorkspace() {
+ return myLaunchUseWorkspace.isSelected() ? myLaunchWorkspace.getText().trim() : null;
+ }
+
+ public TrackerApplication getSelectedApplication() {
+ boolean deskzilla = myAppDeskzilla.isSelected();
+ return deskzilla ? TrackerApplication.DESKZILLA : TrackerApplication.JIRA_CLIENT;
+ }
+}

Added: trunk/modules/sample/src/deskzilla/plugin/Main.java
==============================================================================
--- (empty file)
+++ trunk/modules/sample/src/deskzilla/plugin/Main.java Fri Aug 24 01:57:18 2007
@@ -0,0 +1,27 @@
+package deskzilla.plugin;
+
+import com.almworks.tracker.alpha.AlphaConnector;
+import com.almworks.tracker.eapi.alpha.ConnectorProperty;
+import com.almworks.tracker.eapi.alpha.TrackerConnector;
+
+import javax.swing.*;
+import java.io.File;
+import java.util.Date;
+// IDEADEV-5710
+
+public class Main implements Runnable {
+ private TrackerConnector myTrackerConnector;
+
+ public static void main(String[] args) {
+ SwingUtilities.invokeLater(new Main());
+ }
+
+ public void run() {
+ myTrackerConnector = new AlphaConnector();
+ myTrackerConnector.configureLogging(new File("C:\\Temp"));
+ myTrackerConnector.start();
+ myTrackerConnector.setProperty(ConnectorProperty.NAME, "Sample Deskzilla Plug-in started on " + new Date());
+ myTrackerConnector.setProperty(ConnectorProperty.SHORT_NAME, "Deskzilla Plug-in");
+ new MainFrame(myTrackerConnector).show();
+ }
+}

Added: trunk/modules/sample/src/deskzilla/plugin/MainFrame.java
==============================================================================
--- (empty file)
+++ trunk/modules/sample/src/deskzilla/plugin/MainFrame.java Fri Aug 24 01:57:18 2007
@@ -0,0 +1,270 @@
+package deskzilla.plugin;
+
+import com.almworks.dup.util.*;
+import com.almworks.tracker.eapi.alpha.*;
+
+import javax.swing.*;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+
+public class MainFrame {
+ private final JFrame myFrame = new JFrame("Sample Deskzilla Plug-in");
+
+ private final Form myForm = new Form();
+
+ private String myLastUrl = null;
+ private final boolean myLockUpdate = false;
+ private static final String DEFAULT_STYLESHEET = "<style>\n" +
+ "body, td, pre { font-family: Tahoma; font-size: 11pt; }\n" +
+ ".url { text-align: right; text-decoration: underline; margin-bottom: 8px; }\n" +
+ ".header { font-weight: bold; font-size: 13pt; }\n" +
+ ".fields { margin: 8px 0px 0px 0px; }\n" +
+ ".value { margin: 0px 0px 0px 16px; }\n" +
+ ".ctitle, .cuser, .cwhen { font-weight: bold; margin: 12px 0px 0px 0px;}\n" +
+ ".cwhen { text-align: right; }\n" +
+ "</style>";
+ private final TrackerConnector myConnector;
+ private final CollectionMonitor myCollectionMonitor;
+ private final ArtifactCache myArtifactCache;
+
+ public MainFrame(TrackerConnector connector) {
+ myConnector = connector;
+ myCollectionMonitor = new CollectionMonitor(connector, myForm);
+ myArtifactCache = new ArtifactCache(connector, myForm);
+ initFrame();
+ initButtons();
+ initTextControls();
+ initListenStatus();
+ initSecondPanel();
+ initThirdPanel();
+ initFifthPanel();
+ }
+
+ private void initFifthPanel() {
+ myForm.addApplyConnectMethodListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ switch (myForm.getSelectedConnectMethod()) {
+ case 0:
+ myConnector.getTrackerStarter().useTrackerDiscovery(myForm.getSelectedApplication(), null);
+ break;
+ case 1:
+ myConnector.getTrackerStarter().useTrackerWorkspace(myForm.getUseWorkspace());
+ break;
+ case 2:
+ myConnector.getTrackerStarter().useTrackerPort(myForm.getUsePort());
+ break;
+ default:
+ assert false;
+ }
+ }
+ });
+ }
+
+ private void initThirdPanel() {
+ final DetachComposite detach = new DetachComposite();
+ myForm.addListenForAddCollectionRequestListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ boolean selected = ((AbstractButton) e.getSource()).isSelected();
+ if (selected) {
+ detach.reset();
+ myConnector.getArtifactCollectionConfigurationManager()
+ .registerAddCollectionAcceptor(detach, new AddCollectionAcceptor() {
+ public void acceptAddCollection(CollectionData collection) {
+ myCollectionMonitor.addCollection(collection);
+ }
+ });
+ } else {
+ detach.detach();
+ }
+ }
+ });
+ }
+
+ private void initSecondPanel() {
+ final DetachComposite detach = new DetachComposite();
+ myForm.addRequestForInboundFindUsagesCheckboxListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ boolean selected = ((AbstractButton) e.getSource()).isSelected();
+ if (selected) {
+ detach.reset();
+ myConnector.getFindArtifactManager().registerFindArtifactAcceptor(detach, new FindArtifactAcceptor() {
+ public void acceptFindArtifacts(Collection<String> urls) {
+ StringBuffer buffer = new StringBuffer().append("Request Received\n").append(new Date()).append("\n\n");
+ for (String url : urls) {
+ buffer.append(url).append('\n');
+ }
+ myForm.showRequestForInboundFindUsages(buffer.toString());
+ }
+ });
+ } else {
+ detach.detach();
+ }
+ }
+ });
+ myForm.addRequestCollectionSelectionFromDeskzillaListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ myConnector.getArtifactCollectionConfigurationManager().requestAddCollectionAction();
+ }
+ });
+ myForm.addRequestDefaultCollectionsListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ myConnector.getArtifactCollectionConfigurationManager().requestAddDefaultCollections();
+ }
+ });
+ myForm.addAddCollectionManuallyListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ String id = myForm.getEditedCollectionId();
+ myCollectionMonitor.addCollection(id);
+ }
+ });
+ }
+
+ private void initListenStatus() {
+ final ValueModel<TrackerConnectionStatus> statusModel = myConnector.getTrackerStarter().getConnectionStatus();
+ statusModel.events().addListener(Lifespan.FOREVER, ValueEvent.class, new EventListener<ValueEvent>() {
+ public void onEvent(ValueEvent event) {
+ TrackerConnectionStatus status = statusModel.getValue();
+ ConnectionState state = status.getConnectionState();
+ if (state == ConnectionState.CONNECTED)
+ myForm.setConnectionStatus("Connected: " + status.getWorkspaceDirectory());
+ else if (state == ConnectionState.CONNECTION_CLOSED)
+ myForm.setConnectionStatus("Connection closed");
+ else if (state == ConnectionState.CONNECTION_FAILED)
+ myForm.setConnectionStatus("Connection failed");
+ else if (state == ConnectionState.NOT_CONNECTED)
+ myForm.setConnectionStatus("Not connected");
+ }
+ });
+ }
+
+ private void initTextControls() {
+ DocumentListener listener = new DocumentListener() {
+ public void insertUpdate(DocumentEvent e) {
+ updateEditor();
+ }
+
+ public void removeUpdate(DocumentEvent e) {
+ updateEditor();
+ }
+
+ public void changedUpdate(DocumentEvent e) {
+ updateEditor();
+ }
+ };
+ myForm.addHtmlDocumentListener(listener);
+ myForm.addStylesheetDocumentListener(listener);
+ myForm.setStylesheet(DEFAULT_STYLESHEET);
+ }
+
+ private void updateEditor() {
+ if (myLockUpdate)
+ return;
+ myForm.updateBugView();
+ }
+
+ private void initButtons() {
+ myForm.addRequestButtonListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ boolean download = myForm.isDownloadRequested();
+ boolean createConnection = myForm.isCreateConnectionRequested();
+ ArtifactLoadOption[] options;
+ if (createConnection) {
+ options = ArtifactLoadOption.MAYBE_CREATE_CONNECTION_AND_DOWNLOAD;
+ } else if (download) {
+ options = ArtifactLoadOption.MAYBE_DOWNLOAD;
+ } else {
+ options = ArtifactLoadOption.NONE;
+ }
+ request(options);
+ }
+ });
+ myForm.addStartButtonListener(new ActionListener() {
+ public void actionPerformed(ActionEvent event) {
+ try {
+ boolean debug = myForm.isDebugVersionPreferred();
+ if (debug) {
+ System.getProperties().setProperty("use.deskzilla", "debug");
+ } else {
+ System.getProperties().remove("use.deskzilla");
+ }
+ String w = myForm.getLaunchWorkspace();
+ if (w == null || w.length() == 0) {
+ myConnector.getTrackerStarter().startTracker(myForm.getSelectedApplication());
+ } else {
+ myConnector.getTrackerStarter().startTracker(myForm.getSelectedApplication(), new File(w));
+ }
+ } catch (IOException e) {
+ System.out.println("cannot start Deskzilla");
+ }
+ }
+ });
+ }
+
+ private void request(ArtifactLoadOption[] options) {
+ String myUrl = myForm.getUrl();
+ if (myUrl.length() > 0)
+ showInfo(myUrl, options);
+ }
+
+ private void showInfo(String url, ArtifactLoadOption[] options) {
+ ArtifactLoader loader = myConnector.getArtifactLoader();
+ if (!url.equals(myLastUrl)) {
+ loader.unsubscribeArtifacts(this, Collections.singleton(myLastUrl));
+ }
+ myLastUrl = url;
+ myForm.setRequestStatus("Requesting...");
+ loader.subscribeArtifacts(this, Lifespan.FOREVER, Collections.singleton(myLastUrl), options);
+ }
+
+
+ private void artifactUpdated(ArtifactInfo artifactInfo) {
+ String url = artifactInfo.getUrl();
+ if (myLastUrl == null || !myLastUrl.equals(url)) {
+ System.out.println("out of order update: " + artifactInfo);
+ return;
+ }
+ ArtifactInfoStatus status = artifactInfo.getStatus();
+ if (status == ArtifactInfoStatus.OK) {
+ String html = artifactInfo.getPresentation(GenericKeys.LONG_DESCRIPTION_HTML);
+ myForm.setHtml(html);
+ myForm.setRequestStatus("Artifact loaded");
+ } else {
+ myForm.setHtml("");
+ if (status == ArtifactInfoStatus.NO_ARTIFACT) {
+ myForm.setRequestStatus("Artifact not found");
+ } else if (status == ArtifactInfoStatus.NO_CONNECTION) {
+ myForm.setRequestStatus("There's no such connection");
+ } else if (status == ArtifactInfoStatus.UNRECOGNIZED_URL) {
+ myForm.setRequestStatus("Url is not recognized");
+ } else if (status == ArtifactInfoStatus.WAIT_CONNECTION_SETUP) {
+ myForm.setRequestStatus("Creating connection...");
+ } else if (status == ArtifactInfoStatus.WAIT_DOWNLOADING) {
+ myForm.setRequestStatus("Downloading...");
+ }
+ }
+ }
+
+ private void initFrame() {
+ myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ myFrame.setSize(800, 700);
+ myFrame.setLocationRelativeTo(null);
+ myFrame.getContentPane().add(myForm.getWholePanel());
+ }
+
+ public void show() {
+ myConnector.getArtifactLoader().events()
+ .addListener(Lifespan.FOREVER, ArtifactInfoEvent.class, new EventListener<ArtifactInfoEvent>() {
+ public void onEvent(ArtifactInfoEvent event) {
+ artifactUpdated(event.getArtifactInfo());
+ }
+ });
+ myFrame.show();
+ }
+}

Modified: trunk/modules/selena/selena.iml
==============================================================================
--- trunk/modules/selena/selena.iml (original)
+++ trunk/modules/selena/selena.iml Fri Aug 24 01:57:18 2007
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module relativePaths="true" type="JAVA_MODULE" version="4">
- <component name="ModuleRootManager" />
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">

Modified: trunk/modules/selena/src/com/almworks/tracklink/vcslinks/VCSUtil.java
==============================================================================
--- trunk/modules/selena/src/com/almworks/tracklink/vcslinks/VCSUtil.java (original)
+++ trunk/modules/selena/src/com/almworks/tracklink/vcslinks/VCSUtil.java Fri Aug 24 01:57:18 2007
@@ -35,6 +35,7 @@

/**
* @author Vassiliy Kudryashov
+ * PR-2 Test
*/
public class VCSUtil {
private static final Logger LOG = Logger.getInstance("#com.almworks.tracklink.vcslinks.VCSUtil");
@@ -44,6 +45,8 @@
private static final String CVS_VCS_NAME = "cvs";

/**
+ * @param dateAfter
+ * @param dateBefore
* @return java.util.List containing pairs {RepositoryVersion, VirtualFile of appropriate Module content root}
*/
@Nullable
@@ -76,7 +79,10 @@
if (pair == null)
continue;
VirtualFile contentRoot = pair.getFirst();
+
AbstractVcs vcs = pair.getSecond();
+ RepositoryLocation repositoryLocation = new DefaultRepositoryLocation(project.getBaseDir().getPresentableUrl());
+ //todo research test
if (contentRoot == null || vcs == null) {
Log.warn("Bad pair (Module content root, AbstractVCS): " + pair);
continue;
@@ -88,7 +94,8 @@
continue;
}
try {
- List<CommittedChangeList> changeLists = committedChangesProvider.getCommittedChanges(settings, contentRoot, 0);
+ List<CommittedChangeList> changeLists =
+ committedChangesProvider.getCommittedChanges(settings, repositoryLocation, 0);
Log.debug("getFilteredVersions() = #" + changeLists.size());
for (CommittedChangeList repositoryVersion : changeLists) {
sink.process(new ChangeSet(contentRoot, vcs, repositoryVersion));
@@ -161,7 +168,7 @@
List<Pair<VirtualFile, AbstractVcs>> result = new ArrayList<Pair<VirtualFile, AbstractVcs>>();
ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project);
VirtualFile[] roots = vcsManager.getAllVersionedRoots();
- for(VirtualFile root: roots) {
+ for (VirtualFile root : roots) {
AbstractVcs vcs = vcsManager.getVcsFor(root);
if (vcs != null) {
result.add(Pair.create(root, vcs));
@@ -349,7 +356,7 @@
}

public static class MockVirtualFile extends AbstractVcsVirtualFile {
- private Project myProject;
+ private final Project myProject;
private AbstractVcs myVcs;
private Date myDate;

Modified: trunk/modules/selena/src/com/almworks/tracklink/vcslinks/cache/impl/VCSCacheImpl.java
==============================================================================
--- trunk/modules/selena/src/com/almworks/tracklink/vcslinks/cache/impl/VCSCacheImpl.java (original)
+++ trunk/modules/selena/src/com/almworks/tracklink/vcslinks/cache/impl/VCSCacheImpl.java Fri Aug 24 01:57:18 2007
@@ -67,9 +67,9 @@

public VCSCacheImpl(Project project) {
myProject = project;
- myCache = TrackLinkCaches.getInstanse().getArtifactInfoCache();
- TrackLinkPlugin plugin = TrackLinkPlugin.getInstanse(project);
- myModel = plugin.getModel();
+ myCache = TrackLinkCaches.getInstance().getArtifactInfoCache();
+ TrackLinkPlugin plugin = TrackLinkPlugin.getInstance(project);
+ myModel = plugin.getIssueModel();
myParser = plugin.getParser();
}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/ModelCache.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/ModelCache.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/ModelCache.java Fri Aug 24 01:57:18 2007
@@ -25,9 +25,11 @@
* @author Vassiliy Kudryashov
*/
public class ModelCache {
+
private static ModelCache ourInstance = new ModelCache();
- private HashMap<Project, IssueLinkModel> myModels = new HashMap<Project, IssueLinkModel>(1);
+
private final List<PropertyChangeEvent> myEvents = new ArrayList<PropertyChangeEvent>(1);
+
private final WeakList<PatternIndexer> myIndexers = new WeakList<PatternIndexer>();

private final Runnable myApplyingJob = new Runnable() {
@@ -43,12 +45,14 @@
}
}
};
- private Runnable myResetJob = new Runnable() {
+
+ private final Runnable myResetJob = new Runnable() {
public void run() {
myEvents.clear();
}
};

+ private HashMap<Project, IssueLinkModel> myModels = new HashMap<Project, IssueLinkModel>(1);

public static synchronized ModelCache getInstance() {
return ourInstance;
@@ -57,21 +61,23 @@
private ModelCache() {
}

- public void addModel(@NotNull final Project project, @NotNull final IssueLinkModel model, @NotNull Lifespan lifespan) {
+ public void addModel(@NotNull final Project project, @NotNull final IssueLinkModel model,
+ @NotNull Lifespan lifespan)
+ {
myModels.put(project, model);
final TableModelListener modelListener = new TableModelListener() {
public void tableChanged(TableModelEvent e) {
if (e.getFirstRow() == e.getLastRow())
switch (e.getType()) {
- case TableModelEvent.INSERT:
- myEvents.add(createEvent(null, model.get(e.getFirstRow())));
- break;
- case TableModelEvent.UPDATE:
- myEvents.add(createEvent(model.getOld(e.getFirstRow()), model.get(e.getFirstRow())));
- break;
- case TableModelEvent.DELETE:
- myEvents.add(createEvent(model.getOld(e.getFirstRow()), null));
- break;
+ case TableModelEvent.INSERT:
+ myEvents.add(createEvent(null, model.get(e.getFirstRow())));
+ break;
+ case TableModelEvent.UPDATE:
+ myEvents.add(createEvent(model.getOld(e.getFirstRow()), model.get(e.getFirstRow())));
+ break;
+ case TableModelEvent.DELETE:
+ myEvents.add(createEvent(model.getOld(e.getFirstRow()), null));
+ break;
}
}
};
@@ -100,15 +106,16 @@
}

private PropertyChangeEvent createEvent(CodeLinkType oldCodeLinkType, CodeLinkType newCodeLinkType) {
- return new PropertyChangeEvent(ModelCache.this, IndexPatternProvider.PROP_INDEX_PATTERNS, oldCodeLinkType, newCodeLinkType);
+ return new PropertyChangeEvent(ModelCache.this, IndexPatternProvider.PROP_INDEX_PATTERNS, oldCodeLinkType,
+ newCodeLinkType);
}

public void registerPatternIndexer(PatternIndexer patternIndexer) {
myIndexers.add(patternIndexer);
}
-
+
public PatternIndexer getPatternIndexer() {
- if (myIndexers.size()>0)
+ if (myIndexers.size() > 0)
return myIndexers.get(0);
return null;
}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/PatternIndexer.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/PatternIndexer.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/PatternIndexer.java Fri Aug 24 01:57:18 2007
@@ -12,7 +12,7 @@
/**
* @author Vassiliy Kudryashov
*/
-public class PatternIndexer implements /*ApplicationComponent,*/ IndexPatternProvider, PropertyChangeListener {
+public class PatternIndexer implements IndexPatternProvider, PropertyChangeListener {
private final List<PropertyChangeListener> myListeners = new ArrayList<PropertyChangeListener>();

public PatternIndexer() {

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/TrackLinkCaches.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/TrackLinkCaches.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/TrackLinkCaches.java Fri Aug 24 01:57:18 2007
@@ -17,13 +17,21 @@
* @author Vassiliy Kudryashov
*/
public class TrackLinkCaches implements ApplicationComponent, NamedJDOMExternalizable {
+
private final ArtifactInfoCache myCache;
+
private final CollectionsCache myCollectionsCache;
+
private final FileMapperManager myFileMapperManager;

+ /**
+ * For non-IDEA purpuse
+ */
+ static TrackLinkCaches instance = null;
+
public TrackLinkCaches() {
myCache = new ArtifactInfoCacheImpl();
- myCollectionsCache = new CollectionsCacheImpl();
+ myCollectionsCache = new CollectionsCacheImpl(myCache);
myFileMapperManager = new FileMapperManager();
}

@@ -68,7 +76,13 @@
return myFileMapperManager;
}

- public static TrackLinkCaches getInstanse() {
+ public static TrackLinkCaches getInstance() {
+ if (ApplicationManager.getApplication() == null) {
+ if (instance == null) {
+ instance = new TrackLinkCaches();
+ }
+ return instance;
+ }
return ApplicationManager.getApplication().getComponent(TrackLinkCaches.class);
}
}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/TrackLinkPlugin.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/TrackLinkPlugin.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/TrackLinkPlugin.java Fri Aug 24 01:57:18 2007
@@ -87,7 +87,7 @@
}

public void initComponent() {
- TrackLinkCaches caches = TrackLinkCaches.getInstanse();
+ TrackLinkCaches caches = TrackLinkCaches.getInstance();
if (caches == null)
return;
myEditorWatcher = new FileEditorWatcherImpl(myProject, myParser, caches.getArtifactInfoCache());
@@ -171,7 +171,7 @@
}

@NotNull
- public IssueLinkModel getModel() {
+ public IssueLinkModel getIssueModel() {
return myModel;
}

@@ -187,7 +187,7 @@
return myEditorWatcher;
}

- public static TrackLinkPlugin getInstanse(Project project) {
+ public static TrackLinkPlugin getInstance(Project project) {
return project.getComponent(TrackLinkPlugin.class);
}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/actions/OpenArtifactsAction.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/actions/OpenArtifactsAction.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/actions/OpenArtifactsAction.java Fri Aug 24 01:57:18 2007
@@ -9,49 +9,43 @@
import com.almworks.tracklink.dialogs.StartDeskzillaConfirmationDialog;
import com.almworks.tracklink.util.StringBundle;
import com.almworks.tracklink.util.Utils;
-import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.actionSystem.DataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;

import java.awt.*;
-import java.util.Arrays;
+import java.util.ArrayList;
import java.util.Collection;

/**
- * @author Vassiliy Kudryashov
+ * @author Vassiliy Kudryashov, Stalex
*/
public class OpenArtifactsAction extends AnAction {
public void update(AnActionEvent e) {
DataContext dataContext = e.getDataContext();
- if (ActionPlaces.MAIN_MENU.equals(e.getPlace()) && !isInEditor(dataContext)) {
- e.getPresentation().setEnabled(false);
- return;
- }
-
- Collection<IssueLink> links = Utils.getIssueLinks(dataContext);
+ String anObject = e.getPlace();
+
+ IssueLink links = Utils.getIssueLinks(dataContext);
TrackerConnector connector = Utils.getConnector(dataContext);
TrackLinkPlugin plugin = Utils.getTrackLinkPlugin(dataContext);
boolean enabled = false;
String text = null;
- if (links != null && links.size() > 0 && connector != null && plugin != null) {
+ if (links != null && connector != null && plugin != null) {
TrackerConnectionStatus status = connector.getTrackerStarter().getConnectionStatus().getValue();
if (status != null && status.getConnectionState() == ConnectionState.CONNECTED) {
text = status.getTrackerName();
enabled = true;
} else {
- text = plugin.getModel().getApplicationDisplayName();
+ text = plugin.getIssueModel().getApplicationDisplayName();
enabled = text != null;
}
}

- // special - until Deskzilla is able to show multiple issues correctly (not opening a tab for each)
- if (enabled) {
- if (links.size() > 1) {
- enabled = false;
- }
- }
-
e.getPresentation().setEnabled(enabled);
+ e.getPresentation().setVisible(enabled);
if (text != null) {
text = StringBundle.get("action.openIssues.inTracker", text);
e.getPresentation().setText(text);
@@ -61,7 +55,7 @@
}

private boolean isInEditor(DataContext context) {
- return context.getData(DataConstants.EDITOR) != null;
+ return DataKeys.EDITOR.getData(context) != null;
}

public void actionPerformed(AnActionEvent e) {
@@ -71,21 +65,23 @@
return;

TrackLinkPlugin plugin = Utils.getTrackLinkPlugin(dataContext);
- Project project = (Project) dataContext.getData(DataConstants.PROJECT);
- Component component = (Component) dataContext.getData(DataConstants.CONTEXT_COMPONENT);
+ Project project = DataKeys.PROJECT.getData(dataContext);
+ Component component = DataKeys.CONTEXT_COMPONENT.getData(dataContext);
if (plugin == null || project == null || component == null)
return;
- Collection<IssueLink> links = Utils.getIssueLinks(dataContext);
- if (links != null && links.size() > 0) {
+ IssueLink links = Utils.getIssueLinks(dataContext);
+ if (links != null ) {
if (!connector.getTrackerStarter().getConnectionStatus().getValue().isConnected()) {
maybeStartTracker(plugin, project, e);
}
- connector.getArtifactOpener().openArtifacts(Arrays.asList(Utils.getUrls(links)));
+ Collection<String> coll = new ArrayList<String>(1);
+ coll.add(links.getURL());
+ connector.getArtifactOpener().openArtifacts(coll);
}
}

private boolean maybeStartTracker(TrackLinkPlugin plugin, Project project, AnActionEvent e) {
- IssueLinkModel model = plugin.getModel();
+ IssueLinkModel model = plugin.getIssueModel();
if (!model.isAutoStartingAllowed()) {
StartDeskzillaConfirmationDialog confirmationDialog = new StartDeskzillaConfirmationDialog(model, project);
confirmationDialog.show();

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/actions/OpenArtifactsInBrowserAction.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/actions/OpenArtifactsInBrowserAction.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/actions/OpenArtifactsInBrowserAction.java Fri Aug 24 01:57:18 2007
@@ -1,34 +1,39 @@
package com.almworks.tracklink.actions;

import com.almworks.tracklink.IssueLink;
+import com.almworks.tracklink.util.StringBundle;
import com.almworks.tracklink.util.Utils;
import com.intellij.ide.BrowserUtil;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.DataContext;
-
-import java.util.Collection;
+import com.intellij.openapi.ui.Messages;

public class OpenArtifactsInBrowserAction extends AnAction {
- private static final int MAX_OPEN = 10;

- public void update(AnActionEvent e) {
- DataContext dataContext = e.getDataContext();
- Collection<IssueLink> links = Utils.getIssueLinks(dataContext);
- boolean enabled = links != null && links.size() > 0 && links.size() <= MAX_OPEN;
- e.getPresentation().setEnabled(enabled);
+ public void update(AnActionEvent e) {
+ IssueLink link = Utils.getIssueLinks(e.getDataContext());
+
+ boolean visible = link != null;
+
+
+ e.getPresentation().setEnabled(visible);
+ e.getPresentation().setVisible(visible);
+
Utils.checkVisibility(e);
}

public void actionPerformed(AnActionEvent e) {
- DataContext dataContext = e.getDataContext();
- Collection<IssueLink> links = Utils.getIssueLinks(dataContext);
- boolean enabled = links != null && links.size() > 0 && links.size() <= MAX_OPEN;
- if (!enabled)
- return;
- for (IssueLink link : links) {
+ IssueLink link = Utils.getIssueLinks(e.getDataContext());
+
+ if (link != null){
+
String url = link.getURL();
- BrowserUtil.launchBrowser(url);
+ if (BrowserUtil.isAbsoluteURL(url)) {
+ BrowserUtil.launchBrowser(url);
+ } else {
+ Messages.showErrorDialog(url, StringBundle.get("browser.url.wrong"));
+ }
}
+
}
}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/actions/SearchAction.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/actions/SearchAction.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/actions/SearchAction.java Fri Aug 24 01:57:18 2007
@@ -2,13 +2,14 @@

import com.almworks.tracklink.PatternIndexer;
import com.almworks.tracklink.codelinks.CodeLinkType;
-import com.almworks.tracklink.findusages.*;
+import com.almworks.tracklink.findusages.FindUtils;
import com.almworks.tracklink.util.StringBundle;
-import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.DataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.text.StringUtil;
-import org.jetbrains.annotations.*;

import java.util.regex.Matcher;

@@ -19,12 +20,12 @@

public void update(AnActionEvent e) {
super.update(e);
- Project project = (Project) e.getDataContext().getData(DataConstants.PROJECT);
+ final Project project = DataKeys.PROJECT.getData(e.getDataContext());
e.getPresentation().setEnabled(project != null && FindUtils.getPatternIndexer() != null);
}

public void actionPerformed(AnActionEvent e) {
- final Project project = (Project) e.getDataContext().getData(DataConstants.PROJECT);
+ final Project project = DataKeys.PROJECT.getData(e.getDataContext());
if (project == null)
return;
final String[] urls = getURLs(project);
@@ -35,10 +36,10 @@
final CodeLinkType[] codeLinkTypes = patternIndexer.getIndexPatterns();
for (CodeLinkType codeLinkType : codeLinkTypes) {
for (int j = 0; j < urls.length; j++) {
- String url = urls[j];
- final Matcher matcher = codeLinkType.getPattern().matcher(url);
- if (matcher.matches())
+ final Matcher matcher = codeLinkType.getPattern().matcher(urls[j]);
+ if (matcher.matches()) {
urls[j] = matcher.replaceAll(codeLinkType.getReplacePattern());
+ }
}
}
}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/actions/ShowArtifactInfoAction.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/actions/ShowArtifactInfoAction.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/actions/ShowArtifactInfoAction.java Fri Aug 24 01:57:18 2007
@@ -4,11 +4,12 @@
import com.almworks.tracklink.IssueLink;
import com.almworks.tracklink.codelinks.cache.ArtifactInfoCache;
import com.almworks.tracklink.popup.ArtifactInfoDialogWrapper;
+import com.almworks.tracklink.util.PluginDataConstants;
import com.almworks.tracklink.util.Utils;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.DataConstants;
import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.actionSystem.DataKeys;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;

@@ -22,7 +23,10 @@
public class ShowArtifactInfoAction extends AnAction {
public void update(AnActionEvent e) {
DataContext dataContext = e.getDataContext();
- TrackerConnector connector = Utils.getConnector(dataContext);
+ TrackerConnector connector = null;
+ IssueLink issueLink = null;
+
+ connector = Utils.getConnector(dataContext);
// kind of a hack - look in dashboard if ctrl-alt-shift pressed
boolean lookAtDashboard = false;
InputEvent inputEvent = e.getInputEvent();
@@ -33,26 +37,33 @@
lookAtDashboard = true;
}
}
- IssueLink issueLink = Utils.getIssueLink(dataContext, lookAtDashboard);
+
+ issueLink = Utils.getIssueLink(dataContext, lookAtDashboard);
+
e.getPresentation().setEnabled(issueLink != null && connector != null);
e.getPresentation().setVisible(issueLink != null && connector != null);
}

public void actionPerformed(AnActionEvent e) {
DataContext dataContext = e.getDataContext();
- Project project = (Project) dataContext.getData(DataConstants.PROJECT);
+ Project project = DataKeys.PROJECT.getData(dataContext);
if (project == null)
return;
boolean lookAtDashboard = e.getInputEvent() instanceof KeyEvent;
IssueLink issueLink = Utils.getIssueLink(dataContext, lookAtDashboard);
ArtifactInfoCache cache = Utils.getArtifactInfoCache();
- Component component = (Component) dataContext.getData(DataConstants.CONTEXT_COMPONENT);
- Editor editor = (Editor) dataContext.getData(DataConstants.EDITOR);
+ Component component = DataKeys.CONTEXT_COMPONENT.getData(dataContext);
+ Editor editor = DataKeys.EDITOR.getData(dataContext);
+
+
+ Object filterObject = dataContext.getData(PluginDataConstants.FILTRATION_STRING);
+ String filter = filterObject != null ? (String)filterObject : "";
+
if (component != null && cache != null && issueLink != null) {
Point point = editor != null ? Utils.getCaretScreenPoint(editor) : null;
String url = issueLink.getURL();
ArtifactInfoDialogWrapper artifactInfoDialogWrapper =
- new ArtifactInfoDialogWrapper(component, cache, url, project);
+ new ArtifactInfoDialogWrapper(component, cache, url, project, filter);
if (point != null)
artifactInfoDialogWrapper.setLocation(point);
artifactInfoDialogWrapper.show();

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/actions/ShowDiffDialogAction.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/actions/ShowDiffDialogAction.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/actions/ShowDiffDialogAction.java Fri Aug 24 01:57:18 2007
@@ -47,6 +47,7 @@
if (file != null && project != null) {
Date date = file.getUserData(VCSUtil.VCS_MODIFICATION_DATE);
try {
+
Pair<VcsFileRevision, VcsFileRevision> revisionPair =
VCSUtil.getAppropriateRevisionPair(project, file, date, VCSUtil.MIN_DIFF);

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/actions/ShowSameCodeLinksAction.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/actions/ShowSameCodeLinksAction.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/actions/ShowSameCodeLinksAction.java Fri Aug 24 01:57:18 2007
@@ -2,30 +2,29 @@

import com.almworks.tracklink.IssueLink;
import com.almworks.tracklink.findusages.FindUtils;
+import com.almworks.tracklink.toolwindow.actions.DataKey;
import com.almworks.tracklink.util.Utils;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.DataConstants;
import com.intellij.openapi.project.Project;

-import java.util.Collection;
-
/**
* @author Vassiliy Kudryashov
*/
public class ShowSameCodeLinksAction extends AnAction {
public void update(AnActionEvent e) {
- Collection<IssueLink> links = Utils.getIssueLinks(e.getDataContext());
- Project project = (Project) e.getDataContext().getData(DataConstants.PROJECT);
- e.getPresentation().setVisible(links != null && links.size() > 0 && project != null);
+ IssueLink link = Utils.getIssueLinks(e.getDataContext());
+ Project project = DataKey.PROJECT.getData(e.getDataContext());
+ e.getPresentation().setVisible(link != null && project != null);
}

public void actionPerformed(AnActionEvent e) {
- Project project = (Project) e.getDataContext().getData(DataConstants.PROJECT);
- Collection<IssueLink> links = Utils.getIssueLinks(e.getDataContext());
- if (links == null || project == null || links.size() == 0)
+ Project project = DataKey.PROJECT.getData(e.getDataContext());
+ IssueLink links = Utils.getIssueLinks(e.getDataContext());
+ if (links == null || project == null)
return;
- String[] urls = Utils.getUrls(links);
+ String url = links.getURL();
+ String [] urls = {url};
FindUtils.findUsages(project, urls);
}
}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/checkin/ArtifactColumnInfo.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/checkin/ArtifactColumnInfo.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/checkin/ArtifactColumnInfo.java Fri Aug 24 01:57:18 2007
@@ -11,7 +11,7 @@
* @author Vassiliy Kudryashov
*/
public class ArtifactColumnInfo<T> extends ColumnInfo<ArtifactInfo, T> {
- private ArtifactPresentationKey<T> myKey;
+ private final ArtifactPresentationKey<T> myKey;

public ArtifactColumnInfo(ArtifactPresentationKey<T> key) {
super(StringBundle.get("Column." + key.getName()));

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/checkin/BeforeCheckinDialog.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/checkin/BeforeCheckinDialog.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/checkin/BeforeCheckinDialog.java Fri Aug 24 01:57:18 2007
@@ -19,7 +19,6 @@
import com.intellij.ui.GuiUtils;
import com.intellij.ui.table.TableView;
import com.intellij.util.containers.HashSet;
-import com.intellij.util.ui.ColumnInfo;
import com.intellij.util.ui.ListTableModel;
import com.intellij.util.ui.SortableColumnModel;
import org.jetbrains.annotations.NonNls;
@@ -29,7 +28,6 @@
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
-import java.net.URL;
import java.util.Collection;
import java.util.List;
import java.util.Set;
@@ -65,7 +63,7 @@

@NonNls
public static final String LOGO_SMALL = "/com/almworks/tracklink/icons/linked.png";
- private IconColumnInfo myIconColumnInfo;
+ //private IconColumnInfo myIconColumnInfo;

private final MessageOptionsForm myMessageOptions = new MessageOptionsForm();

@@ -146,7 +144,6 @@
urls.add(artifactInfo.getUrl());
}
myFileMapper.forgetURLs(urls);
- myIconColumnInfo.removeUrls(urls);
myView.getTableViewModel().fireTableDataChanged();
}
}
@@ -165,17 +162,9 @@
}

@Nullable
- protected JComponent createCenterPanel() {//table
- URL url = getClass().getResource(LOGO_SMALL);
- String urlStr = url.toExternalForm();
- myIconColumnInfo = new IconColumnInfo(StringBundle.get("Column.WorkedOn", urlStr), myFilteredInfos) {
- @NonNls
- public String getMaxStringValue() {
- return "mmmmmm";
- }
- };
- myTableModel = new ListTableModel<ArtifactInfo>(new ColumnInfo[]{
- myIconColumnInfo,
+ protected JComponent createCenterPanel() {
+ //#674
+ myTableModel = new ListTableModel<ArtifactInfo>(
new CheckBoxColumnInfo(StringBundle.get("Column.Checkbox"), myMap) {
@NonNls
public String getMaxStringValue() {
@@ -189,7 +178,7 @@
}
},
new ArtifactColumnInfo<String>(GenericKeys.SUMMARY)
- });
+ );

myView = new TableView(myTableModel);
myTableModel.sortByColumn(2, SortableColumnModel.SORT_ASCENDING);

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/checkin/CheckBoxColumnInfo.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/checkin/CheckBoxColumnInfo.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/checkin/CheckBoxColumnInfo.java Fri Aug 24 01:57:18 2007
@@ -16,7 +16,7 @@
* @author Vassiliy Kudryashov
*/
public class CheckBoxColumnInfo extends ColumnInfo<ArtifactInfo, Boolean> {
- private LinkCheckMap myMap;
+ private final LinkCheckMap myMap;

public CheckBoxColumnInfo(String name, LinkCheckMap map) {
super(name);
@@ -79,7 +79,6 @@
} else {
setBorder(noFocusBorder);
}
-
return this;
}
}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/checkin/MessageOptionsForm.form
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/checkin/MessageOptionsForm.form (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/checkin/MessageOptionsForm.form Fri Aug 24 01:57:18 2007
@@ -1,34 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.almworks.tracklink.checkin.MessageOptionsForm">
- <grid id="431dc" binding="myWholePanel" row-count="3" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+ <grid id="431dc" binding="myWholePanel" layout-manager="GridLayoutManager" row-count="3" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
- <xy x="45" y="105" width="479" height="76"/>
- <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3"/>
+ <xy x="45" y="105" width="379" height="100"/>
</constraints>
<properties/>
<border type="none"/>
<children>
- <grid id="4d73" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="1" vgap="-1">
+ <grid id="4d73" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
- <xy x="153" y="0" width="175" height="24"/>
- <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="3"/>
+ <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="59e95" class="javax.swing.JSpinner" binding="myMaximumColumns">
<constraints>
- <xy x="109" y="0" width="66" height="24"/>
- <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="1"/>
+ <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="34a24" class="javax.swing.JLabel" binding="mySpinnerLabel">
<constraints>
- <xy x="0" y="5" width="108" height="14"/>
- <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0"/>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="com/almworks/tracklink/util/StringBundle" key="checkin.dialog.maxLength"/>
@@ -36,19 +32,9 @@
</component>
</children>
</grid>
- <component id="23e12" class="javax.swing.JCheckBox" binding="myIncludeSummary">
- <constraints>
- <xy x="0" y="1" width="134" height="22"/>
- <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0"/>
- </constraints>
- <properties>
- <text resource-bundle="com/almworks/tracklink/util/StringBundle" key="checkin.dialog.useSummary"/>
- </properties>
- </component>
<component id="4ed0e" class="javax.swing.JCheckBox" binding="myReplaceUserComment">
<constraints>
- <xy x="153" y="29" width="175" height="22"/>
- <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0"/>
+ <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="com/almworks/tracklink/util/StringBundle" key="checkin.dialog.replaceComment"/>
@@ -56,8 +42,7 @@
</component>
<component id="f695f" class="javax.swing.JCheckBox" binding="myAllowMultiline">
<constraints>
- <xy x="0" y="29" width="143" height="22"/>
- <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0"/>
+ <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="com/almworks/tracklink/util/StringBundle" key="checkin.dialog.useMultiline"/>
@@ -65,23 +50,20 @@
</component>
<hspacer id="57f7c">
<constraints>
- <xy x="328" y="6" width="151" height="11"/>
- <grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1"/>
+ <grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
- <grid id="67948" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="0" vgap="0">
+ <grid id="67948" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="0" vgap="0">
<margin top="0" left="5" bottom="0" right="0"/>
<constraints>
- <xy x="0" y="56" width="117" height="20"/>
- <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="10" fill="0"/>
+ <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="10" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="e013" class="javax.swing.JLabel">
<constraints>
- <xy x="5" y="3" width="112" height="14"/>
- <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0"/>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="com/almworks/tracklink/util/StringBundle" key="checkin.dialog.finalComment"/>
@@ -89,6 +71,14 @@
</component>
</children>
</grid>
+ <component id="23e12" class="javax.swing.JCheckBox" binding="myIncludeSummary">
+ <constraints>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+ </constraints>
+ <properties>
+ <text resource-bundle="com/almworks/tracklink/util/StringBundle" key="checkin.dialog.useSummary"/>
+ </properties>
+ </component>
</children>
</grid>
</form>

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/checkin/TracklinkCheckinHandler.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/checkin/TracklinkCheckinHandler.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/checkin/TracklinkCheckinHandler.java Fri Aug 24 01:57:18 2007
@@ -35,15 +35,26 @@
* @author Vassiliy Kudryashov
*/
public class TracklinkCheckinHandler extends CheckinHandler {
- private Project myProject;
- private ArtifactInfoCache myCache;
+
+ private final Project myProject;
+
+ private final ArtifactInfoCache myCache;
+
private final FileMapper myFileMapper;
- private BooleanWrapper myCheckinWrapper;
- private BooleanWrapper myFilteringWrapper;
- private CheckinProjectPanel myCheckinProjectPanel;
- private IssueMonitor myIssueMonitor;
- private Dimension myDefaultDialogDimension;
- private JCheckBox myCheckBox = createCheckbox();
+
+ private final BooleanWrapper myCheckinWrapper;
+
+ private final BooleanWrapper myFilteringWrapper;
+
+ private final CheckinProjectPanel myCheckinProjectPanel;
+
+ private final IssueMonitor myIssueMonitor;
+
+ private final Dimension myDefaultDialogDimension;
+
+ private final JCheckBox myCheckBox = createCheckbox();
+
+ private VirtualFile[] myVirtualFiles;//hack about empty VirtualFile array in ChackinProjectPanel (when checkinSuccessful() is called)

private static JCheckBox createCheckbox() {
JCheckBox checkBox = new JCheckBox(StringBundle.get("checkin.checkbox.text"));
@@ -52,8 +63,6 @@
return checkBox;
}

- private VirtualFile[] myVirtualFiles;//hack about empty VirtualFile array in ChackinProjectPanel (when checkinSuccessful() is called)
-
public TracklinkCheckinHandler(Project project, ArtifactInfoCache cache, FileMapper fileMapper,
BooleanWrapper checkinWrapper, BooleanWrapper filteringWrapper, CheckinProjectPanel panel,
IssueMonitor issueMonitor, Dimension defaultDialogDimension)
@@ -82,6 +91,7 @@
JPanel spacer = new JPanel();
myPanel.add(spacer, BorderLayout.CENTER);
}
+
public JComponent getComponent() {
return myPanel;
}
@@ -96,8 +106,8 @@
}

public void restoreState() {
- myCheckBox
- .setSelected(myCheckinWrapper.getValue() && (!myFileMapper.hasNoAssociations() || !myIssueMonitor.isEmpty()));
+ myCheckBox.setSelected(myCheckinWrapper.getValue() &&
+ (!myFileMapper.hasNoAssociations() || !myIssueMonitor.isEmpty()));
}
};
}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/checkin/TracklinkCheckinHandlerFactory.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/checkin/TracklinkCheckinHandlerFactory.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/checkin/TracklinkCheckinHandlerFactory.java Fri Aug 24 01:57:18 2007
@@ -35,14 +35,15 @@
private static final String LAST_DIALOG_WIDTH = "dialogWidth";
@NonNls
private static final String LAST_DIALOG_HEIGHT = "dialogHeight";
-
@Nullable
private Project myProject;

private final Dashboard myDashboard;

private final BooleanWrapper myCheckinWrapper = new BooleanWrapperImpl();
+
private final BooleanWrapper myFilteringWrapper = new BooleanWrapperImpl();
+
private Dimension myDefaultDialogDimension = new Dimension(700, 580);

public TracklinkCheckinHandlerFactory(Project project, Dashboard dashboard) {
@@ -53,7 +54,7 @@
@NotNull
public CheckinHandler createHandler(final CheckinProjectPanel panel) {
return new TracklinkCheckinHandler(myProject, myDashboard.getArtifactInfoCache(), myDashboard.getFileMapper(),
- myCheckinWrapper, myFilteringWrapper, panel, myDashboard, myDefaultDialogDimension);
+ myCheckinWrapper, myFilteringWrapper, panel, myDashboard.getIssueMonitor(), myDefaultDialogDimension);
}

public void projectOpened() {

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/checkin/actions/FilterByWorkedOnAction.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/checkin/actions/FilterByWorkedOnAction.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/checkin/actions/FilterByWorkedOnAction.java Fri Aug 24 01:57:18 2007
@@ -1,6 +1,8 @@
package com.almworks.tracklink.checkin.actions;

-import com.almworks.tracklink.util.*;
+import com.almworks.tracklink.util.BooleanWrapper;
+import com.almworks.tracklink.util.PluginDataConstants;
+import com.almworks.tracklink.util.StringBundle;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.ToggleAction;

@@ -13,6 +15,7 @@
super.update(e);
e.getPresentation().setEnabled(e.getDataContext().getData(PluginDataConstants.BOOLEAN_WRAPPER) != null);
}
+

public boolean isSelected(AnActionEvent e) {
BooleanWrapper wrapper = (BooleanWrapper) e.getDataContext().getData(PluginDataConstants.BOOLEAN_WRAPPER);

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/cache/ArtifactInfoCache.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/cache/ArtifactInfoCache.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/cache/ArtifactInfoCache.java Fri Aug 24 01:57:18 2007
@@ -5,7 +5,7 @@
import com.almworks.tracker.eapi.alpha.ArtifactInfo;
import com.almworks.tracker.eapi.alpha.ArtifactInfoEvent;
import com.almworks.tracker.eapi.alpha.TrackerConnector;
-import com.almworks.tracklink.popup.ArtifactInfoModel;
+import com.almworks.tracklink.popup.ArtifactInfoList;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.JDOMExternalizable;
import org.jetbrains.annotations.NotNull;
@@ -18,11 +18,14 @@
@NotNull
ArtifactInfo getArtifactInfoSnapshot(@NotNull String url);

+ void removeArtifacts(Collection<String> urls);
+
void listenArtifactInfo(Lifespan lifespan, EventListener<ArtifactInfoEvent> listener);

- ArtifactInfoModel getListModel(Object key, Project project, Lifespan lifespan, String url);
+ ArtifactInfoList getListModel(Object key, Project project, Lifespan lifespan, String url);

- ArtifactInfoModel getListModel(Object key, Project project, Lifespan lifespan, Collection<String> urls);
+ ArtifactInfoList getListModel(Object key, Project project, Lifespan lifespan, Collection<String> urls);

TrackerConnector getConnector(Project project);
+
}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/cache/impl/ArtifactInfoCacheImpl.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/cache/impl/ArtifactInfoCacheImpl.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/cache/impl/ArtifactInfoCacheImpl.java Fri Aug 24 01:57:18 2007
@@ -6,7 +6,7 @@
import com.almworks.tracker.eapi.alpha.*;
import com.almworks.tracklink.TrackLinkPlugin;
import com.almworks.tracklink.codelinks.cache.ArtifactInfoCache;
-import com.almworks.tracklink.popup.ArtifactInfoModel;
+import com.almworks.tracklink.popup.ArtifactInfoList;
import com.almworks.tracklink.util.Utils;
import com.almworks.util.Log;
import com.intellij.openapi.project.Project;
@@ -25,6 +25,7 @@
import java.io.IOException;
import java.util.*;
import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;

public class ArtifactInfoCacheImpl
implements ArtifactInfoCache, com.almworks.dup.util.EventListener<ArtifactInfoEvent>
@@ -36,11 +37,11 @@
private final Map<Project, TrackerConnector> myConnectors = new HashMap<Project, TrackerConnector>();
private final Map<String, ArtifactInfo> myArtifactMap = new HashMap<String, ArtifactInfo>();

- // thread-awt
- private final List<EventListener<ArtifactInfoEvent>> myListeners = new ArrayList<EventListener<ArtifactInfoEvent>>();
- private final List<ArtifactInfoModel> myModels = new ArrayList<ArtifactInfoModel>();

private final DataFile myStorage;
+ // thread-awt
+ private final List<EventListener<ArtifactInfoEvent>> myListeners = new CopyOnWriteArrayList<EventListener<ArtifactInfoEvent>>();
+ private final List<ArtifactInfoList> myModels = new CopyOnWriteArrayList<ArtifactInfoList>();

public ArtifactInfoCacheImpl() {
File dataHome = TrackLinkPlugin.getSystemHome();
@@ -82,20 +83,20 @@
synchronized (myArtifactMap) {
oldInfo = myArtifactMap.put(url, info);
}
+
+
if (!equal(oldInfo, info)) {
myStorage.setDirty();
int listenerCount = myListeners.size();
if (listenerCount > 0) {
- EventListener[] listeners = myListeners.toArray(new EventListener[listenerCount]);
- for (EventListener<ArtifactInfoEvent> eventListener : listeners) {
+ for (EventListener<ArtifactInfoEvent> eventListener : myListeners) {
eventListener.onEvent(event);
}
}
if (oldInfo != null) {
int modelCount = myModels.size();
if (modelCount > 0) {
- ArtifactInfoModel[] models = myModels.toArray(new ArtifactInfoModel[modelCount]);
- for (ArtifactInfoModel listModel : models) {
+ for (ArtifactInfoList listModel : myModels) {
listModel.onInfoChanged(info);
}
}
@@ -127,6 +128,7 @@
}
}
return true;
+
}


@@ -142,6 +144,7 @@
}
}

+
public void listenArtifactInfo(Lifespan lifespan, final EventListener<ArtifactInfoEvent> listener) {
assert EventQueue.isDispatchThread();
myListeners.add(listener);
@@ -153,20 +156,20 @@
});
}

- public final ArtifactInfoModel getListModel(Object key, Project project, Lifespan lifespan, String url) {
+ public final ArtifactInfoList getListModel(Object key, Project project, Lifespan lifespan, String url) {
return getListModel(key, project, lifespan, Collections.singleton(url));
}

- public ArtifactInfoModel getListModel(Object key, Project project, Lifespan lifespan, Collection<String> urls) {
+ public ArtifactInfoList getListModel(Object key, Project project, Lifespan lifespan, Collection<String> urls) {
assert EventQueue.isDispatchThread();

if (urls.size() == 0)
- return ArtifactInfoModel.EMPTY;
+ return ArtifactInfoList.EMPTY;

TrackerConnector connector = getConnector(project);
if (connector == null) {
Log.error("no connector for project " + project);
- return ArtifactInfoModel.EMPTY;
+ return ArtifactInfoList.EMPTY;
}

if (urls.size() > 1) {
@@ -181,7 +184,7 @@
list.add(snapshot);
}

- final ArtifactInfoModel listModel = new ArtifactInfoModel(list);
+ final ArtifactInfoList listModel = new ArtifactInfoList(list);
myModels.add(listModel);
lifespan.add(new Detach() {
protected void doDetach() {
@@ -200,6 +203,13 @@
}
}

+ public void removeArtifacts(Collection<String> urls) {
+ synchronized (myArtifactMap) {
+ for (String url : urls) {
+ myArtifactMap.remove(url);
+ }
+ }
+ }

private static Set<String> filter(@NotNull Collection<String> urls) {
Set<String> set = new HashSet<String>(urls.size());
@@ -314,11 +324,16 @@
private static Set<ArtifactPresentationKey> DEFAULT_KEYS =
Collections.unmodifiableSet(new HashSet<ArtifactPresentationKey>(Arrays.asList(GenericKeys.ID,
GenericKeys.SUMMARY, GenericKeys.SHORT_DESCRIPTION_HTML, GenericKeys.LONG_DESCRIPTION_HTML)));
+
private final String myUrl;
+
+ private final String myStringID;
+
private final long myTimeStamp;

public UrlOnlyArtifactInfo(String url) {
myUrl = url;
+ myStringID = Utils.getHackedID(myUrl);
myTimeStamp = System.currentTimeMillis();
}

@@ -338,7 +353,7 @@
@Nullable
public <T> T getPresentation(ArtifactPresentationKey<T> key) {
if (GenericKeys.ID.equals(key))
- return (T) Utils.getHackedID(myUrl);
+ return (T) myStringID;
if (DEFAULT_KEYS.contains(key))
return (T) "";
return null;

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/highlight/CodeParser.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/highlight/CodeParser.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/highlight/CodeParser.java Fri Aug 24 01:57:18 2007
@@ -5,22 +5,27 @@
import com.almworks.tracklink.codelinks.CodeLinkType;
import com.almworks.tracklink.util.Utils;
import com.almworks.util.Log;
-import com.intellij.openapi.actionSystem.DataConstants;
import com.intellij.openapi.actionSystem.DataContext;
-import com.intellij.openapi.editor.*;
-import com.intellij.psi.*;
+import com.intellij.openapi.actionSystem.DataKeys;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.LogicalPosition;
+import com.intellij.psi.PsiComment;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
import com.intellij.psi.javadoc.PsiDocToken;
-import org.jetbrains.annotations.*;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;

import java.awt.*;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
* @author Vassiliy Kudryashov
- * #1038, #986
*/
public class CodeParser {
private final IssueLinkModel myModel;
@@ -68,8 +73,8 @@

@Nullable
public URLTextRange getURLTextRange(DataContext context) {
- Editor editor = (Editor) context.getData(DataConstants.EDITOR);
- PsiFile psiFile = (PsiFile) context.getData(DataConstants.PSI_FILE);
+ Editor editor = DataKeys.EDITOR.getData(context);
+ PsiFile psiFile = DataKeys.PSI_FILE.getData(context);
if (editor == null || editor.isDisposed()) {
return null;
}
@@ -93,7 +98,7 @@
}

public List<URLTextRange> getURLTextRanges(Editor editor, int startOffset, int endOffset) {
- assert endOffset >= startOffset:"startOffset: " + startOffset + "; endOffset: " + endOffset;
+ assert endOffset >= startOffset : "startOffset: " + startOffset + "; endOffset: " + endOffset;
if (editor.isDisposed() || endOffset <= startOffset)
return Collections.emptyList();
startOffset = Utils.ensureInBounds(editor, startOffset);

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/highlight/EditorInputHandler.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/highlight/EditorInputHandler.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/highlight/EditorInputHandler.java Fri Aug 24 01:57:18 2007
@@ -50,7 +50,8 @@
private LightweightHint myNavigateHint = null;
@Nullable
private LightweightHint myInfoHint = null;
- private static final CompoundBorder HINT_BORDER = new CompoundBorder(new SideBorder2(Color.WHITE, Color.WHITE, Color.GRAY, Color.GRAY, 1), new EmptyBorder(2, 2, 2, 2));
+ private static final CompoundBorder HINT_BORDER = new CompoundBorder(
+ new SideBorder2(Color.WHITE, Color.WHITE, Color.GRAY, Color.GRAY, 1), new EmptyBorder(2, 2, 2, 2));
private static final Color HINT_BACKGROUND = new Color(253, 254, 226);


@@ -107,7 +108,9 @@

private void updateHightlight() {
Point point = myLastLocation;
- URLTextRange hoveredRange = point != null ? myParser.getURLTextRange(myEditor, myPsiFile, point) : null;
+ URLTextRange hoveredRange = point != null ?
+ myParser.getURLTextRange(myEditor, myPsiFile, point) :
+ null;
if (hoveredRange == null || !hoveredRange.isActive()) {
if (myLastLinkRange != null) {
clearNavigationHighlight();
@@ -186,7 +189,9 @@

private Point translateToFrame(Point point) {
Point result = new Point(point);
- for (Component component = myEditor.getContentComponent(); !(component instanceof JRootPane); component = component.getParent()) {
+ for (Component component = myEditor.getContentComponent(); !(component instanceof JRootPane);
+ component = component.getParent())
+ {
result.x += component.getX();
result.y += component.getY();
}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/highlight/URLTextRange.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/highlight/URLTextRange.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/codelinks/highlight/URLTextRange.java Fri Aug 24 01:57:18 2007
@@ -1,19 +1,19 @@
package com.almworks.tracklink.codelinks.highlight;

+import com.almworks.tracker.eapi.alpha.ArtifactInfo;
+import com.almworks.tracker.eapi.alpha.GenericKeys;
import com.almworks.tracklink.IssueLink;
import com.almworks.tracklink.codelinks.CodeLink;
import com.almworks.tracklink.codelinks.CodeLinkType;
import com.almworks.tracklink.codelinks.cache.ArtifactInfoCache;
import com.almworks.tracklink.util.Utils;
-import com.almworks.tracker.eapi.alpha.ArtifactInfo;
-import com.almworks.tracker.eapi.alpha.GenericKeys;
-import com.intellij.openapi.util.Comparing;
-import com.intellij.openapi.util.Key;
-import com.intellij.openapi.editor.markup.MarkupModel;
-import com.intellij.openapi.editor.markup.RangeHighlighter;
+import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.markup.HighlighterLayer;
import com.intellij.openapi.editor.markup.HighlighterTargetArea;
-import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.markup.MarkupModel;
+import com.intellij.openapi.editor.markup.RangeHighlighter;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.Key;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@@ -113,6 +113,7 @@
RangeHighlighter highlighter = markupModel.addRangeHighlighter(this.getStartOffset(), this.getEndOffset(),
HighlighterLayer.ERROR, StyleConstants.STATIC_TEXT_ATTRIBUTES, HighlighterTargetArea.EXACT_RANGE);
highlighter.setErrorStripeMarkColor(StyleConstants.CORPORATE);
+ //< alm
ArtifactInfoCache cache = Utils.getArtifactInfoCache();
String summary;
if (cache != null) {
@@ -124,6 +125,8 @@
summary = summary.substring(0, 38) + " ...";
} else
summary = "";
+
+ // alm >
highlighter.setErrorStripeTooltip(this.getCodeLink().getCodeFragment() + " " + summary);
highlighter.putUserData(STATIC_HIGHLIGHTER_KEY, this);
}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/collections/CollectionsCacheImpl.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/collections/CollectionsCacheImpl.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/collections/CollectionsCacheImpl.java Fri Aug 24 01:57:18 2007
@@ -1,7 +1,7 @@
package com.almworks.tracklink.collections;

import com.almworks.tracker.eapi.alpha.CollectionData;
-import com.intellij.openapi.util.Comparing;
+import com.almworks.tracklink.codelinks.cache.ArtifactInfoCache;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.WriteExternalException;
@@ -15,6 +15,7 @@
* @author Vassiliy Kudryashov
*/
public class CollectionsCacheImpl implements CollectionsCache {
+
private final static String COLLECTIONS_ELEM = "Collections";
private final static String COLLECTION_ELEM = "Collection";
private final static String ID_ATTR = "id";
@@ -22,40 +23,56 @@
private static final String ARTIFACT_INFO_ELEM = "ArtifactInfo";
private static final String URL_ATTR = "url";

- Map<CollectionData, HashSet<String>> myURLsMap = new HashMap<CollectionData, HashSet<String>>();
+ private final ArtifactInfoCache myArtifactInfoCache;

+ Map<String, Set<String>> myURLsMap = new HashMap<String, Set<String>>();
+ Map<String, CollectionData> myCollectionDataMap = new HashMap<String, CollectionData>();
+ public CollectionsCacheImpl(ArtifactInfoCache cache) {
+ myArtifactInfoCache = cache;
+ }

public void store(CollectionData collectionData, Collection<String> infoURLs) {
- Set<CollectionData> keys = myURLsMap.keySet();
- for(CollectionData data: keys) {
- if (Comparing.strEqual(data.getCollectionId(), collectionData.getCollectionId()))
- myURLsMap.get(data).addAll(infoURLs);
- }
- myURLsMap.put(collectionData, new HashSet<String>(infoURLs));
+ put(collectionData, new HashSet<String>(infoURLs));
}

@Nullable
public Pair<CollectionData, ? extends Set<String>> restore(String collectionID) {
- Set<CollectionData> keys = myURLsMap.keySet();
- for (CollectionData data: keys) {
- if (Comparing.strEqual(data.getCollectionId(), collectionID))
- return Pair.create(data, myURLsMap.get(data));
+ if (myURLsMap.containsKey(collectionID)) {
+ return Pair.create(myCollectionDataMap.get(collectionID), myURLsMap.get(collectionID));
}
return null;
}

- public void forgetCollection(String collectionID) {
- Set<CollectionData> set = myURLsMap.keySet();
- CollectionData[] datas = set.toArray(new CollectionData[set.size()]);
- for(CollectionData data: datas) {
- if (Comparing.strEqual(data.getCollectionId(), collectionID))
- myURLsMap.remove(data);
+
+
+ public synchronized void forgetCollection(String collectionID) {
+
+ Set<String> urls = myURLsMap.get(collectionID);
+
+ remove(collectionID);
+
+ Collection<String> toRemoveFromCache = new HashSet<String>(urls);
+ for (String url : urls) {
+ if (otherCollectionContainsUrl(url)) {
+ toRemoveFromCache.remove(url);
+ }
+ }
+ myArtifactInfoCache.removeArtifacts(toRemoveFromCache);
+
+ }
+
+ private boolean otherCollectionContainsUrl(String url) {
+ for (Set<String> urls : myURLsMap.values()) {
+ if (urls.contains(url)) {
+ return true;
+ }
}
+ return false;
}

public void readExternal(Element element) throws InvalidDataException {
Element collectionsElement = element.getChild(COLLECTIONS_ELEM);
- if (collectionsElement==null)
+ if (collectionsElement == null)
return;
List children = collectionsElement.getChildren(COLLECTION_ELEM);
for (Object child : children) {
@@ -63,7 +80,8 @@
String id = collectionElement.getAttributeValue(ID_ATTR);
String name = collectionElement.getAttributeValue(NAME_ATTR);
if (id != null && name != null) {
- CollectionData collectionData = new CollectionData(id, true, Collections.singletonMap(CollectionData.COLLECTION_NAME, name));
+ CollectionData collectionData =
+ new CollectionData(id, true, Collections.singletonMap(CollectionData.COLLECTION_NAME, name));
HashSet<String> set = new HashSet<String>();
List infos = collectionElement.getChildren(ARTIFACT_INFO_ELEM);
for (Object info : infos) {
@@ -72,23 +90,34 @@
if (url != null)
set.add(url);
}
- myURLsMap.put(collectionData, set);
+ put(collectionData, set);
}
}
}

+ private CollectionData put(CollectionData data, Set<String> urls) {
+ String id = data.getCollectionId();
+ myURLsMap.put(id, urls);
+ return myCollectionDataMap.put(id, data);
+ }
+
+ private CollectionData remove(String id) {
+ myURLsMap.remove(id);
+ return myCollectionDataMap.remove(id);
+ }
+
public void writeExternal(Element element) throws WriteExternalException {
- Set<CollectionData> keys = myURLsMap.keySet();
+ Set<String> keys = myURLsMap.keySet();
Element collectionsElement = new Element(COLLECTIONS_ELEM);
- for (CollectionData collectionData : keys) {
+ for (String collectionId : keys) {
Element collectionElement = new Element(COLLECTION_ELEM);
- collectionElement.setAttribute(ID_ATTR, collectionData.getCollectionId());
- String name = collectionData.getProperty(CollectionData.COLLECTION_NAME);
+ collectionElement.setAttribute(ID_ATTR, collectionId);
+ String name = myCollectionDataMap.get(collectionId).getProperty(CollectionData.COLLECTION_NAME);
if (name == null)
name = "";
collectionElement.setAttribute(NAME_ATTR, name);

- Set<String> list = myURLsMap.get(collectionData);
+ Set<String> list = myURLsMap.get(collectionId);
for (String url : list) {
Element infoElement = new Element(ARTIFACT_INFO_ELEM);
infoElement.setAttribute(URL_ATTR, url);

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/dialogs/DialogWrapperImpl.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/dialogs/DialogWrapperImpl.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/dialogs/DialogWrapperImpl.java Fri Aug 24 01:57:18 2007
@@ -3,10 +3,12 @@
import com.intellij.openapi.ui.DialogWrapper;

import javax.swing.*;
-import java.awt.event.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;

public class DialogWrapperImpl extends DialogWrapper {
- private JComponent myContent;
+ private final JComponent myContent;
private DialogOrientedComponent myComponent;

public DialogWrapperImpl(JComponent invoker, DialogOrientedComponent component, String title) {

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/filemonitoring/FileEditorWatcherImpl.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/filemonitoring/FileEditorWatcherImpl.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/filemonitoring/FileEditorWatcherImpl.java Fri Aug 24 01:57:18 2007
@@ -18,7 +18,11 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

-import java.util.*;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;

/**
* @author Vassiliy Kudryashov
@@ -30,7 +34,7 @@
new WeakHashMap<VirtualFile, PsiLinkHighlighter>();
private final CodeParser myParser;
private final ArtifactInfoCache myCache;
- private final List<FileChangeListener> myListeners = new ArrayList<FileChangeListener>(1);
+ private final List<FileChangeListener> myListeners = new CopyOnWriteArrayList<FileChangeListener>();

@Nullable
private Project myProject;
@@ -104,9 +108,8 @@

highlighter.addDocumentListener(new DocumentAdapter() {
public void documentChanged(DocumentEvent e) {
- Object[] listeners = myListeners.toArray();
- for (Object fileChangeListener : listeners) {
- ((FileChangeListener) fileChangeListener).fileChanged(file);
+ for (FileChangeListener fileChangeListener : myListeners) {
+ fileChangeListener.fileChanged(file);
}
}
});

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/filemonitoring/FileMapper.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/filemonitoring/FileMapper.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/filemonitoring/FileMapper.java Fri Aug 24 01:57:18 2007
@@ -11,7 +11,7 @@
/**
* @author Vassiliy Kudryashov
*/
-public interface FileMapper extends JDOMExternalizable, FileChangeListener {
+public interface FileMapper extends FileChangeListener, JDOMExternalizable {

boolean isURLActive(String url);

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/filemonitoring/FileMapperImpl.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/filemonitoring/FileMapperImpl.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/filemonitoring/FileMapperImpl.java Fri Aug 24 01:57:18 2007
@@ -159,7 +159,7 @@
Project project = getProject();
if (!urls.isEmpty() && project != null) {
TrackLinkPlugin linkPlugin = project.getComponent(TrackLinkPlugin.class);
- List<CodeLinkType> codeLinkTypes = linkPlugin.getModel().getReferenceTypes();
+ List<CodeLinkType> codeLinkTypes = linkPlugin.getIssueModel().getReferenceTypes();
StringBuffer label = new StringBuffer();
int typedCount = 0;
for (String url : urls) {

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/filemonitoring/FileMapperManager.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/filemonitoring/FileMapperManager.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/filemonitoring/FileMapperManager.java Fri Aug 24 01:57:18 2007
@@ -2,6 +2,7 @@

import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.InvalidDataException;
+import com.intellij.openapi.util.JDOMExternalizable;
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.HashMap;
@@ -15,7 +16,7 @@
/**
* @author Vassiliy Kudryashov
*/
-public class FileMapperManager {
+public class FileMapperManager implements JDOMExternalizable {
private static final String MANAGER_ELEM = "TrackLink.FileMapperManager";
private static final String MAPPER_ELEM = "FileMapper";
private static final String PROJECT_ATTR = "projectURL";

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/findusages/CodeLinkUsage.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/findusages/CodeLinkUsage.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/findusages/CodeLinkUsage.java Fri Aug 24 01:57:18 2007
@@ -10,7 +10,9 @@
import com.intellij.openapi.module.Module;
import com.intellij.openapi.roots.OrderEntry;
import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.psi.*;
+import com.intellij.psi.PsiDocumentManager;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
import com.intellij.usageView.UsageInfo;
import com.intellij.usages.*;
import com.intellij.usages.rules.*;
@@ -28,8 +30,8 @@
private final UsageInfo2UsageAdapter myAdapter;
private final CodeLinkUsagePresentation myPresentation;

- private List<RangeMarker> myRangeMarkers = new ArrayList<RangeMarker>();
- private URLTextRange myTextRange;
+ private final List<RangeMarker> myRangeMarkers = new ArrayList<RangeMarker>();
+ private final URLTextRange myTextRange;

public CodeLinkUsage(final UsageInfo usageInfo, URLTextRange textRange) {
myTextRange = textRange;

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/findusages/CodeLinkUsageGroup.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/findusages/CodeLinkUsageGroup.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/findusages/CodeLinkUsageGroup.java Fri Aug 24 01:57:18 2007
@@ -21,7 +21,7 @@
class CodeLinkUsageGroup implements UsageGroup {
private final Project myProject;
private final VirtualFile myFile;
- private String myPresentableName;
+ private final String myPresentableName;
private Icon myIcon;

public CodeLinkUsageGroup(Project project, VirtualFile file) {
@@ -49,10 +49,8 @@

final CodeLinkUsageGroup CodeLinkUsageGroup = (CodeLinkUsageGroup) o;

- if (myFile != null ? !myFile.equals(CodeLinkUsageGroup.myFile) : CodeLinkUsageGroup.myFile != null)
- return false;
+ return !(myFile != null ? !myFile.equals(CodeLinkUsageGroup.myFile) : CodeLinkUsageGroup.myFile != null);

- return true;
}

public int hashCode() {
@@ -92,6 +90,7 @@
}

public Object getData(String dataId) {
+
if (DataConstants.VIRTUAL_FILE.equals(dataId)) {
return myFile != null && myFile.isValid() ? myFile : null;
}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/findusages/CodelinkTypeGroupingRuleProvider.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/findusages/CodelinkTypeGroupingRuleProvider.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/findusages/CodelinkTypeGroupingRuleProvider.java Fri Aug 24 01:57:18 2007
@@ -1,21 +1,27 @@
package com.almworks.tracklink.findusages;

-import com.intellij.usages.rules.UsageGroupingRuleProvider;
-import com.intellij.usages.rules.UsageGroupingRule;
-import com.intellij.usages.*;
-import com.intellij.usages.impl.UsageViewImpl;
-import com.intellij.openapi.components.ApplicationComponent;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.actionSystem.*;
-import com.intellij.openapi.util.*;
import com.almworks.tracklink.util.PluginIcons;
import com.almworks.tracklink.util.StringBundle;
-import org.jetbrains.annotations.*;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.ToggleAction;
+import com.intellij.openapi.components.ApplicationComponent;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.InvalidDataException;
+import com.intellij.openapi.util.JDOMExternalizable;
+import com.intellij.openapi.util.WriteExternalException;
+import com.intellij.usages.Usage;
+import com.intellij.usages.UsageGroup;
+import com.intellij.usages.UsageView;
+import com.intellij.usages.impl.UsageViewImpl;
+import com.intellij.usages.rules.UsageGroupingRule;
+import com.intellij.usages.rules.UsageGroupingRuleProvider;
import org.jdom.Element;
+import org.jetbrains.annotations.NonNls;

import javax.swing.*;
-import java.util.List;
import java.util.ArrayList;
+import java.util.List;

/**
* @author Vassiliy Kudryashov
@@ -64,7 +70,7 @@
}

private static class VCSLinkGroupingRule implements UsageGroupingRule {
- private Project myProject;
+ private final Project myProject;

public VCSLinkGroupingRule(Project project) {
myProject = project;
@@ -80,7 +86,7 @@


private static class CodeLinkGroupingRule implements UsageGroupingRule {
- private Project myProject;
+ private final Project myProject;

public CodeLinkGroupingRule(Project project) {
myProject = project;
@@ -96,7 +102,7 @@


private class CustomRuleAction extends ToggleAction {
- private UsageViewImpl myView;
+ private final UsageViewImpl myView;

public CustomRuleAction(UsageViewImpl view, final String text, final Icon icon) {
super(text, null, icon);

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/findusages/FindUsagesActionUtil.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/findusages/FindUsagesActionUtil.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/findusages/FindUsagesActionUtil.java Fri Aug 24 01:57:18 2007
@@ -1,18 +1,18 @@
package com.almworks.tracklink.findusages;

-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.ui.DialogWrapper;
-import com.intellij.openapi.util.*;
-import com.intellij.ui.GuiUtils;
-import com.almworks.tracklink.util.StringBundle;
import com.almworks.tracklink.util.ItemAdapter;
+import com.almworks.tracklink.util.StringBundle;
import com.almworks.tracklink.util.Utils;
import com.almworks.tracklink.vcslinks.cache.VCSCache;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.DialogWrapper;
+import com.intellij.openapi.util.IconLoader;
+import com.intellij.ui.GuiUtils;

import javax.swing.*;
-import javax.swing.border.EmptyBorder;
import javax.swing.border.Border;
import javax.swing.border.CompoundBorder;
+import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.ItemListener;
import java.util.Date;
@@ -32,7 +32,7 @@
ourSettings = settings;
}

- static FindUsagesSettings getFindUsageSettings(Project project, String...url) {
+ static FindUsagesSettings getFindUsageSettings(Project project, String... url) {
UsageTypeDialogWrapper wrapper = new UsageTypeDialogWrapper(project, url);
wrapper.show();
if (DialogWrapper.OK_EXIT_CODE == wrapper.getExitCode())
@@ -50,7 +50,7 @@
private final JCheckBox myOpenInNewTabCheckbox =
new JCheckBox(StringBundle.get("find.dialog.openInNewTab"), ourSettings.openInNewTab());
private final String[] myURL;
- private ItemListener myItemListener = new ItemAdapter() {
+ private final ItemListener myItemListener = new ItemAdapter() {
protected void fireSelected(boolean isSelected) {
checkOKAction();
}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/findusages/FindUtils.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/findusages/FindUtils.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/findusages/FindUtils.java Fri Aug 24 01:57:18 2007
@@ -15,7 +15,7 @@
import com.almworks.tracklink.vcslinks.cache.impl.VirtualFileRevision;
import com.almworks.util.Log;
import com.intellij.ide.DataManager;
-import com.intellij.openapi.actionSystem.DataConstants;
+import com.intellij.openapi.actionSystem.DataKeys;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.project.Project;
@@ -46,7 +46,7 @@
return ModelCache.getInstance().getPatternIndexer();
}

- private static void showIssueLinks(@Nullable Project project, FindUsagesSettings settings, String...urls) {
+ private static void showIssueLinks(@Nullable Project project, FindUsagesSettings settings, String... urls) {
Log.debug("showIssueLinks");
PatternIndexer provider = getPatternIndexer();
if (project == null || provider == null)
@@ -60,7 +60,8 @@
}

private static List<Pair<PsiElement, URLTextRange>> filterProject(PatternIndexer provider, Project project,
- String...urls) {
+ String... urls)
+ {
CodeLinkType[] codeLinkTypes = filterCodeLinkTypes(provider.getIndexPatterns(), urls);

PsiSearchHelper searchHelper = PsiManager.getInstance(project).getSearchHelper();
@@ -90,7 +91,7 @@
return foundFiles;
}

- private static UsageTarget[] createUsageTargets(Project project, String...urls) {
+ private static UsageTarget[] createUsageTargets(Project project, String... urls) {
ArtifactInfoCache cache = Utils.getArtifactInfoCache();
UsageTarget[] result = new UsageTarget[urls.length];
for (int i = 0; i < urls.length; i++) {
@@ -113,7 +114,8 @@
*/
@NonNls
private static Usage[] createUsages(final Project project, final boolean searchInCode, final boolean searchInVCS,
- @Nullable final Boolean refresh, final String ... urls) {
+ @Nullable final Boolean refresh, final String... urls)
+ {
Log.debug("createUsages(urls #" + urls.length + ")");
final List<Usage> usages = new ArrayList<Usage>();

@@ -236,7 +238,8 @@
}

private static void showFindUsages(Project project, UsageViewPresentation presentation, UsageTarget[] targets,
- Usage[] usages) {
+ Usage[] usages)
+ {
if (usages.length != 0) {
UsageViewManager uvm = UsageViewManager.getInstance(project);
UsageView usageView = uvm.showUsages(targets, usages, presentation);
@@ -247,11 +250,10 @@
}


- public static void findUsages(Project project, String ... urls) {
+ public static void findUsages(Project project, String... urls) {
Log.debug("findUsages");
if (project == null) {
- // todo maybe not needed
- project = (Project) DataManager.getInstance().getDataContext().getData(DataConstants.PROJECT);
+ project = DataKeys.PROJECT.getData(DataManager.getInstance().getDataContext());
}
if (project == null) {
assert false : urls;

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/findusages/URLUsageTarget.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/findusages/URLUsageTarget.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/findusages/URLUsageTarget.java Fri Aug 24 01:57:18 2007
@@ -8,7 +8,7 @@
import com.intellij.openapi.vcs.FileStatus;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.usages.UsageTarget;
-import org.jetbrains.annotations.*;
+import org.jetbrains.annotations.Nullable;

import javax.swing.*;

@@ -16,7 +16,7 @@
* @author Vassiliy Kudryashov
*/
public class URLUsageTarget implements UsageTarget {
- private Project myProject;
+ private final Project myProject;
private final String myName;

public URLUsageTarget(Project project, String name) {

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/findusages/VCSLinkUsage.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/findusages/VCSLinkUsage.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/findusages/VCSLinkUsage.java Fri Aug 24 01:57:18 2007
@@ -38,14 +38,14 @@
private static final TextChunk TEXT_SPACE = new TextChunk(null, " ");
private static final TextChunk TEXT_BY = new TextChunk(null, " by ");//NON-NLS

- private static Map<DifferenceType, TextAttributes> myTextAttributesMap =
+ private static final Map<DifferenceType, TextAttributes> myTextAttributesMap =
new HashMap<DifferenceType, TextAttributes>(4);

private final UsageInfo myUsageInfo;
// private String myUrl;
private final VirtualFileRevision myRevision;
- private Project myProject;
- private VCSLinkUsagePresentation myPresentation;
+ private final Project myProject;
+ private final VCSLinkUsagePresentation myPresentation;

private VCSLinkUsage(UsageInfo usageInfo, VirtualFileRevision revision, Project project)
{

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/findusages/VCSLinkUsageGroup.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/findusages/VCSLinkUsageGroup.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/findusages/VCSLinkUsageGroup.java Fri Aug 24 01:57:18 2007
@@ -1,19 +1,17 @@
package com.almworks.tracklink.findusages;

-import com.intellij.usages.UsageGroup;
-import com.intellij.usages.UsageView;
+import com.almworks.tracklink.util.StringBundle;
+import com.intellij.openapi.actionSystem.DataConstants;
+import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.project.Project;
-import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.openapi.util.Iconable;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.vcs.FileStatus;
import com.intellij.openapi.vcs.FileStatusManager;
-import com.intellij.openapi.fileEditor.FileEditorManager;
-import com.intellij.openapi.actionSystem.DataConstants;
-import com.intellij.util.IconUtil;
+import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
-import com.almworks.tracklink.util.StringBundle;
+import com.intellij.usages.UsageGroup;
+import com.intellij.usages.UsageView;

import javax.swing.*;

@@ -23,7 +21,7 @@
public class VCSLinkUsageGroup implements UsageGroup {
private final Project myProject;
private final VirtualFile myFile;
- private String myPresentableName;
+ private final String myPresentableName;
private Icon myIcon;

public VCSLinkUsageGroup(Project project, VirtualFile file) {
@@ -51,10 +49,8 @@

final VCSLinkUsageGroup VCSLinkUsageGroup = (VCSLinkUsageGroup) o;

- if (myFile != null ? !myFile.equals(VCSLinkUsageGroup.myFile) : VCSLinkUsageGroup.myFile != null)
- return false;
+ return !(myFile != null ? !myFile.equals(VCSLinkUsageGroup.myFile) : VCSLinkUsageGroup.myFile != null);

- return true;
}

public int hashCode() {

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/popup/ArtifactInfoDialogWrapper.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/popup/ArtifactInfoDialogWrapper.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/popup/ArtifactInfoDialogWrapper.java Fri Aug 24 01:57:18 2007
@@ -36,7 +36,7 @@
private final static int MIN_WIDTH = 500;
private final static int MIN_HEIGHT = 70;

- private final ArtifactInfoModel myModel;
+ private final ArtifactInfoList myModel;

@Nullable
private final TrackerConnector myConnector;
@@ -45,18 +45,21 @@
private Point myPreferredLocation;
private final DetachComposite myLifespan = new DetachComposite();
private static final Action[] EMPTY_ACTIONS = new Action[0];
+ private String myHighLightPattern;

- public ArtifactInfoDialogWrapper(Component parent, ArtifactInfoCache cache, String url, Project project) {
+ public ArtifactInfoDialogWrapper(Component parent, ArtifactInfoCache cache, String url, Project project,
+ String highlightPattern)
+ {
super(parent, true);
myModel = cache.getListModel(this, project, myLifespan, url);
myConnector = cache.getConnector(project);
+ myHighLightPattern = highlightPattern;

init();
setModal(false);
setUndecorated(true);
initClosingListeners();
checkPreferredSize();
- //pack();
}

public Point getInitialLocation() {
@@ -177,7 +180,7 @@
toolbarPanel.setPreferredSize(new Dimension(MAX_WIDTH, 27));
toolbarPanel.updateLabels(myModel);
DragAdapter.attachToComponent(toolbarPanel, getWindow(), myLifespan);
- myHtmlPane = new HTMLPane(ArtifactInfoDialogWrapper.this, myModel);
+ myHtmlPane = new HTMLPane(this, myModel, myHighLightPattern);
p.add(toolbarPanel, BorderLayout.NORTH);
p.add(myHtmlPane, BorderLayout.CENTER);
return p;
@@ -207,11 +210,10 @@
}

private Pair<Boolean, Boolean> checkModel() {
- ArtifactInfo[] infos = myModel.getValuesSnapshot();
boolean noArtifact = false;
boolean noConnection = false;

- for (ArtifactInfo artifactInfo : infos) {
+ for (ArtifactInfo artifactInfo : myModel.getValuesSnapshot()) {
ArtifactInfoStatus status = artifactInfo.getStatus();
if (status == ArtifactInfoStatus.NO_ARTIFACT)
noArtifact = true;

Added: trunk/modules/tracklink/src/com/almworks/tracklink/popup/ArtifactInfoList.java
==============================================================================
--- (empty file)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/popup/ArtifactInfoList.java Fri Aug 24 01:57:18 2007
@@ -0,0 +1,69 @@
+package com.almworks.tracklink.popup;
+
+import com.almworks.tracker.eapi.alpha.ArtifactInfo;
+import com.intellij.openapi.util.Comparing;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.event.ListDataEvent;
+import javax.swing.event.ListDataListener;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+public class ArtifactInfoList {
+ public static final ArtifactInfoList EMPTY = new ArtifactInfoList(Collections.<ArtifactInfo>emptyList());
+
+ private final List<ListDataListener> myListeners = new CopyOnWriteArrayList<ListDataListener>();;
+ private final List<ArtifactInfo> myValues;
+
+ public ArtifactInfoList(@NotNull List<ArtifactInfo> list) {
+ myValues = new ArrayList<ArtifactInfo>(list);
+ }
+
+ public synchronized void onInfoChanged(@NotNull ArtifactInfo info) {
+ int minChange = Integer.MAX_VALUE;
+ int maxChange = Integer.MIN_VALUE;
+ for (int i = 0; i < myValues.size(); i++) {
+ ArtifactInfo oldInfo = myValues.get(i);
+ if (Comparing.strEqual(oldInfo.getUrl(), info.getUrl())) {
+ myValues.set(i, info);
+ if (i > maxChange)
+ maxChange = i;
+ if (i < minChange)
+ minChange = i;
+ }
+ }
+ if (minChange <= maxChange) {
+ fireValueChanged(minChange, maxChange);
+ }
+ }
+
+ public synchronized List<String> getURLs() {
+ List<String> urls = new ArrayList<String>();
+ for (ArtifactInfo info : myValues) {
+ urls.add(info.getUrl());
+ }
+ return urls;
+
+ }
+
+ private void fireValueChanged(int minChange, int maxChange) {
+ ListDataEvent event = new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, minChange, maxChange);
+ for (ListDataListener listDataListener : myListeners) {
+ listDataListener.contentsChanged(event);
+ }
+ }
+
+ public synchronized void addListDataListener(ListDataListener l) {
+ myListeners.add(l);
+ }
+
+ public synchronized void removeListDataListener(ListDataListener l) {
+ myListeners.remove(l);
+ }
+
+ public synchronized List<ArtifactInfo> getValuesSnapshot() {
+ return Collections.unmodifiableList(myValues);
+ }
+}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/popup/HTMLPane.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/popup/HTMLPane.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/popup/HTMLPane.java Fri Aug 24 01:57:18 2007
@@ -6,31 +6,42 @@
import com.almworks.tracklink.util.HTMLViewer;
import com.almworks.tracklink.util.StringBundle;
import com.almworks.tracklink.util.Utils;
+import com.almworks.util.ui.ColorUtil;
+import org.jetbrains.annotations.NonNls;

import javax.swing.*;
import javax.swing.event.ListDataEvent;
import java.awt.*;
-
-import org.jetbrains.annotations.NonNls;
+import java.util.List;

/**
* @author Vassiliy Kudryashov
*/
final class HTMLPane extends JScrollPane {
private static final Font FONT = UIManager.getFont("Label.font"); //NON-NLS
+
private static final String STYLE_BLOCK = "<head><style>\n" + "body {margin:2px; background-color:#FFFFD7;}\n" +
"body, td, pre { font-family: " + FONT.getFamily() + "; font-size: " + FONT.getSize() + "pt; }\n" +
+ ".found {background-color:" + ColorUtil.SEARCH_HIGLIGHT_BACKCOLOR_LITERAL + "; color:#FFFFFF;}\n" +
".url { text-align: right; text-decoration: underline; margin-bottom: 8px; }\n" +
".header { font-weight: bold; font-size: " + (int) (1.2F * FONT.getSize()) + "pt; }\n" +
".fields { margin: 8px 0px 0px 0px; }\n" + ".value { margin: 0px 0px 0px 16px; }\n" +
".ctitle, .cuser, .cwhen { font-weight: bold; margin: " + (int) (1.1F * FONT.getSize()) + "px 0px 0px 0px;}\n" +
".cwhen { text-align: right; }\n" + "</style></head>";
+
private final HTMLViewer myHTMLViewer = new HTMLViewer();
private LiveDialog myLiveDialog;
+ private String myHighlight;

- public HTMLPane(LiveDialog liveDialog, final ArtifactInfoModel model) {
+ public HTMLPane(LiveDialog liveDialog, final ArtifactInfoList model) {
+ this(liveDialog, model, "");
+ }
+
+ public HTMLPane(LiveDialog liveDialog, final ArtifactInfoList model, String highlight) {
myLiveDialog = liveDialog;
+ myHighlight = highlight;
setViewportView(myHTMLViewer);
+
setBorder(null);

model.addListDataListener(new ChangeListAdapter() {
@@ -41,23 +52,24 @@
setText(model.getValuesSnapshot());
}

- private void setText(ArtifactInfo[] infos) {
+ private void setText(List<ArtifactInfo> infos) {
@NonNls StringBuffer buffer = new StringBuffer("<html>").append(STYLE_BLOCK).append("\n<body>\n"); //NON-NLS
- for (int i = 0; i < infos.length; i++) {
- ArtifactInfo artifactInfo = infos[i];
+
+ for (ArtifactInfo artifactInfo : infos) {
ArtifactInfoStatus currentStatus = artifactInfo.getStatus();
if (currentStatus == ArtifactInfoStatus.OK) {
- buffer.append(artifactInfo.getPresentation(GenericKeys.LONG_DESCRIPTION_HTML));
+ String presentation = artifactInfo.getPresentation(GenericKeys.LONG_DESCRIPTION_HTML);
+ if (myHighlight != null && !myHighlight.equals("")) {
+ String html = Utils.getHighlightedHtml(presentation, myHighlight);
+ buffer.append(html);
+ } else {
+ buffer.append(presentation);
+ }
} else {
buffer
-// .append("<i>")
-// .append("<font color=\"#FF0000\">")
.append(StringBundle.get("html.status", Utils.getStatusPresentation(currentStatus)))
-// .append("</font></i>")
.append("<br>\n");//NON-NLS
}
- if (i < infos.length - 1)
- buffer.append("<hr>\n");
}
final Point viewPosition = getViewport().getViewPosition();
myHTMLViewer.setText(buffer.toString());
@@ -72,6 +84,6 @@
}

public JComponent getPreferredFocusedComponent() {
- return HTMLPane.this;
+ return this;
}
}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/popup/PopupConstants.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/popup/PopupConstants.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/popup/PopupConstants.java Fri Aug 24 01:57:18 2007
@@ -5,7 +5,7 @@
*/
public class PopupConstants {

- public static final String ARTIFACT_INFO_MODEL = "ArtifactInfoModel";
+ public static final String ARTIFACT_INFO_MODEL = "ArtifactInfoList";
public static final String POPUP_LIFESPAN = "PopupLifespan";
public static final String NEED_DOWNLOAD_ISSUES = "NeedDownloadIssues";
public static final String NEED_MAKE_CONNECTION = "NeedMakeConnection";

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/popup/ToolbarPanel.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/popup/ToolbarPanel.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/popup/ToolbarPanel.java Fri Aug 24 01:57:18 2007
@@ -1,7 +1,7 @@
package com.almworks.tracklink.popup;

-import com.almworks.dup.util.*;
-import com.almworks.tracker.eapi.alpha.*;
+import com.almworks.tracker.eapi.alpha.ArtifactInfo;
+import com.almworks.tracker.eapi.alpha.ArtifactInfoStatus;
import com.almworks.tracklink.util.StringBundle;
import com.almworks.tracklink.util.Utils;
import com.intellij.openapi.actionSystem.ActionToolbar;
@@ -10,7 +10,6 @@

import javax.swing.*;
import javax.swing.border.Border;
-import javax.swing.event.ListDataEvent;
import java.awt.*;
import java.text.MessageFormat;
import java.util.Date;
@@ -42,24 +41,23 @@
setBorder(new UnderlineBorder());
}

- void updateLabels(ArtifactInfoModel model) {
+ void updateLabels(ArtifactInfoList model) {
boolean isWaitingForConnection = false;
boolean isWaitingForDownload = false;
- long myFirstTimestamp = Long.MAX_VALUE;
- ArtifactInfo[] infos = model.getValuesSnapshot();
- for (ArtifactInfo artifactInfo : infos) {
+ long firstTimestamp = Long.MAX_VALUE;
+ for (ArtifactInfo artifactInfo : model.getValuesSnapshot()) {
ArtifactInfoStatus status = artifactInfo.getStatus();
if (status == ArtifactInfoStatus.WAIT_CONNECTION_SETUP)
isWaitingForConnection = true;
if (status == ArtifactInfoStatus.WAIT_DOWNLOADING)
isWaitingForDownload = true;
long timestamp = artifactInfo.getTimestamp();
- if (timestamp < myFirstTimestamp)
- myFirstTimestamp = timestamp;
+ if (timestamp < firstTimestamp)
+ firstTimestamp = timestamp;
}
- if (myFirstTimestamp!=0)
+ if (firstTimestamp != 0)
myTitleLabel.setText(
- new MessageFormat(StringBundle.get("popup.title")).format(new Object[] {new Date(myFirstTimestamp)}));
+ new MessageFormat(StringBundle.get("popup.title")).format(new Object[]{new Date(firstTimestamp)}));
else
myTitleLabel.setText(null);

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/popup/actions/CreateConnectionAction.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/popup/actions/CreateConnectionAction.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/popup/actions/CreateConnectionAction.java Fri Aug 24 01:57:18 2007
@@ -3,10 +3,12 @@
import com.almworks.dup.util.Lifespan;
import com.almworks.tracker.eapi.alpha.ArtifactLoadOption;
import com.almworks.tracker.eapi.alpha.TrackerConnector;
-import com.almworks.tracklink.popup.ArtifactInfoModel;
+import com.almworks.tracklink.popup.ArtifactInfoList;
import com.almworks.tracklink.popup.PopupConstants;
import com.almworks.tracklink.util.Utils;
-import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.DataContext;

/**
* @author Vassiliy Kudryashov
@@ -24,7 +26,7 @@
public void actionPerformed(AnActionEvent e) {
DataContext dataContext = e.getDataContext();
TrackerConnector connector = Utils.getConnector(dataContext);
- ArtifactInfoModel model = (ArtifactInfoModel) dataContext.getData(PopupConstants.ARTIFACT_INFO_MODEL);
+ ArtifactInfoList model = (ArtifactInfoList) dataContext.getData(PopupConstants.ARTIFACT_INFO_MODEL);
Lifespan lifespan = (Lifespan) dataContext.getData(PopupConstants.POPUP_LIFESPAN);
if (connector != null && model != null && lifespan != null) {
connector.getArtifactLoader()

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/popup/actions/DownloadIssueAction.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/popup/actions/DownloadIssueAction.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/popup/actions/DownloadIssueAction.java Fri Aug 24 01:57:18 2007
@@ -1,12 +1,14 @@
package com.almworks.tracklink.popup.actions;

-import com.intellij.openapi.actionSystem.*;
-import com.almworks.tracklink.util.Utils;
-import com.almworks.tracklink.popup.PopupConstants;
-import com.almworks.tracklink.popup.ArtifactInfoModel;
-import com.almworks.tracker.eapi.alpha.TrackerConnector;
-import com.almworks.tracker.eapi.alpha.ArtifactLoadOption;
import com.almworks.dup.util.Lifespan;
+import com.almworks.tracker.eapi.alpha.ArtifactLoadOption;
+import com.almworks.tracker.eapi.alpha.TrackerConnector;
+import com.almworks.tracklink.popup.ArtifactInfoList;
+import com.almworks.tracklink.popup.PopupConstants;
+import com.almworks.tracklink.util.Utils;
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.DataContext;

/**
* @author Vassiliy Kudryashov
@@ -26,7 +28,7 @@
public void actionPerformed(AnActionEvent e) {
DataContext dataContext = e.getDataContext();
TrackerConnector connector = Utils.getConnector(dataContext);
- ArtifactInfoModel model = (ArtifactInfoModel) dataContext.getData(PopupConstants.ARTIFACT_INFO_MODEL);
+ ArtifactInfoList model = (ArtifactInfoList) dataContext.getData(PopupConstants.ARTIFACT_INFO_MODEL);
Lifespan lifespan = (Lifespan) dataContext.getData(PopupConstants.POPUP_LIFESPAN);
if (connector != null && model != null && lifespan != null) {
connector.getArtifactLoader()

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/settings/RefTypeEditForm.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/settings/RefTypeEditForm.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/settings/RefTypeEditForm.java Fri Aug 24 01:57:18 2007
@@ -6,6 +6,7 @@
import com.almworks.tracklink.settings.wizards.PatternSettingsWizard;
import com.almworks.tracklink.util.StringBundle;
import com.almworks.tracklink.util.Utils;
+import com.almworks.util.ui.ColorUtil;
import com.intellij.openapi.util.Pair;
import com.intellij.ui.DocumentAdapter;
import com.intellij.util.containers.HashMap;
@@ -149,7 +150,7 @@
}

private void showError(String messageKey) {
- myResultField.setForeground(Utils.ERROR_COLOR);
+ myResultField.setForeground(ColorUtil.ERROR_COLOR);
myResultField.setText(StringBundle.get(messageKey));
}

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/settings/ReferenceSettingsPanelForm.java
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/settings/ReferenceSettingsPanelForm.java (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/settings/ReferenceSettingsPanelForm.java Fri Aug 24 01:57:18 2007
@@ -222,7 +222,8 @@
myBrowseButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
FileChooserDescriptor descriptor =
- FileChooserDescriptorFactory.getDirectoryChooserDescriptor(StringBundle.get("app.workspace", myModel.getApplicationDisplayNameNotNull()));
+ FileChooserDescriptorFactory.getDirectoryChooserDescriptor(
+ StringBundle.get("app.workspace", myModel.getApplicationDisplayNameNotNull()));
VirtualFile[] files = FileChooser.chooseFiles(myWorkspaceTextField, descriptor);
if (files.length != 0) {
myWorkspaceTextField.setText(FileUtil.toSystemDependentName(files[0].getPath()));

Modified: trunk/modules/tracklink/src/com/almworks/tracklink/settings/ReferencesSettingsForm.form
==============================================================================
--- trunk/modules/tracklink/src/com/almworks/tracklink/settings/ReferencesSettingsForm.form (original)
+++ trunk/modules/tracklink/src/com/almworks/tracklink/settings/ReferencesSettingsForm.form Fri Aug 24 01:57:18 2007
@@ -1,37 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.almworks.tracklink.settings.ReferenceSettingsPanelForm">
- <grid id="b1771" binding="myWholePanel" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="4" vgap="-1">
+ <grid id="b1771" binding="myWholePanel" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="4" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
- <xy x="40" y="33" width="532" height="594"/>
- <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0"/>
+ <xy x="40" y="33" width="571" height="594"/>
</constraints>
<properties/>
<border type="none"/>
<children>
- <grid id="19b21" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="9" vgap="9">
+ <grid id="19b21" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="9" vgap="9">
<margin top="5" left="5" bottom="5" right="5"/>
<constraints>
- <xy x="0" y="544" width="532" height="50"/>
- <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3"/>
+ <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="46e86" class="javax.swing.JLabel">
<constraints>
- <xy x="5" y="25" width="67" height="20"/>
- <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="3"/>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="com/almworks/tracklink/util/StringBundle" key="settings.version"/>
</properties>
</component>
- <xy id="e9142" binding="myLinkPanel" hgap="-1" vgap="-1">
+ <xy id="e9142" binding="myLinkPanel" layout-manager="XYLayout" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
- <xy x="81" y="25" width="446" height="20"/>
- <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="1" fill="3"/>
+ <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="1" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -39,19 +35,17 @@
</xy>
</children>
</grid>
- <grid id="596b0" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="2">
+ <grid id="596b0" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="2">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
- <xy x="0" y="0" width="532" height="298"/>
- <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="3" anchor="0" fill="3"/>
+ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="etched" title-resource-bundle="com/almworks/tracklink/util/StringBundle" title-key="settings.border.text"/>
<children>
<scrollpane id="64cb6">
<constraints>
- <xy x="6" y="20" width="441" height="272"/>
- <grid row="0" column="0" row-span="4" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3"/>
+ <grid row="0" column="0" row-span="4" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
@@ -67,8 +61,7 @@
</scrollpane>
<component id="a24f5" class="javax.swing.JButton" binding="myAddButton">
<constraints>
- <xy x="451" y="20" width="75" height="25"/>
- <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1"/>
+ <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<borderPainted value="true"/>
@@ -78,8 +71,7 @@
</component>
<component id="21d88" class="javax.swing.JButton" binding="myEditButton">
<constraints>
- <xy x="451" y="47" width="75" height="25"/>
- <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1"/>
+ <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="com/almworks/tracklink/util/StringBundle" key="settings.action.edit"/>
@@ -87,8 +79,7 @@
</component>
<component id="692df" class="javax.swing.JButton" binding="myRemoveButton">
<constraints>
- <xy x="451" y="74" width="75" height="25"/>
- <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1"/>
+ <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layo

==============================================================================
Diff truncated at 200k characters

Reply all
Reply to author
Forward
0 new messages