[jbosstools-commits] JBoss Tools SVN: r42586 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Jul 16 08:28:14 EDT 2012


Author: jpeterka
Date: 2012-07-16 08:28:13 -0400 (Mon, 16 Jul 2012)
New Revision: 42586

Modified:
   trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/SubversiveHelper.java
Log:
Method for checking if Subversive is installed added into Subversive Helper, disableSVNDecorator updated to reflect state when Subversive is not installed

Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/SubversiveHelper.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/SubversiveHelper.java	2012-07-16 11:53:22 UTC (rev 42585)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/SubversiveHelper.java	2012-07-16 12:28:13 UTC (rev 42586)
@@ -1,14 +1,41 @@
 package org.jboss.tools.ui.bot.ext.helper;
 
+import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.Platform;
 import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.osgi.framework.Bundle;
 
 public class SubversiveHelper {
+	
+	static Logger log = Logger.getLogger(SubversiveHelper.class);
 
 	/**
+	 * Check if Subversive is installed or not
+	 */
+	public static boolean isSubversiveInstalled() {
+		String[] names = { "org.eclipse.team.svn","org.eclipse.team.svn.core","org.eclipse.team.svn.ui"};
+	
+		boolean result = true;
+		for (String name : names ) {
+			Bundle bundle = Platform.getBundle(name);
+			if (bundle == null) {
+				result = false;
+				break;
+			}			
+		}
+		return result;			
+	}
+	
+	/**
 	 * Disables Subversive Decorations (for projects, etc.)
 	 */
 	public static void disableSVNDecoration() {
 
+		if (!isSubversiveInstalled()) {
+			log.info("Subversive is not installed, skiping SVN Decoration disabling");
+			return;
+		}
+		
 		// commented, this is relevant only when SVN is installed as all
 
 		SWTBotExt botExt = new SWTBotExt();



More information about the jbosstools-commits mailing list