JBoss Tools SVN: r30601 - trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2011-04-15 16:20:16 -0400 (Fri, 15 Apr 2011)
New Revision: 30601
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizardPage.java
Log:
JBIDE-8737 - check to make sure we need to validate against the web.xml file before complaining it's missing
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizardPage.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizardPage.java 2011-04-15 20:17:00 UTC (rev 30600)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizardPage.java 2011-04-15 20:20:16 UTC (rev 30601)
@@ -566,8 +566,10 @@
IFile web = ((JBossWSAnnotatedClassWizard) this.getWizard()).getWebFile();
if (web == null || !web.exists()) {
- setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NotDynamicWebProject);
- return false;
+ if (updateWebXML.getSelection()) {
+ setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NotDynamicWebProject);
+ return false;
+ }
}
try {
13 years, 7 months
JBoss Tools SVN: r30600 - branches/jbosstools-3.2.x/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2011-04-15 16:17:00 -0400 (Fri, 15 Apr 2011)
New Revision: 30600
Modified:
branches/jbosstools-3.2.x/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizardPage.java
Log:
OPEN - issue JBIDE-8737: Simple Web Service wizard prevents creating sample in Dynamic Web Project if web.xml is missing
https://issues.jboss.org/browse/JBIDE-8737
Modified: branches/jbosstools-3.2.x/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizardPage.java
===================================================================
--- branches/jbosstools-3.2.x/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizardPage.java 2011-04-15 18:58:52 UTC (rev 30599)
+++ branches/jbosstools-3.2.x/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/wizards/JBossWSAnnotatedClassWizardPage.java 2011-04-15 20:17:00 UTC (rev 30600)
@@ -566,8 +566,10 @@
IFile web = ((JBossWSAnnotatedClassWizard) this.getWizard()).getWebFile();
if (web == null || !web.exists()) {
- setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NotDynamicWebProject);
- return false;
+ if (updateWebXML.getSelection()) {
+ setErrorMessage(JBossWSUIMessages.Error_JBossWS_GenerateWizard_NotDynamicWebProject);
+ return false;
+ }
}
try {
13 years, 7 months
JBoss Tools SVN: r30599 - in branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user: doc and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2011-04-15 14:58:52 -0400 (Fri, 15 Apr 2011)
New Revision: 30599
Added:
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/IgnoredResourcesPreferencePage.png
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/NewPattern.png
Removed:
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/FileFilterPreferencePage.png
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/NewFilteredFileExtension.png
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/NewFilteredFolderName.png
Modified:
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/ModeShapeHelpContexts.xml
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc.zip
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/ModeShapePreferencesDialog.html
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/ResourceContextMenu.html
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/helpContexts.xml
Log:
JBIDE-7857 ModeShape preferences should match the "Team"->"Ignored Resources." Updated the Eclipse context help pages and images.
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/ModeShapeHelpContexts.xml
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/ModeShapeHelpContexts.xml 2011-04-15 18:44:20 UTC (rev 30598)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/ModeShapeHelpContexts.xml 2011-04-15 18:58:52 UTC (rev 30599)
@@ -27,9 +27,9 @@
<topic href="doc/ModeShapePreferencesDialog.html" label="ModeShape Preferences"/>
</context>
<context id="preferencesHelpContext" title="ModeShape Preference Pages Help">
- <description>The ModeShape Preferences Dialog allows you to identify file extensions and folder names that should not be involved in publishing operations.</description>
+ <description>The ModeShape Preferences Dialog allows you to identify file and folder name patterns that should not be involved in publishing operations.</description>
<topic href="doc/ModeShapePreferencesDialog.html" label="ModeShape Preferences"/>
- <topic href="doc/PublishDialog.html" label="Publish/Unpublish Dialog"/>
+ <topic href="doc/PublishDialog.html" label="Publishing Operations Dialog"/>
</context>
<context id="messageConsoleHelpContext" title="ModeShape Message Console">
<description>The ModeShape Message Console contains the output from the publishing and unpublishing operations.</description>
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/ModeShapePreferencesDialog.html
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/ModeShapePreferencesDialog.html 2011-04-15 18:44:20 UTC (rev 30598)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/ModeShapePreferencesDialog.html 2011-04-15 18:58:52 UTC (rev 30599)
@@ -12,14 +12,14 @@
<h2>ModeShape Preference Pages</h2>
<p>The <i>ModeShape Preference Pages</i> provide settings that allow you to personalize how ModeShape Tools' publishing operations
-are done. A publishing operation occurs when selected files in your local workspace are either uploaded (published) or deleted
-(unpublished) to/from a specific ModeShape repository workspace. Here's a list of the preference pages:</p>
+are done. A publishing operation occurs when selected files in your local workspace are either uploaded (published) to, or deleted
+(unpublished) from, a specific ModeShape repository workspace. Here's a list of the ModeShape Tools preference pages:</p>
<ul>
<li><a href="#generalSettingsPrefPage">General Settings</a> - these settings control if published files should be put under
version control by the ModeShape server.
</li>
-<li><a href="#fileFiltersPrefPage">File and Folder Filters</a> - these settings control which files are filtered out of your
+<li><a href="#ignoredResourcesPrefPage">Ignored Resources</a> - these settings control which files are filtered out of your
publishing operations.
</li>
</ul>
@@ -33,28 +33,21 @@
<img src="images/GeneralPreferencePage.png" border="0" alt="">
-<h3><a name="fileFiltersPrefPage">File and Folder Filters Preference Page</a></h3>
+<h3><a name="ignoredResourcesPrefPage">Ignored Resources Preference Page</a></h3>
-<p>The <i>File and Folder Filters Preference Page</i> is where you identify the file extensions and the folder names you
+<p>The <i>Ignored Resources Preference Page</i> is where you identify the name patterns of files and folders that you
<strong>do not</strong> want involved in your publishing operations.</p>
-<p>Here is what the <i>File and Folder Filters Preference Page</i> looks like:</p>
+<p>Here is what the <i>Ignored Resources Preference Page</i> looks like:</p>
-<img src="images/FileFilterPreferencePage.png" border="0" alt="">
+<img src="images/IgnoredResourcesPreferencePage.png" border="0" alt="">
-<p>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 (ex., txt, jpg, class) simply click on the <code>New...</code> button to display the following dialog:</p>
+<p>If a file name matches one of these patterns, or is found in a folder whose name matches one of those patterns, it will not be
+involved in either a publishing or unpublishing operation. To add new pattern click on the <code>New...</code> button to display
+the following dialog:</p>
-<p><img src="images/NewFilteredFileExtension.png" border="0" alt=""></p>
+<p><img src="images/NewPattern.png" border="0" alt=""></p>
-<p>The <i>Filtered Folder 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 <strong>not</strong> 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>
-
-<p><img src="images/NewFilteredFolderName.png" border="0" alt=""></p>
-
<h3>Related Topics</h3>
<ul>
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/ResourceContextMenu.html
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/ResourceContextMenu.html 2011-04-15 18:44:20 UTC (rev 30598)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/ResourceContextMenu.html 2011-04-15 18:58:52 UTC (rev 30599)
@@ -22,15 +22,15 @@
<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="ModeShapePreferencesDialog.html#fileFiltersPrefPage">File and Folder Filters Preference 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 operations even though they have been selected. Use the
+<a href="ModeShapePreferencesDialog.html#ignoredResourcesPrefPage">Ignored Resources Preference Page</a> to control which files
+are filtered out. If a file name, or the name of the folder they are contained in, or the name of an ancestor folder, match one
+of the patterns identified on this preference page, they will not be included in publishing operations.</p>
<h3>Related Topics</h3>
<ul>
-<li><a href="ModeShapePreferencesDialog.html#fileFiltersPrefPage">File and Folder Filters Preference Page</a></li>
+<li><a href="ModeShapePreferencesDialog.html#ignoredResourcesPrefPage">Ignored Resources Preference Page</a></li>
<li><a href="PublishDialog.html">Publishing Operations Dialog</a></li>
<li><a href="PublishedLocationsDialog.html">Published Locations Dialog</a></li>
</ul>
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/helpContexts.xml
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/helpContexts.xml 2011-04-15 18:44:20 UTC (rev 30598)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/helpContexts.xml 2011-04-15 18:58:52 UTC (rev 30599)
@@ -27,9 +27,9 @@
<topic href="docs/ModeShapePreferencesDialog.html" label="ModeShape Preferences"/>
</context>
<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>
+ <description>The ModeShape Preferences Dialog allows you to identify file and folder name patterns 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"/>
+ <topic href="docs/PublishDialog.html" label="Publishing Operations Dialog"/>
</context>
<context id="messageConsoleHelpContext" title="ModeShape Message Console">
<description>The ModeShape Message Console contains the output from the publishing and unpublishing operations.</description>
Deleted: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/FileFilterPreferencePage.png
===================================================================
(Binary files differ)
Added: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/IgnoredResourcesPreferencePage.png
===================================================================
(Binary files differ)
Property changes on: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/IgnoredResourcesPreferencePage.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/NewFilteredFileExtension.png
===================================================================
(Binary files differ)
Deleted: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/NewFilteredFolderName.png
===================================================================
(Binary files differ)
Added: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/NewPattern.png
===================================================================
(Binary files differ)
Property changes on: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/NewPattern.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc.zip
===================================================================
(Binary files differ)
13 years, 7 months
JBoss Tools SVN: r30598 - in trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user: doc and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2011-04-15 14:44:20 -0400 (Fri, 15 Apr 2011)
New Revision: 30598
Added:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/IgnoredResourcesPreferencePage.png
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/NewPattern.png
Removed:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/FileFilterPreferencePage.png
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/NewFilteredFileExtension.png
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/NewFilteredFolderName.png
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/ModeShapeHelpContexts.xml
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc.zip
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/ModeShapePreferencesDialog.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/ResourceContextMenu.html
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/helpContexts.xml
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/GeneralPreferencePage.png
Log:
JBIDE-7857 ModeShape preferences should match the "Team"->"Ignored Resources." Modified Eclipse context help pages and images.
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/ModeShapeHelpContexts.xml
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/ModeShapeHelpContexts.xml 2011-04-15 18:38:31 UTC (rev 30597)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/ModeShapeHelpContexts.xml 2011-04-15 18:44:20 UTC (rev 30598)
@@ -27,9 +27,9 @@
<topic href="doc/ModeShapePreferencesDialog.html" label="ModeShape Preferences"/>
</context>
<context id="preferencesHelpContext" title="ModeShape Preference Pages Help">
- <description>The ModeShape Preferences Dialog allows you to identify file extensions and folder names that should not be involved in publishing operations.</description>
+ <description>The ModeShape Preferences Dialog allows you to identify file and folder name patterns that should not be involved in publishing operations.</description>
<topic href="doc/ModeShapePreferencesDialog.html" label="ModeShape Preferences"/>
- <topic href="doc/PublishDialog.html" label="Publish/Unpublish Dialog"/>
+ <topic href="doc/PublishDialog.html" label="Publishing Operations Dialog"/>
</context>
<context id="messageConsoleHelpContext" title="ModeShape Message Console">
<description>The ModeShape Message Console contains the output from the publishing and unpublishing operations.</description>
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/ModeShapePreferencesDialog.html
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/ModeShapePreferencesDialog.html 2011-04-15 18:38:31 UTC (rev 30597)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/ModeShapePreferencesDialog.html 2011-04-15 18:44:20 UTC (rev 30598)
@@ -12,14 +12,14 @@
<h2>ModeShape Preference Pages</h2>
<p>The <i>ModeShape Preference Pages</i> provide settings that allow you to personalize how ModeShape Tools' publishing operations
-are done. A publishing operation occurs when selected files in your local workspace are either uploaded (published) or deleted
-(unpublished) to/from a specific ModeShape repository workspace. Here's a list of the preference pages:</p>
+are done. A publishing operation occurs when selected files in your local workspace are either uploaded (published) to, or deleted
+(unpublished) from, a specific ModeShape repository workspace. Here's a list of the ModeShape Tools preference pages:</p>
<ul>
<li><a href="#generalSettingsPrefPage">General Settings</a> - these settings control if published files should be put under
version control by the ModeShape server.
</li>
-<li><a href="#fileFiltersPrefPage">File and Folder Filters</a> - these settings control which files are filtered out of your
+<li><a href="#ignoredResourcesPrefPage">Ignored Resources</a> - these settings control which files are filtered out of your
publishing operations.
</li>
</ul>
@@ -33,28 +33,21 @@
<img src="images/GeneralPreferencePage.png" border="0" alt="">
-<h3><a name="fileFiltersPrefPage">File and Folder Filters Preference Page</a></h3>
+<h3><a name="ignoredResourcesPrefPage">Ignored Resources Preference Page</a></h3>
-<p>The <i>File and Folder Filters Preference Page</i> is where you identify the file extensions and the folder names you
+<p>The <i>Ignored Resources Preference Page</i> is where you identify the name patterns of files and folders that you
<strong>do not</strong> want involved in your publishing operations.</p>
-<p>Here is what the <i>File and Folder Filters Preference Page</i> looks like:</p>
+<p>Here is what the <i>Ignored Resources Preference Page</i> looks like:</p>
-<img src="images/FileFilterPreferencePage.png" border="0" alt="">
+<img src="images/IgnoredResourcesPreferencePage.png" border="0" alt="">
-<p>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 (ex., txt, jpg, class) simply click on the <code>New...</code> button to display the following dialog:</p>
+<p>If a file name matches one of these patterns, or is found in a folder whose name matches one of those patterns, it will not be
+involved in either a publishing or unpublishing operation. To add new pattern click on the <code>New...</code> button to display
+the following dialog:</p>
-<p><img src="images/NewFilteredFileExtension.png" border="0" alt=""></p>
+<p><img src="images/NewPattern.png" border="0" alt=""></p>
-<p>The <i>Filtered Folder 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 <strong>not</strong> 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>
-
-<p><img src="images/NewFilteredFolderName.png" border="0" alt=""></p>
-
<h3>Related Topics</h3>
<ul>
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/ResourceContextMenu.html
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/ResourceContextMenu.html 2011-04-15 18:38:31 UTC (rev 30597)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/ResourceContextMenu.html 2011-04-15 18:44:20 UTC (rev 30598)
@@ -22,15 +22,15 @@
<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="ModeShapePreferencesDialog.html#fileFiltersPrefPage">File and Folder Filters Preference 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 operations even though they have been selected. Use the
+<a href="ModeShapePreferencesDialog.html#ignoredResourcesPrefPage">Ignored Resources Preference Page</a> to control which files
+are filtered out. If a file name, or the name of the folder they are contained in, or the name of an ancestor folder, match one
+of the patterns identified on this preference page, they will not be included in publishing operations.</p>
<h3>Related Topics</h3>
<ul>
-<li><a href="ModeShapePreferencesDialog.html#fileFiltersPrefPage">File and Folder Filters Preference Page</a></li>
+<li><a href="ModeShapePreferencesDialog.html#ignoredResourcesPrefPage">Ignored Resources Preference Page</a></li>
<li><a href="PublishDialog.html">Publishing Operations Dialog</a></li>
<li><a href="PublishedLocationsDialog.html">Published Locations Dialog</a></li>
</ul>
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/helpContexts.xml
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/helpContexts.xml 2011-04-15 18:38:31 UTC (rev 30597)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/helpContexts.xml 2011-04-15 18:44:20 UTC (rev 30598)
@@ -27,9 +27,9 @@
<topic href="docs/ModeShapePreferencesDialog.html" label="ModeShape Preferences"/>
</context>
<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>
+ <description>The ModeShape Preferences Dialog allows you to identify file and folder name patterns 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"/>
+ <topic href="docs/PublishDialog.html" label="Publishing Operations Dialog"/>
</context>
<context id="messageConsoleHelpContext" title="ModeShape Message Console">
<description>The ModeShape Message Console contains the output from the publishing and unpublishing operations.</description>
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/FileFilterPreferencePage.png
===================================================================
(Binary files differ)
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/GeneralPreferencePage.png
===================================================================
(Binary files differ)
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/IgnoredResourcesPreferencePage.png
===================================================================
(Binary files differ)
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/IgnoredResourcesPreferencePage.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/NewFilteredFileExtension.png
===================================================================
(Binary files differ)
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/NewFilteredFolderName.png
===================================================================
(Binary files differ)
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/NewPattern.png
===================================================================
(Binary files differ)
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc/images/NewPattern.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc.zip
===================================================================
(Binary files differ)
13 years, 7 months
JBoss Tools SVN: r30597 - workspace/adietish/org.jboss.ide.eclipse.as7.deployment.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-04-15 14:38:31 -0400 (Fri, 15 Apr 2011)
New Revision: 30597
Modified:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.project
Log:
implementing service
Modified: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.project
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.project 2011-04-15 16:50:51 UTC (rev 30596)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment/.project 2011-04-15 18:38:31 UTC (rev 30597)
@@ -20,6 +20,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
13 years, 7 months
JBoss Tools SVN: r30596 - in trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui: search and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-04-15 12:50:51 -0400 (Fri, 15 Apr 2011)
New Revision: 30596
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/BeanMatch.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/EventMatch.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/ObserverMethodMatch.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointLabelProvider.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointMatchPresentation.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java
Log:
https://issues.jboss.org/browse/JBIDE-8704
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java 2011-04-15 16:44:43 UTC (rev 30595)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java 2011-04-15 16:50:51 UTC (rev 30596)
@@ -20,7 +20,10 @@
NLS.initializeMessages(BUNDLE_NAME, CDIUIMessages.class);
}
- public static String INJECTION_POINT_LABEL_PROVIDER;
+ public static String INJECTION_POINT_LABEL_PROVIDER_INJECT_BEAN;
+ public static String INJECTION_POINT_LABEL_PROVIDER_OBSERVER_METHOD;
+ public static String INJECTION_POINT_LABEL_PROVIDER_EVENT;
+
public static String CDI_UI_IMAGESBASE_URL_FOR_IMAGE_REGISTRY_CANNOT_BE_NULL;
public static String CDI_UI_IMAGESIMAGE_NAME_CANNOT_BE_NULL;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2011-04-15 16:44:43 UTC (rev 30595)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2011-04-15 16:50:51 UTC (rev 30596)
@@ -9,7 +9,9 @@
### Red Hat, Inc. - initial API and implementation
##################################################################################
-INJECTION_POINT_LABEL_PROVIDER=Injected class
+INJECTION_POINT_LABEL_PROVIDER_INJECT_BEAN=@Inject Bean ''{0}''
+INJECTION_POINT_LABEL_PROVIDER_OBSERVER_METHOD=CDI Observer Method ''{0}.{1}()''
+INJECTION_POINT_LABEL_PROVIDER_EVENT=CDI Event ''{0}.{1}''
CDI_UI_IMAGESBASE_URL_FOR_IMAGE_REGISTRY_CANNOT_BE_NULL=Base url for image registry cannot be null.
CDI_UI_IMAGESIMAGE_NAME_CANNOT_BE_NULL=Image name cannot be null.
CDI_REFACTOR_CONTRIBUTOR_MENU_NAME=CDI Refactor
Copied: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/BeanMatch.java (from rev 30578, trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointMatch.java)
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/BeanMatch.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/BeanMatch.java 2011-04-15 16:50:51 UTC (rev 30596)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.ui.search;
+
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.search.ui.text.Match;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.ui.CDIUIPlugin;
+
+public class BeanMatch extends Match {
+ private IBean bean;
+ public BeanMatch(IBean bean){
+ super(bean, 0, 0);
+ try{
+ ISourceRange range = bean.getBeanClass().getNameRange();
+ setOffset(range.getOffset());
+ setLength(range.getLength());
+ }catch(JavaModelException ex){
+ CDIUIPlugin.getDefault().logError(ex);
+ }
+ this.bean = bean;
+ }
+
+ public IBean getBean(){
+ return bean;
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/BeanMatch.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/EventMatch.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/EventMatch.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/EventMatch.java 2011-04-15 16:50:51 UTC (rev 30596)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.ui.search;
+
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.search.ui.text.Match;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IInjectionPointField;
+import org.jboss.tools.cdi.core.IInjectionPointMethod;
+import org.jboss.tools.cdi.core.IInjectionPointParameter;
+import org.jboss.tools.cdi.ui.CDIUIPlugin;
+
+public class EventMatch extends Match {
+ private IInjectionPoint event;
+
+ public EventMatch(IInjectionPoint event) {
+ super(event, 0, 0);
+ try{
+ ISourceRange range = null;
+ if(event instanceof IInjectionPointField){
+ range = ((IInjectionPointField)event).getField().getNameRange();
+ }else if(event instanceof IInjectionPointMethod){
+ range = ((IInjectionPointMethod)event).getMethod().getNameRange();
+ }else if(event instanceof IInjectionPointParameter){
+ range = ((IInjectionPointParameter)event).getBeanMethod().getMethod().getNameRange();
+ }
+
+ if(range != null){
+ setOffset(range.getOffset());
+ setLength(range.getLength());
+ }
+ }catch(JavaModelException ex){
+ CDIUIPlugin.getDefault().logError(ex);
+ }
+ this.event = event;
+ }
+
+ public IInjectionPoint getEvent(){
+ return event;
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/EventMatch.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointLabelProvider.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointLabelProvider.java 2011-04-15 16:44:43 UTC (rev 30595)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointLabelProvider.java 2011-04-15 16:50:51 UTC (rev 30596)
@@ -12,8 +12,13 @@
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IInjectionPointField;
+import org.jboss.tools.cdi.core.IInjectionPointMethod;
+import org.jboss.tools.cdi.core.IInjectionPointParameter;
+import org.jboss.tools.cdi.core.IObserverMethod;
import org.jboss.tools.cdi.ui.CDIUIMessages;
import org.jboss.tools.cdi.ui.CDIUiImages;
@@ -26,7 +31,15 @@
public String getText(Object element) {
if(element instanceof IBean){
- return CDIUIMessages.INJECTION_POINT_LABEL_PROVIDER+" "+((IBean)element).getBeanClass().getElementName(); //$NON-NLS-1$
+ return NLS.bind(CDIUIMessages.INJECTION_POINT_LABEL_PROVIDER_INJECT_BEAN, ((IBean)element).getBeanClass().getElementName());
+ }else if(element instanceof IObserverMethod){
+ return NLS.bind(CDIUIMessages.INJECTION_POINT_LABEL_PROVIDER_OBSERVER_METHOD, ((IObserverMethod)element).getMethod().getDeclaringType().getElementName(), ((IObserverMethod)element).getMethod().getElementName());
+ }else if(element instanceof IInjectionPointField){
+ return NLS.bind(CDIUIMessages.INJECTION_POINT_LABEL_PROVIDER_EVENT, ((IInjectionPointField)element).getField().getDeclaringType().getElementName(), ((IInjectionPointField)element).getField().getElementName());
+ }else if(element instanceof IInjectionPointMethod){
+ return NLS.bind(CDIUIMessages.INJECTION_POINT_LABEL_PROVIDER_EVENT, ((IInjectionPointMethod)element).getMethod().getDeclaringType().getElementName(), ((IInjectionPointMethod)element).getMethod().getElementName());
+ }else if(element instanceof IInjectionPointParameter){
+ return NLS.bind(CDIUIMessages.INJECTION_POINT_LABEL_PROVIDER_EVENT, ((IInjectionPointParameter)element).getBeanMethod().getMethod().getDeclaringType().getElementName(), ((IInjectionPointParameter)element).getBeanMethod().getMethod().getElementName());
}else
return ""; //$NON-NLS-1$
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointMatchPresentation.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointMatchPresentation.java 2011-04-15 16:44:43 UTC (rev 30595)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointMatchPresentation.java 2011-04-15 16:50:51 UTC (rev 30596)
@@ -16,6 +16,10 @@
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.search.ui.text.Match;
import org.eclipse.ui.PartInitException;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IInjectionPointField;
+import org.jboss.tools.cdi.core.IInjectionPointMethod;
+import org.jboss.tools.cdi.core.IInjectionPointParameter;
import org.jboss.tools.cdi.ui.CDIUIPlugin;
public class InjectionPointMatchPresentation implements IMatchPresentation {
@@ -27,14 +31,26 @@
public void showMatch(Match match, int currentOffset, int currentLength,
boolean activate) throws PartInitException {
- if(match instanceof InjectionPointMatch){
- try{
- JavaUI.openInEditor(((InjectionPointMatch)match).getBean().getBeanClass());
- }catch(JavaModelException ex){
- CDIUIPlugin.getDefault().logError(ex);
- }catch(PartInitException ex){
- CDIUIPlugin.getDefault().logError(ex);
+
+ try{
+ if(match instanceof BeanMatch){
+ JavaUI.openInEditor(((BeanMatch)match).getBean().getBeanClass());
+ }else if(match instanceof ObserverMethodMatch){
+ JavaUI.openInEditor(((ObserverMethodMatch)match).getObserverMethod().getMethod());
+ }else if(match instanceof EventMatch){
+ IInjectionPoint iPoint = ((EventMatch)match).getEvent();
+ if(iPoint instanceof IInjectionPointField){
+ JavaUI.openInEditor(((IInjectionPointField)iPoint).getField());
+ }else if(iPoint instanceof IInjectionPointMethod){
+ JavaUI.openInEditor(((IInjectionPointMethod)iPoint).getMethod());
+ }else if(iPoint instanceof IInjectionPointParameter){
+ JavaUI.openInEditor(((IInjectionPointParameter)iPoint).getBeanMethod().getMethod());
+ }
}
+ }catch(JavaModelException ex){
+ CDIUIPlugin.getDefault().logError(ex);
+ }catch(PartInitException ex){
+ CDIUIPlugin.getDefault().logError(ex);
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java 2011-04-15 16:44:43 UTC (rev 30595)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java 2011-04-15 16:50:51 UTC (rev 30596)
@@ -10,36 +10,37 @@
******************************************************************************/
package org.jboss.tools.cdi.ui.search;
+import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IAnnotatable;
-import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.ISourceRange;
-import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
-import org.eclipse.jdt.internal.core.Member;
import org.eclipse.jdt.ui.search.ElementQuerySpecification;
import org.eclipse.jdt.ui.search.IMatchPresentation;
import org.eclipse.jdt.ui.search.IQueryParticipant;
import org.eclipse.jdt.ui.search.ISearchRequestor;
import org.eclipse.jdt.ui.search.QuerySpecification;
import org.eclipse.search.ui.text.Match;
-import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.CDICorePlugin;
import org.jboss.tools.cdi.core.CDIUtil;
import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IBeanMethod;
import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IObserverMethod;
+import org.jboss.tools.cdi.core.IParameter;
public class InjectionPointQueryParticipant implements IQueryParticipant{
+ ArrayList<Object> objects = new ArrayList<Object>();
public int estimateTicks(QuerySpecification specification) {
return 10;
@@ -53,6 +54,8 @@
QuerySpecification querySpecification, IProgressMonitor monitor)
throws CoreException {
+ objects.clear();
+
if(querySpecification instanceof ElementQuerySpecification){
if (!isSearchForReferences(querySpecification.getLimitTo()))
return;
@@ -76,30 +79,69 @@
Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
- if (element instanceof IAnnotatable) {
- IAnnotatable annotatable = (IAnnotatable)element;
-
- IAnnotation annotation = annotatable.getAnnotation(CDIConstants.INJECT_ANNOTATION_TYPE_NAME);
- if (annotation == null)
- return;
- IInjectionPoint injectionPoint = CDIUtil.findInjectionPoint(beans, element, 0);
- if(injectionPoint != null){
- Set<IBean> resultBeanSet = cdiProject.getBeans(false, injectionPoint);
- List<IBean> resultBeanList = CDIUtil.sortBeans(resultBeanSet);
- for(IBean bean : resultBeanList){
- if(bean != null){
- IType type = bean.getBeanClass();
- ISourceRange range = ((Member)type).getNameRange();
- Match match = new InjectionPointMatch(bean, range.getOffset(), range.getLength());
+ IInjectionPoint injectionPoint = CDIUtil.findInjectionPoint(beans, element, 0);
+ if(injectionPoint != null){
+ Set<IBean> resultBeanSet = cdiProject.getBeans(false, injectionPoint);
+ List<IBean> resultBeanList = CDIUtil.sortBeans(resultBeanSet);
+ for(IBean bean : resultBeanList){
+ if(bean != null){
+ if(!objects.contains(bean)){
+ Match match = new BeanMatch(bean);
requestor.reportMatch(match);
+ objects.add(bean);
}
}
}
+ Set<IObserverMethod> observerMethods = cdiProject.resolveObserverMethods(injectionPoint);
+ for(IObserverMethod observerMethod : observerMethods){
+ // match observer method
+ if(!objects.contains(observerMethod)){
+ Match match = new ObserverMethodMatch(observerMethod);
+ requestor.reportMatch(match);
+ objects.add(observerMethod);
+ }
+ }
}
+ if(element instanceof IMethod){
+ IParameter param = findObserverParameter(beans, (IMethod)element);
+ if(param != null){
+ Set<IInjectionPoint> events = cdiProject.findObservedEvents(param);
+ for(IInjectionPoint event : events){
+ // match event
+ if(!objects.contains(event)){
+ Match match = new EventMatch(event);
+ requestor.reportMatch(match);
+ objects.add(event);
+ }
+ }
+ }
+ }
}
}
}
+ private IParameter findObserverParameter(Set<IBean> beans, IMethod method) throws JavaModelException {
+ for (IBean bean: beans) {
+ if(bean instanceof IClassBean) {
+ Set<IBeanMethod> observers = ((IClassBean)bean).getObserverMethods();
+ for (IBeanMethod bm: observers) {
+ if(bm instanceof IObserverMethod) {
+ if(bm.getMethod().equals(method)){
+ IObserverMethod obs = (IObserverMethod)bm;
+ Set<IParameter> ps = obs.getObservedParameters();
+ if(!ps.isEmpty()) {
+ return ps.iterator().next();
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+
public boolean isSearchForReferences(int limitTo) {
int maskedLimitTo = limitTo & ~(IJavaSearchConstants.IGNORE_DECLARING_TYPE+IJavaSearchConstants.IGNORE_RETURN_TYPE);
if (maskedLimitTo == IJavaSearchConstants.REFERENCES || maskedLimitTo == IJavaSearchConstants.ALL_OCCURRENCES) {
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/ObserverMethodMatch.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/ObserverMethodMatch.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/ObserverMethodMatch.java 2011-04-15 16:50:51 UTC (rev 30596)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.ui.search;
+
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.search.ui.text.Match;
+import org.jboss.tools.cdi.core.IObserverMethod;
+import org.jboss.tools.cdi.ui.CDIUIPlugin;
+
+public class ObserverMethodMatch extends Match {
+ private IObserverMethod observerMethod;
+
+ public ObserverMethodMatch(IObserverMethod observerMethod) {
+ super(observerMethod, 0, 0);
+ try{
+ ISourceRange range = observerMethod.getMethod().getNameRange();
+ setOffset(range.getOffset());
+ setLength(range.getLength());
+ }catch(JavaModelException ex){
+ CDIUIPlugin.getDefault().logError(ex);
+ }
+
+ this.observerMethod = observerMethod;
+ }
+
+ public IObserverMethod getObserverMethod(){
+ return observerMethod;
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/ObserverMethodMatch.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 7 months
JBoss Tools SVN: r30595 - in branches/jbosstools-3.2.x/modeshape: plugins/org.jboss.tools.modeshape.rest/META-INF and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2011-04-15 12:44:43 -0400 (Fri, 15 Apr 2011)
New Revision: 30595
Added:
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/package-info.java
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesEditor.java
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesModel.java
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesPreferencePage.java
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ResourcePattern.java
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/package-info.java
branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/preferences/
branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesModelTest.java
branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilterTest.java
branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/preferences/ResourcePatternTest.java
Removed:
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FileFiltersPreferencePage.java
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFileExtensionEditor.java
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFoldersEditor.java
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PrefUtils.java
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/SortedListEditor.java
Modified:
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF/MANIFEST.MF
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.properties
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.xml
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/IUiConstants.java
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Utils.java
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ModeShapePreferencePage.java
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilter.java
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/prefs.properties
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java
branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/test/AllTests.java
Log:
JBIDE-7857 ModeShape preferences should match the "Team"->"Ignored Resources." Removed the file and folder name prefernces and added an ignored resources preference. The prefernce page was changed to match the "Team" preference page look and behavior.
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF/MANIFEST.MF 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF/MANIFEST.MF 2011-04-15 16:44:43 UTC (rev 30595)
@@ -20,6 +20,7 @@
.
Export-Package: javax.jcr.nodetype,
org.jboss.tools.modeshape.rest,
+ org.jboss.tools.modeshape.rest.preferences,
org.modeshape.common.i18n,
org.modeshape.web.jcr.rest.client,
org.modeshape.web.jcr.rest.client.domain
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.properties
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.properties 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.properties 2011-04-15 16:44:43 UTC (rev 30595)
@@ -14,7 +14,7 @@
contextMenu.label = ModeShape
decorator.description = Decorates objects in the ModeShape View
decorator.label = ModeShape View Decorator
-fileFiltersPreferencePage = File Filters
+ignoredResourcesPreferencePage = Ignored Resources
modeShapeCategory = ModeShape
preferenceInitializer = Preference Initializer for default values
publishCommand.name = Publish
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.xml
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.xml 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.xml 2011-04-15 16:44:43 UTC (rev 30595)
@@ -209,14 +209,14 @@
</page>
</extension>
-<!-- File Filters Preference Page -->
+<!-- Ignored Resources Preference Page -->
<extension
point="org.eclipse.ui.preferencePages">
<page
- name="%fileFiltersPreferencePage"
+ name="%ignoredResourcesPreferencePage"
category="modeShapePreferencePage"
- class="org.jboss.tools.modeshape.rest.preferences.FileFiltersPreferencePage"
- id="modeShapeFileFiltersPreferencePage">
+ class="org.jboss.tools.modeshape.rest.preferences.IgnoredResourcesPreferencePage"
+ id="modeShapeIgnoredResourcesPreferencePage">
</page>
<!-- Preference Initializer -->
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/IUiConstants.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/IUiConstants.java 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/IUiConstants.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -90,27 +90,27 @@
* The message console help context.
*/
String MESSAGE_CONSOLE_HELP_CONTEXT = HELP_CONTEXT_PREFIX + "messageConsoleHelpContext"; //$NON-NLS-1$
-
+
/**
* The preference pages help context.
*/
String PREFERENCE_PAGE_HELP_CONTEXT = HELP_CONTEXT_PREFIX + "preferencesHelpContext"; //$NON-NLS-1$
-
+
/**
* The publish and unpublish dialog help context.
*/
String PUBLISH_DIALOG_HELP_CONTEXT = HELP_CONTEXT_PREFIX + "publishDialogHelpContext"; //$NON-NLS-1$
-
+
/**
* The server wizard and dialog page help context.
*/
String SERVER_DIALOG_HELP_CONTEXT = HELP_CONTEXT_PREFIX + "serverDialogHelpContext"; //$NON-NLS-1$
-
+
/**
* The server view help context.
*/
String SERVER_VIEW_HELP_CONTEXT = HELP_CONTEXT_PREFIX + "serverViewHelpContext"; //$NON-NLS-1$
-
+
}
/**
@@ -122,22 +122,18 @@
* A preference that indicates if the ModeShape server should use resource versioning. If versioning is not used, only one
* copy of the resource will be persisted.
*/
- String ENABLE_RESOURCE_VERSIONING = "modeShape.preference.filteredFileExtensions"; //$NON-NLS-1$
+ String ENABLE_RESOURCE_VERSIONING = "modeShape.preference.enableResourceVersioning"; //$NON-NLS-1$
/**
- * A preference for a list of file extensions that will not be part of publishing operations.
+ * A preference for a list of ignored resource patterns. Files or folders whose name matches on of the patterns will not be
+ * part of publishing operations.
*/
- String FILTERED_FILE_EXTENSIONS_PREFERENCE = "modeShape.preference.filteredFileExtensions"; //$NON-NLS-1$
+ String IGNORED_RESOURCES_PREFERENCE = "modeShape.preference.ignoredResources"; //$NON-NLS-1$
/**
- * A preference for a list of folder names whose contents will not be part of publishing operations.
+ * The ignored resources preference page ID.
*/
- String FILTERED_FOLDER_NAMES_PREFERENCE = "modeShape.preference.filteredFolderNames"; //$NON-NLS-1$
-
- /**
- * The file and folder preference page ID.
- */
- String FILTERS_PREFERENCE_PAGE_ID = "modeShapeFileFiltersPreferencePage"; //$NON-NLS-1$
+ String IGNORED_RESOURCES_PREFERENCE_PAGE_ID = "modeShapeIgnoredResourcesPreferencePage"; //$NON-NLS-1$
/**
* The main ModeShape preference page ID.
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -38,19 +38,15 @@
public static I18n errorRestoringServerRegistry;
public static I18n errorSavingServerRegistry;
- public static I18n fileFiltersPreferencePageDescription;
- public static I18n fileFiltersPreferencePageFilteredFileExtensionsLabel;
- public static I18n fileFiltersPreferencePageFilteredFolderNamesLabel;
- public static I18n fileFiltersPreferencePageMessage;
- public static I18n fileFiltersPreferencePageTitle;
+ public static I18n ignoredResourcesPreferencePageDescription;
+ public static I18n ignoredResourcesPreferencePageLabel;
+ public static I18n ignoredResourcesPreferencePageMessage;
+ public static I18n ignoredResourcesPreferencePageTitle;
public static I18n missingImage;
- public static I18n newFilteredFileExtensionDialogLabel;
- public static I18n newFilteredFileExtensionDialogTitle;
-
- public static I18n newFilteredFolderNameDialogLabel;
- public static I18n newFilteredFolderNameDialogTitle;
+ public static I18n newIgnoredResourceDialogLabel;
+ public static I18n newIgnoredResourceDialogTitle;
public static I18n newItemDialogValueExists;
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2011-04-15 16:44:43 UTC (rev 30595)
@@ -30,19 +30,15 @@
errorRestoringServerRegistry = Error trying to restore the server registry from file "{0}"
errorSavingServerRegistry = Error trying to save the server registry to "{0}"
-fileFiltersPreferencePageDescription = 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.
-fileFiltersPreferencePageFilteredFileExtensionsLabel = Filtered File Extensions:
-fileFiltersPreferencePageFilteredFolderNamesLabel = Filtered Folder Names:
-fileFiltersPreferencePageMessage = File Filters
-fileFiltersPreferencePageTitle = File Filters
+ignoredResourcesPreferencePageDescription = Use this page to specify a list of file and folder name patterns to exclude from publishing operations. \n\nIgnore Patterns:
+ignoredResourcesPreferencePageLabel = Ignore Patterns:
+ignoredResourcesPreferencePageMessage = Ignored Resources
+ignoredResourcesPreferencePageTitle = Ignored Resources
missingImage = The following image cannot be found "{0}"
-newFilteredFileExtensionDialogLabel = File extension:
-newFilteredFileExtensionDialogTitle = New Filtered File Extension
-
-newFilteredFolderNameDialogLabel = Folder name:
-newFilteredFolderNameDialogTitle = New Filtered Folder Name
+newIgnoredResourceDialogLabel = Enter a file name or folder name (* = any string, ? = and character):
+newIgnoredResourceDialogTitle = New Ignore Pattern
newItemDialogValueExists = Value already exists
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Utils.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Utils.java 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Utils.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -12,11 +12,9 @@
package org.jboss.tools.modeshape.rest;
import static org.jboss.tools.modeshape.rest.IUiConstants.PLUGIN_ID;
+
import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.StringTokenizer;
-import java.util.TreeSet;
+
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
@@ -27,28 +25,7 @@
public final class Utils {
- // ===========================================================================================================================
- // Class Methods
- // ===========================================================================================================================
-
/**
- * @param tokens the tokens being combined into one value (never <code>null</code>)
- * @param delimiter the character inserted to separate each token
- * @return the tokens separated by the delimiter
- */
- public static String combineTokens( String[] tokens,
- char delimiter ) {
- CheckArg.isNotNull(tokens, "tokens");
- StringBuilder value = new StringBuilder();
-
- for (String token : tokens) {
- value.append(token).append(delimiter);
- }
-
- return value.toString();
- }
-
- /**
* Converts the non-Eclipse status severity to an Eclipse severity level. An {@link Status.Severity#UNKNOWN unknown status} is
* converted to {@link IStatus#CANCEL cancel}.
*
@@ -84,7 +61,7 @@
* @return the Eclipse status object (never <code>null</code>)
*/
public static IStatus convert( Status status ) {
- CheckArg.isNotNull(status, "status");
+ CheckArg.isNotNull(status, "status"); //$NON-NLS-1$
return new org.eclipse.core.runtime.Status(convertSeverity(status.getSeverity()), PLUGIN_ID, status.getMessage(),
status.getException());
}
@@ -96,7 +73,7 @@
* @return the image or <code>null</code> if no associated image for the status severity
*/
public static Image getImage( Status status ) {
- CheckArg.isNotNull(status, "status");
+ CheckArg.isNotNull(status, "status"); //$NON-NLS-1$
String imageId = null;
if (status.isError()) {
@@ -115,38 +92,13 @@
}
/**
- * @param string the string whose tokens are being requested (may be <code>null</code>)
- * @param delimiters the delimiters that separate the tokens (never <code>null</code>)
- * @param removeDuplicates a flag indicating if duplicate tokens should be removed
- * @return the tokens (never <code>null</code>)
- */
- public static String[] getTokens( String string,
- String delimiters,
- boolean removeDuplicates ) {
- CheckArg.isNotNull(delimiters, "delimiters");
-
- if (string == null) {
- return new String[0];
- }
-
- Collection<String> tokens = removeDuplicates ? new TreeSet<String>() : new ArrayList<String>();
- StringTokenizer st = new StringTokenizer(string, delimiters);
-
- while (st.hasMoreTokens()) {
- tokens.add(st.nextToken());
- }
-
- return tokens.toArray(new String[tokens.size()]);
- }
-
- /**
* The image can be used to decorate an existing image.
*
* @param status the status whose image overlay is being requested (never <code>null</code>)
* @return the image descriptor or <code>null</code> if none found for the status severity
*/
public static ImageDescriptor getOverlayImage( Status status ) {
- CheckArg.isNotNull(status, "status");
+ CheckArg.isNotNull(status, "status"); //$NON-NLS-1$
String imageId = null;
if (status.isError()) {
Added: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/package-info.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/package-info.java (rev 0)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/package-info.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -0,0 +1,16 @@
+/*
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ *
+ * This software is made available by Red Hat, Inc. 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.
+ */
+/**
+ * The ModeShape REST Client Eclipse jobs package defines the Eclipse jobs that are needed to publish, unpublish, and manage
+ * the server registry.
+ */
+package org.jboss.tools.modeshape.rest.jobs;
\ No newline at end of file
Property changes on: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/package-info.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FileFiltersPreferencePage.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FileFiltersPreferencePage.java 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FileFiltersPreferencePage.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -1,180 +0,0 @@
-/*
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.
- *
- * This software is made available by Red Hat, Inc. 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.HelpContexts.PREFERENCE_PAGE_HELP_CONTEXT;
-import static org.jboss.tools.modeshape.rest.RestClientI18n.fileFiltersPreferencePageDescription;
-import static org.jboss.tools.modeshape.rest.RestClientI18n.fileFiltersPreferencePageMessage;
-import static org.jboss.tools.modeshape.rest.RestClientI18n.fileFiltersPreferencePageTitle;
-
-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>FileFiltersPreferencePage</code> is the UI for managing all file extension and folder name filter preferences.
- */
-public final class FileFiltersPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
- /**
- * 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;
-
- /**
- * {@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 fileFiltersPreferencePageDescription.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 fileFiltersPreferencePageMessage.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 fileFiltersPreferencePageTitle.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();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean)
- */
- @Override
- public void setVisible( boolean visible ) {
- super.setVisible(visible);
-
- if (visible) {
- this.extensionsEditor.setFocus();
- }
- }
-
-}
Deleted: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFileExtensionEditor.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFileExtensionEditor.java 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFileExtensionEditor.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -1,97 +0,0 @@
-/*
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.
- *
- * This software is made available by Red Hat, Inc. 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.Preferences.FILTERED_FILE_EXTENSIONS_PREFERENCE;
-import static org.jboss.tools.modeshape.rest.RestClientI18n.fileFiltersPreferencePageFilteredFileExtensionsLabel;
-import static org.jboss.tools.modeshape.rest.RestClientI18n.newFilteredFileExtensionDialogLabel;
-import static org.jboss.tools.modeshape.rest.RestClientI18n.newFilteredFileExtensionDialogTitle;
-
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.jboss.tools.modeshape.rest.Utils;
-
-/**
- * The <code>FilteredFileExtensionEditor</code> is an editor for managing a set of filtered file extensions.
- */
-public final class FilteredFileExtensionEditor extends SortedListEditor implements VerifyListener {
-
- /**
- * The filter that removes resources, with specific file extensions, from publishing operations (never <code>null</code>).
- */
- private final PublishingFileFilter filter;
-
- /**
- * @param parent the parent control
- */
- public FilteredFileExtensionEditor( Composite parent ) {
- super(FILTERED_FILE_EXTENSIONS_PREFERENCE, fileFiltersPreferencePageFilteredFileExtensionsLabel.text(), parent);
- this.filter = new PublishingFileFilter();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.preference.ListEditor#createList(java.lang.String[])
- */
- @Override
- protected String createList( String[] items ) {
- return Utils.combineTokens(items, this.filter.getFileExtensionDelimiter());
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.rest.preferences.SortedListEditor#getNewItemDialogLabel()
- */
- @Override
- protected String getNewItemDialogLabel() {
- return newFilteredFileExtensionDialogLabel.text();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.rest.preferences.SortedListEditor#getNewItemDialogTitle()
- */
- @Override
- protected String getNewItemDialogTitle() {
- return newFilteredFileExtensionDialogTitle.text();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.preference.ListEditor#parseString(java.lang.String)
- */
- @Override
- protected String[] parseString( String stringList ) {
- return Utils.getTokens(stringList, Character.toString(this.filter.getFileExtensionDelimiter()), true);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.VerifyListener#verifyText(org.eclipse.swt.events.VerifyEvent)
- */
- @Override
- public void verifyText( VerifyEvent event ) {
- for (char c : this.filter.getFileExtensionInvalidCharacters().toCharArray()) {
- if (c == event.character) {
- event.doit = false;
- break;
- }
- }
- }
-
-}
Deleted: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFoldersEditor.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFoldersEditor.java 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFoldersEditor.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -1,97 +0,0 @@
-/*
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.
- *
- * This software is made available by Red Hat, Inc. 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.Preferences.FILTERED_FOLDER_NAMES_PREFERENCE;
-import static org.jboss.tools.modeshape.rest.RestClientI18n.fileFiltersPreferencePageFilteredFolderNamesLabel;
-import static org.jboss.tools.modeshape.rest.RestClientI18n.newFilteredFolderNameDialogLabel;
-import static org.jboss.tools.modeshape.rest.RestClientI18n.newFilteredFolderNameDialogTitle;
-
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.jboss.tools.modeshape.rest.Utils;
-
-/**
- * The <code>FilteredFoldersEditor</code> is an editor for managing a set of folder names.
- */
-public final class FilteredFoldersEditor extends SortedListEditor implements VerifyListener {
-
- /**
- * The filter that removes resources, contained in specific folders, from publishing operations (never <code>null</code>).
- */
- private final PublishingFileFilter filter;
-
- /**
- * @param parent the parent control
- */
- public FilteredFoldersEditor( Composite parent ) {
- super(FILTERED_FOLDER_NAMES_PREFERENCE, fileFiltersPreferencePageFilteredFolderNamesLabel.text(), parent);
- this.filter = new PublishingFileFilter();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.preference.ListEditor#createList(java.lang.String[])
- */
- @Override
- protected String createList( String[] items ) {
- return Utils.combineTokens(items, this.filter.getFolderNameDelimiter());
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.rest.preferences.SortedListEditor#getNewItemDialogLabel()
- */
- @Override
- protected String getNewItemDialogLabel() {
- return newFilteredFolderNameDialogLabel.text();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.jboss.tools.modeshape.rest.preferences.SortedListEditor#getNewItemDialogTitle()
- */
- @Override
- protected String getNewItemDialogTitle() {
- return newFilteredFolderNameDialogTitle.text();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.preference.ListEditor#parseString(java.lang.String)
- */
- @Override
- protected String[] parseString( String stringList ) {
- return Utils.getTokens(stringList, Character.toString(this.filter.getFolderNameDelimiter()), true);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.VerifyListener#verifyText(org.eclipse.swt.events.VerifyEvent)
- */
- @Override
- public void verifyText( VerifyEvent event ) {
- for (char c : this.filter.getFolderNameInvalidCharacters().toCharArray()) {
- if (c == event.character) {
- event.doit = false;
- break;
- }
- }
- }
-
-}
Added: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesEditor.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesEditor.java (rev 0)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesEditor.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -0,0 +1,539 @@
+/*
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ *
+ * This software is made available by Red Hat, Inc. 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.Preferences.IGNORED_RESOURCES_PREFERENCE;
+import static org.jboss.tools.modeshape.rest.RestClientI18n.ignoredResourcesPreferencePageLabel;
+import static org.jboss.tools.modeshape.rest.RestClientI18n.newIgnoredResourceDialogLabel;
+import static org.jboss.tools.modeshape.rest.RestClientI18n.newIgnoredResourceDialogTitle;
+
+import java.util.Collection;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableLayout;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.ISharedImages;
+import org.jboss.tools.modeshape.rest.Activator;
+import org.jboss.tools.modeshape.rest.RestClientI18n;
+
+/**
+ * The <code>IgnoredResourcesEditor</code> is an editor for managing a set of ignored resources.
+ */
+public final class IgnoredResourcesEditor extends FieldEditor {
+
+ private Button btnAdd;
+
+ private Button btnRemove;
+
+ /**
+ * The data model (never <code>null</code>).
+ */
+ private IgnoredResourcesModel model;
+
+ private TableViewer viewer;
+
+ /**
+ * @param parent the parent control
+ */
+ public IgnoredResourcesEditor( Composite parent ) {
+ super(IGNORED_RESOURCES_PREFERENCE, ignoredResourcesPreferencePageLabel.text(), parent);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.FieldEditor#adjustForNumColumns(int)
+ */
+ @Override
+ protected void adjustForNumColumns( int numColumns ) {
+ Control control = getLabelControl();
+ ((GridData)control.getLayoutData()).horizontalSpan = numColumns;
+ ((GridData)this.viewer.getControl().getLayoutData()).horizontalSpan = numColumns - 1;
+ }
+
+ /**
+ * Creates a push button.
+ *
+ * @param parent the parent control
+ * @param key the resource name used to supply the button's label text
+ * @return the button (never <code>null</code>)
+ */
+ private Button createPushButton( Composite parent,
+ String key ) {
+ Button button = new Button(parent, SWT.PUSH);
+ button.setText(JFaceResources.getString(key));
+ button.setFont(parent.getFont());
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ int widthHint = convertHorizontalDLUsToPixels(button, IDialogConstants.BUTTON_WIDTH);
+ data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
+ button.setLayoutData(data);
+ return button;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.FieldEditor#doFillIntoGrid(org.eclipse.swt.widgets.Composite, int)
+ */
+ @Override
+ protected void doFillIntoGrid( Composite parent,
+ int numColumns ) {
+ // create table
+ this.viewer = new TableViewer(parent, (SWT.CHECK | SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.BORDER));
+
+ this.viewer.setContentProvider(new IStructuredContentProvider() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
+ @Override
+ public void dispose() {
+ // nothing to do
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
+ @Override
+ public Object[] getElements( Object inputElement ) {
+ return getPatterns().toArray();
+ }
+
+ /**
+ * {@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
+ }
+ });
+
+ // sort the table rows by resource name pattern
+ this.viewer.setComparator(new ViewerComparator() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object,
+ * java.lang.Object)
+ */
+ @Override
+ public int compare( Viewer viewer,
+ Object e1,
+ Object e2 ) {
+ ResourcePattern pattern1 = (ResourcePattern)e1;
+ ResourcePattern pattern2 = (ResourcePattern)e2;
+
+ return pattern1.getPattern().compareTo(pattern2.getPattern());
+ }
+ });
+
+ this.viewer.setLabelProvider(new LabelProvider() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText( Object element ) {
+ return ((ResourcePattern)element).getPattern();
+ }
+ });
+
+ Table table = this.viewer.getTable();
+ table.setLayout(new TableLayout());
+ table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ table.addListener(SWT.Selection, new Listener() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
+ */
+ @Override
+ public void handleEvent( Event event ) {
+ if (event.detail == SWT.CHECK) {
+ handlePatternChecked((TableItem)event.item);
+ } else {
+ handlePatternSelected();
+ }
+ }
+ });
+
+ // create buttons
+ Composite pnlButtons = new Composite(parent, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ layout.marginWidth = 0;
+ pnlButtons.setLayout(layout);
+ pnlButtons.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
+
+ this.btnAdd = createPushButton(pnlButtons, "ListEditor.add");//$NON-NLS-1$
+ this.btnAdd.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ handleAddPressed();
+ }
+ });
+
+ this.btnRemove = createPushButton(pnlButtons, "ListEditor.remove");//$NON-NLS-1$
+ this.btnRemove.setEnabled(false);
+ this.btnRemove.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ handleRemovePressed();
+ }
+ });
+
+ this.model = new IgnoredResourcesModel(); // model must be created before setInput is called
+ this.viewer.setInput(this); // doesn't matter what you pass in
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.FieldEditor#doLoad()
+ */
+ @Override
+ protected void doLoad() {
+ // load model from current preference value and refresh UI
+ String prefValue = getPreferenceStore().getString(getPreferenceName());
+ this.model.load(prefValue);
+ refreshUi();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.FieldEditor#doLoadDefault()
+ */
+ @Override
+ protected void doLoadDefault() {
+ // load model from default preference value and refresh UI
+ String prefValue = getPreferenceStore().getDefaultString(getPreferenceName());
+ this.model.load(prefValue);
+ refreshUi();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.FieldEditor#doStore()
+ */
+ @Override
+ protected void doStore() {
+ getPreferenceStore().setValue(getPreferenceName(), this.model.createList());
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.FieldEditor#getNumberOfControls()
+ */
+ @Override
+ public int getNumberOfControls() {
+ return 2;
+ }
+
+ Collection<ResourcePattern> getPatterns() {
+ return this.model.getPatterns();
+ }
+
+ /**
+ * Handler for when add button is pressed.
+ */
+ void handleAddPressed() {
+ // display dialog to get new pattern from user
+ NewPatternDialog dialog = new NewPatternDialog(this.btnAdd.getShell(), getPatterns());
+
+ if (dialog.open() == Window.OK) {
+ // update model and UI
+ this.model.addPattern(new ResourcePattern(dialog.getNewPattern(), true));
+ refreshUi();
+ }
+ }
+
+ /**
+ * @param item the item whose checked state has been changed (may not be <code>null</code>)
+ */
+ void handlePatternChecked( TableItem item ) {
+ ResourcePattern pattern = (ResourcePattern)item.getData();
+ pattern.setEnabled(item.getChecked());
+ }
+
+ /**
+ * Handler for when pattern is selected.
+ */
+ void handlePatternSelected() {
+ IStructuredSelection selection = (IStructuredSelection)this.viewer.getSelection();
+ boolean enable = !selection.isEmpty();
+
+ if (this.btnRemove.getEnabled() != enable) {
+ this.btnRemove.setEnabled(enable);
+ }
+ }
+
+ /**
+ * Handler for when the remove button is pressed.
+ */
+ void handleRemovePressed() {
+ assert (!this.viewer.getSelection().isEmpty());
+ Object pattern = ((IStructuredSelection)this.viewer.getSelection()).getFirstElement();
+ this.model.removePattern((ResourcePattern)pattern);
+ refreshUi();
+ }
+
+ /**
+ * Updates the check state of each table item to reflect the appropriate value in the model.
+ */
+ private void initializeCheckBoxStates() {
+ for (TableItem item : this.viewer.getTable().getItems()) {
+ ResourcePattern pattern = (ResourcePattern)item.getData();
+
+ if (pattern.isEnabled()) {
+ item.setChecked(true);
+ }
+ }
+ }
+
+ /**
+ * Refreshes the viewer.
+ */
+ private void refreshUi() {
+ this.viewer.refresh();
+ initializeCheckBoxStates();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.FieldEditor#setFocus()
+ */
+ @Override
+ public void setFocus() {
+ this.viewer.getControl().setFocus();
+ }
+
+ /**
+ * A <code>NewPatternDialog</code> allows the user to enter a pattern.
+ */
+ class NewPatternDialog extends Dialog implements ModifyListener {
+
+ /**
+ * The existing ignored resource patterns.
+ */
+ private final Collection<ResourcePattern> existingPatterns;
+
+ /**
+ * A message for the user.
+ */
+ private CLabel lblMessage;
+
+ /**
+ * The contents of the new pattern text field.
+ */
+ private String newPattern;
+
+ /**
+ * @param parentShell the parent shell (can be <code>null</code>)
+ * @param existingPatterns the existing patterns (can be <code>null</code> or empty)
+ */
+ public NewPatternDialog( Shell parentShell,
+ Collection<ResourcePattern> existingPatterns ) {
+ super(parentShell);
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ this.existingPatterns = existingPatterns;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+ */
+ @Override
+ protected void configureShell( Shell newShell ) {
+ newShell.setText(newIgnoredResourceDialogTitle.text());
+ super.configureShell(newShell);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#createButton(org.eclipse.swt.widgets.Composite, int, java.lang.String, boolean)
+ */
+ @Override
+ protected Button createButton( Composite parent,
+ int id,
+ String label,
+ boolean defaultButton ) {
+ Button button = super.createButton(parent, id, label, defaultButton);
+
+ // disable OK button initially
+ if (id == OK) {
+ button.setEnabled(false);
+ }
+
+ return button;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createDialogArea( Composite parent ) {
+ Composite panel = (Composite)super.createDialogArea(parent);
+ Composite pnlEditor = new Composite(panel, SWT.NONE);
+ pnlEditor.setLayout(new GridLayout());
+ pnlEditor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ Label label = new Label(pnlEditor, SWT.NONE);
+ label.setLayoutData(new GridData(SWT.LEFT, SWT.NONE, false, false));
+ label.setText(newIgnoredResourceDialogLabel.text());
+
+ Text textField = new Text(pnlEditor, SWT.BORDER);
+ textField.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
+ textField.addModifyListener(this);
+ textField.addVerifyListener(new VerifyListener() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.VerifyListener#verifyText(org.eclipse.swt.events.VerifyEvent)
+ */
+ @Override
+ public void verifyText( VerifyEvent e ) {
+ // don't allow slashes as input
+ if (e.text.contains("\\") || e.text.contains("/")) { //$NON-NLS-1$ //$NON-NLS-2$
+ e.doit = false;
+ }
+ }
+ });
+
+ // add image and message labels
+ this.lblMessage = new CLabel(pnlEditor, SWT.NONE);
+ this.lblMessage.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
+ ((GridData)this.lblMessage.getLayoutData()).horizontalSpan = 2;
+
+ return panel;
+ }
+
+ /**
+ * @return the new pattern name or <code>null</code> if the dialog was canceled
+ */
+ public String getNewPattern() {
+ if (getReturnCode() == OK) {
+ return this.newPattern;
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#initializeBounds()
+ */
+ @Override
+ protected void initializeBounds() {
+ super.initializeBounds();
+
+ // resize shell to be twice the width needed for the title (without this the title maybe cropped)
+ int width = (4 * convertWidthInCharsToPixels(newIgnoredResourceDialogTitle.text().length()));
+ Rectangle rectangle = getShell().getBounds();
+ getShell().setBounds(rectangle.x, rectangle.y, width, rectangle.height);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ @Override
+ public void modifyText( ModifyEvent event ) {
+ // clear message
+ this.lblMessage.setImage(null);
+ this.lblMessage.setText(""); //$NON-NLS-1$
+
+ // enable/disable OK button
+ this.newPattern = ((Text)event.widget).getText();
+
+ // make sure at least one character entered
+ boolean enable = (this.newPattern.length() != 0);
+
+ // make sure value is not a disallowed value
+ if (enable && (this.existingPatterns != null)) {
+ for (ResourcePattern pattern : this.existingPatterns) {
+ if (this.newPattern.equals(pattern.getPattern())) {
+ enable = false;
+ this.lblMessage.setImage(Activator.getDefault().getSharedImage(ISharedImages.IMG_OBJS_INFO_TSK));
+ this.lblMessage.setText(RestClientI18n.newItemDialogValueExists.text());
+ break;
+ }
+ }
+ }
+
+ // set enabled state if different than current state
+ if (getButton(OK).getEnabled() != enable) {
+ getButton(OK).setEnabled(enable);
+ }
+ }
+
+ }
+
+}
Property changes on: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesEditor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesModel.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesModel.java (rev 0)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesModel.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -0,0 +1,127 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ *
+ * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
+ *
+ * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
+ */
+package org.jboss.tools.modeshape.rest.preferences;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.modeshape.common.util.CheckArg;
+
+/**
+ * The <code>IgnoredResourcesModel</code> class is used to keep track of ignored resources patterns used for resources publishing
+ * operations.
+ */
+public final class IgnoredResourcesModel {
+
+ /**
+ * Delimiter used when creating a single string representative of all patterns. Also used when parsing.
+ *
+ * @see #createList()
+ * @see #load(String)
+ */
+ private final static char DELIMITER = '\n';
+
+ /**
+ * Combines the ignored resource patterns into a single string. This method is the converse of <code>load</code>.
+ *
+ * @param patterns the patterns that will be combined into a string representation (never <code>null</code>)
+ * @return the string representation of the specified patterns (never <code>null</code> but can be empty)
+ */
+ public static String createList( ResourcePattern... patterns ) {
+ StringBuilder value = new StringBuilder();
+
+ for (ResourcePattern pattern : patterns) {
+ value.append(pattern.getPattern()).append(DELIMITER).append(pattern.isEnabled()).append(DELIMITER);
+ }
+
+ return value.toString();
+ }
+
+ /**
+ * @param stringList a string representation of zero or more patterns (may be <code>null</code> or empty)
+ * @return the patterns parsed from the string (never <code>null</code> but can be empty)
+ */
+ public ResourcePattern[] parseList( String stringList ) {
+ if ((stringList != null) && !stringList.equals("")) { //$NON-NLS-1$
+ StringTokenizer st = new StringTokenizer(stringList, Character.toString(DELIMITER));
+ ResourcePattern[] patterns = new ResourcePattern[(st.countTokens() > 0) ? (st.countTokens() / 2) : 0];
+ int i = 0;
+
+ while (st.hasMoreTokens()) {
+ String pattern = st.nextToken();
+ boolean enabled = Boolean.parseBoolean(st.nextToken());
+ patterns[i++] = new ResourcePattern(pattern, enabled);
+ }
+
+ return patterns;
+ }
+
+ return new ResourcePattern[0];
+ }
+
+ /**
+ * The patterns included in this model (never <code>null</code>).
+ */
+ private final Set<ResourcePattern> patterns = new HashSet<ResourcePattern>();
+
+ /**
+ * Adds the specified pattern if one with that same pattern does not already exist.
+ *
+ * @param pattern the pattern being added (may not be <code>null</code>)
+ */
+ public void addPattern( ResourcePattern pattern ) {
+ CheckArg.isNotNull(pattern, "pattern"); //$NON-NLS-1$
+ this.patterns.add(pattern);
+ }
+
+ /**
+ * Combines the ignored resource patterns into a single string. This method is the converse of <code>load</code>.
+ *
+ * @return the combined string (never <code>null</code> but can be empty)
+ * @see #load(String)
+ */
+ public String createList() {
+ return createList(this.patterns.toArray(new ResourcePattern[this.patterns.size()]));
+ }
+
+ /**
+ * @return an unmodifiable collection of patterns contained in this model (never <code>null</code>)
+ */
+ public Collection<ResourcePattern> getPatterns() {
+ return Collections.unmodifiableCollection(this.patterns);
+ }
+
+ /**
+ * Clears the current patterns and loads new patterns by parsing the specified string.
+ *
+ * @param stringList a string representation of zero or more patterns (may be <code>null</code> or empty)
+ */
+ public void load( String stringList ) {
+ this.patterns.clear();
+
+ // parse list into new patterns
+ ResourcePattern[] temp = parseList(stringList);
+
+ if (temp.length != 0) {
+ this.patterns.addAll(Arrays.asList(temp));
+ }
+ }
+
+ /**
+ * @param pattern the pattern being removed if it exists in the model (may not be <code>null</code>)
+ */
+ public void removePattern( ResourcePattern pattern ) {
+ CheckArg.isNotNull(pattern, "pattern"); //$NON-NLS-1$
+ this.patterns.remove(pattern);
+ }
+
+}
Property changes on: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesModel.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesPreferencePage.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesPreferencePage.java (rev 0)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesPreferencePage.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -0,0 +1,164 @@
+/*
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ *
+ * This software is made available by Red Hat, Inc. 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.HelpContexts.PREFERENCE_PAGE_HELP_CONTEXT;
+import static org.jboss.tools.modeshape.rest.RestClientI18n.ignoredResourcesPreferencePageDescription;
+import static org.jboss.tools.modeshape.rest.RestClientI18n.ignoredResourcesPreferencePageMessage;
+import static org.jboss.tools.modeshape.rest.RestClientI18n.ignoredResourcesPreferencePageTitle;
+
+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>IgnoredResourcesPreferencePage</code> is the UI for managing all ignored file extension and folder names.
+ */
+public final class IgnoredResourcesPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ /**
+ * The editor used to manage the list of ignored file extensions and folder names.
+ */
+ private IgnoredResourcesEditor ignoredResourcesEditor;
+
+ /**
+ * {@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.ignoredResourcesEditor = new IgnoredResourcesEditor(panel);
+ this.ignoredResourcesEditor.setPreferenceStore(getPreferenceStore());
+
+ // populate the extensions editor
+ this.ignoredResourcesEditor.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 ignoredResourcesPreferencePageDescription.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 ignoredResourcesPreferencePageMessage.text();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.PreferencePage#getPreferenceStore()
+ */
+ @Override
+ public IPreferenceStore getPreferenceStore() {
+ return Activator.getDefault().getPreferenceStore();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#getTitle()
+ */
+ @Override
+ public String getTitle() {
+ return ignoredResourcesPreferencePageTitle.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.ignoredResourcesEditor.loadDefault();
+ super.performDefaults();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.preference.PreferencePage#performOk()
+ */
+ @Override
+ public boolean performOk() {
+ this.ignoredResourcesEditor.store();
+ return super.performOk();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean)
+ */
+ @Override
+ public void setVisible( boolean visible ) {
+ super.setVisible(visible);
+
+ if (visible) {
+ this.ignoredResourcesEditor.setFocus();
+ }
+ }
+
+}
Property changes on: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesPreferencePage.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ModeShapePreferencePage.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ModeShapePreferencePage.java 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ModeShapePreferencePage.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -109,7 +109,7 @@
*/
@Override
public IPreferenceStore getPreferenceStore() {
- return PrefUtils.getPreferenceStore();
+ return Activator.getDefault().getPreferenceStore();
}
/**
Deleted: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PrefUtils.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PrefUtils.java 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PrefUtils.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -1,64 +0,0 @@
-/*
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.
- *
- * This software is made available by Red Hat, Inc. 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 org.eclipse.jface.preference.IPreferenceStore;
-import org.jboss.tools.modeshape.rest.Activator;
-import org.jboss.tools.modeshape.rest.Utils;
-import org.modeshape.common.util.CheckArg;
-
-/**
- * The <code>PrefUtils</code> class provides common utilities relating to preferences. This class assumes the Eclipse runtime
- * platform is running.
- */
-public final class PrefUtils {
-
- /**
- * @param propertyId the property name whose list values are being requested (never <code>null</code>)
- * @param delimiter the character separating the items in the property value
- * @param removeDuplicates a flag indicating if duplicate items should be removed
- * @return the property value items (never <code>null</code>)
- */
- public static String[] getListPropertyValue( String propertyId,
- char delimiter,
- boolean removeDuplicates ) {
- CheckArg.isNotNull(propertyId, "propertyId"); //$NON-NLS-1$
- return Utils.getTokens(getPreferenceStore().getString(propertyId), Character.toString(delimiter), removeDuplicates);
- }
-
- /**
- * @return the plugin preference store
- */
- public static IPreferenceStore getPreferenceStore() {
- return Activator.getDefault().getPreferenceStore();
- }
-
- /**
- * @param propertyId the property name being set (never <code>null</code>)
- * @param items the items used to create the property value (never <code>null</code>)
- * @param delimiter the character to use to separate the items
- */
- public static void setListPropertyValue( String propertyId,
- String[] items,
- char delimiter ) {
- CheckArg.isNotNull(propertyId, "propertyId"); //$NON-NLS-1$
- CheckArg.isNotNull(items, "items"); //$NON-NLS-1$
- getPreferenceStore().setValue(propertyId, Utils.combineTokens(items, delimiter));
- }
-
- /**
- * Don't allow construction.
- */
- private PrefUtils() {
- // nothing to do
- }
-}
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilter.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilter.java 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilter.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -11,171 +11,58 @@
*/
package org.jboss.tools.modeshape.rest.preferences;
-import static org.jboss.tools.modeshape.rest.IUiConstants.Preferences.FILTERED_FILE_EXTENSIONS_PREFERENCE;
-import static org.jboss.tools.modeshape.rest.IUiConstants.Preferences.FILTERED_FOLDER_NAMES_PREFERENCE;
-import static org.jboss.tools.modeshape.rest.RestClientI18n.preferenceNotFound;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.jboss.tools.modeshape.rest.Activator;
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>PublishingFileFilter</code> is a file filter that uses the preferences when filtering files.
+ * The <code>PublishingFileFilter</code> is a resource name filter.
*/
public final class PublishingFileFilter {
/**
- * The preference name for the delimiter that separates filtered file extensions when the preference value is stored.
+ * @param text the text being tested against the pattern (may not be <code>null</code> or empty)
+ * @param pattern the pattern used (may not be <code>null</code> or empty)
+ * @return <code>true</code> if the text is matched by the pattern
*/
- private static final String FILE_EXT_DELIMITER_PREF_NAME = "fileExtension.delimiter"; //$NON-NLS-1$
+ public static boolean matches( String text,
+ String pattern ) {
+ final String regex = pattern.replace("?", ".?").replace("*", ".*?"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ return text.matches(regex);
+ }
/**
- * The preference name for characters that are <strong>NOT</strong> allowed to appear in a file extension.
+ * The data model (never <code>null</code>).
*/
- private static final String FILE_EXT_INVALID_CHARS_PREF_NAME = "fileExtension.invalidChars"; //$NON-NLS-1$
+ private final IgnoredResourcesModel model;
/**
- * The preference name for the delimiter that separates filtered folder names when the preference value is stored.
+ * @param model the data model (may not be <code>null</code>)
*/
- private static final String FOLDER_NAME_DELIMITER_PREF_NAME = "folderName.delimiter"; //$NON-NLS-1$
+ public PublishingFileFilter( IgnoredResourcesModel model ) {
+ CheckArg.isNotNull(model, "model"); //$NON-NLS-1$
+ this.model = model;
+ }
/**
- * The preference name for characters that are <strong>NOT</strong> allowed to appear in a folder name.
- */
- private static final String FOLDER_NAME_INVALID_CHARS_PREF_NAME = "folderName.invalidChars"; //$NON-NLS-1$
-
- /**
- * @param resource the resource being tested (never <code>null</code>)
+ * @param resource the resource being tested (may not be <code>null</code>)
* @return <code>true</code> if the resource should be included (i.e., it is not filtered out)
*/
public boolean accept( IResource resource ) {
CheckArg.isNotNull(resource, "resource"); //$NON-NLS-1$
+ final String name = resource.getName();
- if ((resource instanceof IFolder) || (resource instanceof IProject)) {
- String name = resource.getName();
-
- // see if folder name has been filtered
- for (String filteredName : getFilteredFolderNames()) {
- if (filteredName.equals(name)) {
- return false;
- }
+ for (ResourcePattern pattern : model.getPatterns()) {
+ if (pattern.isEnabled() && matches(name, pattern.getPattern())) {
+ return false;
}
-
- // check parent
- if (resource.getParent() != null) {
- return accept(resource.getParent());
- }
- } else if (resource instanceof IFile) {
- // see if file extension has been filtered
- for (String extension : getFilteredFileExtensions()) {
- if (resource.getFullPath().toString().endsWith('.' + extension)) {
- return false;
- }
- }
-
- // check parent
- if (resource.getParent() != null) {
- return accept(resource.getParent());
- }
}
-
- return true;
- }
-
- /**
- * The delimiter that separates filtered file extensions when the preference value is stored.
- *
- * @return the file extension separator character
- */
- public char getFileExtensionDelimiter() {
- String value = PrefUtils.getPreferenceStore().getDefaultString(FILE_EXT_DELIMITER_PREF_NAME);
-
- if ((value != null) && (value.length() > 0)) {
- return value.charAt(0);
+
+ if (resource.getParent() == null) {
+ return true;
}
- // no value found so log and give a default value
- value = ","; //$NON-NLS-1$
- Activator.getDefault().log(new Status(Severity.ERROR, preferenceNotFound.text(FILE_EXT_DELIMITER_PREF_NAME, value), null));
- return value.charAt(0);
+ // check parents
+ return accept(resource.getParent());
}
- /**
- * The characters that are <strong>NOT</strong> allowed to appear in a file extension.
- *
- * @return the invalid file extension characters (never <code>null</code> or empty)
- */
- public String getFileExtensionInvalidCharacters() {
- String value = PrefUtils.getPreferenceStore().getDefaultString(FILE_EXT_INVALID_CHARS_PREF_NAME);
-
- if ((value != null) && (value.length() > 0)) {
- return value;
- }
-
- // no value found so log and give a default value
- value = "*?<>|/\\:;."; //$NON-NLS-1$
- Activator.getDefault().log(new Status(Severity.ERROR,
- preferenceNotFound.text(FILE_EXT_INVALID_CHARS_PREF_NAME, value),
- null));
- return value;
- }
-
- /**
- * @return the file extensions being filtered out of publishing operations (never <code>null</code> but can be empty)
- */
- public String[] getFilteredFileExtensions() {
- return PrefUtils.getListPropertyValue(FILTERED_FILE_EXTENSIONS_PREFERENCE, getFileExtensionDelimiter(), true);
- }
-
- /**
- * @return the folder names being filtered out of publishing operations (never <code>null</code> but can be empty)
- */
- public String[] getFilteredFolderNames() {
- return PrefUtils.getListPropertyValue(FILTERED_FOLDER_NAMES_PREFERENCE, getFolderNameDelimiter(), true);
- }
-
- /**
- * The delimiter that separates filtered folder names when the preference value is stored.
- *
- * @return the folder name separator character
- */
- public char getFolderNameDelimiter() {
- String value = PrefUtils.getPreferenceStore().getDefaultString(FOLDER_NAME_DELIMITER_PREF_NAME);
-
- if ((value != null) && (value.length() > 0)) {
- return value.charAt(0);
- }
-
- // no value found so log and give a default value
- value = ","; //$NON-NLS-1$
- Activator.getDefault()
- .log(new Status(Severity.ERROR, preferenceNotFound.text(FOLDER_NAME_DELIMITER_PREF_NAME, value), null));
- return value.charAt(0);
- }
-
- /**
- * The characters that are <strong>NOT</strong> allowed to appear in a folder name (never <code>null</code> but can be empty).
- *
- * @return the invalid folder name characters (never <code>null</code> or empty)
- */
- public String getFolderNameInvalidCharacters() {
- String value = PrefUtils.getPreferenceStore().getDefaultString(FOLDER_NAME_INVALID_CHARS_PREF_NAME);
-
- if ((value != null) && (value.length() > 0)) {
- return value;
- }
-
- // no value found so log and give a default value
- value = "*?<>|/\\:;"; //$NON-NLS-1$
- Activator.getDefault().log(new Status(Severity.ERROR,
- preferenceNotFound.text(FOLDER_NAME_INVALID_CHARS_PREF_NAME, value),
- null));
- return value;
- }
-
}
Added: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ResourcePattern.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ResourcePattern.java (rev 0)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ResourcePattern.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ *
+ * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
+ *
+ * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
+ */
+package org.jboss.tools.modeshape.rest.preferences;
+
+import org.modeshape.common.util.CheckArg;
+
+/**
+ * A <code>ResourcePattern</code> is a resource name pattern that is used to determine if a resource shoiuld be include in
+ * publishing operations. Wildcards (*, ?) are allowed.
+ */
+public final class ResourcePattern {
+
+ /**
+ * The name pattern (may not be <code>null</code>).
+ */
+ private final String pattern;
+
+ /**
+ * Indicates if the patter is enabled. Default is {@value} .
+ */
+ private boolean enabled;
+
+ /**
+ * @param pattern the resource name pattern (may not be <code>null</code> or empty)
+ * @param enabled <code>true</code> if the pattern should be enabled
+ */
+ public ResourcePattern( String pattern,
+ boolean enabled ) {
+ CheckArg.isNotEmpty(pattern, "pattern"); //$NON-NLS-1$
+ this.pattern = pattern;
+ this.enabled = enabled;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals( Object obj ) {
+ if (this == obj) {
+ return true;
+ }
+
+ if ((obj == null) || !getClass().equals(obj.getClass())) {
+ return false;
+ }
+
+ return this.pattern.equals(((ResourcePattern)obj).pattern);
+ }
+
+ /**
+ * @return the resource name pattern (never <code>null</code>)
+ */
+ public String getPattern() {
+ return this.pattern;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return this.pattern.hashCode();
+ }
+
+ /**
+ * @return <code>true</code> if pattern is enabled
+ */
+ public boolean isEnabled() {
+ return this.enabled;
+ }
+
+ /**
+ * @param enabled <code>true</code> if pattern should be enabled
+ */
+ public void setEnabled( boolean enabled ) {
+ this.enabled = enabled;
+ }
+
+}
Property changes on: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ResourcePattern.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/SortedListEditor.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/SortedListEditor.java 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/SortedListEditor.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -1,383 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- *
- * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
- *
- * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
- */
-package org.jboss.tools.modeshape.rest.preferences;
-
-import java.util.Arrays;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.ListEditor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.VerifyListener;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.ISharedImages;
-import org.jboss.tools.modeshape.rest.Activator;
-import org.jboss.tools.modeshape.rest.RestClientI18n;
-import org.modeshape.common.util.CheckArg;
-
-/**
- * A preference list string value editor that sorts its entries each time a
- * value is added.
- */
-public abstract class SortedListEditor extends ListEditor {
-
- /**
- * Indicates if duplicate values are allowed.
- */
- private boolean allowDuplicates;
-
- /**
- * The listener verifying input characters.
- */
- private VerifyListener verifyListener;
-
- /**
- * Duplicate items are not allowed.
- *
- * @param name
- * the name of the preference this field editor works on
- * @param labelText
- * the label text of the field editor
- * @param parent
- * the parent of the field editor's control
- */
- public SortedListEditor(String name, String labelText, Composite parent) {
- super(name, labelText, parent);
- }
-
- private void disableUpDownButtons() {
- // disable up button
- Button button = getUpButton();
-
- if (button.getEnabled()) {
- button.setEnabled(false);
- }
-
- // disable down button
- button = getDownButton();
-
- if (button.getEnabled()) {
- button.setEnabled(false);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.preference.ListEditor#getButtonBoxControl(org.eclipse.swt.widgets.Composite)
- */
- @Override
- public Composite getButtonBoxControl(Composite parent) {
- Composite buttonBox = super.getButtonBoxControl(parent);
- getUpButton().setVisible(false);
- getDownButton().setVisible(false);
- disableUpDownButtons();
- return buttonBox;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.preference.ListEditor#getNewInputObject()
- */
- @Override
- protected final String getNewInputObject() {
- NewItemDialog dialog = new NewItemDialog(getShell(), getNewItemDialogTitle(), getNewItemDialogLabel(),
- this.verifyListener);
- if (!this.allowDuplicates) {
- dialog.setDisallowedValues(getList().getItems());
- }
-
- if (dialog.open() == Window.OK) {
- String newItem = dialog.getNewItem();
-
- // add new item, sort, and update list
- if (newItem != null) {
- getList().add(newItem);
- String[] items = getList().getItems();
- Arrays.sort(items);
- getList().setItems(items);
- }
- }
-
- // always return null because we have already updated the list
- return null;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.preference.ListEditor#selectionChanged()
- */
- @Override
- protected void selectionChanged() {
- super.selectionChanged();
- disableUpDownButtons();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.preference.ListEditor#setEnabled(boolean,
- * org.eclipse.swt.widgets.Composite)
- */
- @Override
- public void setEnabled(boolean enabled, Composite parent) {
- super.setEnabled(enabled, parent);
- disableUpDownButtons();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.preference.ListEditor#setFocus()
- */
- @Override
- public void setFocus() {
- if ((getList() == null) || getList().getItemCount() == 0) {
- getAddButton().setFocus();
- } else {
- super.setFocus();
- }
- }
-
- /**
- * @return the localized dialog title used when a new item is added (may not
- * be <code>null</code>)
- */
- protected abstract String getNewItemDialogTitle();
-
- /**
- * @return the localized label on the new item dialog that identifies the
- * type of the new item (may not be <code>null</code>)
- */
- protected abstract String getNewItemDialogLabel();
-
- /**
- * @param verifyListener
- * a listener that verifies input from the user of a new item
- * entry (can be <code>null</code>)
- */
- protected void setVerifyListener(VerifyListener verifyListener) {
- this.verifyListener = verifyListener;
- }
-
- /**
- * A <code>NewItemDialog</code> allows the user to enter a text value.
- * Caller can optionally furnish a list of disallowed values.
- */
- class NewItemDialog extends Dialog implements ModifyListener {
-
- /**
- * The label describing the new item.
- */
- private final String label;
-
- /**
- * A list of disallowed values. If <code>null</code> any non-empty value
- * is allowed.
- */
- private String[] disallowedValues;
-
- /**
- * A message for the user.
- */
- private CLabel lblMessage;
-
- /**
- * The contents of the new item text field.
- */
- private String newItem;
-
- /**
- * The dialog title.
- */
- private final String title;
-
- /**
- * The listener verifying input characters.
- */
- private final VerifyListener verifyListener;
-
- /**
- * @param parentShell
- * the parent shell (may be <code>null</code>)
- * @param title
- * the localized dialog title (never <code>null</code>)
- * @param label
- * the localized label (never <code>null</code>)
- * @param verifyListener
- * a listener that validates input characters (may be
- * <code>null</code>)
- */
- public NewItemDialog(Shell parentShell, String title, String label, VerifyListener verifyListener) {
- super(parentShell);
-
- CheckArg.isNotNull(title, "title"); //$NON-NLS-1$
- CheckArg.isNotNull(label, "label"); //$NON-NLS-1$
-
- this.title = title;
- this.label = label;
- this.verifyListener = verifyListener;
-
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
- */
- @Override
- protected void configureShell(Shell newShell) {
- newShell.setText(this.title);
- super.configureShell(newShell);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.dialogs.Dialog#createButton(org.eclipse.swt.widgets.Composite,
- * int, java.lang.String, boolean)
- */
- @Override
- protected Button createButton(Composite parent, int id, String label, boolean defaultButton) {
- Button button = super.createButton(parent, id, label, defaultButton);
-
- // disable OK button initially
- if (id == OK) {
- button.setEnabled(false);
- }
-
- return button;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite panel = (Composite) super.createDialogArea(parent);
- Composite pnlEditor = new Composite(panel, SWT.NONE);
- pnlEditor.setLayout(new GridLayout(2, false));
- pnlEditor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- Label label = new Label(pnlEditor, SWT.NONE);
- label.setLayoutData(new GridData(SWT.LEFT, SWT.NONE, false, false));
- label.setText(this.label);
-
- Text textField = new Text(pnlEditor, SWT.BORDER);
- textField.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
- textField.addModifyListener(this);
-
- // add listener if necessary
- if (this.verifyListener != null) {
- textField.addVerifyListener(this.verifyListener);
- }
-
- // add image and message labels
- this.lblMessage = new CLabel(pnlEditor, SWT.NONE);
- this.lblMessage.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
- ((GridData) this.lblMessage.getLayoutData()).horizontalSpan = 2;
-
- return panel;
- }
-
- /**
- * @return the new item or <code>null</code> if the dialog was canceled
- */
- public String getNewItem() {
- if (getReturnCode() == OK) {
- return this.newItem;
- }
-
- return null;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.dialogs.Dialog#initializeBounds()
- */
- @Override
- protected void initializeBounds() {
- super.initializeBounds();
-
- // resize shell to be twice the width needed for the title (without
- // this the title maybe cropped)
- int width = (2 * convertWidthInCharsToPixels(this.title.length()));
- Rectangle rectangle = getShell().getBounds();
- getShell().setBounds(rectangle.x, rectangle.y, width, rectangle.height);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- @Override
- public void modifyText(ModifyEvent event) {
- // clear message
- this.lblMessage.setImage(null);
- this.lblMessage.setText(""); //$NON-NLS-1$
-
- // enable/disable OK button
- this.newItem = ((Text) event.widget).getText();
-
- // make sure at least one character entered
- boolean enable = (this.newItem.length() != 0);
-
- // make sure value is not a disallowed value
- if (enable && (this.disallowedValues != null)) {
- for (String disallowedValue : this.disallowedValues) {
- if (this.newItem.equals(disallowedValue)) {
- enable = false;
- this.lblMessage
- .setImage(Activator.getDefault().getSharedImage(ISharedImages.IMG_OBJS_INFO_TSK));
- this.lblMessage.setText(RestClientI18n.newItemDialogValueExists.text());
- break;
- }
- }
- }
-
- // set enabled state if different than current state
- if (getButton(OK).getEnabled() != enable) {
- getButton(OK).setEnabled(enable);
- }
- }
-
- /**
- * A list of values that are not allowed as an input.
- *
- * @param disallowedValues
- * the list of values which are not allowed (can be
- * <code>null</code> or empty)
- */
- public void setDisallowedValues(String[] disallowedValues) {
- if ((disallowedValues == null) || (disallowedValues.length == 0)) {
- this.disallowedValues = null;
- } else {
- this.disallowedValues = disallowedValues;
- }
- }
-
- }
-}
Added: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/package-info.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/package-info.java (rev 0)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/package-info.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -0,0 +1,15 @@
+/*
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ *
+ * This software is made available by Red Hat, Inc. 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.
+ */
+/**
+ * The ModeShape REST Client Eclipse preferences package is responsible for managing preferences.
+ */
+package org.jboss.tools.modeshape.rest.preferences;
\ No newline at end of file
Property changes on: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/package-info.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/prefs.properties
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/prefs.properties 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/prefs.properties 2011-04-15 16:44:43 UTC (rev 30595)
@@ -10,14 +10,10 @@
# individual contributors.
#
-# This properties file is read in by PreferenceInitializer and contains preference default values. The delimiter values are used
-# when the preference values are stored and the valid character values are used by the field editors when they validate user input.
+# This properties file is read in by PreferenceInitializer and contains preference default values.
-fileExtension.delimiter = ,
-fileExtension.invalidChars = *?<>|/\:;.
-
-folderName.delimiter = ,
-folderName.invalidChars = *?<>|/\:;
-
# indicates if ModeShape server should version resources
-enableVersioning = false
\ No newline at end of file
+modeShape.preference.enableResourceVersioning = true
+
+# default ignored resources patterns
+modeShape.preference.ignoredResources = .svn\ntrue\n.project\ntrue\n
\ No newline at end of file
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -13,6 +13,7 @@
import static org.jboss.tools.modeshape.rest.IUiConstants.HelpContexts.PUBLISH_DIALOG_HELP_CONTEXT;
import static org.jboss.tools.modeshape.rest.IUiConstants.Preferences.ENABLE_RESOURCE_VERSIONING;
+import static org.jboss.tools.modeshape.rest.IUiConstants.Preferences.IGNORED_RESOURCES_PREFERENCE;
import static org.jboss.tools.modeshape.rest.IUiConstants.Preferences.MAIN_PREFERENCE_PAGE_ID;
import java.util.ArrayList;
@@ -56,6 +57,7 @@
import org.jboss.tools.modeshape.rest.WorkspaceArea;
import org.jboss.tools.modeshape.rest.actions.NewServerAction;
import org.jboss.tools.modeshape.rest.jobs.PublishJob.Type;
+import org.jboss.tools.modeshape.rest.preferences.IgnoredResourcesModel;
import org.jboss.tools.modeshape.rest.preferences.PublishingFileFilter;
import org.modeshape.common.util.CheckArg;
import org.modeshape.web.jcr.rest.client.Status;
@@ -404,8 +406,10 @@
this.type = type;
this.resources = resources;
- // filter should not be cached as preferences may change
- this.filter = (filterFiles ? new PublishingFileFilter() : null);
+ // load filter with current preference value
+ IgnoredResourcesModel model = new IgnoredResourcesModel();
+ model.load(Activator.getDefault().getPreferenceStore().getString(IGNORED_RESOURCES_PREFERENCE));
+ this.filter = (filterFiles ? new PublishingFileFilter(model) : null);
}
private void constructLocationPanel(Composite parent) {
Added: branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesModelTest.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesModelTest.java (rev 0)
+++ branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesModelTest.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ *
+ * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
+ *
+ * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
+ */
+package org.jboss.tools.modeshape.rest.preferences;
+
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsSame.sameInstance;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ *
+ */
+public final class IgnoredResourcesModelTest {
+
+ private final static int NUM_PATTERNS = 10;
+
+ private final static ResourcePattern[] ENABLED_PATTERNS = new ResourcePattern[NUM_PATTERNS];
+
+ private final static ResourcePattern[] DISABLED_PATTERNS = new ResourcePattern[NUM_PATTERNS];
+
+ static {
+ for (int i = 0; i < NUM_PATTERNS; ++i) {
+ ENABLED_PATTERNS[i] = new ResourcePattern(i + "*.class", true); //$NON-NLS-1$
+ DISABLED_PATTERNS[i] = new ResourcePattern(i + "*.class", false); //$NON-NLS-1$
+ }
+ }
+
+ private IgnoredResourcesModel model;
+
+ @Before
+ public void beforeEach() {
+ this.model = new IgnoredResourcesModel();
+ }
+
+ @Test
+ public void shouldClearPatternsWhenLoading() {
+ this.model.load(IgnoredResourcesModel.createList(DISABLED_PATTERNS));
+ this.model.load(IgnoredResourcesModel.createList(ENABLED_PATTERNS));
+ assertThat(this.model.getPatterns().size(), is(NUM_PATTERNS));
+ }
+
+ @Test
+ public void shouldHaveNoPatternsAfterConstruction() {
+ assertThat(this.model.getPatterns().isEmpty(), is(true));
+ }
+
+ @Test
+ public void shouldLoadEmptyString() {
+ this.model.load(""); //$NON-NLS-1$
+ assertThat(this.model.getPatterns().isEmpty(), is(true));
+ }
+
+ @Test
+ public void shouldLoadNullString() {
+ this.model.load(null);
+ assertThat(this.model.getPatterns().isEmpty(), is(true));
+ }
+
+ @Test
+ public void shouldNotLoadSamePatternTwice() {
+ this.model.load(IgnoredResourcesModel.createList(DISABLED_PATTERNS[0]));
+ this.model.load(IgnoredResourcesModel.createList(DISABLED_PATTERNS[0]));
+ assertThat(this.model.getPatterns().size(), is(1));
+
+ this.model.load(IgnoredResourcesModel.createList(ENABLED_PATTERNS[0]));
+ assertThat(this.model.getPatterns().size(), is(1));
+ }
+
+ @Test
+ public void shouldAddNewPattern() {
+ final ResourcePattern rp = DISABLED_PATTERNS[0];
+ this.model.addPattern(rp);
+ assertThat(this.model.getPatterns().size(), is(1));
+ assertThat(this.model.getPatterns().iterator().next(), sameInstance(rp));
+ }
+
+ @Test
+ public void shouldRemovePattern() {
+ final ResourcePattern rp = DISABLED_PATTERNS[0];
+ this.model.addPattern(rp);
+ this.model.removePattern(rp);
+ assertThat(this.model.getPatterns().isEmpty(), is(true));
+ }
+
+ @Test
+ public void shouldAllowRemoveOfPatternNotInModel() {
+ this.model.removePattern(DISABLED_PATTERNS[0]);
+ }
+
+}
Property changes on: branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesModelTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilterTest.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilterTest.java (rev 0)
+++ branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilterTest.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ *
+ * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
+ *
+ * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
+ */
+package org.jboss.tools.modeshape.rest.preferences;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Test;
+
+/**
+ *
+ */
+public final class PublishingFileFilterTest {
+
+ private static final String PARTS_PROJECT = "PartsProject"; //$NON-NLS-1$
+
+ @Test
+ public void shouldMatchPartsProject() {
+ assertThat(PublishingFileFilter.matches(PARTS_PROJECT, "PartsProject"), is(true)); //$NON-NLS-1$
+ assertThat(PublishingFileFilter.matches(PARTS_PROJECT, "Parts*"), is(true)); //$NON-NLS-1$
+ assertThat(PublishingFileFilter.matches(PARTS_PROJECT, "*Parts*"), is(true)); //$NON-NLS-1$
+ assertThat(PublishingFileFilter.matches(PARTS_PROJECT, "?arts*"), is(true)); //$NON-NLS-1$
+ assertThat(PublishingFileFilter.matches(PARTS_PROJECT, "Part?*"), is(true)); //$NON-NLS-1$
+ assertThat(PublishingFileFilter.matches(PARTS_PROJECT, "Part?*t"), is(true)); //$NON-NLS-1$
+ assertThat(PublishingFileFilter.matches(PARTS_PROJECT, "*Project"), is(true)); //$NON-NLS-1$
+ assertThat(PublishingFileFilter.matches(PARTS_PROJECT, "P*r*s*r*j*c*"), is(true)); //$NON-NLS-1$
+ assertThat(PublishingFileFilter.matches(PARTS_PROJECT, "?a?t?P?o?e?t"), is(true)); //$NON-NLS-1$
+ }
+
+ @Test
+ public void shouldNotMatchPartsProject() {
+ assertThat(PublishingFileFilter.matches(PARTS_PROJECT, " PartsProject"), is(false)); //$NON-NLS-1$
+ assertThat(PublishingFileFilter.matches(PARTS_PROJECT, "PartsProject "), is(false)); //$NON-NLS-1$
+ assertThat(PublishingFileFilter.matches(PARTS_PROJECT, "PartsProject2"), is(false)); //$NON-NLS-1$
+ assertThat(PublishingFileFilter.matches(PARTS_PROJECT, "artsProject2"), is(false)); //$NON-NLS-1$
+ assertThat(PublishingFileFilter.matches(PARTS_PROJECT, "Parts?"), is(false)); //$NON-NLS-1$
+ assertThat(PublishingFileFilter.matches(PARTS_PROJECT, "*artsP*2"), is(false)); //$NON-NLS-1$
+ }
+
+}
Property changes on: branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilterTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/preferences/ResourcePatternTest.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/preferences/ResourcePatternTest.java (rev 0)
+++ branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/preferences/ResourcePatternTest.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ *
+ * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing.
+ *
+ * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors.
+ */
+package org.jboss.tools.modeshape.rest.preferences;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+import org.junit.Test;
+
+/**
+ *
+ */
+public final class ResourcePatternTest {
+
+ @Test(expected = IllegalArgumentException.class)
+ public void shouldNotAllowNullPattern() {
+ new ResourcePattern(null, true);
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void shouldNotAllowEmptyPattern() {
+ new ResourcePattern("", true); //$NON-NLS-1$
+ }
+
+ @Test
+ public void shouldBeEqualWhenPatternsAreEqual() {
+ String pattern = "mypattern"; //$NON-NLS-1$
+ ResourcePattern rp1 = new ResourcePattern(pattern, true);
+ ResourcePattern rp2 = new ResourcePattern(pattern, false);
+ assertThat(rp1.equals(rp2), is(true));
+ }
+
+ @Test
+ public void shouldNotBeEqualWhenComparingWithNull() {
+ ResourcePattern rp = new ResourcePattern("mypattern", true); //$NON-NLS-1$
+ assertThat(rp.equals(null), is(false));
+ }
+
+ @Test
+ public void shouldNotBeEqualWhenPatternsAreNotEqual() {
+ ResourcePattern rp1 = new ResourcePattern("mypattern", true); //$NON-NLS-1$
+ ResourcePattern rp2 = new ResourcePattern(rp1.getPattern() + "abc", false); //$NON-NLS-1$
+ assertThat(rp1.equals(rp2), is(false));
+ }
+
+ @Test
+ public void shouldNotBeEqualWhenComparingWithDifferentClass() {
+ String pattern = "mypattern"; //$NON-NLS-1$
+ ResourcePattern rp = new ResourcePattern(pattern, true);
+ assertThat(rp.equals(pattern), is(false));
+ }
+
+ @Test
+ public void shouldSetPatternCorrectly() {
+ String pattern = "mypattern"; //$NON-NLS-1$
+ ResourcePattern rp = new ResourcePattern(pattern, true);
+ assertThat(rp.getPattern(), is(pattern));
+ }
+
+ @Test
+ public void shouldSetEnabledStateCorrectlyAtConstruction() {
+ boolean enabled = true;
+ ResourcePattern rp = new ResourcePattern("mypattern", enabled); //$NON-NLS-1$
+ assertThat(rp.isEnabled(), is(enabled));
+
+ enabled = !enabled;
+ rp = new ResourcePattern("mypattern", enabled); //$NON-NLS-1$
+ assertThat(rp.isEnabled(), is(enabled));
+ }
+
+ @Test
+ public void shouldSetEnabledStateCorrectly() {
+ boolean enabled = true;
+ ResourcePattern rp = new ResourcePattern("mypattern", enabled); //$NON-NLS-1$
+ rp.setEnabled(!enabled);
+ assertThat(rp.isEnabled(), is(!enabled));
+
+ rp = new ResourcePattern("mypattern", !enabled); //$NON-NLS-1$
+ rp.setEnabled(enabled);
+ assertThat(rp.isEnabled(), is(enabled));
+ }
+
+}
Property changes on: branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/preferences/ResourcePatternTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/test/AllTests.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/test/AllTests.java 2011-04-15 16:39:28 UTC (rev 30594)
+++ branches/jbosstools-3.2.x/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/test/AllTests.java 2011-04-15 16:44:43 UTC (rev 30595)
@@ -3,11 +3,15 @@
import org.jboss.tools.modeshape.rest.PersistedServerTest;
import org.jboss.tools.modeshape.rest.ServerManagerTest;
import org.jboss.tools.modeshape.rest.ServerRegistryEventTest;
+import org.jboss.tools.modeshape.rest.preferences.IgnoredResourcesModelTest;
+import org.jboss.tools.modeshape.rest.preferences.PublishingFileFilterTest;
+import org.jboss.tools.modeshape.rest.preferences.ResourcePatternTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
-@RunWith( Suite.class )
-(a)Suite.SuiteClasses( {PersistedServerTest.class, ServerManagerTest.class, ServerRegistryEventTest.class} )
+(a)RunWith(Suite.class)
+(a)Suite.SuiteClasses({ IgnoredResourcesModelTest.class, PersistedServerTest.class, PublishingFileFilterTest.class,
+ ResourcePatternTest.class, ServerManagerTest.class, ServerRegistryEventTest.class })
public class AllTests {
// nothing to do
}
13 years, 7 months
JBoss Tools SVN: r30594 - branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2011-04-15 12:39:28 -0400 (Fri, 15 Apr 2011)
New Revision: 30594
Added:
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/package-info.java
Modified:
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/EclipseLogger.java
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/EclipseLoggerFactory.java
Log:
JBIDE-8733 Problems With EclipseLogger When Running JUnit Tests. Logger now checks to see if platform is running before calling methods that assume the Eclipse platform is running.
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/EclipseLogger.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/EclipseLogger.java 2011-04-15 16:07:50 UTC (rev 30593)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/EclipseLogger.java 2011-04-15 16:39:28 UTC (rev 30594)
@@ -26,15 +26,26 @@
*/
public final class EclipseLogger implements Logger {
- private static boolean DEBUG_MODE = Platform.inDebugMode()
- && Boolean.parseBoolean(Platform.getDebugOption(IUiConstants.PLUGIN_ID + "/debug")); //$NON-NLS-1$
+ private static boolean initialized = false;
- private static ILog LOGGER = Platform.getLog(Platform.getBundle(IUiConstants.PLUGIN_ID));
+ private static boolean DEBUG_MODE = Platform.isRunning();
+ private static ILog LOGGER; // will be null when platform is not running
+
private String name;
EclipseLogger( String name ) {
this.name = name;
+
+ if (!initialized) {
+ initialized = true;
+
+ if (Platform.isRunning()) {
+ DEBUG_MODE = Platform.inDebugMode()
+ && Boolean.parseBoolean(Platform.getDebugOption(IUiConstants.PLUGIN_ID + "/debug")); //$NON-NLS-1$
+ LOGGER = Platform.getLog(Platform.getBundle(IUiConstants.PLUGIN_ID));
+ }
+ }
}
/**
@@ -194,7 +205,7 @@
@Override
public void error( String message,
Throwable e ) {
- if (isErrorEnabled()) {
+ if (isErrorEnabled() && (LOGGER != null)) {
LOGGER.log(new Status(IStatus.ERROR, IUiConstants.PLUGIN_ID, message, e));
}
}
@@ -321,7 +332,7 @@
@Override
public void info( String message,
Throwable e ) {
- if (isInfoEnabled()) {
+ if (isInfoEnabled() && (LOGGER != null)) {
LOGGER.log(new Status(IStatus.INFO, IUiConstants.PLUGIN_ID, message, e));
}
}
@@ -655,7 +666,7 @@
@Override
public void warn( String message,
Throwable e ) {
- if (isWarnEnabled()) {
+ if (isWarnEnabled() && (LOGGER != null)) {
LOGGER.log(new Status(IStatus.WARNING, IUiConstants.PLUGIN_ID, message, e));
}
}
Modified: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/EclipseLoggerFactory.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/EclipseLoggerFactory.java 2011-04-15 16:07:50 UTC (rev 30593)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/EclipseLoggerFactory.java 2011-04-15 16:39:28 UTC (rev 30594)
@@ -13,33 +13,22 @@
import java.util.HashMap;
import java.util.Map;
+
import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;
public final class EclipseLoggerFactory implements ILoggerFactory {
- // ===========================================================================================================================
- // Class Fields
- // ===========================================================================================================================
-
/**
* The shared instance of the factory.
*/
static final EclipseLoggerFactory INSTANCE = new EclipseLoggerFactory();
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* Map of loggers keyed by logger name.
*/
private Map<String, Logger> loggerMap;
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* Constructs the factory.
*/
@@ -47,10 +36,6 @@
this.loggerMap = new HashMap<String, Logger>();
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* {@inheritDoc}
*
Added: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/package-info.java
===================================================================
--- branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/package-info.java (rev 0)
+++ branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/package-info.java 2011-04-15 16:39:28 UTC (rev 30594)
@@ -0,0 +1,15 @@
+/*
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ *
+ * This software is made available by Red Hat, Inc. 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.
+ */
+/**
+ * The ModeShape REST Client Eclipse log package maps SLF4J logging from the ModeShape library to the Ecipse log.
+ */
+package org.jboss.tools.modeshape.rest.log;
\ No newline at end of file
Property changes on: branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/package-info.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 7 months
JBoss Tools SVN: r30593 - workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/internal/deployment.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-04-15 12:07:50 -0400 (Fri, 15 Apr 2011)
New Revision: 30593
Modified:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/internal/deployment/JBossDeploymentManager.java
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/internal/deployment/TypedDeployer.java
Log:
implementing service
Modified: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/internal/deployment/JBossDeploymentManager.java
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/internal/deployment/JBossDeploymentManager.java 2011-04-15 16:05:11 UTC (rev 30592)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/internal/deployment/JBossDeploymentManager.java 2011-04-15 16:07:50 UTC (rev 30593)
@@ -23,7 +23,7 @@
public DeploymentResult undeployAsync(String host, int port, String deploymentName,
boolean removeFile, IProgressMonitor monitor) throws Exception {
TypedDeployer deployer = new TypedDeployer(host, port);
- return deployer.undeploy(deploymentName, monitor);
+ return deployer.undeploy(deploymentName);
}
public DeploymentResult syncUndeploy(String host, int port, String deploymentName,
Modified: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/internal/deployment/TypedDeployer.java
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/internal/deployment/TypedDeployer.java 2011-04-15 16:05:11 UTC (rev 30592)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment/src/org/jboss/ide/eclipse/as7/internal/deployment/TypedDeployer.java 2011-04-15 16:07:50 UTC (rev 30593)
@@ -54,7 +54,7 @@
}
public DeploymentResult undeploySync(String name, IProgressMonitor monitor) throws DeployerException {
- DeploymentResult result = undeploy(name, monitor);
+ DeploymentResult result = undeploy(name);
result.getStatus();
return result;
}
@@ -65,7 +65,7 @@
return result;
}
- public DeploymentResult undeploy(String name, IProgressMonitor monitor) throws DeployerException {
+ public DeploymentResult undeploy(String name) throws DeployerException {
try {
DeploymentPlanBuilder builder = manager.newDeploymentPlan();
builder = builder.undeploy(name).andRemoveUndeployed();
13 years, 7 months
JBoss Tools SVN: r30592 - in workspace/adietish/org.jboss.ide.eclipse.as7.deployment: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-04-15 12:05:11 -0400 (Fri, 15 Apr 2011)
New Revision: 30592
Modified:
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/META-INF/MANIFEST.MF
workspace/adietish/org.jboss.ide.eclipse.as7.deployment/build.properties
Log:
implementing service
Modified: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/META-INF/MANIFEST.MF
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment/META-INF/MANIFEST.MF 2011-04-15 16:05:01 UTC (rev 30591)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment/META-INF/MANIFEST.MF 2011-04-15 16:05:11 UTC (rev 30592)
@@ -33,3 +33,4 @@
org.jboss.threads,
org.jboss.threads.management
Bundle-Vendor: JBoss by Red Hat
+Service-Component: META-INF/jboss-management-service.xml
Modified: workspace/adietish/org.jboss.ide.eclipse.as7.deployment/build.properties
===================================================================
--- workspace/adietish/org.jboss.ide.eclipse.as7.deployment/build.properties 2011-04-15 16:05:01 UTC (rev 30591)
+++ workspace/adietish/org.jboss.ide.eclipse.as7.deployment/build.properties 2011-04-15 16:05:11 UTC (rev 30592)
@@ -1,4 +1,3 @@
-source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
@@ -7,7 +6,8 @@
jboss-dmr-1.0.0.Beta5.jar,\
jboss-logging-3.0.0.Beta3.jar,\
jboss-marshalling-1.3.0.CR8.jar,\
- jboss-threads-2.0.0.CR8.jar
+ jboss-threads-2.0.0.CR8.jar,\
+ META-INF/jboss-management-service.xml
src.includes = jboss-dmr-1.0.0.Beta5-sources.jar,\
jboss-dmr-1.0.0.Beta5.jar,\
jboss-marshalling-1.3.0.CR8-sources.jar,\
@@ -19,3 +19,4 @@
jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT.jar,\
jboss-as-controller-client-7.0.0.Beta3-SNAPSHOT-sources.jar,\
REAME.txt
+source.. = src/
13 years, 7 months