Author: elvisisking
Date: 2010-01-22 15:40:59 -0500 (Fri, 22 Jan 2010)
New Revision: 19893
Added:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ModeShapeMessageConsole.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ModeShapePreferencesDialog.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/ModeShapeMessageConsole.png
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/ModeShapePreferencesDialog.png
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ModeShapePreferencePage.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeContentProvider.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeMessageConsole.java
Removed:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishingMessageConsole.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishingPreferencesDialog.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/PublishingMessageConsole.png
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/PublishingPreferencesDialog.png
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingPreferencePage.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/PublishingContentProvider.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/PublishingMessageConsole.java
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishDialog.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishedLocationsDialog.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ResourceContextMenu.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ServerDialog.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ServerView.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/Toc.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/helpContexts.xml
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/OperationDialog.png
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/PublishDialog.png
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/PublishedLocationsDialog.png
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/ResourceContextMenu.png
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/ServerDialog.png
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/ServerView.png
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/toc.xml
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.xml
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFileExtensionEditor.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFoldersEditor.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ServerView.java
Log:
MODE-580 Rebranding to ModeShape. Mostly Eclipse Help documentation-related changes.
Copied:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ModeShapeMessageConsole.html
(from rev 19867,
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishingMessageConsole.html)
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ModeShapeMessageConsole.html
(rev 0)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ModeShapeMessageConsole.html 2010-01-22
20:40:59 UTC (rev 19893)
@@ -0,0 +1,65 @@
+<!--
+ ~ ModeShape (
http://www.modeshape.org)
+ - See the COPYRIGHT.txt file distributed with this work for information
+ - regarding copyright ownership.
+ -
+ - Distributed under license by Red Hat, Inc. All rights reserved.
+ - This program is made available under the terms of the
+ - Eclipse Public License v1.0 which accompanies this distribution, and is
+ - available at
http://www.eclipse.org/legal/epl-v10.html.
+ -
+ - See the AUTHORS.txt file in the distribution for a full listing of
+ - individual contributors.
+ -->
+<h2>ModeShape Message Console</h2>
+
+<p>The <i>ModeShape Message Console</i> is shown in the
<i>Workbench Console</i> view. Entries show the status and outcome of the
publishing or unpublishing operations.</p>
+
+<p>Here is what the <i>ModeShape Message Console</i> looks
like:</p>
+
+<img src="images/ModeShapeMessageConsole.png" border="0"
alt="">
+
+<p>There are view toolbar buttons to clear the console, scroll lock, pin the
console, display a different console, and to open another <i>ModeShape Message
Console</i>.</p>
+
+<h3>Console Message Entries</h3>
+
+<p>For each operation there is an entry at the start of the operation that
identifies the job number, operation type, number of files involved in the operation,
server, repository, and workspace. There is another entry at the end of the operation that
identifies the job number, operation type, and how long the operation took. Inbetween
these entries are entries for each file involved in the operation. The file entry takes on
the form of a job number, message prefix, and message. The message consists of an
operation type, eclipse workspace path, and the URL of the repository for that file. The
URL is a hyperlink that opens that file in the default or last used editor for that
file.</p>
+
+<p>Here are the file entry message prefixes:</p>
+
+<table border="1">
+<tr>
+ <td align="center"><strong>++</strong> </td>
+ <td>if the file was successfully published (uploaded)</td>
+</tr>
+<tr>
+ <td align="center"><strong>--</strong> </td>
+ <td>if the file was successfully unpublished (removed)</td>
+</tr>
+<tr>
+ <td
align="center"><strong>ERROR</strong> </td>
+ <td>if there was an error publishing or unpublishing the file</td>
+</tr>
+<tr>
+ <td
align="center"><strong>INFO</strong> </td>
+ <td>if there was an informational message publishing or unpublishing the
file</td>
+</tr>
+<tr>
+ <td
align="center"><strong>WARN</strong> </td>
+ <td>if there is a warning when publishing or unpublishing a file (like trying to
unpublish a file that was never unpublished)</td>
+</tr>
+</table>
+
+<h3>Operations</h3>
+
+<p>Each publishing or unpublishing operation can be run "in the
background" so you don't have to wait around until an operation is finished.
Simply click "Run in Background" on the operation dialog. This dialog identifies
the operation type, the job number, and the operations progress. You can also cancel the
operation using this dialog.</p>
+
+<p>Here is what the <i>Operation Dialog</i> looks like:</p>
+
+<img src="images/OperationDialog.png" border="0"
alt="">
+
+<h3>Related Topics</h3>
+
+<ul>
+<li><a href="PublishDialog.html">Publishing and Unpublishing
Dialog</a></li>
+</ul>
Property changes on:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ModeShapeMessageConsole.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ModeShapePreferencesDialog.html
(from rev 19867,
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishingPreferencesDialog.html)
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ModeShapePreferencesDialog.html
(rev 0)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ModeShapePreferencesDialog.html 2010-01-22
20:40:59 UTC (rev 19893)
@@ -0,0 +1,39 @@
+<!--
+ ~ ModeShape (
http://www.modeshape.org)
+ - See the COPYRIGHT.txt file distributed with this work for information
+ - regarding copyright ownership.
+ -
+ - Distributed under license by Red Hat, Inc. All rights reserved.
+ - This program is made available under the terms of the
+ - Eclipse Public License v1.0 which accompanies this distribution, and is
+ - available at
http://www.eclipse.org/legal/epl-v10.html.
+ -
+ - See the AUTHORS.txt file in the distribution for a full listing of
+ - individual contributors.
+ -->
+<h2>ModeShape Preferences Page</h2>
+
+<p>The <i>ModeShape Preferences Page</i> provides settings that control
what files are included in publishing and unpublishing operations. A publishing operation
occurs when the selected files in your local workspace are uploaded to a specific
ModeShape repository workspace. While an unpublishing operation occurs when the selected
files in your local workspace are removed from a specific ModeShape repository workspace.
The <i>Filtered File Extensions</i> preference and the <i>Filtered
Folder Names</i> preference each provide a way to filter out certain files from
these operations.</p>
+
+<p>Here is what the <i>ModeShape Preferences Page</i> looks
like:</p>
+
+<img src="images/ModeShapePreferencesDialog.png" border="0"
alt="">
+
+<h3>Filtered File Extensions Preference</h3>
+
+The <i>Filtered File Extensions</i> preference provides a way to construct a
list of file extensions. If a file has an extension that matches one of these file
extensions it will not be involved in either a publishing or unpublishing operation. To
add a file extension simply click on the <code>New...</code> button to display
the following dialog:
+
+<p><img src="images/NewFilteredFileExtension.png" border="0"
alt=""></p>
+
+<h3>Filtered Folder Names Preference</h3>
+
+The <i>Filtered File Names</i> preference provides a way to construct a list
of folder names. If a file is contained in a folder, or has an ancestor folder, with a
name that matches one of these folder names it will not be involved in either a publishing
or unpublishing operation. To add a folder name simply click on the
<code>New...</code> button to display the following dialog:
+
+<p><img src="images/NewFilteredFolderName.png" border="0"
alt=""></p>
+
+<h3>Related Topics</h3>
+
+<ul>
+<li><a href="PublishDialog.html">Publish/Unpublish
Dialog</a></li>
+<li><a href="ResourceContextMenu.html">ModeShape Resource Context
Menu</a></li>
+</ul>
Property changes on:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ModeShapePreferencesDialog.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishDialog.html
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishDialog.html 2010-01-22
18:51:55 UTC (rev 19892)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishDialog.html 2010-01-22
20:40:59 UTC (rev 19893)
@@ -11,9 +11,9 @@
- See the AUTHORS.txt file in the distribution for a full listing of
- individual contributors.
-->
-<h2>Publish/Unpublish Dialog</h2>
+<h2>ModeShape Publish/Unpublish Dialog</h2>
-<p>The <i>ModeShape Publish/Unpublish Dialog</i> is used to publish or
unpublish workspace selected files and folders to/from repository workspaces. When
publishing, the selected files will be uploaded to the selected repository workspace. When
unpublishing, the selected files will be removed from the selected repository workspace
(if they exist there). The <a
href="PublishingPreferencesDialog.html">Publishing Preferences Page</a>
allows you to filter out files contained within the selection based on their file
extensions or by the name of the folder, or ancestor folder, they are contained
within.</p>
+<p>The <i>ModeShape Publish/Unpublish Dialog</i> is used to publish or
unpublish workspace selected files and folders to/from repository workspaces. When
publishing, the selected files will be uploaded to the selected repository workspace. When
unpublishing, the selected files will be removed from the selected repository workspace
(if they exist there). The <a
href="ModeShapePreferencesDialog.html">ModeShape Preferences Page</a>
allows you to filter out files contained within the selection based on their file
extensions or by the name of the folder, or ancestor folder, they are contained
within.</p>
<p>Here is what the <i>Publish/Unpublish Dialog</i> looks
like:</p>
@@ -24,11 +24,11 @@
<table border="1">
<tr>
<td align="right"><strong>Server
Combo</strong> </td>
- <td>allows selection of a registered server</td>
+ <td>allows selection of a registered ModeShape server</td>
</tr>
<tr>
<td align="right"><strong>New Server
Button</strong> </td>
- <td>use to create and register a new server that is hosting a ModeShape
repository</td>
+ <td>use to create and register a new server that is hosting one or more ModeShape
repositories</td>
</tr>
<tr>
<td align="right"><strong>Repository
Combo</strong> </td>
@@ -48,12 +48,12 @@
</tr>
</table>
-<p>A server must be selected before a repository can be selected. Likewise, a
repository must be selected before a workspace can be selected. The message area at the
top of the dialog will indicate the type of operation (publish or unpublish) and if there
is any missing information. Once the workspace has been selected the 'Finish'
button will be enabled and the operation can be executed. These operations can be run in
the background so that multiple operations can be run at the same time. The Publishing
Message Console displays output from the operations.</p>
+<p>A server must be selected before a repository can be selected. Likewise, a
repository must be selected before a workspace can be selected. The message area at the
top of the dialog will indicate the type of operation (publish or unpublish) and if there
is any missing information. Once the workspace has been selected the 'Finish'
button will be enabled and the operation can be executed. These operations can be run in
the background so that multiple operations can be run at the same time. The <a
href="ModeShapeMessageConsole.html">ModeShape Message Console</a>
displays output from the operations.</p>
<h3>Related Topics</h3>
<ul>
<li><a href="ServerDialog.html">Server Dialog</a></li>
-<li><a href="PublishingMessageConsole.html">Publishing Message
Console</a></li>
-<li><a href="PublishingPreferencesDialog.html">Publishing
Preferences Page</a></li>
+<li><a href="ModeShapeMessageConsole.html">ModeShape Message
Console</a></li>
+<li><a href="ModeShapePreferencesDialog.html">ModeShape Preferences
Page</a></li>
</ul>
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishedLocationsDialog.html
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishedLocationsDialog.html 2010-01-22
18:51:55 UTC (rev 19892)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishedLocationsDialog.html 2010-01-22
20:40:59 UTC (rev 19893)
@@ -11,7 +11,7 @@
- See the AUTHORS.txt file in the distribution for a full listing of
- individual contributors.
-->
-<h2>Published Locations Dialog</h2>
+<h2>ModeShape Published Locations Dialog</h2>
<p>The <i>Published Locations Dialog</i> identifies all the ModeShape
workspaces the selected file has been published to from this Eclipse workspace.</p>
Deleted:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishingMessageConsole.html
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishingMessageConsole.html 2010-01-22
18:51:55 UTC (rev 19892)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishingMessageConsole.html 2010-01-22
20:40:59 UTC (rev 19893)
@@ -1,65 +0,0 @@
-<!--
- ~ ModeShape (
http://www.modeshape.org)
- - See the COPYRIGHT.txt file distributed with this work for information
- - regarding copyright ownership.
- -
- - Distributed under license by Red Hat, Inc. All rights reserved.
- - This program is made available under the terms of the
- - Eclipse Public License v1.0 which accompanies this distribution, and is
- - available at
http://www.eclipse.org/legal/epl-v10.html.
- -
- - See the AUTHORS.txt file in the distribution for a full listing of
- - individual contributors.
- -->
-<h2>ModeShape Message Console</h2>
-
-<p>The <i>ModeShape Message Console</i> is shown in the
<i>Workbench Console</i> view. Entries show the status and outcome of the
publishing or unpublishing operations.</p>
-
-<p>Here is what the <i>ModeShape Message Console</i> looks
like:</p>
-
-<img src="images/PublishingMessageConsole.png" border="0"
alt="">
-
-<p>There are view toolbar buttons to clear the console, scroll lock, pin the
console, display a different console, and to open another <i>Publishing Message
Console</i>.</p>
-
-<h3>Console Message Entries</h3>
-
-<p>For each operation there is an entry at the start of the operation that
identifies the job number, operation type, number of files involved in the operation,
server, repository, and workspace. There is another entry at the end of the operation that
identifies the job number, operation type, and how long the operation took. Inbetween
these entries are entries for each file involved in the operation. The file entry takes on
the form of a job number, message prefix, and message. The message consists of an
operation type, eclipse workspace path, and the URL of the repository for that file. The
URL is a hyperlink that opens that file in the default or last used editor for that
file.</p>
-
-<p>Here are the file entry message prefixes:</p>
-
-<table border="1">
-<tr>
- <td align="center"><strong>++</strong> </td>
- <td>if the file was successfully published (uploaded)</td>
-</tr>
-<tr>
- <td align="center"><strong>--</strong> </td>
- <td>if the file was successfully unpublished (removed)</td>
-</tr>
-<tr>
- <td
align="center"><strong>ERROR</strong> </td>
- <td>if there was an error publishing or unpublishing the file</td>
-</tr>
-<tr>
- <td
align="center"><strong>INFO</strong> </td>
- <td>if there was an informational message publishing or unpublishing the
file</td>
-</tr>
-<tr>
- <td
align="center"><strong>WARN</strong> </td>
- <td>if there is a warning when publishing or unpublishing a file (like trying to
unpublish a file that was never unpublished)</td>
-</tr>
-</table>
-
-<h3>Operations</h3>
-
-<p>Each publishing or unpublishing operation can be run "in the
background" so you don't have to wait around until an operation is finished.
Simply click "Run in Background" on the operation dialog. This dialog identifies
the operation type, the job number, and the operations progress. You can also cancel the
operation using this dialog.</p>
-
-<p>Here is what the <i>Operation Dialog</i> looks like:</p>
-
-<img src="images/OperationDialog.png" border="0"
alt="">
-
-<h3>Related Topics</h3>
-
-<ul>
-<li><a href="PublishDialog.html">Publishing and Unpublishing
Dialog</a></li>
-</ul>
Deleted:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishingPreferencesDialog.html
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishingPreferencesDialog.html 2010-01-22
18:51:55 UTC (rev 19892)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/PublishingPreferencesDialog.html 2010-01-22
20:40:59 UTC (rev 19893)
@@ -1,39 +0,0 @@
-<!--
- ~ ModeShape (
http://www.modeshape.org)
- - See the COPYRIGHT.txt file distributed with this work for information
- - regarding copyright ownership.
- -
- - Distributed under license by Red Hat, Inc. All rights reserved.
- - This program is made available under the terms of the
- - Eclipse Public License v1.0 which accompanies this distribution, and is
- - available at
http://www.eclipse.org/legal/epl-v10.html.
- -
- - See the AUTHORS.txt file in the distribution for a full listing of
- - individual contributors.
- -->
-<h2>Publishing Preferences Page</h2>
-
-<p>The <i>Publishing Preferences Page</i> provides settings that
control what files are included in publishing and unpublishing operations. A publishing
operation occurs when the selected files in your local workspace are uploaded to a
specific ModeShape repository workspace. While an unpublishing operation occurs when the
selected files in your local workspace are removed from a specific ModeShape repository
workspace. The <i>Filtered File Extensions</i> preference and the
<i>Filtered Folder Names</i> preference each provide a way to filter out
certain files from these operations.</p>
-
-<p>Here is what the <i>Publishing Preferences Page</i> looks
like:</p>
-
-<img src="images/PublishingPreferencesDialog.png" border="0"
alt="">
-
-<h3>Filtered File Extensions Preference</h3>
-
-The <i>Filtered File Extensions</i> preference provides a way to construct a
list of file extensions. If a file has an extension that matches one of these file
extensions it will not be involved in either a publishing or unpublishing operation. To
add a file extension simply click on the <code>New...</code> button to display
the following dialog:
-
-<p><img src="images/NewFilteredFileExtension.png" border="0"
alt=""></p>
-
-<h3>Filtered Folder Names Preference</h3>
-
-The <i>Filtered File Names</i> preference provides a way to construct a list
of folder names. If a file is contained in a folder, or has an ancestor folder, with a
name that matches one of these folder names it will not be involved in either a publishing
or unpublishing operation. To add a folder name simply click on the
<code>New...</code> button to display the following dialog:
-
-<p><img src="images/NewFilteredFolderName.png" border="0"
alt=""></p>
-
-<h3>Related Topics</h3>
-
-<ul>
-<li><a href="PublishDialog.html">Publish/Unpublish
Dialog</a></li>
-<li><a href="ResourceContextMenu.html">ModeShape Resource Context
Menu</a></li>
-</ul>
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ResourceContextMenu.html
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ResourceContextMenu.html 2010-01-22
18:51:55 UTC (rev 19892)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ResourceContextMenu.html 2010-01-22
20:40:59 UTC (rev 19893)
@@ -11,7 +11,7 @@
- See the AUTHORS.txt file in the distribution for a full listing of
- individual contributors.
-->
-<h2>Resource Context Menu</h2>
+<h2>ModeShape Resource Context Menu</h2>
<p>The <i>Resource Context Menu</i> consists of these actions: publish,
unpublish, and show published locations. The publish and unpublish actions will be enabled
when one or more resources (i.e, project, folder, or file) in the workspace are selected.
When publishing, the selected resources will be uploaded to a ModeShape repository
workspace. When unpublishing, the selected resources will be removed from a selected
ModeShape repository workspace (if they exist there). If a resource has already been
published using the current Eclipse workspace, the show published locations action will be
enabled.</p>
@@ -19,11 +19,11 @@
<img src="images/ResourceContextMenu.png" border="0"
alt="">
-<p>Files can be filtered out of publishing and unpublishing operations even though
they have been selected. Use the <a
href="PublishingPreferencesDialog.html">Publishing Preferences Page</a>
to filter out files contained within the selection based on their file extensions or by
the name of the folder, or ancestor folder, they are contained within. </p>
+<p>Files can be filtered out of publishing and unpublishing operations even though
they have been selected. Use the <a
href="ModeShapePreferencesDialog.html">ModeShape Preferences Page</a>
to filter out files contained within the selection based on their file extensions or by
the name of the folder, or ancestor folder, they are contained within. </p>
<h3>Related Topics</h3>
<ul>
<li><a href="PublishDialog.html">Publishing and Unpublishing
Dialog</a></li>
-<li><a href="PublishingPreferenceDialog.html">Publishing
Preferences Dialog</a></li>
+<li><a href="ModeShapePreferenceDialog.html">ModeShape Preferences
Dialog</a></li>
</ul>
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ServerDialog.html
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ServerDialog.html 2010-01-22
18:51:55 UTC (rev 19892)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ServerDialog.html 2010-01-22
20:40:59 UTC (rev 19893)
@@ -11,7 +11,7 @@
- See the AUTHORS.txt file in the distribution for a full listing of
- individual contributors.
-->
-<h2>Server Dialog</h2>
+<h2>ModeShape Server Dialog</h2>
<p>The <i>Server Dialog</i> is used to create and register new servers
that host ModeShape repositories. This dialog is also used to edit an existing
server's properties.</p>
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ServerView.html
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ServerView.html 2010-01-22
18:51:55 UTC (rev 19892)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/ServerView.html 2010-01-22
20:40:59 UTC (rev 19893)
@@ -11,7 +11,7 @@
- See the AUTHORS.txt file in the distribution for a full listing of
- individual contributors.
-->
-<h2>Server View</h2>
+<h2>ModeShape Server View</h2>
<p>The <i>Server View</i> displays the registered servers hosting
ModeShape repositories. For each server, the repositories and repository workspaces are
also displayed. There are view toolbar buttons to create a new server (<img
src="images/new_server.gif" border="0" alt="">), edit a
selected server's properties (<img src="images/edit_server.gif"
border="0" alt="">), discard one or more selected servers (<img
src="images/delete_server.gif" border="0" alt="">),
reconnect to a selected server (<img src="images/refresh.gif"
border="0" alt="">), and collapse all servers so that their
repositories and workspaces can't be seen (<img
src="images/collapse_all.gif" border="0" alt="">). If a
connection to a server cannot be established that server icon will be decorated with an
error overlay image.</p>
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/Toc.html
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/Toc.html 2010-01-22
18:51:55 UTC (rev 19892)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/Toc.html 2010-01-22
20:40:59 UTC (rev 19893)
@@ -17,8 +17,8 @@
<li><a href="PublishDialog.html">Publish/Unpublish
Dialog</a></li>
<li><a href="ServerDialog.html">Server Dialog</a></li>
<li><a href="ServerView.html">Server View</a></li>
-<li><a href="PublishingMessageConsole.html">Publishing Message
Console</a></li>
+<li><a href="ModeShapeMessageConsole.html">ModeShape Message
Console</a></li>
<li><a href="PublishedLocationsDialog.html">Published Locations
Dialog</a></li>
<li><a href="ResourceContextMenu.html">Resource Context
Menu</a></li>
-<li><a href="PublishingPreferencesDialog.html">Publishing
Preferences Page</a></li>
+<li><a href="ModeShapePreferencesDialog.html">ModeShape Preferences
Page</a></li>
</ul>
\ No newline at end of file
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/helpContexts.xml
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/helpContexts.xml 2010-01-22
18:51:55 UTC (rev 19892)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/helpContexts.xml 2010-01-22
20:40:59 UTC (rev 19893)
@@ -26,15 +26,15 @@
<description>The Publish/Unpublish Dialog uploads or removes selected resources
from the selected server.</description>
<topic href="docs/PublishDialog.html" label="Publish/Unpublish
Dialog"/>
<topic href="docs/ServerDialog.html" label="Create a new
server"/>
- <topic href="docs/PublishingPreferencesDialog.html"
label="Publishing Preferences"/>
+ <topic href="docs/ModeShapePreferencesDialog.html"
label="ModeShape Preferences"/>
</context>
- <context id="preferencesHelpContext" title="Publishing Preferences
Dialog Help">
- <description>The Publishing Preferences Dialog allows you to identify file
extensions and folder names that should not be involved in publishing
operations.</description>
- <topic href="docs/PublishingPreferencesDialog.html"
label="Publishing Preferences"/>
+ <context id="preferencesHelpContext" title="ModeShape Preferences
Dialog Help">
+ <description>The ModeShape Preferences Dialog allows you to identify file
extensions and folder names that should not be involved in publishing
operations.</description>
+ <topic href="docs/ModeShapePreferencesDialog.html"
label="ModeShape Preferences"/>
<topic href="docs/PublishDialog.html" label="Publish/Unpublish
Dialog"/>
</context>
- <context id="messageConsoleHelpContext" title="Publishing Message
Console">
- <description>The ModeShape Publishing Message Console contains the output from
the publishing and unpublishing operations.</description>
- <topic href="docs/PublishingMessageConsole.html" label="Publishing
Message Console"/>
+ <context id="messageConsoleHelpContext" title="ModeShape Message
Console">
+ <description>The ModeShape Message Console contains the output from the
publishing and unpublishing operations.</description>
+ <topic href="docs/ModeShapeMessageConsole.html" label="ModeShape
Message Console"/>
</context>
</contexts>
Copied:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/ModeShapeMessageConsole.png
(from rev 19867,
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/PublishingMessageConsole.png)
===================================================================
(Binary files differ)
Property changes on:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/ModeShapeMessageConsole.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Copied:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/ModeShapePreferencesDialog.png
(from rev 19867,
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/PublishingPreferencesDialog.png)
===================================================================
(Binary files differ)
Property changes on:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/ModeShapePreferencesDialog.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/OperationDialog.png
===================================================================
(Binary files differ)
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/PublishDialog.png
===================================================================
(Binary files differ)
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/PublishedLocationsDialog.png
===================================================================
(Binary files differ)
Deleted:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/PublishingMessageConsole.png
===================================================================
(Binary files differ)
Deleted:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/PublishingPreferencesDialog.png
===================================================================
(Binary files differ)
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/ResourceContextMenu.png
===================================================================
(Binary files differ)
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/ServerDialog.png
===================================================================
(Binary files differ)
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/images/ServerView.png
===================================================================
(Binary files differ)
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/toc.xml
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/toc.xml 2010-01-22
18:51:55 UTC (rev 19892)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/docs/toc.xml 2010-01-22
20:40:59 UTC (rev 19893)
@@ -15,8 +15,8 @@
<topic label="Publishing/Unpublishing Dialog"
href="docs/PublishDialog.html"/>
<topic label="Server View" href="docs/ServerView.html"/>
<topic label="Server Dialog"
href="docs/ServerDialog.html"/>
- <topic label="Publishing Message Console"
href="docs/PublishingMessageConsole.html"/>
+ <topic label="ModeShape Message Console"
href="docs/ModeShapeMessageConsole.html"/>
<topic label="Published Locations Dialog"
href="docs/PublishedLocationsDialog.html"/>
<topic label="Resource Context Menu"
href="docs/ResourceContextMenu.html"/>
- <topic label="Publishing Preferences Dialog"
href="docs/PublishingPreferencesDialog.html"/>
+ <topic label="ModeShape Preferences Dialog"
href="docs/ModeShapePreferencesDialog.html"/>
</toc>
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.xml
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.xml 2010-01-22 18:51:55
UTC (rev 19892)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.xml 2010-01-22 20:40:59
UTC (rev 19893)
@@ -116,7 +116,7 @@
adaptable="true"
label="%decorator.label"
state="true"
-
class="org.jboss.tools.modeshape.rest.views.PublishingContentProvider"
+
class="org.jboss.tools.modeshape.rest.views.ModeShapeContentProvider"
id="org.jboss.tools.modeshape.rest.decorator">
<description>
%decorator.description
@@ -149,8 +149,8 @@
point="org.eclipse.ui.preferencePages">
<page
name="%modeShapeCategory"
-
class="org.jboss.tools.modeshape.rest.preferences.PublishingPreferencePage"
- id="publishingPreferencePage">
+
class="org.jboss.tools.modeshape.rest.preferences.ModeShapePreferencePage"
+ id="modeShapePreferencePage">
</page>
</extension>
</plugin>
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java 2010-01-22
18:51:55 UTC (rev 19892)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java 2010-01-22
20:40:59 UTC (rev 19893)
@@ -71,11 +71,11 @@
public static I18n publishingConsoleProblemCreatingHyperlinkMsg;
public static I18n publishingConsoleFilePathNotFoundMsg;
- public static I18n publishingPreferencePageDescription;
- public static I18n publishingPreferencePageFilteredFileExtensionsLabel;
- public static I18n publishingPreferencePageFilteredFolderNamesLabel;
- public static I18n publishingPreferencePageMessage;
- public static I18n publishingPreferencePageTitle;
+ public static I18n preferencePageDescription;
+ public static I18n preferencePageFilteredFileExtensionsLabel;
+ public static I18n preferencePageFilteredFolderNamesLabel;
+ public static I18n preferencePageMessage;
+ public static I18n preferencePageTitle;
public static I18n publishJobCanceled;
public static I18n publishJobDurationMsg;
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2010-01-22
18:51:55 UTC (rev 19892)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2010-01-22
20:40:59 UTC (rev 19893)
@@ -63,11 +63,11 @@
publishingConsoleProblemCreatingHyperlinkMsg = Unexpected problem creating hyperlink in
ModeShape Message Console view
publishingConsoleFilePathNotFoundMsg = A hyperlink could not be created in the ModeShape
Message Console because the file path of "{0}" could not be found.
-publishingPreferencePageDescription = Add or remove filtered file extensions and folder
names. Files with a matching file extension or files that are contained in a folder with a
matching name will NOT be published to or unpublished from repositories.
-publishingPreferencePageFilteredFileExtensionsLabel = Filtered File Extensions:
-publishingPreferencePageFilteredFolderNamesLabel = Filtered Folder Names:
-publishingPreferencePageMessage = ModeShape
-publishingPreferencePageTitle = ModeShape Preferences
+preferencePageDescription = Add or remove file extensions and folder names. Files with a
matching file extension or files that are contained in a folder with a matching name will
NOT be published to or unpublished from repositories.
+preferencePageFilteredFileExtensionsLabel = Filtered File Extensions:
+preferencePageFilteredFolderNamesLabel = Filtered Folder Names:
+preferencePageMessage = ModeShape
+preferencePageTitle = ModeShape Preferences
publishJobCanceled = Job {0} was canceled. See log for details.
publishJobDurationMsg = {0} hour(s), {1} minute(s), {2} second(s)
@@ -106,7 +106,7 @@
publishPageNoResourcesToPublishStatusMsg = There are no files that can be published
publishPageNoResourcesToUnpublishStatusMsg = There are no files that can be unpublished
publishPagePublishOkStatusMsg = Choose the server, repository, and workspace where the
resources will be published. Click "Finish" to execute the publish operation.
-publishPagePublishResourcesLabel = These resources will be uploaded to the specified
workspace:
+publishPagePublishResourcesLabel = These resources will be uploaded to the above
specified ModeShape workspace:
publishPageRecurseCheckBox = Recurse folders and projects
publishPageRecurseCheckBoxToolTip = Add all files under folders recursively under
selected projects and folders
publishPageRecurseProcessingErrorMsg = Unexpected error processing resources. See log for
more details.
@@ -149,7 +149,7 @@
serverPageAuthenticationGroupTitle = Authentication
serverPageInvalidServerProperties = Cannot construct a server because all server
properties are not valid
-serverPageOkStatusMsg = Define the server information where the repositories are
located.
+serverPageOkStatusMsg = Define the server information where the ModeShape repositories
are located.
serverPagePasswordLabel = Password:
serverPagePasswordToolTip = The password used to authenticate the user when connecting to
the server
serverPageSavePasswordButton = Save password
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java 2010-01-22
18:51:55 UTC (rev 19892)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java 2010-01-22
20:40:59 UTC (rev 19893)
@@ -27,8 +27,8 @@
import org.jboss.tools.modeshape.rest.PublishedResourceHelper;
import org.jboss.tools.modeshape.rest.RestClientI18n;
import org.jboss.tools.modeshape.rest.ServerManager;
-import org.jboss.tools.modeshape.rest.views.PublishingContentProvider;
-import org.jboss.tools.modeshape.rest.views.PublishingMessageConsole;
+import org.jboss.tools.modeshape.rest.views.ModeShapeContentProvider;
+import org.jboss.tools.modeshape.rest.views.ModeShapeMessageConsole;
import org.modeshape.common.util.CheckArg;
import org.modeshape.web.jcr.rest.client.Status;
import org.modeshape.web.jcr.rest.client.domain.Workspace;
@@ -185,13 +185,13 @@
// write initial message to console
if (isPublishing()) {
-
PublishingMessageConsole.writeln(RestClientI18n.publishJobPublish.text(this.jobId,
+
ModeShapeMessageConsole.writeln(RestClientI18n.publishJobPublish.text(this.jobId,
serverUrl,
repositoryName,
workspaceName,
fileCount));
} else {
-
PublishingMessageConsole.writeln(RestClientI18n.publishJobUnpublish.text(this.jobId,
+
ModeShapeMessageConsole.writeln(RestClientI18n.publishJobUnpublish.text(this.jobId,
serverUrl,
repositoryName,
workspaceName,
@@ -231,7 +231,7 @@
monitor.worked(1);
// let decorator know publishing state has changed on this file
- PublishingContentProvider decorator =
PublishingContentProvider.getDecorator();
+ ModeShapeContentProvider decorator =
ModeShapeContentProvider.getDecorator();
if (decorator != null) {
decorator.refresh(eclipseFile);
@@ -279,21 +279,21 @@
if (canceled) {
if (isPublishing()) {
-
PublishingMessageConsole.writeln(RestClientI18n.publishJobPublishCanceledMsg.text(this.jobId,
+
ModeShapeMessageConsole.writeln(RestClientI18n.publishJobPublishCanceledMsg.text(this.jobId,
numProcessed,
this.files.size(),
duration));
} else {
-
PublishingMessageConsole.writeln(RestClientI18n.publishJobUnpublishCanceledMsg.text(this.jobId,
+
ModeShapeMessageConsole.writeln(RestClientI18n.publishJobUnpublishCanceledMsg.text(this.jobId,
numProcessed,
this.files.size(),
duration));
}
} else {
if (isPublishing()) {
-
PublishingMessageConsole.writeln(RestClientI18n.publishJobPublishFinishedMsg.text(this.jobId,
duration));
+
ModeShapeMessageConsole.writeln(RestClientI18n.publishJobPublishFinishedMsg.text(this.jobId,
duration));
} else {
-
PublishingMessageConsole.writeln(RestClientI18n.publishJobUnpublishFinishedMsg.text(this.jobId,
duration));
+
ModeShapeMessageConsole.writeln(RestClientI18n.publishJobUnpublishFinishedMsg.text(this.jobId,
duration));
}
}
}
@@ -347,7 +347,7 @@
}
// write to console creating a hyperlink
- PublishingMessageConsole.writeln(message, file);
+ ModeShapeMessageConsole.writeln(message, file);
}
}
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFileExtensionEditor.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFileExtensionEditor.java 2010-01-22
18:51:55 UTC (rev 19892)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFileExtensionEditor.java 2010-01-22
20:40:59 UTC (rev 19893)
@@ -16,7 +16,7 @@
import static
org.jboss.tools.modeshape.rest.IUiConstants.FILTERED_FILE_EXTENSIONS_PREFERENCE;
import static
org.jboss.tools.modeshape.rest.RestClientI18n.newFilteredFileExtensionDialogLabel;
import static
org.jboss.tools.modeshape.rest.RestClientI18n.newFilteredFileExtensionDialogTitle;
-import static
org.jboss.tools.modeshape.rest.RestClientI18n.publishingPreferencePageFilteredFileExtensionsLabel;
+import static
org.jboss.tools.modeshape.rest.RestClientI18n.preferencePageFilteredFileExtensionsLabel;
import static org.jboss.tools.modeshape.rest.preferences.PrefUtils.FILE_EXT_DELIMITER;
import static
org.jboss.tools.modeshape.rest.preferences.PrefUtils.FILE_EXT_INVALID_CHARS;
import java.util.Arrays;
@@ -51,7 +51,7 @@
* @param parent the parent control
*/
public FilteredFileExtensionEditor( Composite parent ) {
- super(FILTERED_FILE_EXTENSIONS_PREFERENCE,
publishingPreferencePageFilteredFileExtensionsLabel.text(), parent);
+ super(FILTERED_FILE_EXTENSIONS_PREFERENCE,
preferencePageFilteredFileExtensionsLabel.text(), parent);
this.extensions = new TreeSet<String>();
}
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFoldersEditor.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFoldersEditor.java 2010-01-22
18:51:55 UTC (rev 19892)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFoldersEditor.java 2010-01-22
20:40:59 UTC (rev 19893)
@@ -16,7 +16,7 @@
import static
org.jboss.tools.modeshape.rest.IUiConstants.FILTERED_FOLDER_NAMES_PREFERENCE;
import static
org.jboss.tools.modeshape.rest.RestClientI18n.newFilteredFolderNameDialogLabel;
import static
org.jboss.tools.modeshape.rest.RestClientI18n.newFilteredFolderNameDialogTitle;
-import static
org.jboss.tools.modeshape.rest.RestClientI18n.publishingPreferencePageFilteredFolderNamesLabel;
+import static
org.jboss.tools.modeshape.rest.RestClientI18n.preferencePageFilteredFolderNamesLabel;
import static
org.jboss.tools.modeshape.rest.preferences.PrefUtils.FOLDER_NAME_DELIMITER;
import static
org.jboss.tools.modeshape.rest.preferences.PrefUtils.FOLDER_NAME_INVALID_CHARS;
import java.util.Arrays;
@@ -51,7 +51,7 @@
* @param parent the parent control
*/
public FilteredFoldersEditor( Composite parent ) {
- super(FILTERED_FOLDER_NAMES_PREFERENCE,
publishingPreferencePageFilteredFolderNamesLabel.text(), parent);
+ super(FILTERED_FOLDER_NAMES_PREFERENCE,
preferencePageFilteredFolderNamesLabel.text(), parent);
this.folderNames = new TreeSet<String>();
}
Copied:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ModeShapePreferencePage.java
(from rev 19867,
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingPreferencePage.java)
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ModeShapePreferencePage.java
(rev 0)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ModeShapePreferencePage.java 2010-01-22
20:40:59 UTC (rev 19893)
@@ -0,0 +1,175 @@
+/*
+ * ModeShape (
http://www.modeshape.org)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ *
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at
http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ */
+package org.jboss.tools.modeshape.rest.preferences;
+
+import static org.jboss.tools.modeshape.rest.IUiConstants.ModeShape_IMAGE_16x;
+import static org.jboss.tools.modeshape.rest.IUiConstants.PREFERENCE_PAGE_HELP_CONTEXT;
+import static org.jboss.tools.modeshape.rest.RestClientI18n.preferencePageDescription;
+import static org.jboss.tools.modeshape.rest.RestClientI18n.preferencePageMessage;
+import static org.jboss.tools.modeshape.rest.RestClientI18n.preferencePageTitle;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.help.IWorkbenchHelpSystem;
+import org.jboss.tools.modeshape.rest.Activator;
+
+/**
+ * The <code>ModeShapePreferencePage</code> is the UI for managing all
ModeShape-related preferences.
+ */
+public final class ModeShapePreferencePage extends PreferencePage implements
IWorkbenchPreferencePage {
+
+ //
===========================================================================================================================
+ // Fields
+ //
===========================================================================================================================
+
+ /**
+ * The editor used to manage the list of filtered file extensions.
+ */
+ private FilteredFileExtensionEditor extensionsEditor;
+
+ /**
+ * The editor used to manage the list of filtered folder names.
+ */
+ private FilteredFoldersEditor foldersEditor;
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see
org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createContents( Composite parent ) {
+ Composite panel = new Composite(parent, SWT.NONE);
+ panel.setLayout(new GridLayout(2, false));
+ panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ // create the filtered extensions editor
+ this.extensionsEditor = new FilteredFileExtensionEditor(panel);
+ this.extensionsEditor.setPreferenceStore(getPreferenceStore());
+ this.extensionsEditor.getListControl(panel).setLayoutData(new GridData(SWT.FILL,
SWT.FILL, true, true));
+
+ // populate the extensions editor
+ this.extensionsEditor.load();
+
+ // create the filtered folders editor
+ this.foldersEditor = new FilteredFoldersEditor(panel);
+ this.foldersEditor.setPreferenceStore(getPreferenceStore());
+ this.foldersEditor.getListControl(panel).setLayoutData(new GridData(SWT.FILL,
SWT.FILL, true, true));
+
+ // populate the folders editor
+ this.foldersEditor.load();
+
+ // register with the help system
+ IWorkbenchHelpSystem helpSystem =
Activator.getDefault().getWorkbench().getHelpSystem();
+ helpSystem.setHelp(panel, PREFERENCE_PAGE_HELP_CONTEXT);
+
+ return panel;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#getDescription()
+ */
+ @Override
+ public String getDescription() {
+ return preferencePageDescription.text();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#getImage()
+ */
+ @Override
+ public Image getImage() {
+ return Activator.getDefault().getImage(ModeShape_IMAGE_16x);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#getMessage()
+ */
+ @Override
+ public String getMessage() {
+ return preferencePageMessage.text();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.PreferencePage#getPreferenceStore()
+ */
+ @Override
+ public IPreferenceStore getPreferenceStore() {
+ return PrefUtils.getPreferenceStore();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#getTitle()
+ */
+ @Override
+ public String getTitle() {
+ return preferencePageTitle.text();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+ */
+ @Override
+ public void init( IWorkbench workbench ) {
+ // nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
+ */
+ @Override
+ protected void performDefaults() {
+ this.extensionsEditor.loadDefault();
+ this.foldersEditor.loadDefault();
+ super.performDefaults();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.PreferencePage#performOk()
+ */
+ @Override
+ public boolean performOk() {
+ this.extensionsEditor.store();
+ this.foldersEditor.store();
+ return super.performOk();
+ }
+
+}
Property changes on:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ModeShapePreferencePage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingPreferencePage.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingPreferencePage.java 2010-01-22
18:51:55 UTC (rev 19892)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingPreferencePage.java 2010-01-22
20:40:59 UTC (rev 19893)
@@ -1,175 +0,0 @@
-/*
- * ModeShape (
http://www.modeshape.org)
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.
- *
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at
http://www.eclipse.org/legal/epl-v10.html.
- *
- * See the AUTHORS.txt file in the distribution for a full listing of
- * individual contributors.
- */
-package org.jboss.tools.modeshape.rest.preferences;
-
-import static org.jboss.tools.modeshape.rest.IUiConstants.ModeShape_IMAGE_16x;
-import static org.jboss.tools.modeshape.rest.IUiConstants.PREFERENCE_PAGE_HELP_CONTEXT;
-import static
org.jboss.tools.modeshape.rest.RestClientI18n.publishingPreferencePageDescription;
-import static
org.jboss.tools.modeshape.rest.RestClientI18n.publishingPreferencePageMessage;
-import static
org.jboss.tools.modeshape.rest.RestClientI18n.publishingPreferencePageTitle;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.jboss.tools.modeshape.rest.Activator;
-
-/**
- * The <code>PublishingPreferencePage</code> is the UI for managing all
ModeShape-related preferences.
- */
-public final class PublishingPreferencePage extends PreferencePage implements
IWorkbenchPreferencePage {
-
- //
===========================================================================================================================
- // Fields
- //
===========================================================================================================================
-
- /**
- * The editor used to manage the list of filtered file extensions.
- */
- private FilteredFileExtensionEditor extensionsEditor;
-
- /**
- * The editor used to manage the list of filtered folder names.
- */
- private FilteredFoldersEditor foldersEditor;
-
- //
===========================================================================================================================
- // Methods
- //
===========================================================================================================================
-
- /**
- * {@inheritDoc}
- *
- * @see
org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createContents( Composite parent ) {
- Composite panel = new Composite(parent, SWT.NONE);
- panel.setLayout(new GridLayout(2, false));
- panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- // create the filtered extensions editor
- this.extensionsEditor = new FilteredFileExtensionEditor(panel);
- this.extensionsEditor.setPreferenceStore(getPreferenceStore());
- this.extensionsEditor.getListControl(panel).setLayoutData(new GridData(SWT.FILL,
SWT.FILL, true, true));
-
- // populate the extensions editor
- this.extensionsEditor.load();
-
- // create the filtered folders editor
- this.foldersEditor = new FilteredFoldersEditor(panel);
- this.foldersEditor.setPreferenceStore(getPreferenceStore());
- this.foldersEditor.getListControl(panel).setLayoutData(new GridData(SWT.FILL,
SWT.FILL, true, true));
-
- // populate the folders editor
- this.foldersEditor.load();
-
- // register with the help system
- IWorkbenchHelpSystem helpSystem =
Activator.getDefault().getWorkbench().getHelpSystem();
- helpSystem.setHelp(panel, PREFERENCE_PAGE_HELP_CONTEXT);
-
- return panel;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.dialogs.DialogPage#getDescription()
- */
- @Override
- public String getDescription() {
- return publishingPreferencePageDescription.text();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.dialogs.DialogPage#getImage()
- */
- @Override
- public Image getImage() {
- return Activator.getDefault().getImage(ModeShape_IMAGE_16x);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.dialogs.DialogPage#getMessage()
- */
- @Override
- public String getMessage() {
- return publishingPreferencePageMessage.text();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.preference.PreferencePage#getPreferenceStore()
- */
- @Override
- public IPreferenceStore getPreferenceStore() {
- return PrefUtils.getPreferenceStore();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.dialogs.DialogPage#getTitle()
- */
- @Override
- public String getTitle() {
- return publishingPreferencePageTitle.text();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
- */
- @Override
- public void init( IWorkbench workbench ) {
- // nothing to do
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- @Override
- protected void performDefaults() {
- this.extensionsEditor.loadDefault();
- this.foldersEditor.loadDefault();
- super.performDefaults();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.preference.PreferencePage#performOk()
- */
- @Override
- public boolean performOk() {
- this.extensionsEditor.store();
- this.foldersEditor.store();
- return super.performOk();
- }
-
-}
Copied:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeContentProvider.java
(from rev 19867,
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/PublishingContentProvider.java)
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeContentProvider.java
(rev 0)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeContentProvider.java 2010-01-22
20:40:59 UTC (rev 19893)
@@ -0,0 +1,415 @@
+/*
+ * ModeShape (
http://www.modeshape.org)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ *
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at
http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ */
+package org.jboss.tools.modeshape.rest.views;
+
+import static org.jboss.tools.modeshape.rest.IUiConstants.PUBLISHED_OVERLAY_IMAGE;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import net.jcip.annotations.GuardedBy;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.IDecoration;
+import org.eclipse.jface.viewers.ILightweightLabelDecorator;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IDecoratorManager;
+import org.jboss.tools.modeshape.rest.Activator;
+import org.jboss.tools.modeshape.rest.IServerRegistryListener;
+import org.jboss.tools.modeshape.rest.PublishedResourceHelper;
+import org.jboss.tools.modeshape.rest.RestClientI18n;
+import org.jboss.tools.modeshape.rest.ServerManager;
+import org.jboss.tools.modeshape.rest.ServerRegistryEvent;
+import org.jboss.tools.modeshape.rest.Utils;
+import org.modeshape.web.jcr.rest.client.Status;
+import org.modeshape.web.jcr.rest.client.Status.Severity;
+import org.modeshape.web.jcr.rest.client.domain.IModeShapeObject;
+import org.modeshape.web.jcr.rest.client.domain.Repository;
+import org.modeshape.web.jcr.rest.client.domain.Server;
+import org.modeshape.web.jcr.rest.client.domain.Workspace;
+
+/**
+ * The <code>ModeShapeContentProvider</code> is a content and label provider
for the repositories. This class
+ * <strong>MUST</strong> be registered, and then unregistered, to receive
server registry events.
+ */
+public final class ModeShapeContentProvider extends ColumnLabelProvider
+ implements ILightweightLabelDecorator, IServerRegistryListener, ITreeContentProvider
{
+
+ //
===========================================================================================================================
+ // Constants
+ //
===========================================================================================================================
+
+ /**
+ * The decorator ID.
+ */
+ private static final String ID =
"org.jboss.tools.modeshape.rest.decorator";
+
+ /**
+ * If a server connection cannot be established, wait this amount of time before
trying again.
+ */
+ private static final long RETRY_DURATION = 2000;
+
+ //
===========================================================================================================================
+ // Class Methods
+ //
===========================================================================================================================
+
+ /**
+ * @return the decorator
+ */
+ public static ModeShapeContentProvider getDecorator() {
+ IDecoratorManager decoratorMgr =
Activator.getDefault().getWorkbench().getDecoratorManager();
+
+ if (decoratorMgr.getEnabled(ID)) {
+ return (ModeShapeContentProvider)decoratorMgr.getBaseLabelProvider(ID);
+ }
+
+ return null;
+ }
+
+ //
===========================================================================================================================
+ // Fields
+ //
===========================================================================================================================
+
+ /**
+ * Servers that a connection can't be established. Value is the last time a
establishing a connection was tried.
+ */
+ @GuardedBy( "offlineServersLock" )
+ private final Map<Server, Long> offlineServerMap = new HashMap<Server,
Long>();
+
+ /**
+ * Lock used for when accessing the offline server map. The map will be accessed in
different threads as the decorator runs in
+ * its own thread (not the UI thread).
+ */
+ private final ReadWriteLock offlineServersLock = new ReentrantReadWriteLock();
+
+ /**
+ * The server manager where the server registry is managed.
+ */
+ private ServerManager serverManager;
+
+ //
===========================================================================================================================
+ // Methods
+ //
===========================================================================================================================
+
+ /**
+ * @param server the server that is offline
+ */
+ private void addOfflineServer( Server server ) {
+ try {
+ this.offlineServersLock.writeLock().lock();
+ this.offlineServerMap.put(server, System.currentTimeMillis());
+ } finally {
+ this.offlineServersLock.writeLock().unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see
org.eclipse.jface.viewers.ILightweightLabelDecorator#decorate(java.lang.Object,
org.eclipse.jface.viewers.IDecoration)
+ */
+ @Override
+ public void decorate( final Object element,
+ IDecoration decoration ) {
+ ImageDescriptor overlay = null;
+ final Display display = Display.getDefault();
+
+ if (display.isDisposed()) {
+ return;
+ }
+
+ if (getServerManager() != null) {
+ if (element instanceof Server) {
+ Server server = (Server)element;
+
+ if (isOkToConnect(server)) {
+ Status status = getServerManager().ping(server);
+ overlay = Utils.getOverlayImage(status);
+
+ if (status.isError()) {
+ addOfflineServer(server);
+ }
+ }
+ } else if ((element instanceof IFile) && new
PublishedResourceHelper(getServerManager()).isPublished((IFile)element)) {
+ overlay =
Activator.getDefault().getImageDescriptor(PUBLISHED_OVERLAY_IMAGE);
+ }
+
+ if (overlay != null) {
+ decoration.addOverlay(overlay);
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+ // nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+ */
+ @Override
+ public Object[] getChildren( Object parentElement ) {
+ assert (parentElement instanceof IModeShapeObject);
+
+ if (getServerManager() != null) {
+ if (parentElement instanceof Server) {
+ Server server = (Server)parentElement;
+
+ if (isOkToConnect(server)) {
+ try {
+ return getServerManager().getRepositories(server).toArray();
+ } catch (Exception e) {
+ addOfflineServer(server);
+ String msg =
RestClientI18n.serverManagerGetRepositoriesExceptionMsg.text(server.getShortDescription());
+ Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
+ }
+ }
+ } else if (parentElement instanceof Repository) {
+ Repository repository = (Repository)parentElement;
+
+ if (isOkToConnect(repository.getServer())) {
+ try {
+ return getServerManager().getWorkspaces(repository).toArray();
+ } catch (Exception e) {
+ addOfflineServer(repository.getServer());
+ String msg =
RestClientI18n.serverManagerGetWorkspacesExceptionMsg.text(repository.getShortDescription());
+ Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
+ }
+ }
+ }
+ }
+
+ return new Object[0];
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see
org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ @Override
+ public Object[] getElements( Object inputElement ) {
+ return ((getServerManager() == null) ? new Object[0] :
getServerManager().getServers().toArray());
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+ */
+ @Override
+ public Image getImage( Object element ) {
+ return Activator.getDefault().getImage(element);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+ */
+ @Override
+ public Object getParent( Object element ) {
+ assert (element instanceof IModeShapeObject);
+
+ if (element instanceof Workspace) {
+ return ((Workspace)element).getRepository();
+ }
+
+ if (element instanceof Repository) {
+ return ((Repository)element).getServer();
+ }
+
+ // server
+ return null;
+ }
+
+ /**
+ * @return the server manager (never <code>null</code>)
+ */
+ private ServerManager getServerManager() {
+ if (this.serverManager == null) {
+ this.serverManager = Activator.getDefault().getServerManager();
+ }
+
+ return this.serverManager;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText( Object element ) {
+ assert (element instanceof IModeShapeObject);
+ return ((IModeShapeObject)element).getName();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see
org.eclipse.jface.viewers.CellLabelProvider#getToolTipImage(java.lang.Object)
+ */
+ @Override
+ public Image getToolTipImage( Object object ) {
+ return getImage(object);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.CellLabelProvider#getToolTipText(java.lang.Object)
+ */
+ @Override
+ public String getToolTipText( Object element ) {
+ if (element instanceof IModeShapeObject) {
+ return ((IModeShapeObject)element).getShortDescription();
+ }
+
+ return super.getToolTipText(element);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see
org.eclipse.jface.viewers.CellLabelProvider#getToolTipTimeDisplayed(java.lang.Object)
+ */
+ @Override
+ public int getToolTipTimeDisplayed( Object object ) {
+ return 3000;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+ */
+ @Override
+ public boolean hasChildren( Object element ) {
+ return getChildren(element).length > 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see
org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
java.lang.Object,
+ * java.lang.Object)
+ */
+ @Override
+ public void inputChanged( Viewer viewer,
+ Object oldInput,
+ Object newInput ) {
+ // nothing to do
+ }
+
+ public void refresh( final Object element ) {
+ final Display display = Display.getDefault();
+
+ if (display.isDisposed()) {
+ return;
+ }
+
+ display.asyncExec(new Runnable() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Runnable#run()
+ */
+ @SuppressWarnings( "synthetic-access" )
+ @Override
+ public void run() {
+ fireLabelProviderChanged(new
LabelProviderChangedEvent(ModeShapeContentProvider.this, element));
+ }
+ });
+ }
+
+ /**
+ * Determines if a try to connect to a server should be done based on the last time a
try was done and failed.
+ *
+ * @param server the server being checked
+ * @return <code>true</code> if it is OK to try and connect
+ */
+ private boolean isOkToConnect( Server server ) {
+ boolean check = false; // check map for time
+
+ try {
+ this.offlineServersLock.readLock().lock();
+ check = this.offlineServerMap.containsKey(server);
+ } finally {
+ this.offlineServersLock.readLock().unlock();
+ }
+
+ if (check) {
+ try {
+ this.offlineServersLock.writeLock().lock();
+
+ if (this.offlineServerMap.containsKey(server)) {
+ long checkTime = this.offlineServerMap.get(server);
+
+ // OK to try and connect if last failed attempt was too long ago
+ if ((System.currentTimeMillis() - checkTime) > RETRY_DURATION) {
+ this.offlineServerMap.remove(server);
+ return true;
+ }
+
+ // don't try and connect because we just tried and failed
+ return false;
+ }
+ } finally {
+ this.offlineServersLock.writeLock().unlock();
+ }
+ }
+
+ // OK to try and connect
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see
org.jboss.tools.modeshape.rest.IServerRegistryListener#serverRegistryChanged(org.jboss.tools.modeshape.rest.ServerRegistryEvent)
+ */
+ @Override
+ public Exception[] serverRegistryChanged( ServerRegistryEvent event ) {
+ Exception[] errors = null;
+
+ // only care about servers being removed or updated
+ if (event.isRemove() || event.isUpdate()) {
+ try {
+ this.offlineServersLock.writeLock().lock();
+ this.offlineServerMap.remove(event.getServer());
+ } catch (Exception e) {
+ errors = new Exception[] {e};
+ } finally {
+ this.offlineServersLock.writeLock().unlock();
+ }
+ }
+
+ return errors;
+ }
+
+}
Property changes on:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeContentProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeMessageConsole.java
(from rev 19867,
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/PublishingMessageConsole.java)
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeMessageConsole.java
(rev 0)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeMessageConsole.java 2010-01-22
20:40:59 UTC (rev 19893)
@@ -0,0 +1,332 @@
+/*
+ * ModeShape (
http://www.modeshape.org)
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ *
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at
http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * See the AUTHORS.txt file in the distribution for a full listing of
+ * individual contributors.
+ */
+package org.jboss.tools.modeshape.rest.views;
+
+import static org.jboss.tools.modeshape.rest.IUiConstants.ModeShape_IMAGE_16x;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.debug.ui.console.FileLink;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.FindReplaceDocumentAdapter;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentListener;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.console.AbstractConsole;
+import org.eclipse.ui.console.ConsolePlugin;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.IConsoleManager;
+import org.eclipse.ui.console.MessageConsole;
+import org.eclipse.ui.console.MessageConsoleStream;
+import org.jboss.tools.modeshape.rest.Activator;
+import org.jboss.tools.modeshape.rest.RestClientI18n;
+import org.modeshape.common.util.CheckArg;
+import org.modeshape.web.jcr.rest.client.Status;
+import org.modeshape.web.jcr.rest.client.Status.Severity;
+
+/**
+ * The <code>ModeShapeMessageConsole</code> is a message console view where
status of publishing operations are logged. This class
+ * ensures all writes to the console are done in the UI thread.
+ */
+public final class ModeShapeMessageConsole extends MessageConsole {
+
+ //
=======================================================================================================================
+ // Constants
+ //
=======================================================================================================================
+
+ /**
+ * Start tag for adding emphasis to a message. Tag will appear in a properties file.
+ */
+ private static final String EMPHASIS_START_TAG = "<em>";
+
+ /**
+ * End tag for adding emphasis to a message. Tag will appear in a properties file.
+ */
+ private static final String EMPHASIS_END_TAG = "</em>";
+
+ /**
+ * The identifier and type of the Message Console.
+ */
+ private static final String ID =
"org.jboss.tools.modeshape.rest.views.ModeShapeMessageConsole";
+
+ /**
+ * The message console name.
+ */
+ private static final String NAME = RestClientI18n.publishingConsoleName.text();
+
+ //
=======================================================================================================================
+ // Class Methods
+ //
=======================================================================================================================
+
+ /**
+ * Note: The <code>ModeShapeMessageConsole</code> should
<strong>NOT</strong> be cached as the user can open/close/create instances.
+ *
+ * @return the Message Console if available or a new one (never
<code>null</code>)
+ */
+ private static ModeShapeMessageConsole getMessageConsole() {
+ ModeShapeMessageConsole console = null;
+ IConsoleManager consoleMgr = ConsolePlugin.getDefault().getConsoleManager();
+ IConsole[] consoles = consoleMgr.getConsoles();
+
+ // see if console is open
+ for (int i = 0; i < consoles.length; ++i) {
+ if (NAME.equals(consoles[i].getName())) {
+ console = (ModeShapeMessageConsole)consoles[i];
+ break;
+ }
+ }
+
+ // create console if necessary
+ if (console == null) {
+ console = new ModeShapeMessageConsole();
+ consoleMgr.addConsoles(new IConsole[] {console});
+ }
+
+ return console;
+ }
+
+ /**
+ * Adds a line feed to the console after the message is printed.
+ *
+ * @param message the message being written to the console (never
<code>null</code>)
+ */
+ public static void writeln( String message ) {
+ CheckArg.isNotNull(message, "message");
+ writeln(message, null);
+ }
+
+ /**
+ * Adds a line feed to the console after the message is printed.
+ *
+ * @param message the message being written to the console (never
<code>null</code>)
+ * @param file the file whose full path, which is contained in the message, will be
made into a hyperlink (may be
+ * <code>null</code>)
+ */
+ public static void writeln( String message,
+ IFile file ) {
+ CheckArg.isNotNull(message, "message");
+
+ ModeShapeMessageConsole console = getMessageConsole();
+ console.print(message, true, file);
+ }
+
+ //
=======================================================================================================================
+ // Constructors
+ //
=======================================================================================================================
+
+ /**
+ * Prevent construction.
+ */
+ private ModeShapeMessageConsole() {
+ super(NAME, Activator.getDefault().getImageDescriptor(ModeShape_IMAGE_16x));
+ }
+
+ //
=======================================================================================================================
+ // Methods
+ //
=======================================================================================================================
+
+ /**
+ * @param message the message being searched for
+ * @param file the file whose full path appears in the message and will become a
hyperlink
+ */
+ void addDocumentListener( String message,
+ IFile file ) {
+ getDocument().addDocumentListener(new HyperlinkCreator(message, this, file));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.console.AbstractConsole#getType()
+ */
+ @Override
+ public String getType() {
+ return ID;
+ }
+
+ /**
+ * @param message the message being written to the console (never
<code>null</code>)
+ * @param doLineFeedAtEnd a flag indicating if a line feed should be done after
writing the message
+ * @param file the file to create a hyperlink for (may be
<code>null</code>)
+ */
+ private void print( final String message,
+ final boolean doLineFeedAtEnd,
+ final IFile file ) {
+ assert (message != null);
+ final Display display = Display.getDefault();
+ final AbstractConsole console = this;
+
+ if (!display.isDisposed()) {
+ display.asyncExec(new Runnable() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ if (!display.isDisposed()) {
+ // bring focus to this view
+ console.activate();
+
+ // register document listener before writing to console
+ if (file != null) {
+ addDocumentListener(message, file);
+ }
+
+ MessageConsoleStream stream = newMessageStream();
+
+ for (int beginIndex = 0, endIndex = 0, msgLength =
message.length(); endIndex < msgLength;) {
+ int startTagIndex = message.indexOf(EMPHASIS_START_TAG,
beginIndex);
+ int endTagIndex = ((startTagIndex < 0) ? -1 :
message.indexOf(EMPHASIS_END_TAG,
+
startTagIndex
+
+ EMPHASIS_START_TAG.length()));
+
+ // ignore tags if both tags are not found
+ if ((endTagIndex < 0) && (startTagIndex >= 0))
{
+ startTagIndex = -1;
+ }
+
+ // determine if in emphasize mode
+ boolean emphasize = (beginIndex == startTagIndex);
+
+ // skip over start tag and set stream to bold font style
+ if (emphasize) {
+ beginIndex += EMPHASIS_START_TAG.length();
+ stream.setFontStyle(SWT.BOLD);
+ endIndex = endTagIndex;
+ } else {
+ stream.setFontStyle(SWT.NORMAL);
+ endIndex = ((startTagIndex < 0) ? msgLength :
startTagIndex);
+ }
+
+ // print to console
+ stream.print(message.substring(beginIndex, endIndex));
+
+ // need to construct a new stream as changes to font style
seem to only work one time
+ stream = newMessageStream();
+
+ // skip over end tag
+ if (emphasize) {
+ endIndex += EMPHASIS_END_TAG.length();
+ }
+
+ beginIndex = endIndex;
+ }
+
+ if (doLineFeedAtEnd) {
+ stream.println();
+ }
+ }
+ }
+ });
+ }
+ }
+
+ //
===========================================================================================================================
+ // Inner Class
+ //
===========================================================================================================================
+
+ /**
+ * The <code>HyperlinkCreator</code> creates a hyperlink in a Message
Console for the first occurrence of the full path of
+ * a specified file.
+ */
+ class HyperlinkCreator implements IDocumentListener {
+
+ //
=======================================================================================================================
+ // Fields
+ //
=======================================================================================================================
+
+ /**
+ * The console where the message is printed to and the hyperlink will be
created.
+ */
+ private final ModeShapeMessageConsole console;
+
+ /**
+ * The file whose full path will become a hyperlink.
+ */
+ private final IFile file;
+
+ /**
+ * The message where the file path is located in.
+ */
+ private final String message;
+
+ //
=======================================================================================================================
+ // Constructors
+ //
=======================================================================================================================
+
+ /**
+ * @param message the message that contains the full path of the file
+ * @param console the console where the message appears
+ * @param file the file whose full path appears in the message and will become a
hyperlink
+ */
+ public HyperlinkCreator( String message,
+ ModeShapeMessageConsole console,
+ IFile file ) {
+ this.message = message.replaceAll("<em>",
"").replaceAll("\\Q</em>\\E", "");
+ this.console = console;
+ this.file = file;
+ }
+
+ //
=======================================================================================================================
+ // Methods
+ //
=======================================================================================================================
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see
org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
+ */
+ @Override
+ public void documentAboutToBeChanged( DocumentEvent arg0 ) {
+ // nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see
org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
+ */
+ @Override
+ public void documentChanged( DocumentEvent event ) {
+ IDocument document = event.getDocument();
+
+ try {
+ FindReplaceDocumentAdapter finder = new
FindReplaceDocumentAdapter(document);
+ IRegion region = finder.find(document.getLength() - 1, this.message,
false, true, false, false);
+
+ if (region != null) {
+ String target = this.file.getFullPath().toString();
+ int index = this.message.indexOf(target);
+
+ if (index == -1) {
+ throw new
BadLocationException(RestClientI18n.publishingConsoleFilePathNotFoundMsg.text(target));
+ }
+
+ this.console.addHyperlink(new FileLink(file, null, -1, -1, -1),
(region.getOffset() + index), target.length());
+
+ // created hyperlink so no need to listen any longer
+ document.removeDocumentListener(this);
+ }
+ } catch (BadLocationException e) {
+ Activator.getDefault().log(new Status(Severity.ERROR,
+
RestClientI18n.publishingConsoleProblemCreatingHyperlinkMsg.text(), e));
+ document.removeDocumentListener(this);
+ }
+ }
+ }
+
+}
Property changes on:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeMessageConsole.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/PublishingContentProvider.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/PublishingContentProvider.java 2010-01-22
18:51:55 UTC (rev 19892)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/PublishingContentProvider.java 2010-01-22
20:40:59 UTC (rev 19893)
@@ -1,415 +0,0 @@
-/*
- * ModeShape (
http://www.modeshape.org)
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.
- *
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at
http://www.eclipse.org/legal/epl-v10.html.
- *
- * See the AUTHORS.txt file in the distribution for a full listing of
- * individual contributors.
- */
-package org.jboss.tools.modeshape.rest.views;
-
-import static org.jboss.tools.modeshape.rest.IUiConstants.PUBLISHED_OVERLAY_IMAGE;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-import net.jcip.annotations.GuardedBy;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.IDecoration;
-import org.eclipse.jface.viewers.ILightweightLabelDecorator;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProviderChangedEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IDecoratorManager;
-import org.jboss.tools.modeshape.rest.Activator;
-import org.jboss.tools.modeshape.rest.IServerRegistryListener;
-import org.jboss.tools.modeshape.rest.PublishedResourceHelper;
-import org.jboss.tools.modeshape.rest.RestClientI18n;
-import org.jboss.tools.modeshape.rest.ServerManager;
-import org.jboss.tools.modeshape.rest.ServerRegistryEvent;
-import org.jboss.tools.modeshape.rest.Utils;
-import org.modeshape.web.jcr.rest.client.Status;
-import org.modeshape.web.jcr.rest.client.Status.Severity;
-import org.modeshape.web.jcr.rest.client.domain.IModeShapeObject;
-import org.modeshape.web.jcr.rest.client.domain.Repository;
-import org.modeshape.web.jcr.rest.client.domain.Server;
-import org.modeshape.web.jcr.rest.client.domain.Workspace;
-
-/**
- * The <code>PublishingContentProvider</code> is a content and label provider
for the repositories. This class
- * <strong>MUST</strong> be registered, and then unregistered, to receive
server registry events.
- */
-public final class PublishingContentProvider extends ColumnLabelProvider
- implements ILightweightLabelDecorator, IServerRegistryListener, ITreeContentProvider
{
-
- //
===========================================================================================================================
- // Constants
- //
===========================================================================================================================
-
- /**
- * The decorator ID.
- */
- private static final String ID =
"org.jboss.tools.modeshape.rest.decorator";
-
- /**
- * If a server connection cannot be established, wait this amount of time before
trying again.
- */
- private static final long RETRY_DURATION = 2000;
-
- //
===========================================================================================================================
- // Class Methods
- //
===========================================================================================================================
-
- /**
- * @return the decorator
- */
- public static PublishingContentProvider getDecorator() {
- IDecoratorManager decoratorMgr =
Activator.getDefault().getWorkbench().getDecoratorManager();
-
- if (decoratorMgr.getEnabled(ID)) {
- return (PublishingContentProvider)decoratorMgr.getBaseLabelProvider(ID);
- }
-
- return null;
- }
-
- //
===========================================================================================================================
- // Fields
- //
===========================================================================================================================
-
- /**
- * Servers that a connection can't be established. Value is the last time a
establishing a connection was tried.
- */
- @GuardedBy( "offlineServersLock" )
- private final Map<Server, Long> offlineServerMap = new HashMap<Server,
Long>();
-
- /**
- * Lock used for when accessing the offline server map. The map will be accessed in
different threads as the decorator runs in
- * its own thread (not the UI thread).
- */
- private final ReadWriteLock offlineServersLock = new ReentrantReadWriteLock();
-
- /**
- * The server manager where the server registry is managed.
- */
- private ServerManager serverManager;
-
- //
===========================================================================================================================
- // Methods
- //
===========================================================================================================================
-
- /**
- * @param server the server that is offline
- */
- private void addOfflineServer( Server server ) {
- try {
- this.offlineServersLock.writeLock().lock();
- this.offlineServerMap.put(server, System.currentTimeMillis());
- } finally {
- this.offlineServersLock.writeLock().unlock();
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see
org.eclipse.jface.viewers.ILightweightLabelDecorator#decorate(java.lang.Object,
org.eclipse.jface.viewers.IDecoration)
- */
- @Override
- public void decorate( final Object element,
- IDecoration decoration ) {
- ImageDescriptor overlay = null;
- final Display display = Display.getDefault();
-
- if (display.isDisposed()) {
- return;
- }
-
- if (getServerManager() != null) {
- if (element instanceof Server) {
- Server server = (Server)element;
-
- if (isOkToConnect(server)) {
- Status status = getServerManager().ping(server);
- overlay = Utils.getOverlayImage(status);
-
- if (status.isError()) {
- addOfflineServer(server);
- }
- }
- } else if ((element instanceof IFile) && new
PublishedResourceHelper(getServerManager()).isPublished((IFile)element)) {
- overlay =
Activator.getDefault().getImageDescriptor(PUBLISHED_OVERLAY_IMAGE);
- }
-
- if (overlay != null) {
- decoration.addOverlay(overlay);
- }
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- @Override
- public void dispose() {
- // nothing to do
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
- */
- @Override
- public Object[] getChildren( Object parentElement ) {
- assert (parentElement instanceof IModeShapeObject);
-
- if (getServerManager() != null) {
- if (parentElement instanceof Server) {
- Server server = (Server)parentElement;
-
- if (isOkToConnect(server)) {
- try {
- return getServerManager().getRepositories(server).toArray();
- } catch (Exception e) {
- addOfflineServer(server);
- String msg =
RestClientI18n.serverManagerGetRepositoriesExceptionMsg.text(server.getShortDescription());
- Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
- }
- }
- } else if (parentElement instanceof Repository) {
- Repository repository = (Repository)parentElement;
-
- if (isOkToConnect(repository.getServer())) {
- try {
- return getServerManager().getWorkspaces(repository).toArray();
- } catch (Exception e) {
- addOfflineServer(repository.getServer());
- String msg =
RestClientI18n.serverManagerGetWorkspacesExceptionMsg.text(repository.getShortDescription());
- Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
- }
- }
- }
- }
-
- return new Object[0];
- }
-
- /**
- * {@inheritDoc}
- *
- * @see
org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- @Override
- public Object[] getElements( Object inputElement ) {
- return ((getServerManager() == null) ? new Object[0] :
getServerManager().getServers().toArray());
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- @Override
- public Image getImage( Object element ) {
- return Activator.getDefault().getImage(element);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
- */
- @Override
- public Object getParent( Object element ) {
- assert (element instanceof IModeShapeObject);
-
- if (element instanceof Workspace) {
- return ((Workspace)element).getRepository();
- }
-
- if (element instanceof Repository) {
- return ((Repository)element).getServer();
- }
-
- // server
- return null;
- }
-
- /**
- * @return the server manager (never <code>null</code>)
- */
- private ServerManager getServerManager() {
- if (this.serverManager == null) {
- this.serverManager = Activator.getDefault().getServerManager();
- }
-
- return this.serverManager;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- @Override
- public String getText( Object element ) {
- assert (element instanceof IModeShapeObject);
- return ((IModeShapeObject)element).getName();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see
org.eclipse.jface.viewers.CellLabelProvider#getToolTipImage(java.lang.Object)
- */
- @Override
- public Image getToolTipImage( Object object ) {
- return getImage(object);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.CellLabelProvider#getToolTipText(java.lang.Object)
- */
- @Override
- public String getToolTipText( Object element ) {
- if (element instanceof IModeShapeObject) {
- return ((IModeShapeObject)element).getShortDescription();
- }
-
- return super.getToolTipText(element);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see
org.eclipse.jface.viewers.CellLabelProvider#getToolTipTimeDisplayed(java.lang.Object)
- */
- @Override
- public int getToolTipTimeDisplayed( Object object ) {
- return 3000;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
- */
- @Override
- public boolean hasChildren( Object element ) {
- return getChildren(element).length > 0;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see
org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
java.lang.Object,
- * java.lang.Object)
- */
- @Override
- public void inputChanged( Viewer viewer,
- Object oldInput,
- Object newInput ) {
- // nothing to do
- }
-
- public void refresh( final Object element ) {
- final Display display = Display.getDefault();
-
- if (display.isDisposed()) {
- return;
- }
-
- display.asyncExec(new Runnable() {
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Runnable#run()
- */
- @SuppressWarnings( "synthetic-access" )
- @Override
- public void run() {
- fireLabelProviderChanged(new
LabelProviderChangedEvent(PublishingContentProvider.this, element));
- }
- });
- }
-
- /**
- * Determines if a try to connect to a server should be done based on the last time a
try was done and failed.
- *
- * @param server the server being checked
- * @return <code>true</code> if it is OK to try and connect
- */
- private boolean isOkToConnect( Server server ) {
- boolean check = false; // check map for time
-
- try {
- this.offlineServersLock.readLock().lock();
- check = this.offlineServerMap.containsKey(server);
- } finally {
- this.offlineServersLock.readLock().unlock();
- }
-
- if (check) {
- try {
- this.offlineServersLock.writeLock().lock();
-
- if (this.offlineServerMap.containsKey(server)) {
- long checkTime = this.offlineServerMap.get(server);
-
- // OK to try and connect if last failed attempt was too long ago
- if ((System.currentTimeMillis() - checkTime) > RETRY_DURATION) {
- this.offlineServerMap.remove(server);
- return true;
- }
-
- // don't try and connect because we just tried and failed
- return false;
- }
- } finally {
- this.offlineServersLock.writeLock().unlock();
- }
- }
-
- // OK to try and connect
- return true;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see
org.jboss.tools.modeshape.rest.IServerRegistryListener#serverRegistryChanged(org.jboss.tools.modeshape.rest.ServerRegistryEvent)
- */
- @Override
- public Exception[] serverRegistryChanged( ServerRegistryEvent event ) {
- Exception[] errors = null;
-
- // only care about servers being removed or updated
- if (event.isRemove() || event.isUpdate()) {
- try {
- this.offlineServersLock.writeLock().lock();
- this.offlineServerMap.remove(event.getServer());
- } catch (Exception e) {
- errors = new Exception[] {e};
- } finally {
- this.offlineServersLock.writeLock().unlock();
- }
- }
-
- return errors;
- }
-
-}
Deleted:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/PublishingMessageConsole.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/PublishingMessageConsole.java 2010-01-22
18:51:55 UTC (rev 19892)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/PublishingMessageConsole.java 2010-01-22
20:40:59 UTC (rev 19893)
@@ -1,332 +0,0 @@
-/*
- * ModeShape (
http://www.modeshape.org)
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.
- *
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at
http://www.eclipse.org/legal/epl-v10.html.
- *
- * See the AUTHORS.txt file in the distribution for a full listing of
- * individual contributors.
- */
-package org.jboss.tools.modeshape.rest.views;
-
-import static org.jboss.tools.modeshape.rest.IUiConstants.ModeShape_IMAGE_16x;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.debug.ui.console.FileLink;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.FindReplaceDocumentAdapter;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.console.AbstractConsole;
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.IConsole;
-import org.eclipse.ui.console.IConsoleManager;
-import org.eclipse.ui.console.MessageConsole;
-import org.eclipse.ui.console.MessageConsoleStream;
-import org.jboss.tools.modeshape.rest.Activator;
-import org.jboss.tools.modeshape.rest.RestClientI18n;
-import org.modeshape.common.util.CheckArg;
-import org.modeshape.web.jcr.rest.client.Status;
-import org.modeshape.web.jcr.rest.client.Status.Severity;
-
-/**
- * The <code>PublishingMessageConsole</code> is a message console view where
status of publishing operations are logged. This class
- * ensures all writes to the console are done in the UI thread.
- */
-public final class PublishingMessageConsole extends MessageConsole {
-
- //
=======================================================================================================================
- // Constants
- //
=======================================================================================================================
-
- /**
- * Start tag for adding emphasis to a message. Tag will appear in a properties file.
- */
- private static final String EMPHASIS_START_TAG = "<em>";
-
- /**
- * End tag for adding emphasis to a message. Tag will appear in a properties file.
- */
- private static final String EMPHASIS_END_TAG = "</em>";
-
- /**
- * The identifier and type of the Message Console.
- */
- private static final String ID =
"org.jboss.tools.modeshape.rest.views.PublishingMessageConsole";
-
- /**
- * The message console name.
- */
- private static final String NAME = RestClientI18n.publishingConsoleName.text();
-
- //
=======================================================================================================================
- // Class Methods
- //
=======================================================================================================================
-
- /**
- * Note: The <code>PublishingMessageConsole</code> should
<strong>NOT</strong> be cached as the user can open/close/create instances.
- *
- * @return the Message Console if available or a new one (never
<code>null</code>)
- */
- private static PublishingMessageConsole getMessageConsole() {
- PublishingMessageConsole console = null;
- IConsoleManager consoleMgr = ConsolePlugin.getDefault().getConsoleManager();
- IConsole[] consoles = consoleMgr.getConsoles();
-
- // see if console is open
- for (int i = 0; i < consoles.length; ++i) {
- if (NAME.equals(consoles[i].getName())) {
- console = (PublishingMessageConsole)consoles[i];
- break;
- }
- }
-
- // create console if necessary
- if (console == null) {
- console = new PublishingMessageConsole();
- consoleMgr.addConsoles(new IConsole[] {console});
- }
-
- return console;
- }
-
- /**
- * Adds a line feed to the console after the message is printed.
- *
- * @param message the message being written to the console (never
<code>null</code>)
- */
- public static void writeln( String message ) {
- CheckArg.isNotNull(message, "message");
- writeln(message, null);
- }
-
- /**
- * Adds a line feed to the console after the message is printed.
- *
- * @param message the message being written to the console (never
<code>null</code>)
- * @param file the file whose full path, which is contained in the message, will be
made into a hyperlink (may be
- * <code>null</code>)
- */
- public static void writeln( String message,
- IFile file ) {
- CheckArg.isNotNull(message, "message");
-
- PublishingMessageConsole console = getMessageConsole();
- console.print(message, true, file);
- }
-
- //
=======================================================================================================================
- // Constructors
- //
=======================================================================================================================
-
- /**
- * Prevent construction.
- */
- private PublishingMessageConsole() {
- super(NAME, Activator.getDefault().getImageDescriptor(ModeShape_IMAGE_16x));
- }
-
- //
=======================================================================================================================
- // Methods
- //
=======================================================================================================================
-
- /**
- * @param message the message being searched for
- * @param file the file whose full path appears in the message and will become a
hyperlink
- */
- void addDocumentListener( String message,
- IFile file ) {
- getDocument().addDocumentListener(new HyperlinkCreator(message, this, file));
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.ui.console.AbstractConsole#getType()
- */
- @Override
- public String getType() {
- return ID;
- }
-
- /**
- * @param message the message being written to the console (never
<code>null</code>)
- * @param doLineFeedAtEnd a flag indicating if a line feed should be done after
writing the message
- * @param file the file to create a hyperlink for (may be
<code>null</code>)
- */
- private void print( final String message,
- final boolean doLineFeedAtEnd,
- final IFile file ) {
- assert (message != null);
- final Display display = Display.getDefault();
- final AbstractConsole console = this;
-
- if (!display.isDisposed()) {
- display.asyncExec(new Runnable() {
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Runnable#run()
- */
- @Override
- public void run() {
- if (!display.isDisposed()) {
- // bring focus to this view
- console.activate();
-
- // register document listener before writing to console
- if (file != null) {
- addDocumentListener(message, file);
- }
-
- MessageConsoleStream stream = newMessageStream();
-
- for (int beginIndex = 0, endIndex = 0, msgLength =
message.length(); endIndex < msgLength;) {
- int startTagIndex = message.indexOf(EMPHASIS_START_TAG,
beginIndex);
- int endTagIndex = ((startTagIndex < 0) ? -1 :
message.indexOf(EMPHASIS_END_TAG,
-
startTagIndex
-
+ EMPHASIS_START_TAG.length()));
-
- // ignore tags if both tags are not found
- if ((endTagIndex < 0) && (startTagIndex >= 0))
{
- startTagIndex = -1;
- }
-
- // determine if in emphasize mode
- boolean emphasize = (beginIndex == startTagIndex);
-
- // skip over start tag and set stream to bold font style
- if (emphasize) {
- beginIndex += EMPHASIS_START_TAG.length();
- stream.setFontStyle(SWT.BOLD);
- endIndex = endTagIndex;
- } else {
- stream.setFontStyle(SWT.NORMAL);
- endIndex = ((startTagIndex < 0) ? msgLength :
startTagIndex);
- }
-
- // print to console
- stream.print(message.substring(beginIndex, endIndex));
-
- // need to construct a new stream as changes to font style
seem to only work one time
- stream = newMessageStream();
-
- // skip over end tag
- if (emphasize) {
- endIndex += EMPHASIS_END_TAG.length();
- }
-
- beginIndex = endIndex;
- }
-
- if (doLineFeedAtEnd) {
- stream.println();
- }
- }
- }
- });
- }
- }
-
- //
===========================================================================================================================
- // Inner Class
- //
===========================================================================================================================
-
- /**
- * The <code>HyperlinkCreator</code> creates a hyperlink in a Message
Console for the first occurrence of the full path of
- * a specified file.
- */
- class HyperlinkCreator implements IDocumentListener {
-
- //
=======================================================================================================================
- // Fields
- //
=======================================================================================================================
-
- /**
- * The console where the message is printed to and the hyperlink will be
created.
- */
- private final PublishingMessageConsole console;
-
- /**
- * The file whose full path will become a hyperlink.
- */
- private final IFile file;
-
- /**
- * The message where the file path is located in.
- */
- private final String message;
-
- //
=======================================================================================================================
- // Constructors
- //
=======================================================================================================================
-
- /**
- * @param message the message that contains the full path of the file
- * @param console the console where the message appears
- * @param file the file whose full path appears in the message and will become a
hyperlink
- */
- public HyperlinkCreator( String message,
- PublishingMessageConsole console,
- IFile file ) {
- this.message = message.replaceAll("<em>",
"").replaceAll("\\Q</em>\\E", "");
- this.console = console;
- this.file = file;
- }
-
- //
=======================================================================================================================
- // Methods
- //
=======================================================================================================================
-
- /**
- * {@inheritDoc}
- *
- * @see
org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
- */
- @Override
- public void documentAboutToBeChanged( DocumentEvent arg0 ) {
- // nothing to do
- }
-
- /**
- * {@inheritDoc}
- *
- * @see
org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
- */
- @Override
- public void documentChanged( DocumentEvent event ) {
- IDocument document = event.getDocument();
-
- try {
- FindReplaceDocumentAdapter finder = new
FindReplaceDocumentAdapter(document);
- IRegion region = finder.find(document.getLength() - 1, this.message,
false, true, false, false);
-
- if (region != null) {
- String target = this.file.getFullPath().toString();
- int index = this.message.indexOf(target);
-
- if (index == -1) {
- throw new
BadLocationException(RestClientI18n.publishingConsoleFilePathNotFoundMsg.text(target));
- }
-
- this.console.addHyperlink(new FileLink(file, null, -1, -1, -1),
(region.getOffset() + index), target.length());
-
- // created hyperlink so no need to listen any longer
- document.removeDocumentListener(this);
- }
- } catch (BadLocationException e) {
- Activator.getDefault().log(new Status(Severity.ERROR,
-
RestClientI18n.publishingConsoleProblemCreatingHyperlinkMsg.text(), e));
- document.removeDocumentListener(this);
- }
- }
- }
-
-}
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ServerView.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ServerView.java 2010-01-22
18:51:55 UTC (rev 19892)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ServerView.java 2010-01-22
20:40:59 UTC (rev 19893)
@@ -82,7 +82,7 @@
/**
* The viewer's content and label provider.
*/
- private PublishingContentProvider provider;
+ private ModeShapeContentProvider provider;
/**
* Refreshes the server connections.
@@ -156,7 +156,7 @@
* @param parent the viewer's parent
*/
private void constructTreeViewer( Composite parent ) {
- this.provider = new PublishingContentProvider();
+ this.provider = new ModeShapeContentProvider();
this.viewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
this.viewer.setContentProvider(this.provider);