JBoss Tools SVN: r30220 - trunk/modeshape/plugins.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2011-04-01 12:15:21 -0400 (Fri, 01 Apr 2011)
New Revision: 30220
Modified:
trunk/modeshape/plugins/pom.xml
Log:
JBIDE-6656
Modified: trunk/modeshape/plugins/pom.xml
===================================================================
--- trunk/modeshape/plugins/pom.xml 2011-04-01 16:10:15 UTC (rev 30219)
+++ trunk/modeshape/plugins/pom.xml 2011-04-01 16:15:21 UTC (rev 30220)
@@ -8,5 +8,6 @@
<packaging>pom</packaging>
<modules>
<module>org.jboss.tools.modeshape.rest</module>
+ <module>org.jboss.tools.modeshape.rest.doc.help</module>
</modules>
</project>
13 years, 11 months
JBoss Tools SVN: r30219 - in trunk/modeshape: plugins/org.jboss.tools.modeshape.rest and 14 other directories.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2011-04-01 12:10:15 -0400 (Fri, 01 Apr 2011)
New Revision: 30219
Added:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/.project
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/.settings/
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/.settings/org.eclipse.pde.core.prefs
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/META-INF/
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/META-INF/MANIFEST.MF
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/ModeShapeHelpContexts.xml
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/build.properties
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc.zip
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/plugin.properties
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/plugin.xml
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/pom.xml
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/toc.xml
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/WorkspaceArea.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FileFiltersPreferencePage.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PreferenceInitializer.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/SortedListEditor.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/slf4j/
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/slf4j/impl/
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/slf4j/impl/StaticLoggerBinder.java
Removed:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/StaticLoggerBinder.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/NewItemDialog.java
Modified:
trunk/modeshape/features/org.jboss.tools.modeshape.rest.feature/
trunk/modeshape/features/org.jboss.tools.modeshape.rest.feature/feature.xml
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-client.jar
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.properties
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.xml
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/log4j.properties
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Activator.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/IUiConstants.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/EclipseLogger.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFileExtensionEditor.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFoldersEditor.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ModeShapePreferencePage.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PrefUtils.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilter.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/prefs.properties
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ServerView.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishWizard.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerPage.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerWizard.java
trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/MockRestClient.java
Log:
JBIDE-8661 ModeShape Tools' SLF4J LoggerFactoryBinder Implementation Not Found On Classpath. StaticLoggerBinder moved to package "org.slf4j.impl."
JBIDE-6656 Create a documentation plugin. A documentation (Eclipse context help) was created.
JBIDE-8242 Change the ModeShape Eclipse plugin to enable resource versioning in the repository. A checkbox, initially set to the value of a user-managed preference, is available each time files are published.
JBIDE-8396 ModeShape Preference page New Filtered File Extension and New Filtered Folder Name dialogs don't validate for existence of entered file extension and folder names. The OK button now will only enable when all the required information is present.
JBDS-1403 ModeShape Tools Should Show The User The Areas In The ModeShape Workspace That Published Files Will Be Sequenced. A ComboBox now contains all the known workspace areas. In addition to that, the user can type in the path to workspace area not found in the known areas.
Property changes on: trunk/modeshape/features/org.jboss.tools.modeshape.rest.feature
___________________________________________________________________
Modified: svn:ignore
- *.class
bin
target
+ *.class
bin
target
.classpath
Modified: trunk/modeshape/features/org.jboss.tools.modeshape.rest.feature/feature.xml
===================================================================
--- trunk/modeshape/features/org.jboss.tools.modeshape.rest.feature/feature.xml 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/features/org.jboss.tools.modeshape.rest.feature/feature.xml 2011-04-01 16:10:15 UTC (rev 30219)
@@ -42,4 +42,10 @@
install-size="0"
version="0.0.0"/>
+ <plugin
+ id="org.jboss.tools.modeshape.rest.doc.user"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
</feature>
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/modeshape-client.jar
===================================================================
(Binary files differ)
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.properties
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.properties 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.properties 2011-04-01 16:10:15 UTC (rev 30219)
@@ -14,7 +14,9 @@
contextMenu.label = ModeShape
decorator.description = Decorates objects in the ModeShape View
decorator.label = ModeShape View Decorator
+fileFiltersPreferencePage = File Filters
modeShapeCategory = ModeShape
+preferenceInitializer = Preference Initializer for default values
publishCommand.name = Publish
serverView = ModeShape
showPublishedLocationsCommand.name = Show Published Locations
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.xml
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.xml 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/plugin.xml 2011-04-01 16:10:15 UTC (rev 30219)
@@ -199,17 +199,7 @@
</decorator>
</extension>
-<!-- Context Help -->
- <extension point="org.eclipse.help.contexts">
- <contexts file="docs/helpContexts.xml" />
- </extension>
-
-<!-- Help Table of Contents -->
- <extension point="org.eclipse.help.toc">
- <toc file="docs/toc.xml" primary="true" />
- </extension>
-
-<!-- Preference Page -->
+<!-- Main Preference Page -->
<extension
point="org.eclipse.ui.preferencePages">
<page
@@ -218,4 +208,24 @@
id="modeShapePreferencePage">
</page>
</extension>
+
+<!-- File Filters Preference Page -->
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ name="%fileFiltersPreferencePage"
+ category="modeShapePreferencePage"
+ class="org.jboss.tools.modeshape.rest.preferences.FileFiltersPreferencePage"
+ id="modeShapeFileFiltersPreferencePage">
+ </page>
+
+<!-- Preference Initializer -->
+ </extension>
+ <extension
+ point="org.eclipse.core.runtime.preferences"
+ id="modeShapeDefaultPreferenceInitializer"
+ name="%preferenceInitializer">
+ <initializer class="org.jboss.tools.modeshape.rest.preferences.PreferenceInitializer" />
+ </extension>
+
</plugin>
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/log4j.properties
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/log4j.properties 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/log4j.properties 2011-04-01 16:10:15 UTC (rev 30219)
@@ -14,8 +14,6 @@
log4j.rootLogger=INFO, LOGFILE
log4j.appender.LOGFILE=org.apache.log4j.FileAppender
-log4j.appender.LOGFILE.File=eclipse.log
log4j.appender.LOGFILE.Append=true
-log4j.appender.LOGFILE.Threshold=INFO
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Activator.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Activator.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Activator.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -13,6 +13,7 @@
import java.net.MalformedURLException;
import java.net.URL;
+
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
@@ -35,19 +36,11 @@
*/
public final class Activator extends AbstractUIPlugin implements IUiConstants {
- // ===========================================================================================================================
- // Class Fields
- // ===========================================================================================================================
-
/**
* The shared plugin instance.
*/
private static Activator plugin;
- // ===========================================================================================================================
- // Class Methods
- // ===========================================================================================================================
-
/**
* @return the shared instance or <code>null</code> if not constructed
*/
@@ -55,10 +48,6 @@
return plugin;
}
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* The image used when the requested image cannot be found.
*/
@@ -69,19 +58,15 @@
*/
private ServerManager serverMgr;
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* @param key the plugin relative path to the image (never <code>null</code>)
* @return the image or an image indicating the requested image could not be found
*/
private ImageDescriptor createImageDescriptor( String key ) {
- CheckArg.isNotNull(key, "key");
+ CheckArg.isNotNull(key, "key"); //$NON-NLS-1$
try {
- URL url = new URL(getBundle().getEntry("/").toString() + key);
+ URL url = new URL(getBundle().getEntry("/").toString() + key); //$NON-NLS-1$
return ImageDescriptor.createFromURL(url);
} catch (final MalformedURLException e) {
log(new Status(Severity.ERROR, RestClientI18n.missingImage.text(key), e));
@@ -106,7 +91,7 @@
* @see ISharedImages
*/
public Image getSharedImage( String imageId ) {
- CheckArg.isNotNull(imageId, "imageId");
+ CheckArg.isNotNull(imageId, "imageId"); //$NON-NLS-1$
Image result = PlatformUI.getWorkbench().getSharedImages().getImage(imageId);
return ((result == null) ? getMissingImage() : result);
}
@@ -117,7 +102,7 @@
* @see ISharedImages
*/
public ImageDescriptor getSharedImageDescriptor( String imageId ) {
- CheckArg.isNotNull(imageId, "imageId");
+ CheckArg.isNotNull(imageId, "imageId"); //$NON-NLS-1$
ImageDescriptor result = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(imageId);
if (result != null) {
@@ -208,9 +193,10 @@
* @param status the status being logged (never <code>null</code>)
*/
public void log( Status status ) {
- CheckArg.isNotNull(status, "status");
+ CheckArg.isNotNull(status, "status"); //$NON-NLS-1$
IStatus eclipseStatus = new org.eclipse.core.runtime.Status(Utils.convertSeverity(status.getSeverity()),
- IUiConstants.PLUGIN_ID, status.getMessage(),
+ IUiConstants.PLUGIN_ID,
+ status.getMessage(),
status.getException());
getLog().log(eclipseStatus);
}
@@ -222,11 +208,10 @@
*/
@Override
public void start( BundleContext context ) throws Exception {
-// BasicConfigurator.configure(); // TODO how does logging get configured now
-
super.start(context);
plugin = this;
+ // restore server registry
this.serverMgr = new ServerManager(getStateLocation().toFile().getAbsolutePath());
Status status = this.serverMgr.restoreState();
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/IUiConstants.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/IUiConstants.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/IUiConstants.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -16,97 +16,134 @@
/**
* The Plug-in's identifier.
*/
- String PLUGIN_ID = "org.jboss.tools.modeshape.rest";
+ String PLUGIN_ID = "org.jboss.tools.modeshape.rest"; //$NON-NLS-1$
- String ICON_FOLDER = "icons/";
+ String ICON_FOLDER = "icons/"; //$NON-NLS-1$
//
// /icons/objects/
//
- String OBJECT_ICONS_FOLDER = ICON_FOLDER + "objects/";
+ String OBJECT_ICONS_FOLDER = ICON_FOLDER + "objects/"; //$NON-NLS-1$
- String CHECKMARK_IMAGE = OBJECT_ICONS_FOLDER + "checkmark.gif";
+ String CHECKMARK_IMAGE = OBJECT_ICONS_FOLDER + "checkmark.gif"; //$NON-NLS-1$
- String REPOSITORY_IMAGE = OBJECT_ICONS_FOLDER + "repository.gif";
+ String REPOSITORY_IMAGE = OBJECT_ICONS_FOLDER + "repository.gif"; //$NON-NLS-1$
- String SERVER_IMAGE = OBJECT_ICONS_FOLDER + "server.gif";
+ String SERVER_IMAGE = OBJECT_ICONS_FOLDER + "server.gif"; //$NON-NLS-1$
- String WORKSPACE_IMAGE = OBJECT_ICONS_FOLDER + "workspace.gif";
+ String WORKSPACE_IMAGE = OBJECT_ICONS_FOLDER + "workspace.gif"; //$NON-NLS-1$
//
// /icons/views/
//
- String VIEWS_ICON_FOLDER = ICON_FOLDER + "views/";
+ String VIEWS_ICON_FOLDER = ICON_FOLDER + "views/"; //$NON-NLS-1$
- String BLANK_IMAGE = VIEWS_ICON_FOLDER + "blank.gif";
+ String BLANK_IMAGE = VIEWS_ICON_FOLDER + "blank.gif"; //$NON-NLS-1$
- String COLLAPSE_ALL_IMAGE = VIEWS_ICON_FOLDER + "collapse_all.gif";
+ String COLLAPSE_ALL_IMAGE = VIEWS_ICON_FOLDER + "collapse_all.gif"; //$NON-NLS-1$
- String DELETE_SERVER_IMAGE = VIEWS_ICON_FOLDER + "delete_server.gif";
+ String DELETE_SERVER_IMAGE = VIEWS_ICON_FOLDER + "delete_server.gif"; //$NON-NLS-1$
- String ModeShape_IMAGE_16x = VIEWS_ICON_FOLDER + "modeShape_icon_16x.png";
+ String ModeShape_IMAGE_16x = VIEWS_ICON_FOLDER + "modeShape_icon_16x.png"; //$NON-NLS-1$
- String EDIT_SERVER_IMAGE = VIEWS_ICON_FOLDER + "edit_server.gif";
+ String EDIT_SERVER_IMAGE = VIEWS_ICON_FOLDER + "edit_server.gif"; //$NON-NLS-1$
- String ERROR_OVERLAY_IMAGE = VIEWS_ICON_FOLDER + "error_overlay.gif";
+ String ERROR_OVERLAY_IMAGE = VIEWS_ICON_FOLDER + "error_overlay.gif"; //$NON-NLS-1$
- String NEW_SERVER_IMAGE = VIEWS_ICON_FOLDER + "new_server.gif";
+ String NEW_SERVER_IMAGE = VIEWS_ICON_FOLDER + "new_server.gif"; //$NON-NLS-1$
- String PUBLISH_IMAGE = VIEWS_ICON_FOLDER + "publish.png";
+ String PUBLISH_IMAGE = VIEWS_ICON_FOLDER + "publish.png"; //$NON-NLS-1$
- String PUBLISHED_OVERLAY_IMAGE = VIEWS_ICON_FOLDER + "published_overlay.png";
+ String PUBLISHED_OVERLAY_IMAGE = VIEWS_ICON_FOLDER + "published_overlay.png"; //$NON-NLS-1$
- String REFRESH_IMAGE = VIEWS_ICON_FOLDER + "refresh.gif";
+ String REFRESH_IMAGE = VIEWS_ICON_FOLDER + "refresh.gif"; //$NON-NLS-1$
- String UNPUBLISH_IMAGE = VIEWS_ICON_FOLDER + "unpublish.png";
+ String UNPUBLISH_IMAGE = VIEWS_ICON_FOLDER + "unpublish.png"; //$NON-NLS-1$
//
// /icons/wizards/
//
- String WIZARD_ICONS_FOLDER = ICON_FOLDER + "wizards/";
+ String WIZARD_ICONS_FOLDER = ICON_FOLDER + "wizards/"; //$NON-NLS-1$
- String WIZARD_BANNER_IMAGE = WIZARD_ICONS_FOLDER + "wizard_banner.png";
+ String WIZARD_BANNER_IMAGE = WIZARD_ICONS_FOLDER + "wizard_banner.png"; //$NON-NLS-1$
//
- // Help Contexts
+ // jobs
//
- String HELP_CONTEXT_PREFIX = PLUGIN_ID + '.';
-
- String MESSAGE_CONSOLE_HELP_CONTEXT = HELP_CONTEXT_PREFIX + "messageConsoleHelpContext";
-
- String PREFERENCE_PAGE_HELP_CONTEXT = HELP_CONTEXT_PREFIX + "preferencesHelpContext";
-
- String PUBLISH_DIALOG_HELP_CONTEXT = HELP_CONTEXT_PREFIX + "publishDialogHelpContext";
-
- String SERVER_DIALOG_HELP_CONTEXT = HELP_CONTEXT_PREFIX + "serverDialogHelpContext";
-
- String SERVER_VIEW_HELP_CONTEXT = HELP_CONTEXT_PREFIX + "serverViewHelpContext";
-
- //
- // Jobs
- //
-
/**
* The <code>Job</code> framework job family for the ModeShape publishing and unpublishing operations.
*/
- String PUBLISHING_JOB_FAMILY = "modeshape.publishing.job.family";
+ String PUBLISHING_JOB_FAMILY = "modeshape.publishing.job.family"; //$NON-NLS-1$
- //
- // Preferences
- //
-
/**
- * A preference for a list of file extensions that will not be part of publishing operations.
+ * Constants associated with help contexts.
*/
- String FILTERED_FILE_EXTENSIONS_PREFERENCE = "modeShape.preference.filteredFileExtensions";
+ interface HelpContexts {
+ String HELP_CONTEXT_PREFIX = IUiConstants.PLUGIN_ID + '.';
+
+ /**
+ * 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$
+
+ }
+
/**
- * A preference for a list of folder names whose contents will not be part of publishing operations.
+ * Constants associated with preferences.
*/
- String FILTERED_FOLDER_NAMES_PREFERENCE = "modeShape.preference.filteredFolderNames";
+ interface Preferences {
+ /**
+ * 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$
+
+ /**
+ * A preference for a list of file extensions that will not be part of publishing operations.
+ */
+ String FILTERED_FILE_EXTENSIONS_PREFERENCE = "modeShape.preference.filteredFileExtensions"; //$NON-NLS-1$
+
+ /**
+ * A preference for a list of folder names whose contents will not be part of publishing operations.
+ */
+ 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$
+
+ /**
+ * The main ModeShape preference page ID.
+ */
+ String MAIN_PREFERENCE_PAGE_ID = "modeShapePreferencePage"; //$NON-NLS-1$
+
+ }
+
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -38,6 +38,12 @@
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 missingImage;
public static I18n newFilteredFileExtensionDialogLabel;
@@ -45,13 +51,12 @@
public static I18n newFilteredFolderNameDialogLabel;
public static I18n newFilteredFolderNameDialogTitle;
+
+ public static I18n newItemDialogValueExists;
public static I18n newServerActionText;
public static I18n newServerActionToolTip;
- public static I18n prefUtilsPropertyFileNotFound;
- public static I18n prefUtilsPropertyNotFound;
-
public static I18n publishedLocationsDialogCopyUrlButton;
public static I18n publishedLocationsDialogCopyUrlButtonToolTip;
public static I18n publishedLocationsDialogFileUrlColumnHeader;
@@ -68,9 +73,13 @@
public static I18n publishingConsoleProblemCreatingHyperlinkMsg;
public static I18n publishingConsoleFilePathNotFoundMsg;
+ public static I18n preferenceDefaultScopeNotFound;
+ public static I18n preferenceFileNotFound;
+ public static I18n preferenceNotFound;
+
public static I18n preferencePageDescription;
- public static I18n preferencePageFilteredFileExtensionsLabel;
- public static I18n preferencePageFilteredFolderNamesLabel;
+ public static I18n preferencePageEnableVersioningEditor;
+ public static I18n preferencePageEnableVersioningEditorToolTip;
public static I18n preferencePageMessage;
public static I18n preferencePageTitle;
@@ -110,6 +119,7 @@
public static I18n publishPageNoAvailableWorkspacesStatusMsg;
public static I18n publishPageNoResourcesToPublishStatusMsg;
public static I18n publishPageNoResourcesToUnpublishStatusMsg;
+ public static I18n publishPageOpenPreferencePageLink;
public static I18n publishPagePublishOkStatusMsg;
public static I18n publishPagePublishResourcesLabel;
public static I18n publishPageRecurseCheckBox;
@@ -119,9 +129,12 @@
public static I18n publishPageRepositoryToolTip;
public static I18n publishPageServerLabel;
public static I18n publishPageServerToolTip;
+ public static I18n publishPageUnableToObtainWorkspaceAreas;
public static I18n publishPageUnpublishOkStatusMsg;
public static I18n publishPageUnpublishResourcesLabel;
public static I18n publishPageUnpublishTitle;
+ public static I18n publishPageVersionCheckBox;
+ public static I18n publishPageVersionCheckBoxToolTip;
public static I18n publishPageWorkspaceLabel;
public static I18n publishPageWorkspacePublishToolTip;
public static I18n publishPageWorkspaceUnpublishToolTip;
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.properties 2011-04-01 16:10:15 UTC (rev 30219)
@@ -29,6 +29,12 @@
errorDialogTitle = Error
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
missingImage = The following image cannot be found "{0}"
@@ -38,11 +44,14 @@
newFilteredFolderNameDialogLabel = Folder name:
newFilteredFolderNameDialogTitle = New Filtered Folder Name
+newItemDialogValueExists = Value already exists
+
newServerActionText = New Server
newServerActionToolTip = Create a new server
-prefUtilsPropertyFileNotFound = The "{0}" property preference file is missing or could not be loaded. All property default values will be used.
-prefUtilsPropertyNotFound = The "{0}" property is missing. Default value of "{1}" will be used.
+preferenceDefaultScopeNotFound = The default scope for plugin "{0}" cannot be found.
+preferenceFileNotFound = The "{0}" preference defaults value file is missing or could not be loaded.
+preferenceNotFound = The "{0}" property is missing. Default value of "{1}" will be used.
publishedLocationsDialogCopyUrlButton = Copy URL
publishedLocationsDialogCopyUrlButtonToolTip = Copy to the clipboard the selected workspace URL where the file is published
@@ -60,11 +69,11 @@
publishingConsoleProblemCreatingHyperlinkMsg = Unexpected problem creating hyperlink in ModeShape Message Console view
publishingConsoleFilePathNotFoundMsg = A hyperlink could not be created in the ModeShape Message Console because the file path of "{0}" could not be found.
-preferencePageDescription = Add or remove file extensions and folder names. Files with a matching file extension or files that are contained in a folder with a matching name will NOT be published to or unpublished from repositories.
-preferencePageFilteredFileExtensionsLabel = Filtered File Extensions:
-preferencePageFilteredFolderNamesLabel = Filtered Folder Names:
+preferencePageDescription = General settings for ModeShape Tools:
+preferencePageEnableVersioningEditor = Enable resource versioning
+preferencePageEnableVersioningEditorToolTip = Inform ModeShape server to keep multiple versions of resources
preferencePageMessage = ModeShape
-preferencePageTitle = ModeShape Preferences
+preferencePageTitle = ModeShape
publishJobCanceled = Job {0} was canceled. See log for details.
publishJobDurationMsg = {0} hour(s), {1} minute(s), {2} second(s)
@@ -97,12 +106,13 @@
publishPageMissingServerStatusMsg = A server must be selected
publishPageMissingWorkspaceStatusMsg = A workspace must be selected
publishPageNewServerButton = New...
-publishPageNoAvailableRepositoriesStatusMsg = There are no repositories available on that server
+publishPageNoAvailableRepositoriesStatusMsg = There are no repositories available on that server, or a \nconnection to the server cannot be made.
publishPageNoAvailableServersStatusMsg = A server must be created first
-publishPageNoAvailableWorkspacesStatusMsg = There are no JCR workspaces available on that server and repository
-publishPageNoResourcesToPublishStatusMsg = There are no files that can be published
+publishPageNoAvailableWorkspacesStatusMsg = There are no JCR workspaces available on that server and repository, or a \nconnection to the server cannot be made.
+publishPageNoResourcesToPublishStatusMsg = There are no files that can be published (See preference filter settings).
publishPageNoResourcesToUnpublishStatusMsg = There are no files that can be unpublished
-publishPagePublishOkStatusMsg = Choose the location of the JCR repository where your local files and folders will be published, and then click "Finish".
+publishPageOpenPreferencePageLink = ( change default in your <a>preferences</a> )
+publishPagePublishOkStatusMsg = Choose the location of the JCR repository where your local files \nand folders will be published, and then click "Finish."
publishPagePublishResourcesLabel = These files were selected and will be published:
publishPageRecurseCheckBox = Recurse folders and projects
publishPageRecurseCheckBoxToolTip = Add all files under folders recursively under selected projects and folders
@@ -111,6 +121,9 @@
publishPageRepositoryToolTip = The JCR repository where the JCR workspace is located
publishPageServerLabel = Server:
publishPageServerToolTip = The server where the JCR repository is located
+publishPageUnableToObtainWorkspaceAreas = Unable to obtain the workspace areas for workspace "{0}"
+publishPageVersionCheckBox = Version the published files
+publishPageVersionCheckBoxToolTip = The published files will be versioned on the ModeShape server.
publishPageUnpublishOkStatusMsg = Choose the location of the JCR repository where the files will be unpublished, and then click "Finish".
publishPageUnpublishResourcesLabel = These files were selected and will be unpublished:
publishPageUnpublishTitle = Unpublish the selected files
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -23,6 +23,7 @@
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
+
import javax.jcr.nodetype.NodeType;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -31,11 +32,14 @@
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
+
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
+
import org.modeshape.common.util.Base64;
import org.modeshape.common.util.CheckArg;
import org.modeshape.common.util.Logger;
+import org.modeshape.web.jcr.rest.client.IJcrConstants;
import org.modeshape.web.jcr.rest.client.IRestClient;
import org.modeshape.web.jcr.rest.client.Status;
import org.modeshape.web.jcr.rest.client.Status.Severity;
@@ -56,50 +60,42 @@
@ThreadSafe
public final class ServerManager implements IRestClient {
- // ===========================================================================================================================
- // Constants
- // ===========================================================================================================================
-
/**
* The tag used to persist a server's login password.
*/
- private static final String PASSWORD_TAG = "password";
+ private static final String PASSWORD_TAG = "password"; //$NON-NLS-1$
/**
* The file name used when persisting the server registry.
*/
- private static final String REGISTRY_FILE = "serverRegistry.xml";
+ private static final String REGISTRY_FILE = "serverRegistry.xml"; //$NON-NLS-1$
/**
* The name of the system property that is set when at least one server exists. This property is used by the menus extension
* that is responsible for showing the ModeShape context menu items.
*/
- public static final String SERVER_EXISTS_PROPERTY = "org.jboss.tools.modeshape.rest.serverExists";
+ public static final String SERVER_EXISTS_PROPERTY = "org.jboss.tools.modeshape.rest.serverExists"; //$NON-NLS-1$
/**
* The tag used when persisting a server.
*/
- private static final String SERVER_TAG = "server";
+ private static final String SERVER_TAG = "server"; //$NON-NLS-1$
/**
* The server collection tag used when persisting the server registry.
*/
- private static final String SERVERS_TAG = "servers";
+ private static final String SERVERS_TAG = "servers"; //$NON-NLS-1$
/**
* The tag used to persist a server's URL.
*/
- private static final String URL_TAG = "url";
+ private static final String URL_TAG = "url"; //$NON-NLS-1$
/**
* The tag used to persist a server's login user.
*/
- private static final String USER_TAG = "user";
+ private static final String USER_TAG = "user"; //$NON-NLS-1$
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* The listeners registered to receive {@link ServerRegistryEvent server registry events}.
*/
@@ -131,10 +127,6 @@
*/
private final ReadWriteLock serverLock = new ReentrantReadWriteLock();
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* @param stateLocationPath the directory where the {@link Server} registry} is persisted (may be <code>null</code> if
* persistence is not desired)
@@ -142,7 +134,7 @@
*/
public ServerManager( String stateLocationPath,
IRestClient restClient ) {
- CheckArg.isNotNull(restClient, "restClient");
+ CheckArg.isNotNull(restClient, "restClient"); //$NON-NLS-1$
this.servers = new ArrayList<Server>();
this.stateLocationPath = stateLocationPath;
@@ -160,10 +152,6 @@
this(stateLocationPath, new JsonRestClient());
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* Listeners already registered will not be added again. The new listener will receive events for all existing servers.
*
@@ -171,7 +159,7 @@
* @return <code>true</code> if listener was added
*/
public boolean addRegistryListener( IServerRegistryListener listener ) {
- CheckArg.isNotNull(listener, "listener");
+ CheckArg.isNotNull(listener, "listener"); //$NON-NLS-1$
boolean result = this.listeners.addIfAbsent(listener);
// inform new listener of registered servers
@@ -189,7 +177,7 @@
* @return a status indicating if the server was added to the registry
*/
public Status addServer( PersistedServer server ) {
- CheckArg.isNotNull(server, "server");
+ CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
return internalAddServer(server, true);
}
@@ -200,8 +188,8 @@
*/
public Server findServer( String url,
String user ) {
- CheckArg.isNotNull(url, "url");
- CheckArg.isNotNull(user, "user");
+ CheckArg.isNotNull(url, "url"); //$NON-NLS-1$
+ CheckArg.isNotNull(user, "user"); //$NON-NLS-1$
for (Server server : getServers()) {
if (url.equals(server.getUrl()) && user.equals(server.getUser())) {
@@ -246,7 +234,7 @@
*/
@Override
public Collection<Repository> getRepositories( Server server ) throws Exception {
- CheckArg.isNotNull(server, "server");
+ CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
try {
this.serverLock.readLock().lock();
@@ -277,6 +265,26 @@
}
/**
+ * @param workspace the workspace whose publishing areas are being requested
+ * @return the workspace areas (never <code>null</code>)
+ * @throws Exception if there is a problem obtaining the workspace areas
+ */
+ public WorkspaceArea[] getWorkspaceAreas( Workspace workspace ) throws Exception {
+ final String path = "jcr:path"; //$NON-NLS-1$
+ final String title = "jcr:title"; //$NON-NLS-1$
+ final String statement = "SELECT [" + path + "], " + '[' + title + ']' + " FROM [mode:publishArea]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ List<QueryRow> rows = query(workspace, IJcrConstants.JCR_SQL2, statement);
+ WorkspaceArea[] workspaceAreas = new WorkspaceArea[rows.size()];
+
+ for (int numRows = rows.size(), i = 0; i < numRows; ++i) {
+ QueryRow row = rows.get(i);
+ workspaceAreas[i] = new WorkspaceArea(workspace, (String)row.getValue(path), (String)row.getValue(title));
+ }
+
+ return workspaceAreas;
+ }
+
+ /**
* {@inheritDoc}
*
* @see org.modeshape.web.jcr.rest.client.IRestClient#getWorkspaces(org.modeshape.web.jcr.rest.client.domain.Repository)
@@ -285,7 +293,7 @@
*/
@Override
public Collection<Workspace> getWorkspaces( Repository repository ) throws Exception {
- CheckArg.isNotNull(repository, "repository");
+ CheckArg.isNotNull(repository, "repository"); //$NON-NLS-1$
try {
this.serverLock.readLock().lock();
@@ -295,8 +303,7 @@
return Collections.unmodifiableCollection(new ArrayList<Workspace>(workspaces));
}
- // a repository's server must be registered in order to obtain it's
- // workspaces
+ // a repository's server must be registered in order to obtain it's workspaces
String msg = RestClientI18n.serverManagerUnregisteredServer.text(repository.getServer().getShortDescription());
throw new RuntimeException(msg);
} finally {
@@ -331,7 +338,7 @@
if (serverExists == null) {
// value of "true" is coded in the plugin.xml as well
- System.setProperty(SERVER_EXISTS_PROPERTY, "true");
+ System.setProperty(SERVER_EXISTS_PROPERTY, "true"); //$NON-NLS-1$
}
// let listeners know of new server
@@ -395,7 +402,7 @@
* @return <code>true</code> if the server has been registered
*/
public boolean isRegistered( Server server ) {
- CheckArg.isNotNull(server, "server");
+ CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
try {
this.serverLock.readLock().lock();
@@ -471,7 +478,7 @@
* @see #isRegistered(Server)
*/
public Status ping( Server server ) {
- CheckArg.isNotNull(server, "server");
+ CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
try {
this.delegate.getRepositories(server);
@@ -483,8 +490,6 @@
/**
* {@inheritDoc}
- * <p>
- * Only tries to unpublish if the workspace's {@link Server server} is registered.
*
* @see org.modeshape.web.jcr.rest.client.IRestClient#publish(org.modeshape.web.jcr.rest.client.domain.Workspace,
* java.lang.String, java.io.File)
@@ -494,14 +499,28 @@
public Status publish( Workspace workspace,
String path,
File file ) {
- CheckArg.isNotNull(workspace, "workspace");
- CheckArg.isNotNull(path, "path");
- CheckArg.isNotNull(file, "file");
+ return publish(workspace, path, file, false);
+ }
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.modeshape.web.jcr.rest.client.IRestClient#publish(org.modeshape.web.jcr.rest.client.domain.Workspace,
+ * java.lang.String, java.io.File, boolean)
+ */
+ @Override
+ public Status publish( Workspace workspace,
+ String path,
+ File file,
+ boolean version ) {
+ CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+ CheckArg.isNotNull(path, "path"); //$NON-NLS-1$
+ CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
+
Server server = workspace.getServer();
if (isRegistered(server)) {
- return this.delegate.publish(workspace, path, file);
+ return this.delegate.publish(workspace, path, file, version);
}
// server must be registered in order to publish
@@ -513,7 +532,7 @@
* @return <code>true</code> if listener was removed
*/
public boolean removeRegistryListener( IServerRegistryListener listener ) {
- CheckArg.isNotNull(listener, "listener");
+ CheckArg.isNotNull(listener, "listener"); //$NON-NLS-1$
return this.listeners.remove(listener);
}
@@ -522,7 +541,7 @@
* @return a status indicating if the specified server was removed from the registry (never <code>null</code>)
*/
public Status removeServer( Server server ) {
- CheckArg.isNotNull(server, "server");
+ CheckArg.isNotNull(server, "server"); //$NON-NLS-1$
return internalRemoveServer(server, true);
}
@@ -551,7 +570,7 @@
Node userNode = attributeMap.getNamedItem(USER_TAG);
Node passwordNode = attributeMap.getNamedItem(PASSWORD_TAG);
String pswd = ((passwordNode == null) ? null : new String(Base64.decode(passwordNode.getNodeValue()),
- "UTF-8"));
+ "UTF-8")); //$NON-NLS-1$
// add server to registry
addServer(new PersistedServer(urlNode.getNodeValue(), userNode.getNodeValue(), pswd, (pswd != null)));
@@ -599,8 +618,8 @@
StreamResult resultXML = new StreamResult(new FileOutputStream(getStateFileName()));
TransformerFactory transFactory = TransformerFactory.newInstance();
Transformer transformer = transFactory.newTransformer();
- transformer.setOutputProperty(OutputKeys.INDENT, "yes");
- transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
+ transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); //$NON-NLS-1$ //$NON-NLS-2$
transformer.transform(source, resultXML);
} catch (Exception e) {
return new Status(Severity.ERROR, RestClientI18n.errorSavingServerRegistry.text(getStateFileName()), e);
@@ -637,9 +656,9 @@
public Status unpublish( Workspace workspace,
String path,
File file ) {
- CheckArg.isNotNull(workspace, "workspace");
- CheckArg.isNotNull(path, "path");
- CheckArg.isNotNull(file, "file");
+ CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+ CheckArg.isNotNull(path, "path"); //$NON-NLS-1$
+ CheckArg.isNotNull(file, "file"); //$NON-NLS-1$
Server server = workspace.getServer();
@@ -660,8 +679,8 @@
*/
public Status updateServer( Server previousServerVersion,
Server newServerVersion ) {
- CheckArg.isNotNull(previousServerVersion, "previousServerVersion");
- CheckArg.isNotNull(newServerVersion, "newServerVersion");
+ CheckArg.isNotNull(previousServerVersion, "previousServerVersion"); //$NON-NLS-1$
+ CheckArg.isNotNull(newServerVersion, "newServerVersion"); //$NON-NLS-1$
Status status = null;
@@ -706,18 +725,15 @@
/**
* {@inheritDoc}
- * <p>
- * <strong>This method is unsupported and should not be called.</strong>
*
- * @throws UnsupportedOperationException if this method is called
* @see org.modeshape.web.jcr.rest.client.IRestClient#query(org.modeshape.web.jcr.rest.client.domain.Workspace,
* java.lang.String, java.lang.String)
*/
@Override
- public List<QueryRow> query( Workspace arg0,
- String arg1,
- String arg2 ) throws Exception {
- throw new UnsupportedOperationException();
+ public List<QueryRow> query( Workspace workspace,
+ String language,
+ String statement ) throws Exception {
+ return this.delegate.query(workspace, language, statement);
}
/**
@@ -730,11 +746,11 @@
* java.lang.String, java.lang.String, int, int)
*/
@Override
- public List<QueryRow> query( Workspace arg0,
- String arg1,
- String arg2,
- int arg3,
- int arg4 ) throws Exception {
+ public List<QueryRow> query( Workspace workspace,
+ String language,
+ String statement,
+ int offset,
+ int limit ) throws Exception {
throw new UnsupportedOperationException();
}
@@ -748,12 +764,12 @@
* java.lang.String, java.lang.String, int, int, java.util.Map)
*/
@Override
- public List<QueryRow> query( Workspace arg0,
- String arg1,
- String arg2,
- int arg3,
- int arg4,
- Map<String, String> arg5 ) throws Exception {
+ public List<QueryRow> query( Workspace workspace,
+ String language,
+ String statement,
+ int offset,
+ int limit,
+ Map<String, String> variables ) throws Exception {
throw new UnsupportedOperationException();
}
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/WorkspaceArea.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/WorkspaceArea.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/WorkspaceArea.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -0,0 +1,63 @@
+package org.jboss.tools.modeshape.rest;
+
+import org.modeshape.common.util.CheckArg;
+import org.modeshape.web.jcr.rest.client.domain.Workspace;
+
+/**
+ * The <code>WorkspaceArea</code> represents a known area in a ModeShape repository where sequencing of resources occurs.
+ */
+public final class WorkspaceArea {
+
+ /**
+ * The path within the workspace where this area is found (never <code>null</code>).
+ */
+ private final String path;
+
+ /**
+ * An optional workspace area title (can be <code>null</code> or empty).
+ */
+ private final String title;
+
+ /**
+ * The workspace where this area is found (never <code>null</code>).
+ */
+ private final Workspace workspace;
+
+ /**
+ * @param workspace the workspace where this area is found (never <code>null</code>)
+ * @param path the workspace path where this area is found (never <code>null</code>)
+ * @param title the workspace area title (can be <code>null</code> or empty)
+ */
+ public WorkspaceArea( Workspace workspace,
+ String path,
+ String title ) {
+ CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
+ CheckArg.isNotEmpty(path, "path"); //$NON-NLS-1$
+
+ this.workspace = workspace;
+ this.path = path;
+ this.title = title;
+ }
+
+ /**
+ * @return path the workspace path where this area is found (never <code>null</code>)
+ */
+ public String getPath() {
+ return this.path;
+ }
+
+ /**
+ * @return title the workspace area title (can be <code>null</code> or empty)
+ */
+ public String getTitle() {
+ return this.title;
+ }
+
+ /**
+ * @return workspace the workspace where this area is found (never <code>null</code>)
+ */
+ public Workspace getWorkspace() {
+ return this.workspace;
+ }
+
+}
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/WorkspaceArea.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -13,10 +13,12 @@
import static org.jboss.tools.modeshape.rest.IUiConstants.PLUGIN_ID;
import static org.jboss.tools.modeshape.rest.IUiConstants.PUBLISHING_JOB_FAMILY;
+
import java.io.File;
import java.net.URL;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -36,10 +38,6 @@
*/
public final class PublishJob extends Job {
- // ===========================================================================================================================
- // Constants
- // ===========================================================================================================================
-
/**
* The job type.
*/
@@ -60,10 +58,6 @@
*/
private static final AtomicInteger JOB_ID = new AtomicInteger();
- // ===========================================================================================================================
- // Class Methods
- // ===========================================================================================================================
-
/**
* @param type the job type (never <code>null</code>)
* @param jobId the job identifier
@@ -71,7 +65,7 @@
*/
private static String getJobName( Type type,
int jobId ) {
- CheckArg.isNotNull(type, "type");
+ CheckArg.isNotNull(type, "type"); //$NON-NLS-1$
if (Type.PUBLISH == type) {
return RestClientI18n.publishJobPublishName.text(jobId);
@@ -81,10 +75,6 @@
return RestClientI18n.publishJobUnpublishName.text(jobId);
}
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* The files being published or unpublished.
*/
@@ -101,6 +91,11 @@
private final Type type;
/**
+ * Indicates if published resources should be versioned on the ModeShape server.
+ */
+ private final boolean version;
+
+ /**
* The workspace to use when publishing or unpublishing.
*/
private final Workspace workspace;
@@ -110,32 +105,31 @@
*/
private final String workspaceArea;
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* @param type the job type (never <code>null</code>)
* @param files the files being published or unpublished (never <code>null</code>)
* @param workspace the workspace to use when publishing or unpublishing (never <code>null</code>)
* @param workspaceArea the path segment prepended to the file project path (maybe be <code>null</code> or empty)
+ * @param version <true> if published resources should be versioned
*/
public PublishJob( Type type,
List<IFile> files,
Workspace workspace,
- String workspaceArea ) {
+ String workspaceArea,
+ boolean version ) {
super(getJobName(type, JOB_ID.incrementAndGet()));
- CheckArg.isNotNull(files, "files");
- CheckArg.isNotNull(workspace, "workspace");
+ CheckArg.isNotNull(files, "files"); //$NON-NLS-1$
+ CheckArg.isNotNull(workspace, "workspace"); //$NON-NLS-1$
this.type = type;
this.files = files;
this.workspace = workspace;
+ this.version = version;
this.jobId = JOB_ID.get();
// setup the workspace area and remove trailing separator if necessary
- String temp = ((workspaceArea == null) ? "" : workspaceArea);
+ String temp = ((workspaceArea == null) ? "" : workspaceArea); //$NON-NLS-1$
if (temp.endsWith(File.separator)) {
this.workspaceArea = temp.substring(0, (temp.length() - 1));
@@ -146,10 +140,6 @@
setUser(true); // allow user to run in background
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* {@inheritDoc}
*
@@ -227,7 +217,7 @@
Status status = null;
if (isPublishing()) {
- status = getServerManager().publish(this.workspace, path, file);
+ status = getServerManager().publish(this.workspace, path, file, this.version);
// set persistent property on resource indicating it has been published
if (!status.isError()) {
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/EclipseLogger.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/EclipseLogger.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/EclipseLogger.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -12,6 +12,7 @@
package org.jboss.tools.modeshape.rest.log;
import java.text.MessageFormat;
+
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
@@ -25,30 +26,14 @@
*/
public final class EclipseLogger implements Logger {
- // ===========================================================================================================================
- // Class Fields
- // ===========================================================================================================================
-
private static ILog LOGGER = Platform.getLog(Platform.getBundle(IUiConstants.PLUGIN_ID));
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
private String name;
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
EclipseLogger( String name ) {
this.name = name;
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* {@inheritDoc}
*
@@ -417,7 +402,7 @@
*/
@Override
public boolean isDebugEnabled() {
- return false;
+ return true;
}
/**
@@ -437,7 +422,7 @@
*/
@Override
public boolean isErrorEnabled() {
- return false;
+ return true;
}
/**
@@ -457,7 +442,7 @@
*/
@Override
public boolean isInfoEnabled() {
- return false;
+ return true;
}
/**
@@ -477,7 +462,7 @@
*/
@Override
public boolean isTraceEnabled() {
- return false;
+ return true;
}
/**
@@ -497,7 +482,7 @@
*/
@Override
public boolean isWarnEnabled() {
- return false;
+ return true;
}
/**
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/StaticLoggerBinder.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/StaticLoggerBinder.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/StaticLoggerBinder.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -1,77 +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.log;
-
-import org.slf4j.ILoggerFactory;
-import org.slf4j.spi.LoggerFactoryBinder;
-
-public final class StaticLoggerBinder implements LoggerFactoryBinder {
-
- // ===========================================================================================================================
- // Class Fields
- // ===========================================================================================================================
-
- /**
- * The class name of the logger factory.
- */
- private static final String LOGGER_FACTORY_CLASS_NAME = EclipseLoggerFactory.class.getName();
-
- /**
- * The unique instance of this class.
- */
- private static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder();
-
- // ===========================================================================================================================
- // Class Methods
- // ===========================================================================================================================
-
- /**
- * @return the static instance of the logger
- */
- public static final StaticLoggerBinder getSingleton() {
- return SINGLETON;
- }
-
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
- /**
- * The logger factory used.
- */
- private final ILoggerFactory loggerFactory = new EclipseLoggerFactory();
-
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
- /**
- * {@inheritDoc}
- *
- * @see org.slf4j.spi.LoggerFactoryBinder#getLoggerFactory()
- */
- @Override
- public ILoggerFactory getLoggerFactory() {
- return this.loggerFactory;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.slf4j.spi.LoggerFactoryBinder#getLoggerFactoryClassStr()
- */
- @Override
- public String getLoggerFactoryClassStr() {
- return LOGGER_FACTORY_CLASS_NAME;
- }
-
-}
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FileFiltersPreferencePage.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FileFiltersPreferencePage.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FileFiltersPreferencePage.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -0,0 +1,180 @@
+/*
+ * 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();
+ }
+ }
+
+}
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FileFiltersPreferencePage.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFileExtensionEditor.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFileExtensionEditor.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFileExtensionEditor.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -11,17 +11,11 @@
*/
package org.jboss.tools.modeshape.rest.preferences;
-import static org.jboss.tools.modeshape.rest.IUiConstants.FILTERED_FILE_EXTENSIONS_PREFERENCE;
+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 static org.jboss.tools.modeshape.rest.RestClientI18n.preferencePageFilteredFileExtensionsLabel;
-import static org.jboss.tools.modeshape.rest.preferences.PrefUtils.FILE_EXT_DELIMITER;
-import static org.jboss.tools.modeshape.rest.preferences.PrefUtils.FILE_EXT_INVALID_CHARS;
-import java.util.Arrays;
-import java.util.Set;
-import java.util.TreeSet;
-import org.eclipse.jface.preference.ListEditor;
-import org.eclipse.jface.window.Window;
+
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.widgets.Composite;
@@ -30,33 +24,21 @@
/**
* The <code>FilteredFileExtensionEditor</code> is an editor for managing a set of filtered file extensions.
*/
-public final class FilteredFileExtensionEditor extends ListEditor implements VerifyListener {
-
- // =======================================================================================================================
- // Fields
- // =======================================================================================================================
-
+public final class FilteredFileExtensionEditor extends SortedListEditor implements VerifyListener {
+
/**
- * The current set of file extensions.
+ * The filter that removes resources, with specific file extensions, from publishing operations (never <code>null</code>).
*/
- private final Set<String> extensions;
+ private final PublishingFileFilter filter;
- // =======================================================================================================================
- // Constructors
- // =======================================================================================================================
-
/**
* @param parent the parent control
*/
public FilteredFileExtensionEditor( Composite parent ) {
- super(FILTERED_FILE_EXTENSIONS_PREFERENCE, preferencePageFilteredFileExtensionsLabel.text(), parent);
- this.extensions = new TreeSet<String>();
+ super(FILTERED_FILE_EXTENSIONS_PREFERENCE, fileFiltersPreferencePageFilteredFileExtensionsLabel.text(), parent);
+ this.filter = new PublishingFileFilter();
}
- // =======================================================================================================================
- // Methods
- // =======================================================================================================================
-
/**
* {@inheritDoc}
*
@@ -64,31 +46,27 @@
*/
@Override
protected String createList( String[] items ) {
- return Utils.combineTokens(items, FILE_EXT_DELIMITER);
+ return Utils.combineTokens(items, this.filter.getFileExtensionDelimiter());
}
/**
* {@inheritDoc}
*
- * @see org.eclipse.jface.preference.ListEditor#getNewInputObject()
+ * @see org.jboss.tools.modeshape.rest.preferences.SortedListEditor#getNewItemDialogLabel()
*/
@Override
- protected String getNewInputObject() {
- NewItemDialog dialog = new NewItemDialog(getShell(), newFilteredFileExtensionDialogTitle.text(),
- newFilteredFileExtensionDialogLabel.text(), this);
+ protected String getNewItemDialogLabel() {
+ return newFilteredFileExtensionDialogLabel.text();
+ }
- if (dialog.open() == Window.OK) {
- String extension = dialog.getNewItem();
-
- // add new extension
- if (extension != null) {
- this.extensions.add(extension);
- return extension;
- }
- }
-
- // user canceled dialog
- return null;
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.tools.modeshape.rest.preferences.SortedListEditor#getNewItemDialogTitle()
+ */
+ @Override
+ protected String getNewItemDialogTitle() {
+ return newFilteredFileExtensionDialogTitle.text();
}
/**
@@ -98,12 +76,7 @@
*/
@Override
protected String[] parseString( String stringList ) {
- String[] values = Utils.getTokens(stringList, Character.toString(FILE_EXT_DELIMITER), true);
-
- this.extensions.clear();
- this.extensions.addAll(Arrays.asList(values));
-
- return values;
+ return Utils.getTokens(stringList, Character.toString(this.filter.getFileExtensionDelimiter()), true);
}
/**
@@ -113,7 +86,7 @@
*/
@Override
public void verifyText( VerifyEvent event ) {
- for (char c : FILE_EXT_INVALID_CHARS.toCharArray()) {
+ for (char c : this.filter.getFileExtensionInvalidCharacters().toCharArray()) {
if (c == event.character) {
event.doit = false;
break;
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFoldersEditor.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFoldersEditor.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/FilteredFoldersEditor.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -11,17 +11,11 @@
*/
package org.jboss.tools.modeshape.rest.preferences;
-import static org.jboss.tools.modeshape.rest.IUiConstants.FILTERED_FOLDER_NAMES_PREFERENCE;
+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 static org.jboss.tools.modeshape.rest.RestClientI18n.preferencePageFilteredFolderNamesLabel;
-import static org.jboss.tools.modeshape.rest.preferences.PrefUtils.FOLDER_NAME_DELIMITER;
-import static org.jboss.tools.modeshape.rest.preferences.PrefUtils.FOLDER_NAME_INVALID_CHARS;
-import java.util.Arrays;
-import java.util.Set;
-import java.util.TreeSet;
-import org.eclipse.jface.preference.ListEditor;
-import org.eclipse.jface.window.Window;
+
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.widgets.Composite;
@@ -30,33 +24,21 @@
/**
* The <code>FilteredFoldersEditor</code> is an editor for managing a set of folder names.
*/
-public final class FilteredFoldersEditor extends ListEditor implements VerifyListener {
+public final class FilteredFoldersEditor extends SortedListEditor implements VerifyListener {
- // =======================================================================================================================
- // Fields
- // =======================================================================================================================
-
/**
- * The current set of folder names.
+ * The filter that removes resources, contained in specific folders, from publishing operations (never <code>null</code>).
*/
- private final Set<String> folderNames;
+ private final PublishingFileFilter filter;
- // =======================================================================================================================
- // Constructors
- // =======================================================================================================================
-
/**
* @param parent the parent control
*/
public FilteredFoldersEditor( Composite parent ) {
- super(FILTERED_FOLDER_NAMES_PREFERENCE, preferencePageFilteredFolderNamesLabel.text(), parent);
- this.folderNames = new TreeSet<String>();
+ super(FILTERED_FOLDER_NAMES_PREFERENCE, fileFiltersPreferencePageFilteredFolderNamesLabel.text(), parent);
+ this.filter = new PublishingFileFilter();
}
- // =======================================================================================================================
- // Methods
- // =======================================================================================================================
-
/**
* {@inheritDoc}
*
@@ -64,31 +46,27 @@
*/
@Override
protected String createList( String[] items ) {
- return Utils.combineTokens(items, FOLDER_NAME_DELIMITER);
+ return Utils.combineTokens(items, this.filter.getFolderNameDelimiter());
}
/**
* {@inheritDoc}
*
- * @see org.eclipse.jface.preference.ListEditor#getNewInputObject()
+ * @see org.jboss.tools.modeshape.rest.preferences.SortedListEditor#getNewItemDialogLabel()
*/
@Override
- protected String getNewInputObject() {
- NewItemDialog dialog = new NewItemDialog(getShell(), newFilteredFolderNameDialogTitle.text(),
- newFilteredFolderNameDialogLabel.text(), this);
+ protected String getNewItemDialogLabel() {
+ return newFilteredFolderNameDialogLabel.text();
+ }
- if (dialog.open() == Window.OK) {
- String folderName = dialog.getNewItem();
-
- // add new folder name
- if (folderName != null) {
- this.folderNames.add(folderName);
- return folderName;
- }
- }
-
- // user canceled dialog
- return null;
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.jboss.tools.modeshape.rest.preferences.SortedListEditor#getNewItemDialogTitle()
+ */
+ @Override
+ protected String getNewItemDialogTitle() {
+ return newFilteredFolderNameDialogTitle.text();
}
/**
@@ -98,12 +76,7 @@
*/
@Override
protected String[] parseString( String stringList ) {
- String[] values = Utils.getTokens(stringList, Character.toString(FOLDER_NAME_DELIMITER), true);
-
- this.folderNames.clear();
- this.folderNames.addAll(Arrays.asList(values));
-
- return values;
+ return Utils.getTokens(stringList, Character.toString(this.filter.getFolderNameDelimiter()), true);
}
/**
@@ -113,7 +86,7 @@
*/
@Override
public void verifyText( VerifyEvent event ) {
- for (char c : FOLDER_NAME_INVALID_CHARS.toCharArray()) {
+ for (char c : this.filter.getFolderNameInvalidCharacters().toCharArray()) {
if (c == event.character) {
event.doit = false;
break;
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ModeShapePreferencePage.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ModeShapePreferencePage.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ModeShapePreferencePage.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -12,10 +12,15 @@
package org.jboss.tools.modeshape.rest.preferences;
import static org.jboss.tools.modeshape.rest.IUiConstants.ModeShape_IMAGE_16x;
-import static org.jboss.tools.modeshape.rest.IUiConstants.PREFERENCE_PAGE_HELP_CONTEXT;
+import static org.jboss.tools.modeshape.rest.IUiConstants.HelpContexts.PREFERENCE_PAGE_HELP_CONTEXT;
+import static org.jboss.tools.modeshape.rest.IUiConstants.Preferences.ENABLE_RESOURCE_VERSIONING;
import static org.jboss.tools.modeshape.rest.RestClientI18n.preferencePageDescription;
+import static org.jboss.tools.modeshape.rest.RestClientI18n.preferencePageEnableVersioningEditor;
+import static org.jboss.tools.modeshape.rest.RestClientI18n.preferencePageEnableVersioningEditorToolTip;
import static org.jboss.tools.modeshape.rest.RestClientI18n.preferencePageMessage;
import static org.jboss.tools.modeshape.rest.RestClientI18n.preferencePageTitle;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
@@ -30,29 +35,16 @@
import org.jboss.tools.modeshape.rest.Activator;
/**
- * The <code>ModeShapePreferencePage</code> is the UI for managing all ModeShape-related preferences.
+ * The <code>ModeShapePreferencePage</code> is the UI for managing general ModeShape-related preferences.
*/
public final class ModeShapePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
- * The editor used to manage the list of filtered file extensions.
+ * The editor used to enable and disable versioning in ModeShape.
*/
- private FilteredFileExtensionEditor extensionsEditor;
+ private BooleanFieldEditor enableVersioningEditor;
/**
- * The editor used to manage the list of filtered folder names.
- */
- private FilteredFoldersEditor foldersEditor;
-
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
- /**
* {@inheritDoc}
*
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
@@ -63,22 +55,16 @@
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));
+ // create the field editor
+ this.enableVersioningEditor = new BooleanFieldEditor(ENABLE_RESOURCE_VERSIONING,
+ preferencePageEnableVersioningEditor.text(),
+ panel);
+ this.enableVersioningEditor.setPreferenceStore(getPreferenceStore());
+ this.enableVersioningEditor.getDescriptionControl(panel).setToolTipText(preferencePageEnableVersioningEditorToolTip.text());
- // populate the extensions editor
- this.extensionsEditor.load();
+ // populate the editor with current preference value
+ this.enableVersioningEditor.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);
@@ -153,8 +139,7 @@
*/
@Override
protected void performDefaults() {
- this.extensionsEditor.loadDefault();
- this.foldersEditor.loadDefault();
+ this.enableVersioningEditor.loadDefault();
super.performDefaults();
}
@@ -165,9 +150,22 @@
*/
@Override
public boolean performOk() {
- this.extensionsEditor.store();
- this.foldersEditor.store();
+ this.enableVersioningEditor.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.enableVersioningEditor.setFocus();
+ }
+ }
}
Deleted: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/NewItemDialog.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/NewItemDialog.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/NewItemDialog.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -1,190 +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.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-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.modeshape.common.util.CheckArg;
-
-/**
- * A <code>NewItemDialog</code> allows the user to enter a new file extension or new folder name that they wish to be filtered out
- * of all publishing operations.
- */
-public final class NewItemDialog extends Dialog implements ModifyListener {
-
- // =======================================================================================================================
- // Fields
- // =======================================================================================================================
-
- /**
- * The label describing the new item.
- */
- private final String label;
-
- /**
- * 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;
-
- // =======================================================================================================================
- // Constructors
- // =======================================================================================================================
-
- /**
- * @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");
- CheckArg.isNotNull(label, "label");
-
- this.title = title;
- this.label = label;
- this.verifyListener = verifyListener;
-
- setShellStyle(getShellStyle() | SWT.RESIZE);
- }
-
- // =======================================================================================================================
- // Methods
- // =======================================================================================================================
-
- /**
- * {@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.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);
- }
-
- 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 ) {
- // disable OK button if text field does not have any characters
- this.newItem = ((Text)event.widget).getText();
- boolean enable = (this.newItem.length() != 0);
-
- if (getButton(OK).getEnabled() != enable) {
- getButton(OK).setEnabled(enable);
- }
- }
-
-}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PrefUtils.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PrefUtils.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PrefUtils.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -11,18 +11,10 @@
*/
package org.jboss.tools.modeshape.rest.preferences;
-import static org.jboss.tools.modeshape.rest.IUiConstants.FILTERED_FILE_EXTENSIONS_PREFERENCE;
-import static org.jboss.tools.modeshape.rest.IUiConstants.FILTERED_FOLDER_NAMES_PREFERENCE;
-import static org.jboss.tools.modeshape.rest.RestClientI18n.prefUtilsPropertyFileNotFound;
-import static org.jboss.tools.modeshape.rest.RestClientI18n.prefUtilsPropertyNotFound;
-import java.io.InputStream;
-import java.util.Properties;
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;
-import org.modeshape.web.jcr.rest.client.Status;
-import org.modeshape.web.jcr.rest.client.Status.Severity;
/**
* The <code>PrefUtils</code> class provides common utilities relating to preferences. This class assumes the Eclipse runtime
@@ -30,155 +22,7 @@
*/
public final class PrefUtils {
- // =======================================================================================================================
- // Constants
- // =======================================================================================================================
-
/**
- * The name of the properties file located in this package.
- */
- private static final String PREFERENCES_FILE = "prefs.properties";
-
- /**
- * The preference name for the delimiter that separates filtered file extensions when the preference value is stored.
- */
- private static final String FILE_EXT_DELIMITER_PREF_NAME = "fileExtension.delimiter";
-
- /**
- * The delimiter that separates filtered file extensions when the preference value is stored.
- */
- public static final char FILE_EXT_DELIMITER;
-
- /**
- * The preference name for characters that are <strong>NOT</strong> allowed to appear in a file extension.
- */
- private static final String FILE_EXT_INVALID_CHARS_PREF_NAME = "fileExtension.invalidChars";
-
- /**
- * The characters that are <strong>NOT</strong> allowed to appear in a file extension.
- */
- public static final String FILE_EXT_INVALID_CHARS;
-
- /**
- * The preference name for the delimiter that separates filtered folder names when the preference value is stored.
- */
- private static final String FOLDER_NAME_DELIMITER_PREF_NAME = "folderName.delimiter";
-
- /**
- * The delimiter that separates filtered folder names when the preference value is stored.
- */
- public static final char FOLDER_NAME_DELIMITER;
-
- /**
- * 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";
-
- /**
- * The characters that are <strong>NOT</strong> allowed to appear in a folder name.
- */
- public static final String FOLDER_NAME_INVALID_CHARS;
-
- // =======================================================================================================================
- // Class Initializer
- // =======================================================================================================================
-
- static {
- InputStream is = null;
- Properties preferenceProperties = new Properties();
-
- // get the properties file
- try {
- is = PrefUtils.class.getResourceAsStream(PREFERENCES_FILE);
- } catch (Exception e) {
- Activator.getDefault().log(new Status(Severity.ERROR, e.getMessage(), e));
- }
-
- if (is == null) {
- Activator.getDefault().log(new Status(Severity.ERROR, prefUtilsPropertyFileNotFound.text(), null));
- } else {
- // load the properties file
- try {
- preferenceProperties.load(is);
- } catch (Exception e) {
- Activator.getDefault().log(new Status(Severity.ERROR, e.getMessage(), e));
- } finally {
- try {
- is.close();
- } catch (Exception e) {
- Activator.getDefault().log(new Status(Severity.ERROR, e.getMessage(), e));
- }
- }
- }
-
- // file extensions delimiter
- String temp = preferenceProperties.getProperty(FILE_EXT_DELIMITER_PREF_NAME);
-
- if ((temp != null) && (temp.length() > 0)) {
- FILE_EXT_DELIMITER = temp.charAt(0);
- } else {
- // make sure preference has a value
- FILE_EXT_DELIMITER = ',';
- Activator.getDefault().log(new Status(Severity.ERROR, prefUtilsPropertyNotFound.text(FILE_EXT_DELIMITER_PREF_NAME),
- null));
- }
-
- // file extension invalid characters
- temp = preferenceProperties.getProperty(FILE_EXT_INVALID_CHARS_PREF_NAME);
-
- if ((temp != null) && (temp.length() > 0)) {
- FILE_EXT_INVALID_CHARS = temp;
- } else {
- // make sure preference has a value
- FILE_EXT_INVALID_CHARS = "*?<>|/\\:;.";
- Activator.getDefault().log(new Status(Severity.ERROR,
- prefUtilsPropertyNotFound.text(FILE_EXT_INVALID_CHARS_PREF_NAME), null));
- }
-
- // folder names delimiter
- temp = preferenceProperties.getProperty(FOLDER_NAME_DELIMITER_PREF_NAME);
-
- if ((temp != null) && (temp.length() > 0)) {
- FOLDER_NAME_DELIMITER = temp.charAt(0);
- } else {
- // make sure preference has a value
- FOLDER_NAME_DELIMITER = ',';
- Activator.getDefault().log(new Status(Severity.ERROR,
- prefUtilsPropertyNotFound.text(FOLDER_NAME_DELIMITER_PREF_NAME), null));
- }
-
- // folder name invalid characters
- temp = preferenceProperties.getProperty(FOLDER_NAME_INVALID_CHARS_PREF_NAME);
-
- if ((temp != null) && (temp.length() > 0)) {
- FOLDER_NAME_INVALID_CHARS = temp;
- } else {
- // make sure preference has a value
- FOLDER_NAME_INVALID_CHARS = "*?<>|/\\:;";
- Activator.getDefault().log(new Status(Severity.ERROR,
- prefUtilsPropertyNotFound.text(FOLDER_NAME_INVALID_CHARS_PREF_NAME), null));
- }
- }
-
- // =======================================================================================================================
- // Class Methods
- // =======================================================================================================================
-
- /**
- * @return the file extensions being filtered out of publishing operations (never null)
- */
- public static String[] getFilteredFileExtensions() {
- return getListPropertyValue(FILTERED_FILE_EXTENSIONS_PREFERENCE, FILE_EXT_DELIMITER, true);
- }
-
- /**
- * @return the folder names being filtered out of publishing operations (never null)
- */
- public static String[] getFilteredFolderNames() {
- return getListPropertyValue(FILTERED_FOLDER_NAMES_PREFERENCE, FOLDER_NAME_DELIMITER, true);
- }
-
- /**
* @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
@@ -187,7 +31,7 @@
public static String[] getListPropertyValue( String propertyId,
char delimiter,
boolean removeDuplicates ) {
- CheckArg.isNotNull(propertyId, "propertyId");
+ CheckArg.isNotNull(propertyId, "propertyId"); //$NON-NLS-1$
return Utils.getTokens(getPreferenceStore().getString(propertyId), Character.toString(delimiter), removeDuplicates);
}
@@ -206,15 +50,11 @@
public static void setListPropertyValue( String propertyId,
String[] items,
char delimiter ) {
- CheckArg.isNotNull(propertyId, "propertyId");
- CheckArg.isNotNull(items, "items");
+ CheckArg.isNotNull(propertyId, "propertyId"); //$NON-NLS-1$
+ CheckArg.isNotNull(items, "items"); //$NON-NLS-1$
getPreferenceStore().setValue(propertyId, Utils.combineTokens(items, delimiter));
}
- // =======================================================================================================================
- // Constructors
- // =======================================================================================================================
-
/**
* Don't allow construction.
*/
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PreferenceInitializer.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PreferenceInitializer.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PreferenceInitializer.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -0,0 +1,87 @@
+/*
+ * 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.jboss.tools.modeshape.rest.IUiConstants.PLUGIN_ID;
+import static org.jboss.tools.modeshape.rest.RestClientI18n.preferenceDefaultScopeNotFound;
+import static org.jboss.tools.modeshape.rest.RestClientI18n.preferenceFileNotFound;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.jboss.tools.modeshape.rest.Activator;
+import org.modeshape.web.jcr.rest.client.Status;
+import org.modeshape.web.jcr.rest.client.Status.Severity;
+
+/**
+ *
+ */
+public final class PreferenceInitializer extends AbstractPreferenceInitializer {
+
+ /**
+ * The name of the preferences default values properties file located in this package.
+ */
+ private static final String PREFERENCES_FILE = "prefs.properties"; //$NON-NLS-1$
+
+ /**
+ * The default preference values.
+ */
+ private Properties preferenceDefaults;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
+ */
+ @Override
+ public void initializeDefaultPreferences() {
+ IEclipsePreferences defaultValues = new DefaultScope().getNode(PLUGIN_ID);
+
+ if (defaultValues == null) {
+ // would only happen if PLUGIN_ID is wrong
+ Activator.getDefault().log(new Status(Severity.ERROR, preferenceDefaultScopeNotFound.text(PLUGIN_ID), null));
+ } else {
+ load();
+
+ // set default values
+ for (String property : this.preferenceDefaults.stringPropertyNames()) {
+ defaultValues.put(property, this.preferenceDefaults.getProperty(property));
+ }
+ }
+ }
+
+ private void load() {
+ this.preferenceDefaults = new Properties();
+ InputStream input = null;
+
+ try {
+ input = getClass().getResource(PREFERENCES_FILE).openStream();
+
+ if (input == null) {
+ Activator.getDefault().log(new Status(Severity.ERROR, preferenceFileNotFound.text(PREFERENCES_FILE), null));
+ } else {
+ this.preferenceDefaults.load(input);
+ }
+ } catch (IOException e) {
+ Activator.getDefault().log(new Status(Severity.ERROR, preferenceFileNotFound.text(PREFERENCES_FILE), null));
+ } finally {
+ try {
+ if (input != null) {
+ input.close();
+ }
+ } catch (IOException e) {
+ Activator.getDefault().log(new Status(Severity.ERROR, e.getMessage(), e));
+ }
+ }
+ }
+
+}
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PreferenceInitializer.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilter.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilter.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PublishingFileFilter.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -11,58 +11,55 @@
*/
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.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.
*/
public final class PublishingFileFilter {
- // =======================================================================================================================
- // Fields
- // =======================================================================================================================
+ /**
+ * The preference name for the delimiter that separates filtered file extensions when the preference value is stored.
+ */
+ private static final String FILE_EXT_DELIMITER_PREF_NAME = "fileExtension.delimiter"; //$NON-NLS-1$
/**
- * The file extensions that should not be involved in publishing operations.
+ * The preference name for characters that are <strong>NOT</strong> allowed to appear in a file extension.
*/
- private final String[] filteredFileExtensions;
+ private static final String FILE_EXT_INVALID_CHARS_PREF_NAME = "fileExtension.invalidChars"; //$NON-NLS-1$
/**
- * The folder names that should not be involved in publishing operations.
+ * The preference name for the delimiter that separates filtered folder names when the preference value is stored.
*/
- private final String[] filteredFolderNames;
+ private static final String FOLDER_NAME_DELIMITER_PREF_NAME = "folderName.delimiter"; //$NON-NLS-1$
- // =======================================================================================================================
- // Constructors
- // =======================================================================================================================
-
/**
- * Construct a filter using the current preferences.
+ * The preference name for characters that are <strong>NOT</strong> allowed to appear in a folder name.
*/
- public PublishingFileFilter() {
- this.filteredFileExtensions = PrefUtils.getFilteredFileExtensions();
- this.filteredFolderNames = PrefUtils.getFilteredFolderNames();
- }
+ private static final String FOLDER_NAME_INVALID_CHARS_PREF_NAME = "folderName.invalidChars"; //$NON-NLS-1$
- // =======================================================================================================================
- // Methods
- // =======================================================================================================================
-
/**
* @param resource the resource being tested (never <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");
+ CheckArg.isNotNull(resource, "resource"); //$NON-NLS-1$
if (resource instanceof IFolder) {
String name = resource.getName();
// see if folder name has been filtered
- for (String filteredName : this.filteredFolderNames) {
+ for (String filteredName : getFilteredFolderNames()) {
if (filteredName.equals(name)) {
return false;
}
@@ -74,7 +71,7 @@
}
} else if (resource instanceof IFile) {
// see if file extension has been filtered
- for (String extension : this.filteredFileExtensions) {
+ for (String extension : getFilteredFileExtensions()) {
if (resource.getFullPath().toString().endsWith('.' + extension)) {
return false;
}
@@ -90,4 +87,95 @@
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);
+ }
+
+ // 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);
+ }
+
+ /**
+ * 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: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/SortedListEditor.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/SortedListEditor.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/SortedListEditor.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -0,0 +1,371 @@
+/*
+ * 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;
+ }
+ }
+
+ }
+}
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/SortedListEditor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/prefs.properties
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/prefs.properties 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/prefs.properties 2011-04-01 16:10:15 UTC (rev 30219)
@@ -10,11 +10,14 @@
# individual contributors.
#
-# This properties file is read in by PrefUtils. The delimiter values are used when the preference values are stored and the
-# valid character values are used by the editors when they validate user input.
+# 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.
fileExtension.delimiter = ,
fileExtension.invalidChars = *?<>|/\:;.
folderName.delimiter = ,
-folderName.invalidChars = *?<>|/\:;
\ No newline at end of file
+folderName.invalidChars = *?<>|/\:;
+
+# indicates if ModeShape server should version resources
+enableVersioning = false
\ No newline at end of file
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ServerView.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ServerView.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ServerView.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -12,7 +12,8 @@
package org.jboss.tools.modeshape.rest.views;
import static org.jboss.tools.modeshape.rest.IUiConstants.COLLAPSE_ALL_IMAGE;
-import static org.jboss.tools.modeshape.rest.IUiConstants.SERVER_VIEW_HELP_CONTEXT;
+import static org.jboss.tools.modeshape.rest.IUiConstants.HelpContexts.SERVER_VIEW_HELP_CONTEXT;
+
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IToolBarManager;
@@ -53,10 +54,6 @@
*/
public final class ServerView extends ViewPart implements IServerRegistryListener {
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* Collapses all tree nodes.
*/
@@ -89,10 +86,6 @@
private TreeViewer viewer;
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
private void constructActions() {
// the collapse all action is always enabled
this.collapseAllAction = new Action() {
@@ -325,7 +318,7 @@
* @param selection the current viewer selection (never <code>null</code>)
*/
private void updateStatusLine( IStructuredSelection selection ) {
- String msg = (selection.size() != 1 ? "" : ((IModeShapeObject)selection.getFirstElement()).getShortDescription());
+ String msg = (selection.size() != 1 ? "" : ((IModeShapeObject)selection.getFirstElement()).getShortDescription()); //$NON-NLS-1$
getViewSite().getActionBars().getStatusLineManager().setMessage(msg);
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -11,13 +11,17 @@
*/
package org.jboss.tools.modeshape.rest.wizards;
-import static org.jboss.tools.modeshape.rest.IUiConstants.PUBLISH_DIALOG_HELP_CONTEXT;
+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.MAIN_PREFERENCE_PAGE_ID;
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
@@ -41,13 +45,15 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.help.IWorkbenchHelpSystem;
import org.jboss.tools.modeshape.rest.Activator;
import org.jboss.tools.modeshape.rest.IServerRegistryListener;
import org.jboss.tools.modeshape.rest.RestClientI18n;
import org.jboss.tools.modeshape.rest.ServerManager;
import org.jboss.tools.modeshape.rest.ServerRegistryEvent;
+import org.jboss.tools.modeshape.rest.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.PublishingFileFilter;
@@ -63,38 +69,26 @@
*/
public final class PublishPage extends WizardPage implements IServerRegistryListener, ModifyListener {
- // ===========================================================================================================================
- // Constants
- // ===========================================================================================================================
-
/**
* The default repository workspace area where files are published.
*/
- private static final String DEFAULT_WORKSPACE_AREA = "/files";
+ private static final String DEFAULT_WORKSPACE_AREA = "/files"; //$NON-NLS-1$
/**
* The key in the wizard <code>IDialogSettings</code> for the recurse flag.
*/
- private static final String RECURSE_KEY = "recurse";
+ private static final String RECURSE_KEY = "recurse"; //$NON-NLS-1$
/**
* The key in the wizard <code>IDialogSettings</code> for the workspace area path segment.
*/
- private static final String WORKSPACE_AREA_KEY = "workspaceArea";
+ private static final String WORKSPACE_AREA_KEY = "workspaceArea"; //$NON-NLS-1$
- // ===========================================================================================================================
- // Class Fields
- // ===========================================================================================================================
-
/**
* Indicates if the file filter should be used.
*/
private static boolean filterFiles = true;
- // ===========================================================================================================================
- // Class Methods
- // ===========================================================================================================================
-
/**
* @param container the project or folder whose files are being requested
* @param recurse the flag indicating if child containers should be traversed
@@ -265,10 +259,6 @@
return result;
}
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* The repository chooser control.
*/
@@ -285,6 +275,11 @@
private Combo cbxWorkspace;
/**
+ * The workspace area chooser control.
+ */
+ private Combo cbxWorkspaceAreas;
+
+ /**
* The files being published or unpublished (never <code>null</code>).
*/
private List<IFile> files;
@@ -340,6 +335,11 @@
private final Type type;
/**
+ * Indicates if versioning of published resources should be done.
+ */
+ private boolean versioning = true;
+
+ /**
* The workspace where the resources are being published/unpublished (may be <code>null</code>).
*/
private Workspace workspace;
@@ -354,10 +354,6 @@
*/
private List<Workspace> workspaces;
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* @param type indicates if publishing or unpublishing is being done
* @param resources the resources being published or unpublished (never <code>null</code>)
@@ -366,7 +362,7 @@
public PublishPage( Type type,
List<IResource> resources ) throws CoreException {
super(PublishPage.class.getSimpleName());
- CheckArg.isNotNull(resources, "resources");
+ CheckArg.isNotNull(resources, "resources"); //$NON-NLS-1$
setTitle((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishTitle.text()
: RestClientI18n.publishPageUnpublishTitle.text());
setPageComplete(false);
@@ -378,10 +374,6 @@
this.filter = (filterFiles ? new PublishingFileFilter() : null);
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
private void constructLocationPanel( Composite parent ) {
Group pnl = new Group(parent, SWT.NONE);
pnl.setText(RestClientI18n.publishPageLocationGroupTitle.text());
@@ -473,25 +465,9 @@
lblWorkspaceArea.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
lblWorkspaceArea.setText(RestClientI18n.publishPageWorkspaceAreaLabel.text());
- Text txtWorkspaceArea = new Text(pnl, SWT.BORDER);
- txtWorkspaceArea.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- txtWorkspaceArea.setToolTipText(RestClientI18n.publishPageWorkspaceAreaToolTip.text());
- txtWorkspaceArea.addModifyListener(new ModifyListener() {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- @Override
- public void modifyText( ModifyEvent e ) {
- handleWorkspaceAreaModified(((Text)e.widget).getText());
- }
- });
-
- // set the workspace area from the dialog settings
- String temp = getDialogSettings().get(WORKSPACE_AREA_KEY);
- this.workspaceArea = ((temp == null) ? DEFAULT_WORKSPACE_AREA : temp);
- txtWorkspaceArea.setText(this.workspaceArea);
+ this.cbxWorkspaceAreas = new Combo(pnl, SWT.DROP_DOWN);
+ this.cbxWorkspaceAreas.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+ this.cbxWorkspaceAreas.setToolTipText(RestClientI18n.publishPageWorkspaceAreaToolTip.text());
}
}
@@ -503,7 +479,8 @@
// pnl layout:
// row 1: lbl
// row 2: lstResources
- // row 3: chkbox
+ // row 3: recurse chkbox
+ // row 4: versioning chkbox and link (only when publishing)
{ // row 1
Label lbl = new Label(pnl, SWT.LEFT);
@@ -517,9 +494,12 @@
}
{ // row 2
- this.lstResources = new org.eclipse.swt.widgets.List(pnl, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+ this.lstResources = new org.eclipse.swt.widgets.List(pnl, SWT.BORDER | SWT.H_SCROLL
+ | SWT.V_SCROLL);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.horizontalSpan = 2;
+ gd.minimumHeight = this.lstResources.getItemHeight() * 2; // set min height
+ gd.heightHint = this.lstResources.getItemHeight() * 10; // set preferred height
this.lstResources.setLayoutData(gd);
final org.eclipse.swt.widgets.List finalLst = this.lstResources;
@@ -542,7 +522,7 @@
loadFiles();
}
- { // row 3
+ { // row 3 recurse chkbox
Button chkRecurse = new Button(pnl, SWT.CHECK);
chkRecurse.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
chkRecurse.setText(RestClientI18n.publishPageRecurseCheckBox.text());
@@ -580,6 +560,51 @@
}
});
}
+
+ if (this.type == Type.PUBLISH) {
+ // row 4 versioning chkbox and link to open preference page
+ Composite pnlVersioning = new Composite(pnl, SWT.NONE);
+ pnlVersioning.setLayout(new GridLayout(2, false));
+ ((GridLayout)pnlVersioning.getLayout()).marginWidth = 0;
+ pnlVersioning.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true));
+ ((GridData)pnlVersioning.getLayoutData()).minimumHeight = 30;
+
+ Button chkVersioning = new Button(pnlVersioning, SWT.CHECK);
+ chkVersioning.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ chkVersioning.setText(RestClientI18n.publishPageVersionCheckBox.text());
+ chkVersioning.setToolTipText(RestClientI18n.publishPageVersionCheckBoxToolTip.text());
+
+ // set the version flag based on preference
+ this.versioning = Activator.getDefault().getPreferenceStore().getBoolean(ENABLE_RESOURCE_VERSIONING);
+
+ chkVersioning.setSelection(this.versioning);
+ chkVersioning.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ handleVersioningChanged(((Button)e.widget).getSelection());
+ }
+ });
+
+ Link link = new Link(pnlVersioning, SWT.WRAP);
+ link.setText(RestClientI18n.publishPageOpenPreferencePageLink.text());
+ link.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ link.addSelectionListener(new SelectionAdapter() {
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected( SelectionEvent e ) {
+ handleOpenPreferencePage();
+ }
+ });
+ }
}
/**
@@ -600,6 +625,7 @@
this.cbxRepository.addModifyListener(this);
this.cbxServer.addModifyListener(this);
this.cbxWorkspace.addModifyListener(this);
+ this.cbxWorkspaceAreas.addModifyListener(this);
// register with the help system
IWorkbenchHelpSystem helpSystem = Activator.getDefault().getWorkbench().getHelpSystem();
@@ -650,6 +676,17 @@
}
/**
+ * Opens the preference page.
+ */
+ void handleOpenPreferencePage() {
+ // open preference page and only allow the pref page where the version setting is
+ PreferencesUtil.createPreferenceDialogOn(getShell(),
+ MAIN_PREFERENCE_PAGE_ID,
+ new String[] { MAIN_PREFERENCE_PAGE_ID },
+ null).open();
+ }
+
+ /**
* Saves the recurse setting and reloads the files to be published or unpublished.
*
* @param selected the flag indicating the new recurse setting
@@ -708,15 +745,28 @@
}
/**
- * Handler for when the workspace area value is modified.
+ * Saves the versioning setting.
*
- * @param workspaceArea the new workspace area (never <code>null</code>)
+ * @param selected the flag indicating the new versioning setting
*/
- void handleWorkspaceAreaModified( String workspaceArea ) {
- this.workspaceArea = workspaceArea.trim();
+ void handleVersioningChanged( boolean selected ) {
+ this.versioning = selected;
}
/**
+ * Handler for when the workspace area value is modified.
+ */
+ void handleWorkspaceAreaModified() {
+ int index = this.cbxWorkspaceAreas.getSelectionIndex();
+
+ if (index == -1) {
+ this.workspaceArea = this.cbxWorkspaceAreas.getText();
+ } else {
+ this.workspaceArea = this.cbxWorkspaceAreas.getItems()[index];
+ }
+ }
+
+ /**
* Handler for when the workspace control value is modified.
*/
void handleWorkspaceModified() {
@@ -724,9 +774,46 @@
// make sure there is a selection
if (index != -1) {
- this.workspace = this.workspaces.get(index);
+ Workspace newWorkspace = this.workspaces.get(index);
+
+ if ((this.workspace == null) || !this.workspace.equals(newWorkspace)) {
+ this.workspace = newWorkspace;
+
+ // update workspace areas
+ WorkspaceArea[] workspaceAreas = null;
+
+ try {
+ workspaceAreas = getServerManager().getWorkspaceAreas(this.workspace);
+ } catch (Exception e) {
+ Activator.getDefault()
+ .log(new Status(Severity.ERROR,
+ RestClientI18n.publishPageUnableToObtainWorkspaceAreas.text(this.workspace),
+ e));
+ }
+
+ if ((workspaceAreas == null) || (workspaceAreas.length == 0)) {
+ // populate with default area name
+ this.cbxWorkspaceAreas.setItems(new String[] { DEFAULT_WORKSPACE_AREA });
+ } else {
+ String[] areaPaths = new String[workspaceAreas.length];
+ int i = 0;
+
+ for (WorkspaceArea area : workspaceAreas) {
+ areaPaths[i++] = area.getPath();
+ }
+
+ this.cbxWorkspaceAreas.setItems(areaPaths);
+ }
+ }
+ } else {
+ this.workspaceArea = null;
+ this.cbxWorkspaceAreas.removeAll();
}
+ if (this.cbxWorkspaceAreas.getItemCount() != 0) {
+ this.cbxWorkspaceAreas.select(0);
+ }
+
updateState();
}
@@ -738,6 +825,13 @@
}
/**
+ * @return <code>true</code> if versioning of published resources should be done
+ */
+ boolean isVersioning() {
+ return this.versioning;
+ }
+
+ /**
* Populates the list of files to be published based on the recurse flag and the list of workspace selected resources.
* Pre-condition is that {@link #processResources(List, boolean, PublishingFileFilter)} has been called.
*/
@@ -762,14 +856,16 @@
handleRepositoryModified();
} else if (e.widget == this.cbxWorkspace) {
handleWorkspaceModified();
+ } else if (e.widget == this.cbxWorkspaceAreas) {
+ handleWorkspaceAreaModified();
} else {
assert false; // should not happen
}
}
/**
- * Refreshes the repository-related fields and controls based on the server registry. This in turn causes the workspaces to
- * also to be refreshed.
+ * Refreshes the repository-related fields and controls based on the server registry. This in turn causes the workspaces to also
+ * to be refreshed.
*/
private void refreshRepositories() {
this.repository = null;
@@ -783,10 +879,6 @@
this.repositories = Collections.emptyList();
String msg = RestClientI18n.serverManagerGetRepositoriesExceptionMsg.text(this.server.getShortDescription());
Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
-
- if (getControl().isVisible()) {
- MessageDialog.openError(getShell(), RestClientI18n.errorDialogTitle.text(), msg);
- }
}
}
@@ -880,41 +972,50 @@
this.workspaces = Collections.emptyList();
String msg = RestClientI18n.serverManagerGetWorkspacesExceptionMsg.text(this.repository);
Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
-
- if (getControl().isVisible()) {
- MessageDialog.openError(getShell(), RestClientI18n.errorDialogTitle.text(), msg);
- }
}
}
// clear items
this.cbxWorkspace.removeAll();
+ this.cbxWorkspaceAreas.removeAll();
// reload
if (this.workspaces.isEmpty()) {
- // disable control if necessary
+ // disable controls if necessary
if (this.cbxWorkspace.getEnabled()) {
this.cbxWorkspace.setEnabled(false);
}
+
+ if (this.cbxWorkspaceAreas.getEnabled()) {
+ this.cbxWorkspaceAreas.setEnabled(false);
+ }
} else if (this.workspaces.size() == 1) {
- this.workspace = this.workspaces.get(0);
- this.cbxWorkspace.add(this.workspace.getName());
+ Workspace temp = this.workspaces.get(0);
+ this.cbxWorkspace.add(temp.getName());
this.cbxWorkspace.select(0);
- // enable control if necessary
+ // enable controls if necessary
if (!this.cbxWorkspace.getEnabled()) {
this.cbxWorkspace.setEnabled(true);
}
+
+ if (!this.cbxWorkspaceAreas.getEnabled()) {
+ this.cbxWorkspaceAreas.setEnabled(true);
+ }
} else {
// add an item for each workspace
for (Workspace workspace : this.workspaces) {
this.cbxWorkspace.add(workspace.getName());
}
- // enable control if necessary
+ // enable controls if necessary
if (!this.cbxWorkspace.getEnabled()) {
this.cbxWorkspace.setEnabled(true);
}
+
+ if (!this.cbxWorkspaceAreas.getEnabled()) {
+ this.cbxWorkspaceAreas.setEnabled(true);
+ }
}
}
@@ -1020,7 +1121,8 @@
String msg = null;
Severity severity = Severity.ERROR;
- if ((this.resources == null) || this.resources.isEmpty() || this.files.isEmpty()) {
+ if ((this.resources == null) || this.resources.isEmpty()
+ || this.files.isEmpty()) {
msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPageNoResourcesToPublishStatusMsg.text()
: RestClientI18n.publishPageNoResourcesToUnpublishStatusMsg.text());
} else if (this.server == null) {
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishWizard.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishWizard.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishWizard.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -12,7 +12,9 @@
package org.jboss.tools.modeshape.rest.wizards;
import static org.jboss.tools.modeshape.rest.IUiConstants.WIZARD_BANNER_IMAGE;
+
import java.util.List;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
@@ -33,10 +35,6 @@
*/
public final class PublishWizard extends Wizard {
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* The wizard page containing all the controls that allow publishing/unpublishing of resources.
*/
@@ -52,10 +50,6 @@
*/
private final Type type;
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* @param type the publishing or unpublishing indicator (never <code>null</code>)
* @param resources the resources being published or unpublished (never <code>null</code>)
@@ -65,9 +59,9 @@
public PublishWizard( Type type,
List<IResource> resources,
ServerManager serverManager ) throws CoreException {
- CheckArg.isNotNull(type, "type");
- CheckArg.isNotNull(resources, "resources");
- CheckArg.isNotNull(serverManager, "serverManager");
+ CheckArg.isNotNull(type, "type"); //$NON-NLS-1$
+ CheckArg.isNotNull(resources, "resources"); //$NON-NLS-1$
+ CheckArg.isNotNull(serverManager, "serverManager"); //$NON-NLS-1$
this.type = type;
this.page = new PublishPage(type, resources);
@@ -78,10 +72,6 @@
setDefaultPageImageDescriptor(Activator.getDefault().getImageDescriptor(WIZARD_BANNER_IMAGE));
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* {@inheritDoc}
*
@@ -141,7 +131,7 @@
Workspace workspace = this.page.getWorkspace();
List<IFile> files = this.page.getFiles();
String workspaceArea = this.page.getWorkspaceArea();
- PublishJob job = new PublishJob(this.type, files, workspace, workspaceArea);
+ PublishJob job = new PublishJob(this.type, files, workspace, workspaceArea, this.page.isVersioning());
job.schedule();
return true;
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerPage.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerPage.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerPage.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -12,7 +12,7 @@
package org.jboss.tools.modeshape.rest.wizards;
import static org.jboss.tools.modeshape.rest.IUiConstants.BLANK_IMAGE;
-import static org.jboss.tools.modeshape.rest.IUiConstants.SERVER_DIALOG_HELP_CONTEXT;
+import static org.jboss.tools.modeshape.rest.IUiConstants.HelpContexts.SERVER_DIALOG_HELP_CONTEXT;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IMessageProvider;
@@ -49,10 +49,6 @@
*/
public final class ServerPage extends WizardPage {
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* The button used to test the connection to the server. Should only be enabled when server properties are valid.
*/
@@ -88,10 +84,6 @@
*/
private String user;
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* Constructs a wizard page that will create a new server.
*/
@@ -117,10 +109,6 @@
this.savePassword = server.isPasswordBeingPersisted();
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
private void constructAuthenticationPanel( Composite parent ) {
Group pnl = new Group(parent, SWT.NONE);
pnl.setText(RestClientI18n.serverPageAuthenticationGroupTitle.text());
@@ -501,10 +489,10 @@
Server changedServer = getServer();
// don't check if modifying existing server and identifying properties have not changed
- if (((this.server == null) || !this.server.hasSameKey(changedServer))
- && getServerManager().isRegistered(changedServer)) {
+ if (((this.server == null) || !this.server.hasSameKey(changedServer)) && getServerManager().isRegistered(changedServer)) {
this.status = new Status(Severity.ERROR,
- RestClientI18n.serverExistsMsg.text(changedServer.getShortDescription()), null);
+ RestClientI18n.serverExistsMsg.text(changedServer.getShortDescription()),
+ null);
}
}
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerWizard.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerWizard.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerWizard.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -12,6 +12,7 @@
package org.jboss.tools.modeshape.rest.wizards;
import static org.jboss.tools.modeshape.rest.IUiConstants.WIZARD_BANNER_IMAGE;
+
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.wizard.Wizard;
import org.jboss.tools.modeshape.rest.Activator;
@@ -25,10 +26,6 @@
*/
public final class ServerWizard extends Wizard {
- // ===========================================================================================================================
- // Fields
- // ===========================================================================================================================
-
/**
* Non-<code>null</code> if the wizard is editing an existing server.
*/
@@ -44,10 +41,6 @@
*/
private final ServerManager serverManager;
- // ===========================================================================================================================
- // Constructors
- // ===========================================================================================================================
-
/**
* Constructs a wizard that creates a new server.
*
@@ -72,13 +65,11 @@
this.page = new ServerPage(server);
this.serverManager = serverManager;
this.existingServer = server;
+
+ setDefaultPageImageDescriptor(Activator.getDefault().getImageDescriptor(WIZARD_BANNER_IMAGE));
setWindowTitle(RestClientI18n.serverWizardEditServerTitle.text());
}
- // ===========================================================================================================================
- // Methods
- // ===========================================================================================================================
-
/**
* {@inheritDoc}
*
Copied: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/slf4j/impl/StaticLoggerBinder.java (from rev 28967, trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/StaticLoggerBinder.java)
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/slf4j/impl/StaticLoggerBinder.java (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/slf4j/impl/StaticLoggerBinder.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -0,0 +1,62 @@
+/*
+ * 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.slf4j.impl;
+
+import org.jboss.tools.modeshape.rest.log.EclipseLoggerFactory;
+import org.slf4j.ILoggerFactory;
+import org.slf4j.spi.LoggerFactoryBinder;
+
+public final class StaticLoggerBinder implements LoggerFactoryBinder {
+
+ /**
+ * The class name of the logger factory.
+ */
+ private static final String LOGGER_FACTORY_CLASS_NAME = EclipseLoggerFactory.class.getName();
+
+ /**
+ * The unique instance of this class.
+ */
+ private static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder();
+
+ /**
+ * @return the static instance of the logger
+ */
+ public static final StaticLoggerBinder getSingleton() {
+ return SINGLETON;
+ }
+
+ /**
+ * The logger factory used.
+ */
+ private final ILoggerFactory loggerFactory = new EclipseLoggerFactory();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.spi.LoggerFactoryBinder#getLoggerFactory()
+ */
+ @Override
+ public ILoggerFactory getLoggerFactory() {
+ return this.loggerFactory;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.slf4j.spi.LoggerFactoryBinder#getLoggerFactoryClassStr()
+ */
+ @Override
+ public String getLoggerFactoryClassStr() {
+ return LOGGER_FACTORY_CLASS_NAME;
+ }
+
+}
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/slf4j/impl/StaticLoggerBinder.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/.project
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/.project (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/.project 2011-04-01 16:10:15 UTC (rev 30219)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.modeshape.rest.doc.user</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/.settings/org.eclipse.pde.core.prefs
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/.settings/org.eclipse.pde.core.prefs (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/.settings/org.eclipse.pde.core.prefs 2011-04-01 16:10:15 UTC (rev 30219)
@@ -0,0 +1,4 @@
+#Tue Mar 22 12:35:06 CDT 2011
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/.settings/org.eclipse.pde.core.prefs
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/META-INF/MANIFEST.MF
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/META-INF/MANIFEST.MF (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/META-INF/MANIFEST.MF 2011-04-01 16:10:15 UTC (rev 30219)
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %bundleName
+Bundle-SymbolicName: org.jboss.tools.modeshape.rest.doc.user;singleton:=true
+Bundle-Version: 1.1.0.qualifier
+Bundle-Vendor: %bundleVendor
+Bundle-Localization: plugin
+Bundle-ActivationPolicy: lazy
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/ModeShapeHelpContexts.xml
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/ModeShapeHelpContexts.xml (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/ModeShapeHelpContexts.xml 2011-04-01 16:10:15 UTC (rev 30219)
@@ -0,0 +1,38 @@
+<!--
+ - 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.
+ -->
+<contexts>
+ <context id="serverViewHelpContext" title="ModeShape Server View">
+ <description>The ModeShape Server View shows all registered servers and their repositories and workspaces.</description>
+ <topic href="ServerView.html" label="Server View"/>
+ <topic href="ServerDialog.html" label="Server Dialog"/>
+ </context>
+ <context id="serverDialogHelpContext" title="Server Dialog">
+ <description>The ModeShape Server Dialog allows you to edit or create a server that hosts one or more repositories.</description>
+ <topic href="ServerDialog.html" label="Server Dialog"/>
+ <topic href="ServerView.html" label="Server View"/>
+ </context>
+ <context id="publishDialogHelpContext" title="ModeShape Publish and Unpublish Dialog Help">
+ <description>The Publish/Unpublish Dialog uploads or removes selected resources from the selected server.</description>
+ <topic href="PublishDialog.html" label="Publish/Unpublish Dialog"/>
+ <topic href="ServerDialog.html" label="Create a new server"/>
+ <topic href="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>
+ <topic href="ModeShapePreferencesDialog.html" label="ModeShape Preferences"/>
+ <topic href="PublishDialog.html" label="Publish/Unpublish Dialog"/>
+ </context>
+ <context id="messageConsoleHelpContext" title="ModeShape Message Console">
+ <description>The ModeShape Message Console contains the output from the publishing and unpublishing operations.</description>
+ <topic href="ModeShapeMessageConsole.html" label="ModeShape Message Console"/>
+ </context>
+</contexts>
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/ModeShapeHelpContexts.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/build.properties
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/build.properties (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/build.properties 2011-04-01 16:10:15 UTC (rev 30219)
@@ -0,0 +1,13 @@
+bin.includes = META-INF/,\
+ doc.zip,\
+ plugin.properties,\
+ plugin.xml,\
+ toc.xml,\
+ ModeShapeHelpContexts.xml
+src.includes = build.properties,\
+ doc.zip,\
+ toc.xml,\
+ plugin.xml,\
+ META-INF/,\
+ ModeShapeHelpContexts.xml,\
+ plugin.properties
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/build.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc.zip
===================================================================
(Binary files differ)
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/doc.zip
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/plugin.properties
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/plugin.properties (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/plugin.properties 2011-04-01 16:10:15 UTC (rev 30219)
@@ -0,0 +1,13 @@
+#
+# 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.
+#
+bundleName = ModeShape REST Eclipse Publishing Plug-in Guide
+bundleVendor = JBoss by Red Hat
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/plugin.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/plugin.xml
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/plugin.xml (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/plugin.xml 2011-04-01 16:10:15 UTC (rev 30219)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<!--
+ - 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.
+-->
+
+<plugin>
+
+<!-- Context Help -->
+ <extension point="org.eclipse.help.contexts">
+ <contexts
+ file="ModeShapeHelpContexts.xml"
+ plugin="org.jboss.tools.modeshape.rest">
+ </contexts>
+ </extension>
+
+<!-- Help Table of Contents -->
+ <extension point="org.eclipse.help.toc">
+ <toc file="toc.xml" primary="true" />
+ </extension>
+
+</plugin>
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/plugin.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/pom.xml
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/pom.xml (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/pom.xml 2011-04-01 16:10:15 UTC (rev 30219)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.2-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.modeshape</groupId>
+ <artifactId>org.jboss.tools.modeshape.rest.doc.user</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
\ No newline at end of file
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/pom.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/toc.xml
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/toc.xml (rev 0)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/toc.xml 2011-04-01 16:10:15 UTC (rev 30219)
@@ -0,0 +1,20 @@
+<!--
+ - 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.
+ -->
+<toc label="ModeShape Publishing">
+ <topic label="Publishing/Unpublishing Dialog" href="docs/PublishDialog.html"/>
+ <topic label="Server View" href="docs/ServerView.html"/>
+ <topic label="Server Dialog" href="docs/ServerDialog.html"/>
+ <topic label="ModeShape Message Console" href="docs/ModeShapeMessageConsole.html"/>
+ <topic label="Published Locations Dialog" href="docs/PublishedLocationsDialog.html"/>
+ <topic label="Resource Context Menu" href="docs/ResourceContextMenu.html"/>
+ <topic label="ModeShape Preferences Dialog" href="docs/ModeShapePreferencesDialog.html"/>
+</toc>
Property changes on: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest.doc.user/toc.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/MockRestClient.java
===================================================================
--- trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/MockRestClient.java 2011-04-01 16:01:07 UTC (rev 30218)
+++ trunk/modeshape/tests/org.jboss.tools.modeshape.rest.test/src/org/jboss/tools/modeshape/rest/MockRestClient.java 2011-04-01 16:10:15 UTC (rev 30219)
@@ -16,7 +16,9 @@
import java.util.Collection;
import java.util.List;
import java.util.Map;
+
import javax.jcr.nodetype.NodeType;
+
import org.modeshape.web.jcr.rest.client.IRestClient;
import org.modeshape.web.jcr.rest.client.Status;
import org.modeshape.web.jcr.rest.client.domain.QueryRow;
@@ -84,6 +86,19 @@
/**
* {@inheritDoc}
*
+ * @see org.modeshape.web.jcr.rest.client.IRestClient#publish(org.modeshape.web.jcr.rest.client.domain.Workspace,
+ * java.lang.String, java.io.File, boolean)
+ */
+ public Status publish( Workspace workspace,
+ String path,
+ File file,
+ boolean version ) {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.modeshape.web.jcr.rest.client.IRestClient#unpublish(org.modeshape.web.jcr.rest.client.domain.Workspace,
* java.lang.String, java.io.File)
*/
13 years, 11 months
JBoss Tools SVN: r30218 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core: src/org/jboss/tools/deltacloud/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-04-01 12:01:07 -0400 (Fri, 01 Apr 2011)
New Revision: 30218
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
Log:
[JBIDE-8668] updating driver state on each test if driver is UNKNOWN
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2011-04-01 15:59:45 UTC (rev 30217)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2011-04-01 16:01:07 UTC (rev 30218)
@@ -1,3 +1,11 @@
+2011-04-01 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/deltacloud/core/DeltaCloud.java
+ (updateDriver):
+ (isValid):
+ (isKnownDriver):
+ [JBIDE-8668] updating driver state on each test if driver is UNKNOWN
+
2011-03-24 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/deltacloud/core/DeltaCloud.java
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2011-04-01 15:59:45 UTC (rev 30217)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2011-04-01 16:01:07 UTC (rev 30218)
@@ -54,14 +54,14 @@
private String lastImageId = "";
private String lastRealmName = "";
private String lastProfileId = "";
-
+
private DeltaCloudClient client;
private DeltaCloudImagesRepository imagesRepo = new DeltaCloudImagesRepository();
private boolean areImagesLoaded = false;
private DeltaCloudInstancesRepository instancesRepo = new DeltaCloudInstancesRepository();
private boolean areInstancesLoaded = false;
-
+
private IImageFilter imageFilter;
private IInstanceFilter instanceFilter;
@@ -101,7 +101,7 @@
throws DeltaCloudException {
this.driver = driver;
- boolean nameChanged = updateName(name);
+ boolean nameChanged = updateName(name);
boolean connectionPropertiesChanged = updateConnectionProperties(url, username, password);
if (nameChanged || connectionPropertiesChanged) {
@@ -189,7 +189,32 @@
return driver;
}
+ private void updateDriver() {
+ try {
+ DeltaCloudDriver driver = getServerDriver(url);
+ this.driver = driver;
+ } catch (DeltaCloudException e) {
+ // ignore
+ }
+ }
+
+ /**
+ * Returns if this cloud points to a known cloud type. The implementation
+ * checks the driver type which will be valid if the url is a valid and
+ * known cloud. The credentials are not checked.
+ *
+ * @return <code>true</code> if this cloud is a known type
+ */
public boolean isValid() {
+ boolean isValid = isKnownDriver();
+ if (!isValid) {
+ updateDriver();
+ isValid = isKnownDriver();
+ }
+ return isValid;
+ }
+
+ protected boolean isKnownDriver() {
return driver != null
&& driver != DeltaCloudDriver.UNKNOWN;
}
@@ -484,8 +509,9 @@
// TODO: remove notification with all instanceRepo, replace by
// notifying the changed instance
firePropertyChange(PROP_INSTANCES, instances, repo.get());
-// int index = repo.indexOf(instance);
-// fireIndexedPropertyChange(PROP_INSTANCES, index, instance, instance);
+ // int index = repo.indexOf(instance);
+ // fireIndexedPropertyChange(PROP_INSTANCES, index, instance,
+ // instance);
}
return result;
} catch (DeltaCloudClientException e) {
13 years, 11 months
JBoss Tools SVN: r30217 - branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-04-01 11:59:45 -0400 (Fri, 01 Apr 2011)
New Revision: 30217
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
Log:
[JBIDE-8662] removed visibility rule for "Launch instance" in cloud viewer
Modified: branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
--- branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2011-04-01 15:58:30 UTC (rev 30216)
+++ branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2011-04-01 15:59:45 UTC (rev 30217)
@@ -664,24 +664,6 @@
label="%command.createinstance.label"
style="push"
tooltip="%command.createinstance.tooltip">
- <visibleWhen
- checkEnabled="true">
- <with
- variable="selection">
- <iterate>
- <and>
- <instanceof
- value="org.jboss.tools.deltacloud.ui.views.cloud.DeltaCloudViewItem">
- </instanceof>
- <not>
- <instanceof
- value="org.jboss.tools.deltacloud.ui.views.cloud.ImageItem">
- </instanceof>
- </not>
- </and>
- </iterate>
- </with>
- </visibleWhen>
</command>
</menuContribution>
<menuContribution
13 years, 11 months
JBoss Tools SVN: r30216 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-04-01 11:58:30 -0400 (Fri, 01 Apr 2011)
New Revision: 30216
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
Log:
[JBIDE-8662] removed visibility rule for "Launch instance" in cloud viewer
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-04-01 15:34:49 UTC (rev 30215)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-04-01 15:58:30 UTC (rev 30216)
@@ -1,5 +1,7 @@
2011-04-01 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+ * plugin.xml:
+ [JBIDE-8662] removed visibility rule for "Launch instance" in cloud viewer
* src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPageModel.java
(prependHttp):
(CloudConnectionPageModel):
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2011-04-01 15:34:49 UTC (rev 30215)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2011-04-01 15:58:30 UTC (rev 30216)
@@ -11,7 +11,7 @@
<view
name="%CloudViewerName"
icon="icons/delta.png"
- category="org.jboss.tools.deltacloud.ui"
+ category="org.jlboss.tools.deltacloud.ui"
class="org.jboss.tools.deltacloud.ui.views.cloud.DeltaCloudView"
id="org.jboss.tools.deltacloud.ui.views.CloudView">
</view>
@@ -672,24 +672,6 @@
label="%command.createinstance.label"
style="push"
tooltip="%command.createinstance.tooltip">
- <visibleWhen
- checkEnabled="true">
- <with
- variable="selection">
- <iterate>
- <and>
- <instanceof
- value="org.jboss.tools.deltacloud.ui.views.cloud.DeltaCloudViewItem">
- </instanceof>
- <not>
- <instanceof
- value="org.jboss.tools.deltacloud.ui.views.cloud.ImageItem">
- </instanceof>
- </not>
- </and>
- </iterate>
- </with>
- </visibleWhen>
</command>
</menuContribution>
<menuContribution
13 years, 11 months
JBoss Tools SVN: r30214 - in trunk/modeshape: site and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2011-04-01 11:19:23 -0400 (Fri, 01 Apr 2011)
New Revision: 30214
Modified:
trunk/modeshape/features/org.jboss.tools.modeshape.rest.test.feature/
trunk/modeshape/site/
Log:
Changes to svn:ignore file.
Property changes on: trunk/modeshape/features/org.jboss.tools.modeshape.rest.test.feature
___________________________________________________________________
Modified: svn:ignore
- *.class
bin
target
+ *.class
bin
target
.classpath
Property changes on: trunk/modeshape/site
___________________________________________________________________
Modified: svn:ignore
- target
buildlog.latest.txt
bin
build
*.class
screenshots
+ target
buildlog.latest.txt
bin
build
*.class
screenshots
.classpath
13 years, 11 months
JBoss Tools SVN: r30213 - trunk/build/parent.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-04-01 10:07:40 -0400 (Fri, 01 Apr 2011)
New Revision: 30213
Modified:
trunk/build/parent/pom.xml
Log:
revert previous changes to pom.xml - nightly, staging, indigo, and TP site shouldn't be on by default so that people can use -Plocal.site w/o pulling remote URLs
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2011-04-01 13:41:44 UTC (rev 30212)
+++ trunk/build/parent/pom.xml 2011-04-01 14:07:40 UTC (rev 30213)
@@ -93,16 +93,6 @@
<configuration>
<resolver>p2</resolver>
<ignoreTychoRepositories>true</ignoreTychoRepositories>
- <target>
- <!-- Target platform file pointing at a single update site from which
- to resolve. -->
- <artifact>
- <groupId>org.jboss.tools</groupId>
- <artifactId>org.jboss.tools.target.platform</artifactId>
- <version>0.0.2-SNAPSHOT</version>
- <classifier>${target.platform.classifier.unified}</classifier>
- </artifact>
- </target>
<environments>
<environment>
<os>macosx</os>
@@ -215,6 +205,98 @@
</issueManagement>
<profiles>
+ <!-- Latest JBT nightly published update site (nightly builds) -->
+ <profile>
+ <id>jbosstools-nightly</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <repositories>
+ <repository>
+ <id>jbosstools-nightly</id>
+ <url>${jbosstools-nightly}</url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ </repositories>
+ </profile>
+
+ <!-- Latest JBT work-in-progress component builds (CI builds), not yet pushed to the above nightly update site -->
+ <profile>
+ <id>jbosstools-nightly-staging-composite</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <repositories>
+ <repository>
+ <id>jbosstools-nightly-staging-composite</id>
+ <url>http://download.jboss.org/jbosstools/builds/staging/_composite_/3.3.indigo/</url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ </repositories>
+ </profile>
+
+ <!-- Contains all the Eclipse.org deps, mirrored onto download.jboss.org.
+ This is the superset of sites from which the TP is created. Should be
+ disabled closer to GA so we're only using the TP contents exclusively. -->
+ <profile>
+ <id>jboss-requirements-composite-mirror</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <repositories>
+ <repository>
+ <id>jboss-requirements-composite-mirror</id>
+ <url>http://download.jboss.org/jbosstools/updates/indigo/</url>
+ <layout>p2</layout>
+ <snapshots> <enabled>true</enabled> </snapshots>
+ <releases> <enabled>true</enabled> </releases>
+ </repository>
+ </repositories>
+ </profile>
+
+ <!-- Target platform file pointing at a single update site from which to
+ resolve. See unified.site if you want to resolve against a site w/o using
+ the unified.target file -->
+ <profile>
+ <id>unified.target</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.tycho</groupId>
+ <artifactId>target-platform-configuration</artifactId>
+ <version>${tychoVersion}</version>
+ <configuration>
+ <target>
+ <artifact>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.target.platform</artifactId>
+ <version>0.0.3-SNAPSHOT</version>
+ <classifier>${target.platform.classifier.unified}</classifier>
+ </artifact>
+ </target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
<!-- To use this profile, must have first created a local.target file,
which points to a local repo. You can do this by hand or generate it from
multiple.target using: cd ~/trunk/build/target-platform; ant See also the
@@ -265,7 +347,28 @@
</repositories>
</profile>
+ <!-- Single repo containing contents of unified.target, but without using the target file -->
<profile>
+ <id>unified.site</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <repositories>
+ <repository>
+ <id>jbosstools-target-site</id>
+ <url>${jbosstools-target-site}</url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ </repositories>
+ </profile>
+
+ <profile>
<id>osx</id>
<activation>
<property>
@@ -523,61 +626,7 @@
</profiles>
<repositories>
- <!-- Contains all the Eclipse.org deps, mirrored onto download.jboss.org.
- This is the superset of sites from which the TP is created. Should be
- disabled closer to GA so we're only using the TP contents exclusively. -->
<repository>
- <id>jboss-requirements-composite-mirror</id>
- <url>http://download.jboss.org/jbosstools/updates/indigo/</url>
- <layout>p2</layout>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>true</enabled>
- </releases>
- </repository>
-
- <!-- Single repo containing contents of unified.target, but without using the target file -->
- <repository>
- <id>jbosstools-target-site</id>
- <url>${jbosstools-target-site}</url>
- <layout>p2</layout>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>true</enabled>
- </releases>
- </repository>
-
- <!-- Latest JBT nightly published update site (nightly builds) -->
- <repository>
- <id>jbosstools-nightly</id>
- <url>${jbosstools-nightly}</url>
- <layout>p2</layout>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>true</enabled>
- </releases>
- </repository>
-
- <!-- Latest JBT work-in-progress component builds (CI builds), not yet pushed to the above nightly update site -->
- <repository>
- <id>jbosstools-nightly-staging-composite</id>
- <url>http://download.jboss.org/jbosstools/builds/staging/_composite_/3.3.indigo/</url>
- <layout>p2</layout>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>true</enabled>
- </releases>
- </repository>
-
- <repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
13 years, 11 months
JBoss Tools SVN: r30212 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-04-01 09:41:44 -0400 (Fri, 01 Apr 2011)
New Revision: 30212
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/NodeProxyUtil.java
Log:
https://issues.jboss.org/browse/JBIDE-8664 : JsfJbide1718Test.testEscapeAttribute() throws NPE with Eclipse 3.7
- now the model is initialized properly
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/NodeProxyUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/NodeProxyUtil.java 2011-04-01 13:07:50 UTC (rev 30211)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/NodeProxyUtil.java 2011-04-01 13:41:44 UTC (rev 30212)
@@ -10,9 +10,10 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.jsf.template.util;
-import org.eclipse.jst.jsp.core.internal.domdocument.DOMModelForJSP;
import org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser;
+import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
import org.eclipse.swt.graphics.Point;
+import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.document.StructuredDocumentFactory;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
@@ -37,7 +38,9 @@
newStructuredDocument.set(attrString);
- IDOMModel modelForJSP = new DOMModelForJSP();
+ IDOMModel modelForJSP = (IDOMModel) StructuredModelManager
+ .getModelManager().createUnManagedStructuredModelFor(
+ ContentTypeIdForJSP.ContentTypeID_JSP);
modelForJSP.setStructuredDocument(newStructuredDocument);
13 years, 11 months
JBoss Tools SVN: r30211 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-04-01 09:07:50 -0400 (Fri, 01 Apr 2011)
New Revision: 30211
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAddQueryDialog.java
Log:
https://issues.jboss.org/browse/JBIDE-8663
fix initialization error
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAddQueryDialog.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAddQueryDialog.java 2011-04-01 11:54:54 UTC (rev 30210)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/internal/mapping/details/HibernateAddQueryDialog.java 2011-04-01 13:07:50 UTC (rev 30211)
@@ -250,7 +250,7 @@
*/
AddQueryStateObject(PersistenceUnit pUnit) {
super(null);
- this.pUnit = this.pUnit;
+ this.pUnit = pUnit;
}
private void addNameProblemsTo(List<Problem> currentProblems) {
13 years, 11 months