JBoss Tools SVN: r40587 - in trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el: internal/core/model and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-04-27 17:35:32 -0400 (Fri, 27 Apr 2012)
New Revision: 40587
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELInstanceImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELModelImpl.java
Log:
JBIDE-11682
https://issues.jboss.org/browse/JBIDE-11682
Do not create empty arrays/lists/maps
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java 2012-04-27 21:18:39 UTC (rev 40586)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ELReference.java 2012-04-27 21:35:32 UTC (rev 40587)
@@ -46,7 +46,6 @@
private int startPosition;
private ELExpression[] el;
private Set<IMarker> markers;
- private IMarker[] markerArray;
private boolean needToInitMarkers = false;
private List<SyntaxError> syntaxErrors;
private String source;
@@ -201,25 +200,22 @@
private static final IMarker[] EMPTY_MARKER_ARRAY = new IMarker[0];
private void initMarkers() {
- if(markers==null) {
- markers = new HashSet<IMarker>();
- if(needToInitMarkers) {
- IFile file = getResource();
- if(file!=null) {
- IMarker[] markers = null;
- try {
- markers = file.findMarkers(null, true, IResource.DEPTH_INFINITE);
- } catch (CoreException e) {
- ELCorePlugin.getDefault().logError(e);
- }
- for(int i=0; i<markers.length; i++){
- String groupName = markers[i].getAttribute("groupName", null); //$NON-NLS-1$
- if(groupName!=null && (groupName.equals(this.elMarkerGroupID))) {
- int start = markers[i].getAttribute(IMarker.CHAR_START, -1);
- int end = markers[i].getAttribute(IMarker.CHAR_END, -1);
- if(start>=startPosition && end<=startPosition+length) {
- addMarker(markers[i]);
- }
+ if(markers == null && needToInitMarkers) {
+ IFile file = getResource();
+ if(file!=null) {
+ IMarker[] markers = null;
+ try {
+ markers = file.findMarkers(null, true, IResource.DEPTH_INFINITE);
+ } catch (CoreException e) {
+ ELCorePlugin.getDefault().logError(e);
+ }
+ for(int i=0; i<markers.length; i++){
+ String groupName = markers[i].getAttribute("groupName", null); //$NON-NLS-1$
+ if(groupName!=null && (groupName.equals(this.elMarkerGroupID))) {
+ int start = markers[i].getAttribute(IMarker.CHAR_START, -1);
+ int end = markers[i].getAttribute(IMarker.CHAR_END, -1);
+ if(start>=startPosition && end<=startPosition+length) {
+ addMarker(markers[i]);
}
}
}
@@ -253,53 +249,31 @@
this.needToInitMarkers = needToInitMarkers;
}
- public synchronized void setMarkers(Set<IMarker> markers) {
- this.markers = markers;
- }
-
/**
- * @return the markers
- */
- public synchronized IMarker[] getMarkers() {
- initMarkers();
- if(markerArray==null) {
- if(markers.isEmpty()) {
- markerArray = EMPTY_MARKER_ARRAY;
- } else {
- markerArray = markers.toArray(new IMarker[markers.size()]);
- }
- }
- return markerArray;
- }
-
- /**
* @param markers the markers to set
*/
public synchronized void addMarker(IMarker marker) {
if(marker==null) {
return;
}
- markerArray = null;
if(markers==null) {
markers = new HashSet<IMarker>();
}
markers.add(marker);
}
- public boolean hasMarkers() {
- return !markers.isEmpty();
- }
-
/**
* Removes all markers from this EL.
*/
public void deleteMarkers() {
- IMarker[] aMarkers = null;
+ Set<IMarker> aMarkers = null;
synchronized (this) {
initMarkers();
- aMarkers = getMarkers();
- markers.clear();
- markerArray = null;
+ if(markers == null) {
+ return;
+ }
+ aMarkers = markers;
+ markers = null;
}
for (IMarker marker : aMarkers) {
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELInstanceImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELInstanceImpl.java 2012-04-27 21:18:39 UTC (rev 40586)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELInstanceImpl.java 2012-04-27 21:35:32 UTC (rev 40587)
@@ -11,6 +11,7 @@
package org.jboss.tools.common.el.internal.core.model;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.jboss.tools.common.el.core.model.ELExpression;
@@ -26,8 +27,10 @@
* @author V. Kabanovich
*/
public class ELInstanceImpl extends ELObjectImpl implements ELInstance {
+ public static final List<SyntaxError> EMPTY = Collections.unmodifiableList(new ArrayList<SyntaxError>());
+
ELExpressionImpl expression;
- List<SyntaxError> errors = new ArrayList<SyntaxError>();
+ List<SyntaxError> errors = null;
public ELInstanceImpl() {
}
@@ -55,7 +58,7 @@
}
public List<SyntaxError> getErrors() {
- return errors;
+ return errors != null ? errors : EMPTY;
}
public void addChild(ELObjectImpl child) {
@@ -108,6 +111,9 @@
}
public void addError(SyntaxError error) {
+ if(errors == null) {
+ errors = new ArrayList<SyntaxError>();
+ }
errors.add(error);
}
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELModelImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELModelImpl.java 2012-04-27 21:18:39 UTC (rev 40586)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/model/ELModelImpl.java 2012-04-27 21:35:32 UTC (rev 40587)
@@ -73,7 +73,7 @@
}
public void setErrors(List<SyntaxError> errors) {
- this.errors = errors;
+ this.errors = errors.isEmpty() ? null : errors;
for (SyntaxError e: errors) {
for (ELInstance i: instances) {
ELInstanceImpl im = (ELInstanceImpl)i;
@@ -87,7 +87,7 @@
}
public List<SyntaxError> getSyntaxErrors() {
- return errors;
+ return errors == null ? ELInstanceImpl.EMPTY : errors;
}
public void shift(int delta) {
12 years, 8 months
JBoss Tools SVN: r40586 - trunk/build/parent.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-04-27 17:18:39 -0400 (Fri, 27 Apr 2012)
New Revision: 40586
Modified:
trunk/build/parent/pom.xml
Log:
fixed profile activation issues for plug-ins with requirements. Now it included in plugins section and just check for requirements.properties to build. Not very efficient but:
- it adds a little for every build because it exits right away if there is no requirements.properties file
- it is good when build works by default without needed to remember adding -Pdefault into maven command
Modified: trunk/build/parent/pom.xml
===================================================================
--- trunk/build/parent/pom.xml 2012-04-27 21:05:05 UTC (rev 40585)
+++ trunk/build/parent/pom.xml 2012-04-27 21:18:39 UTC (rev 40586)
@@ -71,17 +71,15 @@
<!-- Default coverage filter, to be overriden when necessary -->
<coverage.filter>org.jboss.tools.*</coverage.filter>
+ <requirements.root>${basedir}/../../../requirements</requirements.root>
+ <requirement.build.root>${requirements.root}/target</requirement.build.root>
+
</properties>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>${maven.antrun.plugin.version}</version>
- </plugin>
-
- <plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>${tychoVersion}</version>
@@ -271,6 +269,66 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <dependencies>
+ <dependency>
+ <groupId>ant-contrib</groupId>
+ <artifactId>ant-contrib</artifactId>
+ <version>1.0b3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-optional</artifactId>
+ <version>1.5.3-1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>${maven.antrun.plugin.version}</version>
+ <executions>
+ <execution>
+ <id>download-plugin-requirements</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <taskdef resource="net/sf/antcontrib/antcontrib.properties" />
+ <if>
+ <and>
+ <available file="${requirements.root}" type="dir" />
+ <available file="requirements.properties" type="file" />
+ </and>
+ <then>
+ <property file="requirements.properties" />
+ <echo>Requirements build</echo>
+ <ant dir="${requirements.root}" inheritAll="true">
+ <property name="requirements" value="${requirements}" />
+ <property name="settings.offline" value="${settings.offline}" />
+ <property name="skipDownload" value="${skipDownload}" />
+ </ant>
+ </then>
+ <else>
+ <echo>No requrements.properties file</echo>
+ </else>
+ </if>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
<pluginManagement>
@@ -787,76 +845,6 @@
</build>
</profile>
<profile>
- <id>requirements</id>
- <activation>
- <file>
- <exists>${basedir}/requirements.properties</exists>
- </file>
- </activation>
- <properties>
- <requirements.root>${basedir}/../../../requirements</requirements.root>
- <requirement.build.root>${requirements.root}/target</requirement.build.root>
- </properties>
- <build>
- <plugins>
- <plugin>
- <dependencies>
- <dependency>
- <groupId>ant-contrib</groupId>
- <artifactId>ant-contrib</artifactId>
- <version>1.0b3</version>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-optional</artifactId>
- <version>1.5.3-1</version>
- <exclusions>
- <exclusion>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>${maven.antrun.plugin.version}</version>
- <executions>
- <execution>
- <id>download-plugin-requirements</id>
- <phase>generate-test-resources</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <taskdef resource="net/sf/antcontrib/antcontrib.properties" />
- <if>
- <available file="${requirements.root}" type="dir" />
- <then>
- <property file="requirements.properties" />
- <echo>Requirements build</echo>
- <ant dir="${requirements.root}" inheritAll="true">
- <property name="requirements" value="${requirements}" />
- <property name="settings.offline" value="${settings.offline}" />
- <property name="skipDownload" value="${skipDownload}" />
- </ant>
- </then>
- </if>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
12 years, 8 months
JBoss Tools SVN: r40585 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-04-27 17:05:05 -0400 (Fri, 27 Apr 2012)
New Revision: 40585
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF/MANIFEST.MF
Log:
Changed minimum requirements to Java 1.6 as the code uses 1.6 API. Project wouldn't compile when imported as a maven project if a JDK 1.5 is installed
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF/MANIFEST.MF 2012-04-27 20:52:35 UTC (rev 40584)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/META-INF/MANIFEST.MF 2012-04-27 21:05:05 UTC (rev 40585)
@@ -74,4 +74,4 @@
org.jboss.tools.as.wst.server.ui.xpl
Bundle-Activator: org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin
Bundle-Vendor: %Bundle-Vendor.0
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
12 years, 8 months
JBoss Tools SVN: r40584 - in trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal: ui/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-04-27 16:52:35 -0400 (Fri, 27 Apr 2012)
New Revision: 40584
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegate.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CreationLogDialog.java
Log:
[JBIDE-11518] implementing reporting credentials when embedding cartridges
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegate.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegate.java 2012-04-27 20:50:55 UTC (rev 40583)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/console/UserDelegate.java 2012-04-27 20:52:35 UTC (rev 40584)
@@ -23,7 +23,6 @@
import org.jboss.tools.openshift.express.internal.ui.utils.Logger;
import org.jboss.tools.openshift.express.internal.ui.viewer.ConnectToOpenShiftWizard;
-import com.openshift.client.EnumApplicationScale;
import com.openshift.client.IApplication;
import com.openshift.client.ICartridge;
import com.openshift.client.IDomain;
@@ -115,7 +114,7 @@
public IApplication createApplication(String applicationName, ICartridge applicationType)
throws OpenShiftException, SocketTimeoutException {
if(checkForPassword()) {
- return delegate.getDefaultDomain().createApplication(applicationName, applicationType, EnumApplicationScale.DEFAULT, null);
+ return delegate.getDefaultDomain().createApplication(applicationName, applicationType);
}
return null;
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CreationLogDialog.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CreationLogDialog.java 2012-04-27 20:50:55 UTC (rev 40583)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CreationLogDialog.java 2012-04-27 20:52:35 UTC (rev 40584)
@@ -73,7 +73,7 @@
private void setupDialog(Composite parent) {
parent.getShell().setText("Embedded Cartridges");
- setTitle("Please make note of the credentials and url that were reported when your cartridges were embedded / application was created. ");
+ setTitle("Please make note of the credentials and url that were reported\nwhen your cartridges were embedded / application was created. ");
setTitleImage(OpenShiftImages.OPENSHIFT_LOGO_WHITE_MEDIUM_IMG);
setDialogHelpAvailable(false);
}
12 years, 8 months
JBoss Tools SVN: r40583 - trunk/openshift/plugins/org.jboss.tools.openshift.express.client.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-04-27 16:50:55 -0400 (Fri, 27 Apr 2012)
New Revision: 40583
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/openshift-java-client-2.0.0-SNAPSHOT.jar
Log:
new client library that fixes inability to create applications ("Operation failed on parameter node_profile with exit code 134. Reason: Invalid Profile: null. Must be: (jumbo|exlarge|large|medium|micro|small)
Operation failed on parameter node_profile with exit code 134. Reason: Invalid Profile: null. Must be: (jumbo|exlarge|large|medium|micro|small)"
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.client/openshift-java-client-2.0.0-SNAPSHOT.jar
===================================================================
(Binary files differ)
12 years, 8 months
JBoss Tools SVN: r40582 - in trunk/modeshape/plugins: org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/attributes and 9 other directories.
by jbosstools-commits@lists.jboss.org
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-amount", "2"); //$NON-NLS-1$ //$NON-NLS-2$
transformer.transform(source, resultXML);
} catch (Exception e) {
- return new Status(Severity.ERROR, RestClientI18n.errorSavingServerRegistry.text(getStateFileName()), e);
+ 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);
}
}
12 years, 8 months
JBoss Tools SVN: r40581 - in trunk/modeshape/plugins: org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2012-04-27 16:34:53 -0400 (Fri, 27 Apr 2012)
New Revision: 40581
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CommentedCndElement.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/ReconnectToServerAction.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeRepository.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeWorkspace.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/ReconnectJob.java
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/EclipseLogger.java
Log:
JBIDE-11699 Fix Errors Found In ModeShape Tools Using FindBugs Eclipse Plugin. Fixed problems in a couple "equals" methods, as well as, some other minor issues.
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CommentedCndElement.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CommentedCndElement.java 2012-04-27 20:34:11 UTC (rev 40580)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.jcr/src/org/jboss/tools/modeshape/jcr/cnd/CommentedCndElement.java 2012-04-27 20:34:53 UTC (rev 40581)
@@ -118,10 +118,8 @@
// remove beginning inner comment chars
if (result.startsWith(BLOCK_COMMENT_INNER_CHARS)) {
result = result.substring(BLOCK_COMMENT_INNER_CHARS.length());
- result.trim();
} else if (result.startsWith(BLOCK_COMMENT_INNER_CHARS2)) {
result = result.substring(BLOCK_COMMENT_INNER_CHARS2.length());
- result.trim();
}
// remove other inner comment chars
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/ReconnectToServerAction.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/ReconnectToServerAction.java 2012-04-27 20:34:11 UTC (rev 40580)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/actions/ReconnectToServerAction.java 2012-04-27 20:34:53 UTC (rev 40581)
@@ -39,8 +39,8 @@
* @param viewer the server view tree viewer
*/
public ReconnectToServerAction( TreeViewer viewer ) {
- super(RestClientI18n.serverReconnectActionText.text());
- setToolTipText(RestClientI18n.serverReconnectActionToolTip.text());
+ super(RestClientI18n.serverReconnectActionText);
+ setToolTipText(RestClientI18n.serverReconnectActionToolTip);
setImageDescriptor(Activator.getDefault().getImageDescriptor(REFRESH_IMAGE));
setEnabled(false);
@@ -102,7 +102,7 @@
// run job in own thread not in the UI thread
Thread t = new Thread();
- t.run();
+ t.start();
job.setThread(t);
job.schedule();
}
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeRepository.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeRepository.java 2012-04-27 20:34:11 UTC (rev 40580)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeRepository.java 2012-04-27 20:34:53 UTC (rev 40581)
@@ -50,7 +50,12 @@
*/
@Override
public boolean equals( Object obj ) {
- return this.delegate.equals(obj);
+ if ((obj == null) || !getClass().equals(obj.getClass())) {
+ return false;
+ }
+
+ ModeShapeRepository that = (ModeShapeRepository)obj;
+ return this.delegate.equals(that.delegate);
}
/**
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeWorkspace.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeWorkspace.java 2012-04-27 20:34:11 UTC (rev 40580)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/domain/ModeShapeWorkspace.java 2012-04-27 20:34:53 UTC (rev 40581)
@@ -48,7 +48,12 @@
*/
@Override
public boolean equals( Object obj ) {
- return this.delegate.equals(obj);
+ if ((obj == null) || !getClass().equals(obj.getClass())) {
+ return false;
+ }
+
+ ModeShapeWorkspace that = (ModeShapeWorkspace)obj;
+ return this.delegate.equals(that.delegate);
}
/**
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/ReconnectJob.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/ReconnectJob.java 2012-04-27 20:34:11 UTC (rev 40580)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/jobs/ReconnectJob.java 2012-04-27 20:34:53 UTC (rev 40581)
@@ -18,6 +18,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.RestClientI18n;
import org.jboss.tools.modeshape.rest.ServerManager;
@@ -39,7 +40,7 @@
* @param server the server being connected to (never <code>null</code>)
*/
public ReconnectJob( ModeShapeServer server ) {
- super(reconnectJobTaskName.text(server.getShortDescription()));
+ super(NLS.bind(reconnectJobTaskName, server.getShortDescription()));
this.server = server;
}
@@ -64,21 +65,16 @@
ServerManager serverManager = Activator.getDefault().getServerManager();
try {
- String taskName = reconnectJobTaskName.text(this.server.getShortDescription());
+ String taskName = NLS.bind(reconnectJobTaskName, this.server.getShortDescription());
monitor.beginTask(taskName, 1);
monitor.setTaskName(taskName);
Status status = serverManager.ping(this.server);
result = Utils.convert(status);
} catch (Exception e) {
- String msg = null;
-
- if (e instanceof InterruptedException) {
- msg = e.getLocalizedMessage();
- } else {
- msg = RestClientI18n.publishJobUnexpectedErrorMsg.text();
- }
-
- result = new org.eclipse.core.runtime.Status(IStatus.ERROR, PLUGIN_ID, msg, e);
+ result = new org.eclipse.core.runtime.Status(IStatus.ERROR,
+ PLUGIN_ID,
+ RestClientI18n.publishJobUnexpectedErrorMsg,
+ e);
} finally {
monitor.done();
done(result);
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/EclipseLogger.java
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/EclipseLogger.java 2012-04-27 20:34:11 UTC (rev 40580)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/log/EclipseLogger.java 2012-04-27 20:34:53 UTC (rev 40581)
@@ -77,7 +77,9 @@
@Override
public void debug( String pattern,
Object[] arguments ) {
- debug(MessageFormat.format(pattern, arguments), arguments);
+ if (isDebugEnabled()) {
+ info(MessageFormat.format(pattern, arguments), arguments);
+ }
}
/**
12 years, 8 months
JBoss Tools SVN: r40580 - in trunk/modeshape/plugins/org.jboss.tools.modeshape.client: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: elvisisking
Date: 2012-04-27 16:34:11 -0400 (Fri, 27 Apr 2012)
New Revision: 40580
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.client/META-INF/MANIFEST.MF
trunk/modeshape/plugins/org.jboss.tools.modeshape.client/modeshape-client.jar
Log:
JBIDE-11698 Update ModeShape Tools To Obtain SLF4J Dependency From Target Platform. Getting slf4j now from target platform. Updated the MS client jar to 2.8.1.
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.client/META-INF/MANIFEST.MF
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.client/META-INF/MANIFEST.MF 2012-04-27 20:07:58 UTC (rev 40579)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.client/META-INF/MANIFEST.MF 2012-04-27 20:34:11 UTC (rev 40580)
@@ -28,6 +28,7 @@
org.apache.commons.logging,
org.apache.commons.logging.impl,
org.apache.http,
+ org.apache.http.annotation,
org.apache.http.auth,
org.apache.http.auth.params,
org.apache.http.client,
@@ -101,7 +102,6 @@
org.modeshape.common.annotation,
org.modeshape.common.collection,
org.modeshape.common.component,
- org.modeshape.common.i18n,
org.modeshape.common.math,
org.modeshape.common.naming,
org.modeshape.common.statistic,
@@ -110,6 +110,7 @@
org.modeshape.common.util.log,
org.modeshape.common.xml,
org.modeshape.jcr.api,
+ org.modeshape.jcr.api.nodetype,
org.modeshape.jcr.api.query,
org.modeshape.jcr.api.query.qom,
org.modeshape.jdbc,
@@ -120,7 +121,5 @@
org.modeshape.web.jcr.rest.client,
org.modeshape.web.jcr.rest.client.domain,
org.modeshape.web.jcr.rest.client.http,
- org.modeshape.web.jcr.rest.client.json,
- org.slf4j,
- org.slf4j.helpers,
- org.slf4j.spi
+ org.modeshape.web.jcr.rest.client.json
+Require-Bundle: org.slf4j.api;visibility:=reexport
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.client/modeshape-client.jar
===================================================================
(Binary files differ)
12 years, 8 months
JBoss Tools SVN: r40579 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-04-27 16:07:58 -0400 (Fri, 27 Apr 2012)
New Revision: 40579
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
Log:
JBIDE-11682
https://issues.jboss.org/browse/JBIDE-11682
If xml does not contain EL, create light-weight context, and avoid a resource-consuming xml analysis.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2012-04-27 20:04:47 UTC (rev 40578)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2012-04-27 20:07:58 UTC (rev 40579)
@@ -84,6 +84,7 @@
import org.jboss.tools.common.el.core.resolver.ELContextImpl;
import org.jboss.tools.common.el.core.resolver.ELResolverFactoryManager;
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.el.core.resolver.SimpleELContext;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.common.text.ext.util.Utils;
@@ -119,6 +120,9 @@
public static final String FACELETS_PAGE_CONTEXT_TYPE = "FACELETS_PAGE_CONTEXT_TYPE"; //$NON-NLS-1$
private static final String JAVA_PROPERTIES_CONTENT_TYPE = "org.eclipse.jdt.core.javaProperties"; //$NON-NLS-1$
+ public static final String EL_START_1 = "#{"; //$NON-NLS-1$
+ public static final String EL_START_2 = "${"; //$NON-NLS-1$
+
public static final PageContextFactory getInstance() {
return fInstance;
}
@@ -284,7 +288,7 @@
context.setResource(file);
context.setElResolvers(ELResolverFactoryManager.getInstance().getResolvers(file));
String content = FileUtil.getContentFromEditorOrFile(file);
- if(content.indexOf('{')>-1 && content.indexOf("#{") >-1 || content.indexOf("${")>-1 ) { //$NON-NLS-1$
+ if(content.indexOf('{')>-1 && content.indexOf(EL_START_1) >-1 || content.indexOf(EL_START_2)>-1 ) {
ELReference elReference = new ValidationELReference();
elReference.setResource(file);
elReference.setLength(content.length());
@@ -317,9 +321,9 @@
return null;
}
if(value.indexOf('{')>-1) {
- int startEl = value.indexOf("#{"); //$NON-NLS-1$
+ int startEl = value.indexOf(EL_START_1);
if(startEl==-1) {
- startEl = value.indexOf("${"); //$NON-NLS-1$
+ startEl = value.indexOf(EL_START_2);
}
if(startEl>-1) {
ELReference elReference = new ValidationELReference();
@@ -367,6 +371,11 @@
context = createJavaContext(file);
} else if(JAVA_PROPERTIES_CONTENT_TYPE.equalsIgnoreCase(typeId)) {
context = createPropertiesContext(file);
+ } else if(isXMLWithoutEL(file)) {
+ IProject project = file != null ? file.getProject() : getActiveProject();
+ context = new SimpleELContext();
+ context.setResource(file);
+ context.setElResolvers(ELResolverFactoryManager.getInstance().getResolvers(project));
} else {
IModelManager manager = StructuredModelManager.getModelManager();
// manager==null if plug-in org.eclipse.wst.sse.core
@@ -421,6 +430,14 @@
return context;
}
+ boolean isXMLWithoutEL(IFile file) {
+ if(!file.getName().endsWith(".xml")) { //$NON-NLS-1$
+ return false;
+ }
+ String content = FileUtil.getContentFromEditorOrFile(file);
+ return content != null && content.indexOf(EL_START_1) < 0 && content.indexOf(EL_START_2) < 0;
+ }
+
private static IProject getActiveProject() {
ITextEditor editor = EclipseUIUtil.getActiveEditor();
if (editor == null) return null;
@@ -627,7 +644,7 @@
private static void fillElReferencesForRegionNode(IDocument document, IDOMNode node, IStructuredDocumentRegion regionNode, ITextRegion region, XmlContextImpl context) {
String text = regionNode.getFullText(region);
- if(text.indexOf('{')>-1 && (text.indexOf("#{") > -1 || text.indexOf("${") > -1)) { //$NON-NLS-1$
+ if(text.indexOf('{')>-1 && (text.indexOf(EL_START_1) > -1 || text.indexOf(EL_START_2) > -1)) {
int offset = regionNode.getStartOffset() + region.getStart();
if (context.getELReference(offset) != null) return; // prevent the duplication of EL references while iterating thru the regions
12 years, 8 months
JBoss Tools SVN: r40578 - trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-04-27 16:04:47 -0400 (Fri, 27 Apr 2012)
New Revision: 40578
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContextImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/SimpleELContext.java
Log:
JBIDE-11682
https://issues.jboss.org/browse/JBIDE-11682
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContextImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContextImpl.java 2012-04-27 20:04:09 UTC (rev 40577)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContextImpl.java 2012-04-27 20:04:47 UTC (rev 40578)
@@ -81,8 +81,6 @@
this.allVars = allVars;
}
- private static final ELReference[] EMPTY_ARRAY = new ELReference[0];
-
/*
* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.IXmlContext#getELReferences()
@@ -111,10 +109,11 @@
*/
@Override
public ELReference getELReference(int offset) {
- ELReference[] refs = getELReferences();
- for (int i = 0; i < refs.length; i++) {
- if(refs[i].getStartPosition()<=offset && (refs[i].getStartPosition() + refs[i].getLength()>offset)) {
- return refs[i];
+ if(elReferenceSet != null) {
+ for (ELReference ref: elReferenceSet) {
+ if(ref.getStartPosition()<=offset && (ref.getStartPosition() + ref.getLength()>offset)) {
+ return ref;
+ }
}
}
return null;
@@ -123,10 +122,11 @@
@Override
public Set<ELReference> getELReferences(IRegion region) {
Set<ELReference> references = new HashSet<ELReference>();
- ELReference[] refs = getELReferences();
- for (int i = 0; i < refs.length; i++) {
- if(refs[i].getStartPosition()>=region.getOffset() && (refs[i].getStartPosition() + refs[i].getLength()<=region.getOffset() + region.getLength())) {
- references.add(refs[i]);
+ if(elReferenceSet != null) {
+ for (ELReference ref: elReferenceSet) {
+ if(ref.getStartPosition()>=region.getOffset() && (ref.getStartPosition() + ref.getLength()<=region.getOffset() + region.getLength())) {
+ references.add(ref);
+ }
}
}
return references;
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/SimpleELContext.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/SimpleELContext.java 2012-04-27 20:04:09 UTC (rev 40577)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/SimpleELContext.java 2012-04-27 20:04:47 UTC (rev 40578)
@@ -23,6 +23,7 @@
* @author Alexey Kazakov
*/
public class SimpleELContext implements ELContext {
+ static final ELReference[] EMPTY_ARRAY = new ELReference[0];
protected IFile resource;
protected ELResolver[] elResolvers;
@@ -89,7 +90,7 @@
* @see org.jboss.tools.common.el.core.resolver.ELContext#getELReferences()
*/
public ELReference[] getELReferences() {
- return null;
+ return EMPTY_ARRAY;
}
/*
12 years, 8 months