[jbosstools-commits] JBoss Tools SVN: r31301 - in branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner: browser and 1 other directory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri May 13 12:23:20 EDT 2011


Author: dmaliarevich
Date: 2011-05-13 12:23:20 -0400 (Fri, 13 May 2011)
New Revision: 31301

Modified:
   branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/VpeXulrunnerMessages.java
   branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
   branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/messages.properties
Log:
https://issues.jboss.org/browse/JBIDE-7308 , error message was updated

Modified: branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/VpeXulrunnerMessages.java
===================================================================
--- branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/VpeXulrunnerMessages.java	2011-05-13 16:04:23 UTC (rev 31300)
+++ branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/VpeXulrunnerMessages.java	2011-05-13 16:23:20 UTC (rev 31301)
@@ -9,6 +9,7 @@
 	public static String XulRunnerBrowser_cannotGetPathToXulrunner;
 	public static String XulRunnerBrowser_notAvailable;
 	public static String XulRunnerBrowser_wrongVersion;
+	public static String CURRENT_PLATFORM_IS_NOT_SUPPORTED;
 	static {
 		// initialize resource bundle
 		NLS.initializeMessages(BUNDLE_NAME, VpeXulrunnerMessages.class);

Modified: branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
===================================================================
--- branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java	2011-05-13 16:04:23 UTC (rev 31300)
+++ branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java	2011-05-13 16:23:20 UTC (rev 31301)
@@ -205,55 +205,55 @@
 		//this function should be call
 		String xulRunnerPath = System.getProperty(XULRUNNER_PATH);
 		if (xulRunnerPath == null) {
-
 			GREVersionRange[] greRanges = {new GREVersionRange(XULRUNNER_LOWER_VERSION, true, XULRUNNER_HIGHER_VERSION, true)};
 			File xulRunnerFile  = null;
 
 			// JBIDE-1222 begin
 			/*try {
 				if(!XULRUNNER_LOADING_INDICATOR) {
-					
+
 					XULRUNNER_LOADING_INDICATOR=true;
 					//this function should be call
 					xulRunnerFile = Mozilla.getGREPathWithProperties(greRanges, null);
 				} else {
-					
+
 					xulRunnerFile = null;
 				}
 			} catch (FileNotFoundException fnfe) {
 				// Ignre this exception. Will try to get XULRunner from plugin
 			}*/ 
 			// JBIDE-1222 end
-			
 
-				Bundle xulRunnerBundle = Platform.getBundle(getXulRunnerBundle());
-				if (xulRunnerBundle == null) {
-					throw new XulRunnerException(MessageFormat.format(VpeXulrunnerMessages.XulRunnerBrowser_bundleNotFound,getXulRunnerBundle()));  //$NON-NLS-2$
+			Bundle xulRunnerBundle = Platform.getBundle(getXulRunnerBundle());
+			if (xulRunnerBundle == null) {
+				if (!XulRunnerBrowser.isCurrentPlatformOfficiallySupported()) {
+					throw new XulRunnerException(MessageFormat.format(
+							VpeXulrunnerMessages.CURRENT_PLATFORM_IS_NOT_SUPPORTED,
+							XulRunnerBrowser.CURRENT_PLATFORM_ID));
+				} else {
+					throw new XulRunnerException(MessageFormat.format(
+							VpeXulrunnerMessages.XulRunnerBrowser_bundleNotFound,
+							getXulRunnerBundle())); 
 				}
+			}
 
-				String xulRunnerVersion = (String) xulRunnerBundle.getHeaders().get("Bundle-Version"); //$NON-NLS-1$
-				if (!greRanges[0].check(xulRunnerVersion)) {
-					throw new XulRunnerException(MessageFormat.format(VpeXulrunnerMessages.XulRunnerBrowser_wrongVersion, xulRunnerBundle.getLocation() ,XulRunnerBrowser.XULRUNNER_LOWER_VERSION,XulRunnerBrowser.XULRUNNER_HIGHER_VERSION) ); 
-				}
-				
-				
-				URL url = xulRunnerBundle.getEntry(XULRUNNER_ENTRY);
-				if (url == null) {
-					throw new XulRunnerException(MessageFormat.format(VpeXulrunnerMessages.XulRunnerBrowser_bundleDoesNotContainXulrunner, getXulRunnerBundle(),XULRUNNER_ENTRY));  
-				}
-
-				try {
-					URL url1 = FileLocator.resolve(url);
-					xulRunnerFile = new File(FileLocator.toFileURL(url1).getFile());
-				} catch (IOException ioe) {
-					throw new XulRunnerException(MessageFormat.format(VpeXulrunnerMessages.XulRunnerBrowser_cannotGetPathToXulrunner,getXulRunnerBundle()), ioe); 
-				}
-				
+			String xulRunnerVersion = (String) xulRunnerBundle.getHeaders().get("Bundle-Version"); //$NON-NLS-1$
+			if (!greRanges[0].check(xulRunnerVersion)) {
+				throw new XulRunnerException(MessageFormat.format(VpeXulrunnerMessages.XulRunnerBrowser_wrongVersion, xulRunnerBundle.getLocation() ,XulRunnerBrowser.XULRUNNER_LOWER_VERSION,XulRunnerBrowser.XULRUNNER_HIGHER_VERSION) ); 
+			}
+			URL url = xulRunnerBundle.getEntry(XULRUNNER_ENTRY);
+			if (url == null) {
+				throw new XulRunnerException(MessageFormat.format(VpeXulrunnerMessages.XulRunnerBrowser_bundleDoesNotContainXulrunner, getXulRunnerBundle(),XULRUNNER_ENTRY));  
+			}
+			try {
+				URL url1 = FileLocator.resolve(url);
+				xulRunnerFile = new File(FileLocator.toFileURL(url1).getFile());
+			} catch (IOException ioe) {
+				throw new XulRunnerException(MessageFormat.format(VpeXulrunnerMessages.XulRunnerBrowser_cannotGetPathToXulrunner,getXulRunnerBundle()), ioe); 
+			}
 			xulRunnerPath = xulRunnerFile.getAbsolutePath();
 			System.setProperty(XULRUNNER_PATH, xulRunnerPath);
 		}
-
-		
 		return xulRunnerPath;
 	}
 

Modified: branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/messages.properties
===================================================================
--- branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/messages.properties	2011-05-13 16:04:23 UTC (rev 31300)
+++ branches/jbosstools-3.2.x/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/messages.properties	2011-05-13 16:23:20 UTC (rev 31301)
@@ -3,3 +3,4 @@
 XulRunnerBrowser_cannotGetPathToXulrunner=Cannot get path to XULRunner from bundle {0}
 XulRunnerBrowser_notAvailable=nsIWebBrowser is not available
 XulRunnerBrowser_wrongVersion=the version of the bundled XULRunner {0} must be >= {1} and <= {2}
+CURRENT_PLATFORM_IS_NOT_SUPPORTED=Current platform ''{0}'' is not supported.



More information about the jbosstools-commits mailing list