Author: elvisisking
Date: 2012-04-27 16:36:20 -0400 (Fri, 27 Apr 2012)
New Revision: 40582
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/Messages.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/attributes/PropertyValue.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndTokenizer.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/messages.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/PublishedResourceHelper.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/ServerManager.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Utils.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/BasePublishingHandler.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/DeleteServerAction.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/EditServerAction.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/NewServerAction.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/ShowPublishedLocationsHandler.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/DeleteServerDialog.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/PublishedLocationsDialog.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/preferences/IgnoredResourcesEditor.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesPreferencePage.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/PreferenceInitializer.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/PropertyDisplayNameProvider.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeContentProvider.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeMessageConsole.java
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
Log:
JBIDE-11697 Internationalization Messages In The ModeShape Tools REST Plugin No Longer
Working. Changed all ModeShape Tools i18n to use Eclipse's OSGI NLS class.
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/Messages.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/Messages.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/Messages.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -301,6 +301,18 @@
public static String nodeTypeDefinitionName;
/**
+ * A CND parser exception message for missing double quote. Two parameters, the line
number and the column number where the
+ * error occurred, is required.
+ */
+ public static String noMatchingDoubleQuoteFound;
+
+ /**
+ * A CND parser exception message for missing single quote. Two parameters, the line
number and the column number where the
+ * error occurred, is required.
+ */
+ public static String noMatchingSingleQuoteFound;
+
+ /**
* A message indicating a <code>null</code> was found. One parameter, a
string identifying the object, is required.
*/
public static String objectIsNull;
@@ -367,6 +379,12 @@
public static String superTypesExistButMarkedAsVariant;
/**
+ * A message indicating that a property value couldn't be converted from one data
type to another. Three parameters, the
+ * property value, the from data type, and the to data type, are required.
+ */
+ public static String unableToConvertValue;
+
+ /**
* A message indicating a property definition has identified value constraints but
has been marked as a variant. One parameter,
* the property definition name, is required.
*/
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/attributes/PropertyValue.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/attributes/PropertyValue.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/attributes/PropertyValue.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -21,8 +21,9 @@
import javax.jcr.Value;
import javax.jcr.ValueFormatException;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.modeshape.jcr.Messages;
import org.jboss.tools.modeshape.jcr.Utils;
-import org.modeshape.web.jcr.rest.client.RestClientI18n;
/**
*
@@ -199,7 +200,7 @@
} catch (final Exception e) {
final String from = PropertyType.nameFromValue(getType());
final String to = PropertyType.nameFromValue(PropertyType.LONG);
- throw new
ValueFormatException(RestClientI18n.unableToConvertValue.text(this.value, from, to), e);
+ throw new ValueFormatException(NLS.bind(Messages.unableToConvertValue, new
Object[] {this.value, from, to}), e);
}
}
@@ -215,7 +216,7 @@
} catch (final NumberFormatException t) {
final String from = PropertyType.nameFromValue(getType());
final String to = PropertyType.nameFromValue(PropertyType.DECIMAL);
- throw new
ValueFormatException(RestClientI18n.unableToConvertValue.text(this.value, from, to), t);
+ throw new ValueFormatException(NLS.bind(Messages.unableToConvertValue, new
Object[] {this.value, from, to}), t);
}
}
@@ -231,7 +232,7 @@
} catch (final NumberFormatException t) {
final String from = PropertyType.nameFromValue(getType());
final String to = PropertyType.nameFromValue(PropertyType.DOUBLE);
- throw new
ValueFormatException(RestClientI18n.unableToConvertValue.text(this.value, from, to), t);
+ throw new ValueFormatException(NLS.bind(Messages.unableToConvertValue, new
Object[] {this.value, from, to}), t);
}
}
@@ -247,7 +248,7 @@
} catch (final NumberFormatException t) {
final String from = PropertyType.nameFromValue(getType());
final String to = PropertyType.nameFromValue(PropertyType.LONG);
- throw new
ValueFormatException(RestClientI18n.unableToConvertValue.text(this.value, from, to), t);
+ throw new ValueFormatException(NLS.bind(Messages.unableToConvertValue, new
Object[] {this.value, from, to}), t);
}
}
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndTokenizer.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndTokenizer.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CndTokenizer.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -9,7 +9,6 @@
import org.eclipse.osgi.util.NLS;
import org.jboss.tools.modeshape.jcr.Messages;
-import org.modeshape.common.CommonI18n;
import org.modeshape.common.text.ParsingException;
import org.modeshape.common.text.Position;
import org.modeshape.common.text.TokenStream.CharacterStream;
@@ -129,9 +128,8 @@
}
}
if (!foundClosingQuote) {
- String msg =
CommonI18n.noMatchingDoubleQuoteFound.text(startingPosition.getLine(),
-
startingPosition.getColumn());
- throw new ParsingException(startingPosition, msg);
+ throw new ParsingException(startingPosition,
NLS.bind(Messages.noMatchingDoubleQuoteFound,
+
startingPosition.getLine(), startingPosition.getColumn()));
}
endIndex = input.index() + 1; // beyond last character read
tokens.addToken(startingPosition, startIndex, endIndex,
DOUBLE_QUOTED_STRING);
@@ -150,9 +148,8 @@
}
}
if (!foundClosingQuote) {
- String msg =
CommonI18n.noMatchingSingleQuoteFound.text(startingPosition.getLine(),
-
startingPosition.getColumn());
- throw new ParsingException(startingPosition, msg);
+ throw new ParsingException(startingPosition,
NLS.bind(Messages.noMatchingSingleQuoteFound,
+
startingPosition.getLine(), startingPosition.getColumn()));
}
endIndex = input.index() + 1; // beyond last character read
tokens.addToken(startingPosition, startIndex, endIndex,
SINGLE_QUOTED_STRING);
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/messages.properties
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/messages.properties 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/messages.properties 2012-04-27
20:36:20 UTC (rev 40582)
@@ -101,6 +101,10 @@
# 0 = node type definition name
nodeTypeDefinitionHasNoPropertyDefinitionsOrChildNodeDefinitions = The node type
definition "{0}" has no property definitions or child node definitions.
nodeTypeDefinitionName = node type definition name
+# 0 = line number, 1 = column number
+noMatchingDoubleQuoteFound = No matching closing double quote found for the one at line
{0}, column {1}
+# 0 = line number, 1 = column number
+noMatchingSingleQuoteFound = No matching closing single quote found for the one at line
{0}, column {1}
# 0 = name of object
objectIsNull = Object {0} is null
okValidationMsg = There are no validation errors.
@@ -120,6 +124,8 @@
superTypeName = super type name
# 0 = node type definition name
superTypesExistButMarkedAsVariant = Node type definition "{0}" has super types
marked as a variant but has one or more super types.
+# 0 = value, 1 = from data type, 2 = to data type
+unableToConvertValue = Unable to convert '{0}' from type {1} to {2}
# 0 = property definition name
valueConstraintsExistButMarkedAsVariant = Property definition "{0}" has value
constraints marked as a variant but has one or more value constraints.
# 0 = CND line number, CND column number
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 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Activator.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -17,6 +17,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
@@ -69,7 +70,7 @@
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));
+ log(new Status(Severity.ERROR, NLS.bind(RestClientI18n.missingImage, key),
e));
return null;
}
}
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/PublishedResourceHelper.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/PublishedResourceHelper.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/PublishedResourceHelper.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -19,6 +19,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.osgi.util.NLS;
import org.jboss.tools.modeshape.rest.domain.ModeShapeRepository;
import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
import org.jboss.tools.modeshape.rest.domain.ModeShapeWorkspace;
@@ -190,7 +191,9 @@
try {
return !getPublishedWorkspaceLocations(file).isEmpty();
} catch (Exception e) {
- Activator.getDefault().log(new Status(Severity.ERROR,
RestClientI18n.publishedResourcePropertyErrorMsg.text(file), e));
+ Activator.getDefault().log(new Status(Severity.ERROR,
+
NLS.bind(RestClientI18n.publishedResourcePropertyErrorMsg, file),
+ e));
}
return false;
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 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/RestClientI18n.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -11,204 +11,200 @@
*/
package org.jboss.tools.modeshape.rest;
-import org.modeshape.common.i18n.I18n;
+import org.eclipse.osgi.util.NLS;
/**
* The <code>RestClientI18n</code> class provides localized messages.
*/
-public final class RestClientI18n {
+public final class RestClientI18n extends NLS {
- public static I18n basePublishingActionPublishingWizardErrorMsg;
- public static I18n basePublishingActionUnpublishingWizardErrorMsg;
+ public static String basePublishingActionPublishingWizardErrorMsg;
+ public static String basePublishingActionUnpublishingWizardErrorMsg;
- public static I18n collapseActionToolTip;
+ public static String collapseActionToolTip;
- public static I18n deleteServerActionText;
- public static I18n deleteServerActionToolTip;
+ public static String deleteServerActionText;
+ public static String deleteServerActionToolTip;
- public static I18n deleteServerDialogErrorsOccurredMsg;
- public static I18n deleteServerDialogMultipleServersMsg;
- public static I18n deleteServerDialogOneServerMsg;
- public static I18n deleteServerDialogTitle;
+ public static String deleteServerDialogErrorsOccurredMsg;
+ public static String deleteServerDialogMultipleServersMsg;
+ public static String deleteServerDialogOneServerMsg;
+ public static String deleteServerDialogTitle;
- public static I18n editServerActionText;
- public static I18n editServerActionToolTip;
- public static I18n errorDeletingServerRegistryFile;
- public static I18n errorDialogTitle;
- public static I18n errorRestoringServerRegistry;
- public static I18n errorSavingServerRegistry;
+ public static String editServerActionText;
+ public static String editServerActionToolTip;
+ public static String errorDeletingServerRegistryFile;
+ public static String errorDialogTitle;
+ public static String errorRestoringServerRegistry;
+ public static String errorSavingServerRegistry;
- public static I18n ignoredResourcesPreferencePageDescription;
- public static I18n ignoredResourcesPreferencePageLabel;
- public static I18n ignoredResourcesPreferencePageMessage;
- public static I18n ignoredResourcesPreferencePageTitle;
+ public static String ignoredResourcesPreferencePageDescription;
+ public static String ignoredResourcesPreferencePageLabel;
+ public static String ignoredResourcesPreferencePageMessage;
+ public static String ignoredResourcesPreferencePageTitle;
- public static I18n missingImage;
+ public static String missingImage;
- public static I18n newIgnoredResourceDialogLabel;
- public static I18n newIgnoredResourceDialogTitle;
-
- public static I18n newItemDialogValueExists;
+ public static String newIgnoredResourceDialogLabel;
+ public static String newIgnoredResourceDialogTitle;
- public static I18n newServerActionText;
- public static I18n newServerActionToolTip;
+ public static String newItemDialogValueExists;
- public static I18n publishedLocationsDialogCopyUrlButton;
- public static I18n publishedLocationsDialogCopyUrlButtonToolTip;
- public static I18n publishedLocationsDialogFileUrlColumnHeader;
- public static I18n publishedLocationsDialogMsg;
- public static I18n publishedLocationsDialogRepositoryColumnHeader;
- public static I18n publishedLocationsDialogServerUrlColumnHeader;
- public static I18n publishedLocationsDialogTitle;
- public static I18n publishedLocationsDialogUserColumnHeader;
- public static I18n publishedLocationsDialogWorkspaceColumnHeader;
+ public static String newServerActionText;
+ public static String newServerActionToolTip;
- public static I18n publishedResourcePropertyErrorMsg;
+ public static String publishedLocationsDialogCopyUrlButton;
+ public static String publishedLocationsDialogCopyUrlButtonToolTip;
+ public static String publishedLocationsDialogFileUrlColumnHeader;
+ public static String publishedLocationsDialogMsg;
+ public static String publishedLocationsDialogRepositoryColumnHeader;
+ public static String publishedLocationsDialogServerUrlColumnHeader;
+ public static String publishedLocationsDialogTitle;
+ public static String publishedLocationsDialogUserColumnHeader;
+ public static String publishedLocationsDialogWorkspaceColumnHeader;
- public static I18n publishingConsoleName;
- public static I18n publishingConsoleProblemMsg;
- public static I18n publishingConsoleProblemCreatingHyperlinkMsg;
- public static I18n publishingConsoleFilePathNotFoundMsg;
+ public static String publishedResourcePropertyErrorMsg;
- public static I18n preferenceDefaultScopeNotFound;
- public static I18n preferenceFileNotFound;
- public static I18n preferenceNotFound;
+ public static String publishingConsoleName;
+ public static String publishingConsoleProblemMsg;
+ public static String publishingConsoleProblemCreatingHyperlinkMsg;
+ public static String publishingConsoleFilePathNotFoundMsg;
- public static I18n preferencePageDescription;
- public static I18n preferencePageEnableVersioningEditor;
- public static I18n preferencePageEnableVersioningEditorToolTip;
- public static I18n preferencePageMessage;
- public static I18n preferencePageTitle;
-
- public static I18n propertiesBundleLoadErrorMsg;
+ public static String preferenceDefaultScopeNotFound;
+ public static String preferenceFileNotFound;
+ public static String preferenceNotFound;
- public static I18n publishJobCanceled;
- public static I18n publishJobDurationMsg;
- public static I18n publishJobDurationNoHoursMsg;
- public static I18n publishJobDurationNoHoursNoMinutesMsg;
- public static I18n publishJobDurationShortMsg;
- public static I18n publishJobPublish;
- public static I18n publishJobPublishCanceledMsg;
- public static I18n publishJobPublishFile;
- public static I18n publishJobPublishFileFailed;
- public static I18n publishJobPublishFileInfo;
- public static I18n publishJobPublishFileWarning;
- public static I18n publishJobPublishFinishedMsg;
- public static I18n publishJobPublishName;
- public static I18n publishJobPublishTaskName;
- public static I18n publishJobUnexpectedErrorMsg;
- public static I18n publishJobUnpublish;
- public static I18n publishJobUnpublishCanceledMsg;
- public static I18n publishJobUnpublishFile;
- public static I18n publishJobUnpublishFileFailed;
- public static I18n publishJobUnpublishFileInfo;
- public static I18n publishJobUnpublishFileWarning;
- public static I18n publishJobUnpublishFinishedMsg;
- public static I18n publishJobUnpublishName;
- public static I18n publishJobUnpublishTaskName;
+ public static String preferencePageDescription;
+ public static String preferencePageEnableVersioningEditor;
+ public static String preferencePageEnableVersioningEditorToolTip;
+ public static String preferencePageMessage;
+ public static String preferencePageTitle;
- public static I18n publishPagePublishTitle;
- public static I18n publishPageLocationGroupTitle;
- public static I18n publishPageMissingRepositoryStatusMsg;
- public static I18n publishPageMissingServerStatusMsg;
- public static I18n publishPageMissingWorkspaceStatusMsg;
- public static I18n publishPageNewServerButton;
- public static I18n publishPageNoAvailableRepositoriesStatusMsg;
- public static I18n publishPageNoAvailableServersStatusMsg;
- 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;
- public static I18n publishPageRecurseCheckBoxToolTip;
- public static I18n publishPageRecurseProcessingErrorMsg;
- public static I18n publishPageRepositoryLabel;
- 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;
- public static I18n publishPageWorkspaceAreaLabel;
- public static I18n publishPageWorkspaceAreaToolTip;
- public static I18n publishPageFinishedErrorMsg;
+ public static String propertiesBundleLoadErrorMsg;
- public static I18n publishWizardPublishErrorMsg;
- public static I18n publishWizardPublishTitle;
- public static I18n publishWizardUnpublishTitle;
- public static I18n publishWizardUnpublishErrorMsg;
+ public static String publishJobCanceled;
+ public static String publishJobDurationMsg;
+ public static String publishJobDurationNoHoursMsg;
+ public static String publishJobDurationNoHoursNoMinutesMsg;
+ public static String publishJobDurationShortMsg;
+ public static String publishJobPublish;
+ public static String publishJobPublishCanceledMsg;
+ public static String publishJobPublishFile;
+ public static String publishJobPublishFileFailed;
+ public static String publishJobPublishFileInfo;
+ public static String publishJobPublishFileWarning;
+ public static String publishJobPublishFinishedMsg;
+ public static String publishJobPublishName;
+ public static String publishJobPublishTaskName;
+ public static String publishJobUnexpectedErrorMsg;
+ public static String publishJobUnpublish;
+ public static String publishJobUnpublishCanceledMsg;
+ public static String publishJobUnpublishFile;
+ public static String publishJobUnpublishFileFailed;
+ public static String publishJobUnpublishFileInfo;
+ public static String publishJobUnpublishFileWarning;
+ public static String publishJobUnpublishFinishedMsg;
+ public static String publishJobUnpublishName;
+ public static String publishJobUnpublishTaskName;
- public static I18n reconnectJobTaskName;
+ public static String publishPagePublishTitle;
+ public static String publishPageLocationGroupTitle;
+ public static String publishPageMissingRepositoryStatusMsg;
+ public static String publishPageMissingServerStatusMsg;
+ public static String publishPageMissingWorkspaceStatusMsg;
+ public static String publishPageNewServerButton;
+ public static String publishPageNoAvailableRepositoriesStatusMsg;
+ public static String publishPageNoAvailableServersStatusMsg;
+ public static String publishPageNoAvailableWorkspacesStatusMsg;
+ public static String publishPageNoResourcesToPublishStatusMsg;
+ public static String publishPageNoResourcesToUnpublishStatusMsg;
+ public static String publishPageOpenPreferencePageLink;
+ public static String publishPagePublishOkStatusMsg;
+ public static String publishPagePublishResourcesLabel;
+ public static String publishPageRecurseCheckBox;
+ public static String publishPageRecurseCheckBoxToolTip;
+ public static String publishPageRecurseProcessingErrorMsg;
+ public static String publishPageRepositoryLabel;
+ public static String publishPageRepositoryToolTip;
+ public static String publishPageServerLabel;
+ public static String publishPageServerToolTip;
+ public static String publishPageUnableToObtainWorkspaceAreas;
+ public static String publishPageUnpublishOkStatusMsg;
+ public static String publishPageUnpublishResourcesLabel;
+ public static String publishPageUnpublishTitle;
+ public static String publishPageVersionCheckBox;
+ public static String publishPageVersionCheckBoxToolTip;
+ public static String publishPageWorkspaceLabel;
+ public static String publishPageWorkspacePublishToolTip;
+ public static String publishPageWorkspaceUnpublishToolTip;
+ public static String publishPageWorkspaceAreaLabel;
+ public static String publishPageWorkspaceAreaToolTip;
+ public static String publishPageFinishedErrorMsg;
- public static I18n serverEmptyUrlMsg;
- public static I18n serverEmptyUserMsg;
- public static I18n serverExistsMsg;
- public static I18n serverInvalidUrlMsg;
- public static I18n serverInvalidUrlHostMsg;
- public static I18n serverInvalidUrlPortMsg;
+ public static String publishWizardPublishErrorMsg;
+ public static String publishWizardPublishTitle;
+ public static String publishWizardUnpublishTitle;
+ public static String publishWizardUnpublishErrorMsg;
- public static I18n serverManagerConnectionEstablishedMsg;
- public static I18n serverManagerConnectionFailedMsg;
- public static I18n serverManagerGetRepositoriesExceptionMsg;
- public static I18n serverManagerGetWorkspacesExceptionMsg;
- public static I18n serverManagerRegistryAddUnexpectedError;
- public static I18n serverManagerRegistryListenerError;
- public static I18n serverManagerRegistryListenerErrorsOccurred;
- public static I18n serverManagerRegistryRemoveUnexpectedError;
- public static I18n serverManagerRegistryUpdateAddError;
- public static I18n serverManagerRegistryUpdateRemoveError;
- public static I18n serverManagerUnregisteredServer;
+ public static String reconnectJobTaskName;
- public static I18n serverPageAuthenticationGroupTitle;
- public static I18n serverPageInvalidServerProperties;
- public static I18n serverPageOkStatusMsg;
- public static I18n serverPagePasswordLabel;
- public static I18n serverPagePasswordToolTip;
- public static I18n serverPageSavePasswordButton;
- public static I18n serverPageSavePasswordLabel;
- public static I18n serverPageSavePasswordToolTip;
- public static I18n serverPageTestConnectionLabel;
- public static I18n serverPageTestConnectionButton;
- public static I18n serverPageTestConnectionButtonToolTip;
- public static I18n serverPageTestConnectionDialogFailureMsg;
- public static I18n serverPageTestConnectionDialogTitle;
- public static I18n serverPageTestConnectionDialogSuccessMsg;
- public static I18n serverPageTitle;
- public static I18n serverPageUrlLabel;
- public static I18n serverPageUrlTemplateLabel;
- public static I18n serverPageUrlToolTip;
- public static I18n serverPageUserLabel;
- public static I18n serverPageUserToolTip;
+ public static String serverEmptyUrlMsg;
+ public static String serverEmptyUserMsg;
+ public static String serverExistsMsg;
+ public static String serverInvalidUrlMsg;
+ public static String serverInvalidUrlHostMsg;
+ public static String serverInvalidUrlPortMsg;
- public static I18n serverReconnectActionText;
- public static I18n serverReconnectActionToolTip;
+ public static String serverManagerConnectionEstablishedMsg;
+ public static String serverManagerConnectionFailedMsg;
+ public static String serverManagerGetRepositoriesExceptionMsg;
+ public static String serverManagerGetWorkspacesExceptionMsg;
+ public static String serverManagerRegistryAddUnexpectedError;
+ public static String serverManagerRegistryListenerError;
+ public static String serverManagerRegistryListenerErrorsOccurred;
+ public static String serverManagerRegistryRemoveUnexpectedError;
+ public static String serverManagerRegistryUpdateAddError;
+ public static String serverManagerRegistryUpdateRemoveError;
+ public static String serverManagerUnregisteredServer;
- public static I18n serverViewToolTip;
+ public static String serverPageAuthenticationGroupTitle;
+ public static String serverPageInvalidServerProperties;
+ public static String serverPageOkStatusMsg;
+ public static String serverPagePasswordLabel;
+ public static String serverPagePasswordToolTip;
+ public static String serverPageSavePasswordButton;
+ public static String serverPageSavePasswordLabel;
+ public static String serverPageSavePasswordToolTip;
+ public static String serverPageTestConnectionLabel;
+ public static String serverPageTestConnectionButton;
+ public static String serverPageTestConnectionButtonToolTip;
+ public static String serverPageTestConnectionDialogFailureMsg;
+ public static String serverPageTestConnectionDialogTitle;
+ public static String serverPageTestConnectionDialogSuccessMsg;
+ public static String serverPageTitle;
+ public static String serverPageUrlLabel;
+ public static String serverPageUrlTemplateLabel;
+ public static String serverPageUrlToolTip;
+ public static String serverPageUserLabel;
+ public static String serverPageUserToolTip;
- public static I18n serverWizardEditServerErrorMsg;
- public static I18n serverWizardEditServerTitle;
- public static I18n serverWizardNewServerErrorMsg;
- public static I18n serverWizardNewServerTitle;
+ public static String serverReconnectActionText;
+ public static String serverReconnectActionToolTip;
- public static I18n showPublishedLocationsErrorMsg;
+ public static String serverViewToolTip;
- public static I18n testServerActionText;
- public static I18n testServerActionToolTip;
+ public static String serverWizardEditServerErrorMsg;
+ public static String serverWizardEditServerTitle;
+ public static String serverWizardNewServerErrorMsg;
+ public static String serverWizardNewServerTitle;
+ public static String showPublishedLocationsErrorMsg;
+
+ public static String testServerActionText;
+ public static String testServerActionToolTip;
+
static {
- try {
- I18n.initialize(RestClientI18n.class);
- } catch (Exception e) {
- System.err.println(e);
- }
+ NLS.initializeMessages("org.jboss.tools.modeshape.rest.RestClientI18n",
RestClientI18n.class); //$NON-NLS-1$
}
}
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 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/ServerManager.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -34,13 +34,15 @@
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
+import org.eclipse.core.runtime.ILog;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.osgi.util.NLS;
import org.jboss.tools.modeshape.rest.domain.ModeShapeRepository;
import org.jboss.tools.modeshape.rest.domain.ModeShapeServer;
import org.jboss.tools.modeshape.rest.domain.ModeShapeWorkspace;
import org.jboss.tools.modeshape.rest.domain.WorkspaceArea;
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;
@@ -108,11 +110,6 @@
private final IRestClient delegate;
/**
- * The logger.
- */
- private final Logger logger = Logger.getLogger(ServerManager.class);
-
- /**
* The path where the server registry is persisted or <code>null</code>
if not persisted.
*/
private final String stateLocationPath;
@@ -250,7 +247,7 @@
}
// server must be registered in order to obtain it's repositories
- throw new
RuntimeException(RestClientI18n.serverManagerUnregisteredServer.text(server.getShortDescription()));
+ throw new
RuntimeException(NLS.bind(RestClientI18n.serverManagerUnregisteredServer,
server.getShortDescription()));
} finally {
this.serverLock.readLock().unlock();
}
@@ -313,7 +310,7 @@
}
// a repository's server must be registered in order to obtain it's
workspaces
- String msg =
RestClientI18n.serverManagerUnregisteredServer.text(repository.getServer().getShortDescription());
+ String msg = NLS.bind(RestClientI18n.serverManagerUnregisteredServer,
repository.getServer().getShortDescription());
throw new RuntimeException(msg);
} finally {
this.serverLock.readLock().unlock();
@@ -360,7 +357,7 @@
}
// server already exists
- return new Status(Severity.ERROR,
RestClientI18n.serverExistsMsg.text(server.getShortDescription()), null);
+ return new Status(Severity.ERROR, NLS.bind(RestClientI18n.serverExistsMsg,
server.getShortDescription()), null);
}
/**
@@ -403,7 +400,7 @@
// server could not be removed
return new Status(Severity.ERROR,
-
RestClientI18n.serverManagerRegistryRemoveUnexpectedError.text(server.getShortDescription()),
+
NLS.bind(RestClientI18n.serverManagerRegistryRemoveUnexpectedError,
server.getShortDescription()),
null);
}
@@ -473,11 +470,16 @@
return Status.OK_STATUS;
}
+ ILog logger = Activator.getDefault().getLog();
+
for (Exception error : errors) {
- this.logger.error(error, RestClientI18n.serverManagerRegistryListenerError);
+ logger.log(new org.eclipse.core.runtime.Status(IStatus.ERROR,
+ IUiConstants.PLUGIN_ID,
+
RestClientI18n.serverManagerRegistryListenerError,
+ error));
}
- return new Status(Severity.WARNING,
RestClientI18n.serverManagerRegistryListenerErrorsOccurred.text(), null);
+ return new Status(Severity.WARNING,
RestClientI18n.serverManagerRegistryListenerErrorsOccurred, null);
}
/**
@@ -492,9 +494,9 @@
try {
this.delegate.getRepositories(server.getDelegate());
- return new Status(Severity.OK,
RestClientI18n.serverManagerConnectionEstablishedMsg.text(), null);
+ return new Status(Severity.OK,
RestClientI18n.serverManagerConnectionEstablishedMsg, null);
} catch (Exception e) {
- return new Status(Severity.ERROR,
RestClientI18n.serverManagerConnectionFailedMsg.text(e), null);
+ return new Status(Severity.ERROR,
NLS.bind(RestClientI18n.serverManagerConnectionFailedMsg, e), null);
}
}
@@ -528,7 +530,7 @@
}
// server must be registered in order to publish
- throw new
RuntimeException(RestClientI18n.serverManagerUnregisteredServer.text(server.getShortDescription()));
+ throw new
RuntimeException(NLS.bind(RestClientI18n.serverManagerUnregisteredServer,
server.getShortDescription()));
}
/**
@@ -582,7 +584,7 @@
}
}
} catch (Exception e) {
- return new Status(Severity.ERROR,
RestClientI18n.errorRestoringServerRegistry.text(getStateFileName()), e);
+ return new Status(Severity.ERROR,
NLS.bind(RestClientI18n.errorRestoringServerRegistry, getStateFileName()), e);
}
}
}
@@ -627,14 +629,14 @@
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-am...;,
"2"); //$NON-NLS-1$ //$NON-NLS-2$
transformer.transform(source, resultXML);
} catch (Exception e) {
- return new Status(Severity.ERROR,
RestClientI18n.errorSavingServerRegistry.text(getStateFileName()), e);
+ return new Status(Severity.ERROR,
NLS.bind(RestClientI18n.errorSavingServerRegistry, getStateFileName()), e);
}
} else if ((this.stateLocationPath != null) && stateFileExists()) {
// delete current registry file since all servers have been deleted
try {
new File(getStateFileName()).delete();
} catch (Exception e) {
- return new Status(Severity.ERROR,
RestClientI18n.errorDeletingServerRegistryFile.text(getStateFileName()), e);
+ return new Status(Severity.ERROR,
NLS.bind(RestClientI18n.errorDeletingServerRegistryFile, getStateFileName()), e);
}
}
@@ -668,7 +670,7 @@
}
// server must be registered in order to unpublish
- throw new
RuntimeException(RestClientI18n.serverManagerUnregisteredServer.text(server.getShortDescription()));
+ throw new
RuntimeException(NLS.bind(RestClientI18n.serverManagerUnregisteredServer,
server.getShortDescription()));
}
/**
@@ -701,7 +703,7 @@
// unexpected problem adding new version of server to registry
return new Status(Severity.ERROR,
-
RestClientI18n.serverManagerRegistryUpdateAddError.text(status.getMessage()),
+
NLS.bind(RestClientI18n.serverManagerRegistryUpdateAddError, status.getMessage()),
status.getException());
}
} finally {
@@ -710,7 +712,7 @@
// unexpected problem removing server from registry
return new Status(Severity.ERROR,
-
RestClientI18n.serverManagerRegistryUpdateRemoveError.text(status.getMessage()),
+ NLS.bind(RestClientI18n.serverManagerRegistryUpdateRemoveError,
status.getMessage()),
status.getException());
}
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Utils.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Utils.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/Utils.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -17,6 +17,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.ISharedImages;
import org.modeshape.common.util.CheckArg;
@@ -150,7 +151,7 @@
*/
public static Status isUrlValid( String url ) {
if ((url == null) || (url.length() == 0)) {
- return new Status(Severity.ERROR, RestClientI18n.serverEmptyUrlMsg.text(),
null);
+ return new Status(Severity.ERROR, RestClientI18n.serverEmptyUrlMsg, null);
}
try {
@@ -160,17 +161,17 @@
String host = testUrl.getHost();
if ((host == null) || "".equals(host)) { //$NON-NLS-1$
- return new Status(Severity.ERROR,
RestClientI18n.serverInvalidUrlHostMsg.text(), null);
+ return new Status(Severity.ERROR, RestClientI18n.serverInvalidUrlHostMsg,
null);
}
// make sure there is a port
int port = testUrl.getPort();
if (port == -1) {
- return new Status(Severity.ERROR,
RestClientI18n.serverInvalidUrlPortMsg.text(), null);
+ return new Status(Severity.ERROR, RestClientI18n.serverInvalidUrlPortMsg,
null);
}
} catch (Exception e) {
- return new Status(Severity.ERROR,
RestClientI18n.serverInvalidUrlMsg.text(url), e);
+ return new Status(Severity.ERROR,
NLS.bind(RestClientI18n.serverInvalidUrlMsg, url), e);
}
return Status.OK_STATUS;
@@ -182,7 +183,7 @@
*/
public static Status isUserValid( String user ) {
if ((user == null) || (user.length() == 0)) {
- return new Status(Severity.ERROR, RestClientI18n.serverEmptyUserMsg.text(),
null);
+ return new Status(Severity.ERROR, RestClientI18n.serverEmptyUserMsg, null);
}
return Status.OK_STATUS;
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/BasePublishingHandler.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/BasePublishingHandler.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/BasePublishingHandler.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -9,8 +9,10 @@
package org.jboss.tools.modeshape.rest.actions;
import static org.jboss.tools.modeshape.rest.IUiConstants.ModeShape_IMAGE_16x;
+
import java.util.Collections;
import java.util.List;
+
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.commands.IHandlerListener;
@@ -110,13 +112,13 @@
String msg = null;
if (this.type == Type.PUBLISH) {
- msg =
RestClientI18n.basePublishingActionPublishingWizardErrorMsg.text();
+ msg = RestClientI18n.basePublishingActionPublishingWizardErrorMsg;
} else {
- msg =
RestClientI18n.basePublishingActionUnpublishingWizardErrorMsg.text();
+ msg = RestClientI18n.basePublishingActionUnpublishingWizardErrorMsg;
}
Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
- MessageDialog.openError(shell, RestClientI18n.errorDialogTitle.text(), msg);
+ MessageDialog.openError(shell, RestClientI18n.errorDialogTitle, msg);
}
// per javadoc must return null
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/DeleteServerAction.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/DeleteServerAction.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/DeleteServerAction.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -55,8 +55,8 @@
*/
public DeleteServerAction( Shell shell,
ServerManager serverManager ) {
- super(RestClientI18n.deleteServerActionText.text());
- setToolTipText(RestClientI18n.deleteServerActionToolTip.text());
+ super(RestClientI18n.deleteServerActionText);
+ setToolTipText(RestClientI18n.deleteServerActionToolTip);
setImageDescriptor(Activator.getDefault().getImageDescriptor(DELETE_SERVER_IMAGE));
setEnabled(false);
@@ -90,9 +90,8 @@
}
if (errorsOccurred) {
- MessageDialog.openError(this.shell,
- RestClientI18n.errorDialogTitle.text(),
-
RestClientI18n.deleteServerDialogErrorsOccurredMsg.text());
+ MessageDialog.openError(this.shell, RestClientI18n.errorDialogTitle,
+
RestClientI18n.deleteServerDialogErrorsOccurredMsg);
}
}
}
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/EditServerAction.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/EditServerAction.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/EditServerAction.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -50,8 +50,8 @@
*/
public EditServerAction( Shell shell,
ServerManager serverManager ) {
- super(RestClientI18n.editServerActionText.text());
- setToolTipText(RestClientI18n.editServerActionToolTip.text());
+ super(RestClientI18n.editServerActionText);
+ setToolTipText(RestClientI18n.editServerActionToolTip);
setImageDescriptor(Activator.getDefault().getImageDescriptor(EDIT_SERVER_IMAGE));
setEnabled(false);
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/NewServerAction.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/NewServerAction.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/NewServerAction.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -44,8 +44,8 @@
*/
public NewServerAction( Shell shell,
ServerManager serverManager ) {
- super(RestClientI18n.newServerActionText.text());
- setToolTipText(RestClientI18n.newServerActionToolTip.text());
+ super(RestClientI18n.newServerActionText);
+ setToolTipText(RestClientI18n.newServerActionToolTip);
setImageDescriptor(Activator.getDefault().getImageDescriptor(NEW_SERVER_IMAGE));
this.shell = shell;
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/ShowPublishedLocationsHandler.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/ShowPublishedLocationsHandler.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/ShowPublishedLocationsHandler.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -9,6 +9,7 @@
package org.jboss.tools.modeshape.rest.actions;
import java.util.Set;
+
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.resources.IFile;
@@ -19,9 +20,9 @@
import org.eclipse.ui.handlers.HandlerUtil;
import org.jboss.tools.modeshape.rest.Activator;
import org.jboss.tools.modeshape.rest.PublishedResourceHelper;
+import org.jboss.tools.modeshape.rest.PublishedResourceHelper.WorkspaceLocation;
import org.jboss.tools.modeshape.rest.RestClientI18n;
import org.jboss.tools.modeshape.rest.ServerManager;
-import org.jboss.tools.modeshape.rest.PublishedResourceHelper.WorkspaceLocation;
import org.jboss.tools.modeshape.rest.dialogs.PublishedLocationsDialog;
import org.modeshape.web.jcr.rest.client.Status;
import org.modeshape.web.jcr.rest.client.Status.Severity;
@@ -59,10 +60,10 @@
workspaceLocations);
dialog.open();
} catch (Exception e) {
- Activator.getDefault().log(new Status(Severity.ERROR,
RestClientI18n.showPublishedLocationsErrorMsg.text(), e));
+ Activator.getDefault().log(new Status(Severity.ERROR,
RestClientI18n.showPublishedLocationsErrorMsg, e));
MessageDialog.openError(shell,
- RestClientI18n.errorDialogTitle.text(),
-
RestClientI18n.showPublishedLocationsErrorMsg.text());
+ RestClientI18n.errorDialogTitle,
+ RestClientI18n.showPublishedLocationsErrorMsg);
}
// per javadoc must return null
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/DeleteServerDialog.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/DeleteServerDialog.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/DeleteServerDialog.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -17,6 +17,7 @@
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
@@ -45,7 +46,7 @@
*/
public DeleteServerDialog( Shell parentShell,
Collection<ModeShapeServer> serversBeingDeleted ) {
- super(parentShell, RestClientI18n.deleteServerDialogTitle.text(),
Activator.getDefault().getImage(ModeShape_IMAGE_16x),
+ super(parentShell, RestClientI18n.deleteServerDialogTitle,
Activator.getDefault().getImage(ModeShape_IMAGE_16x),
null, MessageDialog.QUESTION, new String[] { IDialogConstants.OK_LABEL,
IDialogConstants.CANCEL_LABEL }, 0);
CheckArg.isNotNull(serversBeingDeleted, "serversBeingDeleted");
//$NON-NLS-1$
@@ -69,9 +70,9 @@
if (this.serversBeingDeleted.size() == 1) {
ModeShapeServer server = this.serversBeingDeleted.iterator().next();
- msg = RestClientI18n.deleteServerDialogOneServerMsg.text(server.getName(),
server.getUser());
+ msg = NLS.bind(RestClientI18n.deleteServerDialogOneServerMsg,
server.getName(), server.getUser());
} else {
- msg =
RestClientI18n.deleteServerDialogMultipleServersMsg.text(this.serversBeingDeleted.size());
+ msg = NLS.bind(RestClientI18n.deleteServerDialogMultipleServersMsg,
this.serversBeingDeleted.size());
}
this.message = msg;
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/PublishedLocationsDialog.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/PublishedLocationsDialog.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/dialogs/PublishedLocationsDialog.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -31,6 +31,7 @@
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.dnd.TextTransfer;
@@ -92,11 +93,11 @@
/**
* The column headers.
*/
- private static final String[] HEADERS =
{RestClientI18n.publishedLocationsDialogServerUrlColumnHeader.text(),
- RestClientI18n.publishedLocationsDialogUserColumnHeader.text(),
- RestClientI18n.publishedLocationsDialogRepositoryColumnHeader.text(),
- RestClientI18n.publishedLocationsDialogWorkspaceColumnHeader.text(),
- RestClientI18n.publishedLocationsDialogFileUrlColumnHeader.text(),};
+ private static final String[] HEADERS =
{RestClientI18n.publishedLocationsDialogServerUrlColumnHeader,
+ RestClientI18n.publishedLocationsDialogUserColumnHeader,
+ RestClientI18n.publishedLocationsDialogRepositoryColumnHeader,
+ RestClientI18n.publishedLocationsDialogWorkspaceColumnHeader,
+ RestClientI18n.publishedLocationsDialogFileUrlColumnHeader};
/**
* The button that copies the file URL to the clipboard.
@@ -121,9 +122,9 @@
public PublishedLocationsDialog( Shell parentShell,
IFile file,
Collection<WorkspaceLocation>
workspaceLocations ) {
- super(parentShell, RestClientI18n.publishedLocationsDialogTitle.text(),
+ super(parentShell, RestClientI18n.publishedLocationsDialogTitle,
Activator.getDefault().getImage(ModeShape_IMAGE_16x),
- RestClientI18n.publishedLocationsDialogMsg.text(file.getFullPath()),
MessageDialog.INFORMATION,
+ NLS.bind(RestClientI18n.publishedLocationsDialogMsg, file.getFullPath()),
MessageDialog.INFORMATION,
new String[] {IDialogConstants.OK_LABEL}, 0);
CheckArg.isNotNull(workspaceLocations, "workspaceLocations");
//$NON-NLS-1$
@@ -213,8 +214,8 @@
//
this.btnCopy = new Button(panel, SWT.PUSH);
-
this.btnCopy.setText(RestClientI18n.publishedLocationsDialogCopyUrlButton.text());
-
this.btnCopy.setToolTipText(RestClientI18n.publishedLocationsDialogCopyUrlButtonToolTip.text());
+ this.btnCopy.setText(RestClientI18n.publishedLocationsDialogCopyUrlButton);
+
this.btnCopy.setToolTipText(RestClientI18n.publishedLocationsDialogCopyUrlButtonToolTip);
this.btnCopy.setEnabled(false);
this.btnCopy.addSelectionListener(new SelectionAdapter() {
/**
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 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/PublishJob.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -23,6 +23,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osgi.util.NLS;
import org.jboss.tools.modeshape.rest.Activator;
import org.jboss.tools.modeshape.rest.PublishedResourceHelper;
import org.jboss.tools.modeshape.rest.RestClientI18n;
@@ -68,11 +69,11 @@
CheckArg.isNotNull(type, "type"); //$NON-NLS-1$
if (Type.PUBLISH == type) {
- return RestClientI18n.publishJobPublishName.text(jobId);
+ return NLS.bind(RestClientI18n.publishJobPublishName, jobId);
}
// unpublish
- return RestClientI18n.publishJobUnpublishName.text(jobId);
+ return NLS.bind(RestClientI18n.publishJobUnpublishName, jobId);
}
/**
@@ -178,8 +179,8 @@
try {
int fileCount = this.files.size();
- String name = (isPublishing() ?
RestClientI18n.publishJobPublishTaskName.text(this.jobId)
- :
RestClientI18n.publishJobUnpublishTaskName.text(this.jobId));
+ String name = (isPublishing() ?
NLS.bind(RestClientI18n.publishJobPublishTaskName, this.jobId)
+ :
NLS.bind(RestClientI18n.publishJobUnpublishTaskName, this.jobId));
monitor.beginTask(name, fileCount);
monitor.setTaskName(name);
@@ -189,11 +190,11 @@
// write initial message to console
if (isPublishing()) {
-
ModeShapeMessageConsole.writeln(RestClientI18n.publishJobPublish.text(this.jobId,
serverUrl, repositoryName,
-
workspaceName, fileCount));
+
ModeShapeMessageConsole.writeln(NLS.bind(RestClientI18n.publishJobPublish, new Object[] {
this.jobId, serverUrl,
+ repositoryName, workspaceName, fileCount }));
} else {
-
ModeShapeMessageConsole.writeln(RestClientI18n.publishJobUnpublish.text(this.jobId,
serverUrl, repositoryName,
-
workspaceName, fileCount));
+
ModeShapeMessageConsole.writeln(NLS.bind(RestClientI18n.publishJobUnpublish, new Object[]
{ this.jobId, serverUrl,
+ repositoryName, workspaceName, fileCount }));
}
PublishedResourceHelper resourceHelper = new
PublishedResourceHelper(getServerManager());
@@ -202,7 +203,7 @@
for (IFile eclipseFile : this.files) {
if (monitor.isCanceled()) {
canceled = true;
- throw new
InterruptedException(RestClientI18n.publishJobCanceled.text(jobId));
+ throw new
InterruptedException(NLS.bind(RestClientI18n.publishJobCanceled, jobId));
}
File file = eclipseFile.getLocation().toFile();
@@ -251,7 +252,7 @@
if (e instanceof InterruptedException) {
msg = e.getLocalizedMessage();
} else {
- msg = RestClientI18n.publishJobUnexpectedErrorMsg.text();
+ msg = RestClientI18n.publishJobUnexpectedErrorMsg;
}
return new org.eclipse.core.runtime.Status(IStatus.INFO, PLUGIN_ID, msg, e);
@@ -266,28 +267,28 @@
long seconds = ((milliseconds % (1000 * 60 * 60)) % (1000 * 60)) / 1000;
if (hours > 0) {
- duration = RestClientI18n.publishJobDurationMsg.text(hours, minutes,
seconds);
+ duration = NLS.bind(RestClientI18n.publishJobDurationMsg, new Object[]
{hours, minutes, seconds});
} else if (minutes > 0) {
- duration = RestClientI18n.publishJobDurationNoHoursMsg.text(minutes,
seconds);
+ duration = NLS.bind(RestClientI18n.publishJobDurationNoHoursMsg, minutes,
seconds);
} else if (seconds > 0) {
- duration =
RestClientI18n.publishJobDurationNoHoursNoMinutesMsg.text(seconds);
+ duration = NLS.bind(RestClientI18n.publishJobDurationNoHoursNoMinutesMsg,
seconds);
} else {
- duration = RestClientI18n.publishJobDurationShortMsg.text();
+ duration = RestClientI18n.publishJobDurationShortMsg;
}
if (canceled) {
if (isPublishing()) {
-
ModeShapeMessageConsole.writeln(RestClientI18n.publishJobPublishCanceledMsg.text(this.jobId,
numProcessed,
-
this.files.size(), duration));
+
ModeShapeMessageConsole.writeln(NLS.bind(RestClientI18n.publishJobPublishCanceledMsg, new
Object[] {
+ this.jobId, numProcessed, this.files.size(), duration }));
} else {
-
ModeShapeMessageConsole.writeln(RestClientI18n.publishJobUnpublishCanceledMsg.text(this.jobId,
numProcessed,
-
this.files.size(), duration));
+
ModeShapeMessageConsole.writeln(NLS.bind(RestClientI18n.publishJobUnpublishCanceledMsg,
new Object[] {
+ this.jobId, numProcessed, this.files.size(), duration }));
}
} else {
if (isPublishing()) {
-
ModeShapeMessageConsole.writeln(RestClientI18n.publishJobPublishFinishedMsg.text(this.jobId,
duration));
+
ModeShapeMessageConsole.writeln(NLS.bind(RestClientI18n.publishJobPublishFinishedMsg,
this.jobId, duration));
} else {
-
ModeShapeMessageConsole.writeln(RestClientI18n.publishJobUnpublishFinishedMsg.text(this.jobId,
duration));
+
ModeShapeMessageConsole.writeln(NLS.bind(RestClientI18n.publishJobUnpublishFinishedMsg,
this.jobId, duration));
}
}
}
@@ -307,33 +308,34 @@
if (status.isOk()) {
if (isPublishing()) {
- message = RestClientI18n.publishJobPublishFile.text(this.jobId,
file.getFullPath(), url.toString());
+ message = NLS.bind(RestClientI18n.publishJobPublishFile,
+ new Object[] { this.jobId, file.getFullPath(),
url.toString() });
} else {
- message = RestClientI18n.publishJobUnpublishFile.text(this.jobId,
file.getFullPath());
+ message = NLS.bind(RestClientI18n.publishJobUnpublishFile, this.jobId,
file.getFullPath());
}
} else if (status.isError()) {
if (isPublishing()) {
- message = RestClientI18n.publishJobPublishFileFailed.text(this.jobId,
file.getFullPath());
+ message = NLS.bind(RestClientI18n.publishJobPublishFileFailed,
this.jobId, file.getFullPath());
} else {
- message = RestClientI18n.publishJobUnpublishFileFailed.text(this.jobId,
file.getFullPath());
+ message = NLS.bind(RestClientI18n.publishJobUnpublishFileFailed,
this.jobId, file.getFullPath());
}
// log
Activator.getDefault().log(status);
} else if (status.isWarning()) {
if (isPublishing()) {
- message = RestClientI18n.publishJobPublishFileWarning.text(this.jobId,
file.getFullPath());
+ message = NLS.bind(RestClientI18n.publishJobPublishFileWarning,
this.jobId, file.getFullPath());
} else {
- message = RestClientI18n.publishJobUnpublishFileWarning.text(this.jobId,
file.getFullPath());
+ message = NLS.bind(RestClientI18n.publishJobUnpublishFileWarning,
this.jobId, file.getFullPath());
}
// log
Activator.getDefault().log(status);
} else {
if (isPublishing()) {
- message = RestClientI18n.publishJobPublishFileInfo.text(this.jobId,
file.getFullPath());
+ message = NLS.bind(RestClientI18n.publishJobPublishFileInfo, this.jobId,
file.getFullPath());
} else {
- message = RestClientI18n.publishJobUnpublishFileInfo.text(this.jobId,
file.getFullPath());
+ message = NLS.bind(RestClientI18n.publishJobUnpublishFileInfo,
this.jobId, file.getFullPath());
}
// log
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesEditor.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesEditor.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesEditor.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -75,7 +75,7 @@
* @param parent the parent control
*/
public IgnoredResourcesEditor( Composite parent ) {
- super(IGNORED_RESOURCES_PREFERENCE, ignoredResourcesPreferencePageLabel.text(),
parent);
+ super(IGNORED_RESOURCES_PREFERENCE, ignoredResourcesPreferencePageLabel,
parent);
}
/**
@@ -407,7 +407,7 @@
*/
@Override
protected void configureShell( Shell newShell ) {
- newShell.setText(newIgnoredResourceDialogTitle.text());
+ newShell.setText(newIgnoredResourceDialogTitle);
super.configureShell(newShell);
}
@@ -445,7 +445,7 @@
Label label = new Label(pnlEditor, SWT.NONE);
label.setLayoutData(new GridData(SWT.LEFT, SWT.NONE, false, false));
- label.setText(newIgnoredResourceDialogLabel.text());
+ label.setText(newIgnoredResourceDialogLabel);
Text textField = new Text(pnlEditor, SWT.BORDER);
textField.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
@@ -494,7 +494,7 @@
super.initializeBounds();
// resize shell to be twice the width needed for the title (without this the
title maybe cropped)
- int width = (4 *
convertWidthInCharsToPixels(newIgnoredResourceDialogTitle.text().length()));
+ int width = (4 *
convertWidthInCharsToPixels(newIgnoredResourceDialogTitle.length()));
Rectangle rectangle = getShell().getBounds();
getShell().setBounds(rectangle.x, rectangle.y, width, rectangle.height);
}
@@ -522,7 +522,7 @@
if (this.newPattern.equals(pattern.getPattern())) {
enable = false;
this.lblMessage.setImage(Activator.getDefault().getSharedImage(ISharedImages.IMG_OBJS_INFO_TSK));
-
this.lblMessage.setText(RestClientI18n.newItemDialogValueExists.text());
+
this.lblMessage.setText(RestClientI18n.newItemDialogValueExists);
break;
}
}
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesPreferencePage.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesPreferencePage.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/IgnoredResourcesPreferencePage.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -72,7 +72,7 @@
*/
@Override
public String getDescription() {
- return ignoredResourcesPreferencePageDescription.text();
+ return ignoredResourcesPreferencePageDescription;
}
/**
@@ -92,7 +92,7 @@
*/
@Override
public String getMessage() {
- return ignoredResourcesPreferencePageMessage.text();
+ return ignoredResourcesPreferencePageMessage;
}
/**
@@ -112,7 +112,7 @@
*/
@Override
public String getTitle() {
- return ignoredResourcesPreferencePageTitle.text();
+ return ignoredResourcesPreferencePageTitle;
}
/**
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 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/ModeShapePreferencePage.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -57,10 +57,10 @@
// create the field editor
this.enableVersioningEditor = new BooleanFieldEditor(ENABLE_RESOURCE_VERSIONING,
-
preferencePageEnableVersioningEditor.text(),
+
preferencePageEnableVersioningEditor,
panel);
this.enableVersioningEditor.setPreferenceStore(getPreferenceStore());
-
this.enableVersioningEditor.getDescriptionControl(panel).setToolTipText(preferencePageEnableVersioningEditorToolTip.text());
+
this.enableVersioningEditor.getDescriptionControl(panel).setToolTipText(preferencePageEnableVersioningEditorToolTip);
// populate the editor with current preference value
this.enableVersioningEditor.load();
@@ -79,7 +79,7 @@
*/
@Override
public String getDescription() {
- return preferencePageDescription.text();
+ return preferencePageDescription;
}
/**
@@ -99,7 +99,7 @@
*/
@Override
public String getMessage() {
- return preferencePageMessage.text();
+ return preferencePageMessage;
}
/**
@@ -119,7 +119,7 @@
*/
@Override
public String getTitle() {
- return preferencePageTitle.text();
+ return preferencePageTitle;
}
/**
Modified:
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 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/preferences/PreferenceInitializer.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -18,6 +18,7 @@
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.osgi.util.NLS;
import org.jboss.tools.modeshape.rest.Activator;
import org.modeshape.web.jcr.rest.client.Status;
import org.modeshape.web.jcr.rest.client.Status.Severity;
@@ -48,7 +49,7 @@
if (defaultValues == null) {
// would only happen if PLUGIN_ID is wrong
- Activator.getDefault().log(new Status(Severity.ERROR,
preferenceDefaultScopeNotFound.text(PLUGIN_ID), null));
+ Activator.getDefault().log(new Status(Severity.ERROR,
NLS.bind(preferenceDefaultScopeNotFound, PLUGIN_ID), null));
} else {
load();
@@ -67,12 +68,12 @@
input = getClass().getResource(PREFERENCES_FILE).openStream();
if (input == null) {
- Activator.getDefault().log(new Status(Severity.ERROR,
preferenceFileNotFound.text(PREFERENCES_FILE), null));
+ Activator.getDefault().log(new Status(Severity.ERROR,
NLS.bind(preferenceFileNotFound, PREFERENCES_FILE), null));
} else {
this.preferenceDefaults.load(input);
}
} catch (IOException e) {
- Activator.getDefault().log(new Status(Severity.ERROR,
preferenceFileNotFound.text(PREFERENCES_FILE), null));
+ Activator.getDefault().log(new Status(Severity.ERROR,
NLS.bind(preferenceFileNotFound, PREFERENCES_FILE), null));
} finally {
try {
if (input != null) {
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/PropertyDisplayNameProvider.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/PropertyDisplayNameProvider.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/properties/PropertyDisplayNameProvider.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -87,7 +87,7 @@
try {
bundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
} catch (Exception e) {
- Activator.getDefault().log(new Status(Severity.ERROR,
RestClientI18n.propertiesBundleLoadErrorMsg.text(), e));
+ Activator.getDefault().log(new Status(Severity.ERROR,
RestClientI18n.propertiesBundleLoadErrorMsg, e));
}
}
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeContentProvider.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeContentProvider.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeContentProvider.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -28,6 +28,7 @@
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IDecoratorManager;
@@ -174,7 +175,7 @@
return getServerManager().getRepositories(server).toArray();
} catch (Exception e) {
addOfflineServer(server);
- String msg =
RestClientI18n.serverManagerGetRepositoriesExceptionMsg.text(server.getShortDescription());
+ String msg =
NLS.bind(RestClientI18n.serverManagerGetRepositoriesExceptionMsg,
server.getShortDescription());
Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
}
}
@@ -186,7 +187,7 @@
return getServerManager().getWorkspaces(repository).toArray();
} catch (Exception e) {
addOfflineServer(repository.getServer());
- String msg =
RestClientI18n.serverManagerGetWorkspacesExceptionMsg.text(repository.getShortDescription());
+ String msg =
NLS.bind(RestClientI18n.serverManagerGetWorkspacesExceptionMsg,
repository.getShortDescription());
Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
}
}
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeMessageConsole.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeMessageConsole.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ModeShapeMessageConsole.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -23,6 +23,7 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentListener;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.console.AbstractConsole;
@@ -61,7 +62,7 @@
/**
* The message console name.
*/
- private static final String NAME = RestClientI18n.publishingConsoleName.text();
+ private static final String NAME = RestClientI18n.publishingConsoleName;
/**
* Note: The <code>ModeShapeMessageConsole</code> should
<strong>NOT</strong> be cached as the user can open/close/create instances.
@@ -218,7 +219,7 @@
}
} catch (IOException e) {
Activator.getDefault().log(new Status(Severity.ERROR,
-
RestClientI18n.publishingConsoleProblemMsg.text(),
+
RestClientI18n.publishingConsoleProblemMsg,
e));
} finally {
if (stream != null) {
@@ -227,7 +228,7 @@
stream.close();
} catch (IOException e) {
Activator.getDefault().log(new
Status(Severity.ERROR,
-
RestClientI18n.publishingConsoleProblemMsg.text(),
+
RestClientI18n.publishingConsoleProblemMsg,
e));
}
}
@@ -301,7 +302,7 @@
int index = this.message.indexOf(target);
if (index == -1) {
- throw new
BadLocationException(RestClientI18n.publishingConsoleFilePathNotFoundMsg.text(target));
+ throw new
BadLocationException(NLS.bind(RestClientI18n.publishingConsoleFilePathNotFoundMsg,
target));
}
this.console.addHyperlink(new FileLink(file, null, -1, -1, -1),
(region.getOffset() + index), target.length());
@@ -311,7 +312,7 @@
}
} catch (BadLocationException e) {
Activator.getDefault().log(new Status(Severity.ERROR,
-
RestClientI18n.publishingConsoleProblemCreatingHyperlinkMsg.text(), e));
+
RestClientI18n.publishingConsoleProblemCreatingHyperlinkMsg, e));
document.removeDocumentListener(this);
}
}
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ServerView.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ServerView.java 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/views/ServerView.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -100,7 +100,7 @@
}
};
-
this.collapseAllAction.setToolTipText(RestClientI18n.collapseActionToolTip.text());
+ this.collapseAllAction.setToolTipText(RestClientI18n.collapseActionToolTip);
this.collapseAllAction.setImageDescriptor(Activator.getDefault().getImageDescriptor(COLLAPSE_ALL_IMAGE));
// the reconnect action tries to ping a selected server
@@ -198,7 +198,7 @@
constructContextMenu();
hookGlobalActions();
- setTitleToolTip(RestClientI18n.serverViewToolTip.text());
+ setTitleToolTip(RestClientI18n.serverViewToolTip);
// register to receive changes to the server registry
getServerManager().addRegistryListener(this);
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 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishPage.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -34,6 +34,7 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -392,8 +393,8 @@
List<IResource> resources ) throws CoreException {
super(PublishPage.class.getSimpleName());
CheckArg.isNotNull(resources, "resources"); //$NON-NLS-1$
- setTitle((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishTitle.text()
- :
RestClientI18n.publishPageUnpublishTitle.text());
+ setTitle((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishTitle
+ : RestClientI18n.publishPageUnpublishTitle);
setPageComplete(false);
this.type = type;
@@ -407,7 +408,7 @@
private void constructLocationPanel( Composite parent ) {
Group pnl = new Group(parent, SWT.NONE);
- pnl.setText(RestClientI18n.publishPageLocationGroupTitle.text());
+ pnl.setText(RestClientI18n.publishPageLocationGroupTitle);
pnl.setLayout(new GridLayout(2, false));
pnl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
@@ -428,16 +429,16 @@
Label lblServer = new Label(pnlServer, SWT.LEFT);
lblServer.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- lblServer.setText(RestClientI18n.publishPageServerLabel.text());
+ lblServer.setText(RestClientI18n.publishPageServerLabel);
this.cbxServer = new Combo(pnlServer, SWT.DROP_DOWN | SWT.READ_ONLY);
this.cbxServer.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-
this.cbxServer.setToolTipText(RestClientI18n.publishPageServerToolTip.text());
+ this.cbxServer.setToolTipText(RestClientI18n.publishPageServerToolTip);
final IAction action = new NewServerAction(this.getShell(),
getServerManager());
final Button btnNewServer = new Button(pnlServer, SWT.PUSH);
btnNewServer.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false,
false));
- btnNewServer.setText(RestClientI18n.publishPageNewServerButton.text());
+ btnNewServer.setText(RestClientI18n.publishPageNewServerButton);
btnNewServer.setToolTipText(action.getToolTipText());
btnNewServer.addSelectionListener(new SelectionAdapter() {
/**
@@ -470,36 +471,36 @@
{ // row 2: repository row
Label lblRepository = new Label(pnl, SWT.LEFT);
lblRepository.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false,
false));
- lblRepository.setText(RestClientI18n.publishPageRepositoryLabel.text());
+ lblRepository.setText(RestClientI18n.publishPageRepositoryLabel);
this.cbxRepository = new Combo(pnl, SWT.DROP_DOWN | SWT.READ_ONLY);
this.cbxRepository.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true,
false));
-
this.cbxRepository.setToolTipText(RestClientI18n.publishPageRepositoryToolTip.text());
+
this.cbxRepository.setToolTipText(RestClientI18n.publishPageRepositoryToolTip);
}
{ // row 3: workspace row
Label lblWorkspace = new Label(pnl, SWT.LEFT);
lblWorkspace.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false,
false));
- lblWorkspace.setText(RestClientI18n.publishPageWorkspaceLabel.text());
+ lblWorkspace.setText(RestClientI18n.publishPageWorkspaceLabel);
this.cbxWorkspace = new Combo(pnl, SWT.DROP_DOWN | SWT.READ_ONLY);
this.cbxWorkspace.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true,
false));
if (type == Type.PUBLISH) {
-
this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspacePublishToolTip.text());
+
this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspacePublishToolTip);
} else {
-
this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspaceUnpublishToolTip.text());
+
this.cbxWorkspace.setToolTipText(RestClientI18n.publishPageWorkspaceUnpublishToolTip);
}
}
{ // row 4: workspace area
Label lblWorkspaceArea = new Label(pnl, SWT.LEFT);
lblWorkspaceArea.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false,
false));
-
lblWorkspaceArea.setText(RestClientI18n.publishPageWorkspaceAreaLabel.text());
+ lblWorkspaceArea.setText(RestClientI18n.publishPageWorkspaceAreaLabel);
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());
+
this.cbxWorkspaceAreas.setToolTipText(RestClientI18n.publishPageWorkspaceAreaToolTip);
}
}
@@ -519,9 +520,9 @@
lbl.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
if (type == Type.PUBLISH) {
- lbl.setText(RestClientI18n.publishPagePublishResourcesLabel.text());
+ lbl.setText(RestClientI18n.publishPagePublishResourcesLabel);
} else {
- lbl.setText(RestClientI18n.publishPageUnpublishResourcesLabel.text());
+ lbl.setText(RestClientI18n.publishPageUnpublishResourcesLabel);
}
}
@@ -561,8 +562,8 @@
{ // 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());
-
chkRecurse.setToolTipText(RestClientI18n.publishPageRecurseCheckBoxToolTip.text());
+ chkRecurse.setText(RestClientI18n.publishPageRecurseCheckBox);
+ chkRecurse.setToolTipText(RestClientI18n.publishPageRecurseCheckBoxToolTip);
// set the recurse flag based on dialog settings
if (getDialogSettings().get(RECURSE_KEY) != null) {
@@ -608,8 +609,8 @@
this.chkVersioning = new Button(pnlVersioning, SWT.CHECK);
this.chkVersioning.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false,
false));
-
this.chkVersioning.setText(RestClientI18n.publishPageVersionCheckBox.text());
-
this.chkVersioning.setToolTipText(RestClientI18n.publishPageVersionCheckBoxToolTip.text());
+ this.chkVersioning.setText(RestClientI18n.publishPageVersionCheckBox);
+
this.chkVersioning.setToolTipText(RestClientI18n.publishPageVersionCheckBoxToolTip);
// set the version flag based on preference
this.versioning =
Activator.getDefault().getPreferenceStore().getBoolean(ENABLE_RESOURCE_VERSIONING);
@@ -629,7 +630,7 @@
});
this.linkPrefs = new Link(pnlVersioning, SWT.WRAP);
-
this.linkPrefs.setText(RestClientI18n.publishPageOpenPreferencePageLink.text());
+ this.linkPrefs.setText(RestClientI18n.publishPageOpenPreferencePageLink);
this.linkPrefs.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false,
false));
this.linkPrefs.setEnabled(false);
this.linkPrefs.addSelectionListener(new SelectionAdapter() {
@@ -736,11 +737,11 @@
this.files = processResources(this.resources, isRecursing(), filter);
loadFiles();
} catch (CoreException e) {
- Activator.getDefault().log(new Status(Severity.ERROR,
RestClientI18n.publishPageRecurseProcessingErrorMsg.text(), e));
+ Activator.getDefault().log(new Status(Severity.ERROR,
RestClientI18n.publishPageRecurseProcessingErrorMsg, e));
if (getControl().isVisible()) {
- MessageDialog.openError(getShell(),
RestClientI18n.errorDialogTitle.text(),
-
RestClientI18n.publishPageRecurseProcessingErrorMsg.text());
+ MessageDialog.openError(getShell(), RestClientI18n.errorDialogTitle,
+
RestClientI18n.publishPageRecurseProcessingErrorMsg);
}
}
}
@@ -827,7 +828,7 @@
} catch (Exception e) {
Activator.getDefault()
.log(new Status(Severity.ERROR,
-
RestClientI18n.publishPageUnableToObtainWorkspaceAreas.text(this.workspace),
+
NLS.bind(RestClientI18n.publishPageUnableToObtainWorkspaceAreas, this.workspace),
e));
}
@@ -917,7 +918,7 @@
this.repositories = new
ArrayList<ModeShapeRepository>(getServerManager().getRepositories(this.server));
} catch (Exception e) {
this.repositories = Collections.emptyList();
- String msg =
RestClientI18n.serverManagerGetRepositoriesExceptionMsg.text(this.server.getShortDescription());
+ String msg =
NLS.bind(RestClientI18n.serverManagerGetRepositoriesExceptionMsg,
this.server.getShortDescription());
Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
}
}
@@ -1013,7 +1014,7 @@
this.workspaces = new
ArrayList<ModeShapeWorkspace>(getServerManager().getWorkspaces(this.repository));
} catch (Exception e) {
this.workspaces = Collections.emptyList();
- String msg =
RestClientI18n.serverManagerGetWorkspacesExceptionMsg.text(this.repository);
+ String msg =
NLS.bind(RestClientI18n.serverManagerGetWorkspacesExceptionMsg, this.repository);
Activator.getDefault().log(new Status(Severity.ERROR, msg, e));
}
}
@@ -1096,8 +1097,8 @@
// set initial message
if (this.status.isOk()) {
- String msg = ((this.type == Type.PUBLISH) ?
RestClientI18n.publishPagePublishOkStatusMsg.text()
- :
RestClientI18n.publishPageUnpublishOkStatusMsg.text());
+ String msg = ((this.type == Type.PUBLISH) ?
RestClientI18n.publishPagePublishOkStatusMsg
+ :
RestClientI18n.publishPageUnpublishOkStatusMsg);
setMessage(msg, IMessageProvider.NONE);
} else {
setMessage(this.status.getMessage(), IMessageProvider.ERROR);
@@ -1117,7 +1118,7 @@
try {
this.files = processResources(this.resources, isRecursing(), this.filter);
} catch (CoreException e) {
- Activator.getDefault().log(new Status(Severity.ERROR,
RestClientI18n.publishPageRecurseProcessingErrorMsg.text(), e));
+ Activator.getDefault().log(new Status(Severity.ERROR,
RestClientI18n.publishPageRecurseProcessingErrorMsg, e));
}
}
@@ -1125,8 +1126,8 @@
* Updates the initial page message.
*/
void updateInitialMessage() {
- String msg = ((this.type == Type.PUBLISH) ?
RestClientI18n.publishPagePublishOkStatusMsg.text()
- :
RestClientI18n.publishPageUnpublishOkStatusMsg.text());
+ String msg = ((this.type == Type.PUBLISH) ?
RestClientI18n.publishPagePublishOkStatusMsg
+ :
RestClientI18n.publishPageUnpublishOkStatusMsg);
if (msg.equals(getMessage())) {
updateState();
@@ -1191,24 +1192,24 @@
Severity severity = Severity.ERROR;
if ((this.resources == null) || this.resources.isEmpty() || this.files.isEmpty())
{
- msg = ((type == Type.PUBLISH) ?
RestClientI18n.publishPageNoResourcesToPublishStatusMsg.text()
- :
RestClientI18n.publishPageNoResourcesToUnpublishStatusMsg.text());
+ msg = ((type == Type.PUBLISH) ?
RestClientI18n.publishPageNoResourcesToPublishStatusMsg
+ :
RestClientI18n.publishPageNoResourcesToUnpublishStatusMsg);
} else if (this.server == null) {
int count = this.cbxServer.getItemCount();
- msg = ((count == 0) ?
RestClientI18n.publishPageNoAvailableServersStatusMsg.text()
- :
RestClientI18n.publishPageMissingServerStatusMsg.text());
+ msg = ((count == 0) ? RestClientI18n.publishPageNoAvailableServersStatusMsg
+ : RestClientI18n.publishPageMissingServerStatusMsg);
} else if (this.repository == null) {
int count = this.cbxRepository.getItemCount();
- msg = ((count == 0) ?
RestClientI18n.publishPageNoAvailableRepositoriesStatusMsg.text()
- :
RestClientI18n.publishPageMissingRepositoryStatusMsg.text());
+ msg = ((count == 0) ?
RestClientI18n.publishPageNoAvailableRepositoriesStatusMsg
+ : RestClientI18n.publishPageMissingRepositoryStatusMsg);
} else if (this.workspace == null) {
int count = this.cbxWorkspace.getItemCount();
- msg = ((count == 0) ?
RestClientI18n.publishPageNoAvailableWorkspacesStatusMsg.text()
- :
RestClientI18n.publishPageMissingWorkspaceStatusMsg.text());
+ msg = ((count == 0) ?
RestClientI18n.publishPageNoAvailableWorkspacesStatusMsg
+ : RestClientI18n.publishPageMissingWorkspaceStatusMsg);
} else {
severity = Severity.OK;
- msg = ((type == Type.PUBLISH) ?
RestClientI18n.publishPagePublishOkStatusMsg.text()
- :
RestClientI18n.publishPageUnpublishOkStatusMsg.text());
+ msg = ((type == Type.PUBLISH) ? RestClientI18n.publishPagePublishOkStatusMsg
+ :
RestClientI18n.publishPageUnpublishOkStatusMsg);
}
this.status = new Status(severity, msg, 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 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/PublishWizard.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -67,8 +67,8 @@
this.page = new PublishPage(type, resources);
this.serverManager = serverManager;
- setWindowTitle((type == Type.PUBLISH) ?
RestClientI18n.publishWizardPublishTitle.text()
- :
RestClientI18n.publishWizardUnpublishTitle.text());
+ setWindowTitle((type == Type.PUBLISH) ? RestClientI18n.publishWizardPublishTitle
+ :
RestClientI18n.publishWizardUnpublishTitle);
setDefaultPageImageDescriptor(Activator.getDefault().getImageDescriptor(WIZARD_BANNER_IMAGE));
}
@@ -124,7 +124,7 @@
this.page.wizardFinished();
} catch (Exception e) {
// don't let this error stop the publishing operation
- Activator.getDefault().log(new Status(Severity.ERROR,
RestClientI18n.publishPageFinishedErrorMsg.text(), e));
+ Activator.getDefault().log(new Status(Severity.ERROR,
RestClientI18n.publishPageFinishedErrorMsg, e));
}
// run publish job
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 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerPage.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -18,6 +18,7 @@
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.custom.StyledText;
@@ -88,7 +89,7 @@
*/
public ServerPage() {
super(ServerPage.class.getSimpleName());
- setTitle(RestClientI18n.serverPageTitle.text());
+ setTitle(RestClientI18n.serverPageTitle);
setPageComplete(false);
}
@@ -99,7 +100,7 @@
*/
public ServerPage( ModeShapeServer server ) {
super(ServerPage.class.getSimpleName());
- setTitle(RestClientI18n.serverPageTitle.text());
+ setTitle(RestClientI18n.serverPageTitle);
this.server = server;
this.url = server.getUrl();
@@ -110,18 +111,18 @@
private void constructAuthenticationPanel( Composite parent ) {
Group pnl = new Group(parent, SWT.NONE);
- pnl.setText(RestClientI18n.serverPageAuthenticationGroupTitle.text());
+ pnl.setText(RestClientI18n.serverPageAuthenticationGroupTitle);
pnl.setLayout(new GridLayout(2, false));
pnl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
{ // user row
Label lblUser = new Label(pnl, SWT.LEFT);
lblUser.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- lblUser.setText(RestClientI18n.serverPageUserLabel.text());
+ lblUser.setText(RestClientI18n.serverPageUserLabel);
Text txtUser = new Text(pnl, SWT.BORDER);
txtUser.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- txtUser.setToolTipText(RestClientI18n.serverPageUserToolTip.text());
+ txtUser.setToolTipText(RestClientI18n.serverPageUserToolTip);
// set initial value
if (this.user != null) {
@@ -144,11 +145,11 @@
{ // password row
Label lblPassword = new Label(pnl, SWT.LEFT);
lblPassword.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- lblPassword.setText(RestClientI18n.serverPagePasswordLabel.text());
+ lblPassword.setText(RestClientI18n.serverPagePasswordLabel);
Text txtPassword = new Text(pnl, SWT.BORDER);
txtPassword.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- txtPassword.setToolTipText(RestClientI18n.serverPagePasswordToolTip.text());
+ txtPassword.setToolTipText(RestClientI18n.serverPagePasswordToolTip);
txtPassword.setEchoChar('*');
// set initial value before hooking up listener
@@ -174,8 +175,8 @@
final Button btn = new Button(pnl, SWT.CHECK | SWT.LEFT);
btn.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
((GridData)btn.getLayoutData()).horizontalSpan = 2;
- btn.setText(RestClientI18n.serverPageSavePasswordButton.text());
- btn.setToolTipText(RestClientI18n.serverPageSavePasswordToolTip.text());
+ btn.setText(RestClientI18n.serverPageSavePasswordButton);
+ btn.setToolTipText(RestClientI18n.serverPageSavePasswordToolTip);
// set initial value before hooking up listeners
if (this.savePassword) {
@@ -216,7 +217,7 @@
lblImage.setImage(Display.getDefault().getSystemImage(SWT.ICON_INFORMATION));
StyledText st = new StyledText(pnl, SWT.READ_ONLY | SWT.MULTI | SWT.NO_FOCUS
| SWT.WRAP);
- st.setText(RestClientI18n.serverPageSavePasswordLabel.text());
+ st.setText(RestClientI18n.serverPageSavePasswordLabel);
st.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
st.setCaret(null);
st.setEnabled(false);
@@ -236,11 +237,11 @@
Label lbl = new Label(pnl, SWT.LEFT);
lbl.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- lbl.setText(RestClientI18n.serverPageTestConnectionLabel.text());
+ lbl.setText(RestClientI18n.serverPageTestConnectionLabel);
this.btnTestConnection = new Button(pnl, SWT.PUSH);
-
this.btnTestConnection.setText(RestClientI18n.serverPageTestConnectionButton.text());
-
this.btnTestConnection.setToolTipText(RestClientI18n.serverPageTestConnectionButtonToolTip.text());
+ this.btnTestConnection.setText(RestClientI18n.serverPageTestConnectionButton);
+
this.btnTestConnection.setToolTipText(RestClientI18n.serverPageTestConnectionButtonToolTip);
// add margins to the side of the text
GridData gd = new GridData(SWT.LEFT, SWT.CENTER, false, false);
@@ -269,11 +270,11 @@
Label lblUrl = new Label(pnl, SWT.LEFT);
lblUrl.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- lblUrl.setText(RestClientI18n.serverPageUrlLabel.text());
+ lblUrl.setText(RestClientI18n.serverPageUrlLabel);
Text txtUrl = new Text(pnl, SWT.BORDER);
txtUrl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
- txtUrl.setToolTipText(RestClientI18n.serverPageUrlToolTip.text());
+ txtUrl.setToolTipText(RestClientI18n.serverPageUrlToolTip);
// set initial value
if (this.url != null) {
@@ -299,7 +300,7 @@
// add the text on the URL format
StyledText st = new StyledText(pnl, SWT.READ_ONLY | SWT.MULTI | SWT.NO_FOCUS |
SWT.WRAP);
- st.setText(RestClientI18n.serverPageUrlTemplateLabel.text());
+ st.setText(RestClientI18n.serverPageUrlTemplateLabel);
st.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
st.setCaret(null);
st.setEnabled(false);
@@ -342,7 +343,7 @@
}
// should never be called if error status
- throw new
RuntimeException(RestClientI18n.serverPageInvalidServerProperties.text());
+ throw new RuntimeException(RestClientI18n.serverPageInvalidServerProperties);
}
/**
@@ -391,12 +392,12 @@
if (success[0]) {
MessageDialog.openInformation(getShell(),
-
RestClientI18n.serverPageTestConnectionDialogTitle.text(),
-
RestClientI18n.serverPageTestConnectionDialogSuccessMsg.text());
+
RestClientI18n.serverPageTestConnectionDialogTitle,
+
RestClientI18n.serverPageTestConnectionDialogSuccessMsg);
} else {
MessageDialog.openError(getShell(),
-
RestClientI18n.serverPageTestConnectionDialogTitle.text(),
-
RestClientI18n.serverPageTestConnectionDialogFailureMsg.text());
+ RestClientI18n.serverPageTestConnectionDialogTitle,
+
RestClientI18n.serverPageTestConnectionDialogFailureMsg);
}
}
@@ -424,7 +425,7 @@
* If the initial message is being displayed do a validation.
*/
void updateInitialMessage() {
- if (RestClientI18n.serverPageOkStatusMsg.text().equals(getMessage())) {
+ if (RestClientI18n.serverPageOkStatusMsg.equals(getMessage())) {
updateState();
}
}
@@ -443,7 +444,7 @@
validate();
// set initial message
- setMessage(RestClientI18n.serverPageOkStatusMsg.text());
+ setMessage(RestClientI18n.serverPageOkStatusMsg);
}
}
@@ -466,7 +467,7 @@
} else if (this.status.isInfo()) {
setMessage(this.status.getMessage(), IMessageProvider.INFORMATION);
} else {
- setMessage(RestClientI18n.serverPageOkStatusMsg.text());
+ setMessage(RestClientI18n.serverPageOkStatusMsg);
}
}
}
@@ -484,7 +485,7 @@
// don't check if modifying existing server and identifying properties
have not changed
if (((this.server == null) || !this.server.hasSameKey(changedServer))
&& getServerManager().isRegistered(changedServer)) {
this.status = new Status(Severity.ERROR,
-
RestClientI18n.serverExistsMsg.text(changedServer.getShortDescription()),
+ NLS.bind(RestClientI18n.serverExistsMsg,
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 2012-04-27
20:34:53 UTC (rev 40581)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerWizard.java 2012-04-27
20:36:20 UTC (rev 40582)
@@ -51,7 +51,7 @@
this.serverManager = serverManager;
setDefaultPageImageDescriptor(Activator.getDefault().getImageDescriptor(WIZARD_BANNER_IMAGE));
- setWindowTitle(RestClientI18n.serverWizardNewServerTitle.text());
+ setWindowTitle(RestClientI18n.serverWizardNewServerTitle);
}
/**
@@ -67,7 +67,7 @@
this.existingServer = server;
setDefaultPageImageDescriptor(Activator.getDefault().getImageDescriptor(WIZARD_BANNER_IMAGE));
- setWindowTitle(RestClientI18n.serverWizardEditServerTitle.text());
+ setWindowTitle(RestClientI18n.serverWizardEditServerTitle);
}
/**
@@ -102,16 +102,16 @@
if (status.isError()) {
MessageDialog.openError(getShell(),
- RestClientI18n.errorDialogTitle.text(),
-
RestClientI18n.serverWizardEditServerErrorMsg.text());
+ RestClientI18n.errorDialogTitle,
+ RestClientI18n.serverWizardEditServerErrorMsg);
}
} else if (!this.existingServer.equals(server)) {
status = this.serverManager.updateServer(this.existingServer, server);
if (status.isError()) {
MessageDialog.openError(getShell(),
- RestClientI18n.errorDialogTitle.text(),
-
RestClientI18n.serverWizardNewServerErrorMsg.text());
+ RestClientI18n.errorDialogTitle,
+ RestClientI18n.serverWizardNewServerErrorMsg);
}
}