Bug 509506 - Move Activator of org.eclipse.e4.tools.css.spy to Util
method
Change-Id: I495fff27a0ebe3aff398f96c2b20db339b5420ad
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
diff --git a/bundles/org.eclipse.e4.tools.css.spy/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.tools.css.spy/META-INF/MANIFEST.MF
index cac01f2..f4f9938 100644
--- a/bundles/org.eclipse.e4.tools.css.spy/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.e4.tools.css.spy/META-INF/MANIFEST.MF
@@ -3,7 +3,6 @@
Bundle-Name: CSS Spy
Bundle-SymbolicName: org.eclipse.e4.tools.css.spy;singleton:=true
Bundle-Version: 0.18.0.qualifier
-Bundle-Activator: org.eclipse.e4.tools.css.spy.Activator
Bundle-Vendor: Eclipse.org
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.6.0",
org.eclipse.e4.ui.workbench;bundle-version="0.9.0";resolution:=optional,
diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/Activator.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/Activator.java
deleted file mode 100644
index 650eb72..0000000
--- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/Activator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Manumitting Technologies, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Brian de Alwis (MT) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.e4.tools.css.spy;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator {
-
- private static BundleContext context;
-
- @Override
- public void start(BundleContext bundleContext) throws Exception {
- Activator.context = bundleContext;
- }
-
- @Override
- public void stop(BundleContext bundleContext) throws Exception {
- Activator.context = null;
- }
-
- public static String join(String[] elements, String glue) {
- StringBuilder sb = new StringBuilder();
- join(sb, elements, glue);
- return sb.toString();
- }
-
- public static void join(StringBuilder sb, String[] elements, String glue) {
- for (int i = 0; i < elements.length; i++) {
- sb.append(elements[i]);
- if (i < elements.length - 1) {
- sb.append(glue);
- }
- }
- }
-
-}
diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyPart.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyPart.java
index c3e7f3e..4ee955c 100644
--- a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyPart.java
+++ b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/CssSpyPart.java
@@ -265,7 +265,7 @@
if (element.getCSSStyle() != null) {
sb.append("\nCSS Inline Style(s):\n ");
- Activator.join(sb, element.getCSSStyle().split(";"), ";\n ");
+ Util.join(sb, element.getCSSStyle().split(";"), ";\n ");
}
if (decl != null) {
@@ -280,22 +280,22 @@
}
if (element.getStaticPseudoInstances().length > 0) {
sb.append("\n\nStatic Pseudoinstances:\n ");
- Activator.join(sb, element.getStaticPseudoInstances(), "\n ");
+ Util.join(sb, element.getStaticPseudoInstances(), "\n ");
}
if (element.getCSSClass() != null) {
sb.append("\n\nCSS Classes:\n ");
- Activator.join(sb, element.getCSSClass().split(" +"), "\n ");
+ Util.join(sb, element.getCSSClass().split(" +"), "\n ");
}
if (element.getCSSId() != null) {
sb.append("\n\nCSS ID:\n ");
- Activator.join(sb, element.getCSSId().split(" +"), "\n ");
+ Util.join(sb, element.getCSSId().split(" +"), "\n ");
}
if (element.getAttribute("style") != null) {
sb.append("\n\nSWT Style Bits:\n ");
- Activator.join(sb, element.getAttribute("style").split(" +"), "\n ");
+ Util.join(sb, element.getAttribute("style").split(" +"), "\n ");
}
sb.append("\n\nCSS Class Element:\n ").append(element.getClass().getName());
@@ -483,7 +483,7 @@
sb.append(element.getLocalName()).append(" (").append(element.getNamespaceURI()).append(")");
if (element.getCSSClass() != null) {
sb.append("\nClasses:\n ");
- Activator.join(sb, element.getCSSClass().split(" +"), "\n ");
+ Util.join(sb, element.getCSSClass().split(" +"), "\n ");
}
return sb.toString();
}
diff --git a/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/Util.java b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/Util.java
new file mode 100644
index 0000000..f6f8c8b
--- /dev/null
+++ b/bundles/org.eclipse.e4.tools.css.spy/src/org/eclipse/e4/tools/css/spy/Util.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2011, 2016 Manumitting Technologies, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Brian de Alwis (MT) - initial API and implementation
+ * Lars Vogel <Lars.Vogel@vogella.com> - Bug 509506
+ *******************************************************************************/
+package org.eclipse.e4.tools.css.spy;
+
+public class Util {
+
+ public static void join(StringBuilder sb, String[] elements, String glue) {
+ for (int i = 0; i < elements.length; i++) {
+ sb.append(elements[i]);
+ if (i < elements.length - 1) {
+ sb.append(glue);
+ }
+ }
+ }
+}