initial commit in accordance with CQ 3784
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/.classpath b/plugins/org.eclipse.objectteams.otequinox.branding/.classpath
new file mode 100644
index 0000000..987380a
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="con" path="OTRE"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/.project b/plugins/org.eclipse.objectteams.otequinox.branding/.project
new file mode 100644
index 0000000..b2b35ef
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/.project
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.objectteams.otequinox.branding</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.objectteams.otdt.builder.OTJBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.objectteams.otdt.OTJavaNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.otequinox.branding/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..2f7f6e2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,16 @@
+#Sun Aug 26 11:11:54 CEST 2007
+eclipse.preferences.version=1
+org.objectteams.otdt.compiler.option.joinpoint_queries=disabled
+org.objectteams.otdt.compiler.option.scoped_keywords=enabled
+org.objectteams.otdt.compiler.problem.abstract_potential_relevant_role=warning
+org.objectteams.otdt.compiler.problem.basecall=warning
+org.objectteams.otdt.compiler.problem.binding_conventions=error
+org.objectteams.otdt.compiler.problem.decapsulation=warning
+org.objectteams.otdt.compiler.problem.deprecated_path_syntax=warning
+org.objectteams.otdt.compiler.problem.effectless_fieldaccess=warning
+org.objectteams.otdt.compiler.problem.fragile_callin=warning
+org.objectteams.otdt.compiler.problem.incomplete_build=error
+org.objectteams.otdt.compiler.problem.inferred_callout=error
+org.objectteams.otdt.compiler.problem.potential_ambiguous_playedby=warning
+org.objectteams.otdt.compiler.problem.unsafe_liftctor=warning
+org.objectteams.otdt.compiler.problem.unused_parammap=warning
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otequinox.branding/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..538e1ee
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/META-INF/MANIFEST.MF
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Example Plug-in for the Equinox-OTRE integration
+Bundle-SymbolicName: org.eclipse.objectteams.otequinox.branding;singleton:=true
+Bundle-Version: 1.4.0.qualifier
+Bundle-Vendor: objectteams.org
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.objectteams.otequinox,
+ org.eclipse.ui.workbench,
+ org.eclipse.ui
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.eclipse.objectteams.otequinox.branding.Activator
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/build.properties b/plugins/org.eclipse.objectteams.otequinox.branding/build.properties
new file mode 100644
index 0000000..5b6f984
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ plugin.xml,\
+ .,\
+ icons/
+src.includes = src/
+
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/icons/signed_adapted.gif b/plugins/org.eclipse.objectteams.otequinox.branding/icons/signed_adapted.gif
new file mode 100644
index 0000000..986fa42
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/icons/signed_adapted.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/icons/unsigned_adapted.gif b/plugins/org.eclipse.objectteams.otequinox.branding/icons/unsigned_adapted.gif
new file mode 100644
index 0000000..915a4e7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/icons/unsigned_adapted.gif
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/plugin.xml b/plugins/org.eclipse.objectteams.otequinox.branding/plugin.xml
new file mode 100644
index 0000000..a2dfe65
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/plugin.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ point="org.eclipse.objectteams.otequinox.aspectBindings">
+ <aspectBinding icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+ <team class="org.eclipse.objectteams.otequinox.internal.branding.BrandingAdaptor"
+ activation="ALL_THREADS"
+ icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif"/>
+ <basePlugin
+ id="org.eclipse.ui.workbench"
+ icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"/>
+ </aspectBinding>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/branding/Activator.java b/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/branding/Activator.java
new file mode 100644
index 0000000..5f971e5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/branding/Activator.java
@@ -0,0 +1,98 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Stephan Herrmann.
+ *
+ * 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
+ * $Id: Activator.java 23461 2010-02-04 22:10:39Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.branding;
+
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * This bundle activator is only responsible for managing two icons,
+ * see {@link #getImage(String)}.
+ *
+ * @author stephan
+ * @since 1.4.0
+ */
+public class Activator extends AbstractUIPlugin {
+
+ /** "Signed" icon with aspect binding decoration. */
+ public static final String IMG_SIGNED_ADAPTED = "org.eclipse.objectteams.otequinox.branding.signed_adapted"; //$NON-NLS-1$
+
+ /** "Unsigned" icon with aspect binding decoration. */
+ public static final String IMG_UNSIGNED_ADAPTED = "org.eclipse.objectteams.otequinox.branding.unsigned_adapted"; //$NON-NLS-1$
+
+ /** The plug-in ID */
+ public static final String PLUGIN_ID = "org.eclipse.objectteams.otequinox.branding"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ private ImageRegistry imageRegistry;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Get an image identified by the given key. Supported values are
+ * {@link #IMG_SIGNED_ADAPTED} and {@link #IMG_UNSIGNED_ADAPTED}.
+ * @param key
+ * @return a cached imaged, if valid key was given, otherwise null.
+ */
+ public Image getImage(String key) {
+ if (this.imageRegistry == null)
+ initializeImageRegistry();
+ return this.imageRegistry.get(key);
+ }
+
+ private void initializeImageRegistry() {
+ this.imageRegistry = new ImageRegistry();
+ this.imageRegistry.put(IMG_SIGNED_ADAPTED, imageDescriptorFromPlugin(PLUGIN_ID, "icons/signed_adapted.gif")); //$NON-NLS-1$
+ this.imageRegistry.put(IMG_UNSIGNED_ADAPTED, imageDescriptorFromPlugin(PLUGIN_ID, "icons/unsigned_adapted.gif")); //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingAdaptor.java b/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingAdaptor.java
new file mode 100644
index 0000000..f3be370
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingAdaptor.java
@@ -0,0 +1,103 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * for its Fraunhofer Institute for Computer Architecture and Software
+ * Technology (FIRST), Berlin, Germany and Technical University Berlin,
+ * Germany.
+ *
+ * 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
+ * $Id:AboutAdaptor.java 15202 2007-01-28 11:30:50Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Fraunhofer FIRST - Initial API and implementation
+ * Technical University Berlin - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal.branding;
+
+import java.util.HashSet;
+
+import org.eclipse.objectteams.otequinox.TransformerPlugin;
+import org.eclipse.objectteams.otequinox.branding.Activator;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.internal.WorkbenchMessages;
+
+import base org.eclipse.ui.internal.about.AboutBundleData;
+import base org.eclipse.ui.internal.about.AboutPluginsPage.BundleTableLabelProvider;
+
+/**
+ * This aspect adapts the branding of the Eclipse workbench by
+ * - adapting the about plug-ins dialog, displaying as a self-application
+ * which plug-ins have been adapted by an OT/J aspect.
+ * - changing the startup message "Loading Workbench" to a OT-specific one.
+ *
+ * @author stephan
+ * @version $Id:AboutAdaptor.java 15202 2007-01-28 11:30:50Z stephan $
+ */
+@SuppressWarnings("restriction")
+public team class BrandingAdaptor
+{
+ public BrandingAdaptor() {
+ WorkbenchMessages.Startup_Loading_Workbench = BrandingMessages.BrandingAdaptor_Loading_Workbench;
+ }
+ /** Append OT-adaptations to the version number of any adapted bundle. */
+ protected class AboutBundleAdaptor playedBy AboutBundleData
+ base when (isAdaptedBaseBundle(base))
+ {
+ callin String getVersion()
+ {
+ String adaptationString = ""; //$NON-NLS-1$
+ HashSet<String> reportedPlugins = new HashSet<String>();
+ adaptationString = BrandingMessages.BrandingAdaptor_OT_adapted_by;
+ for (String element : TransformerPlugin.getDefault().getAdaptingAspectPlugins(getID()))
+ {
+ if (!reportedPlugins.contains(element))
+ adaptationString = adaptationString+"\n* "+element; //$NON-NLS-1$
+ reportedPlugins.add(element);
+ }
+ return base.getVersion() + adaptationString;
+ }
+ getVersion <- replace getVersion;
+
+ String getID() -> String getId();
+ boolean isSigned() -> boolean isSigned();
+ boolean isSignedDetermined() -> boolean isSignedDetermined();
+ }
+
+ /**
+ * For all adapted bundles replace the singed/unsigned icons with
+ * a variant that is decorated with a aspect binding icon.
+ */
+ protected class IconAdaptor playedBy BundleTableLabelProvider {
+
+ Image getAdaptedSigningColumnImage(AboutBundleAdaptor data) <- replace Image getColumnImage(Object element, int columnIndex)
+ base when (columnIndex == 0 && isAdaptedBaseBundle(element))
+ with { data <- (AboutBundleData)element }
+
+ @SuppressWarnings("basecall")
+ callin Image getAdaptedSigningColumnImage(AboutBundleAdaptor data) {
+ if (data.isSignedDetermined()) {
+ if (data.isSigned())
+ return Activator.getDefault().getImage(Activator.IMG_SIGNED_ADAPTED);
+ else
+ return Activator.getDefault().getImage(Activator.IMG_UNSIGNED_ADAPTED);
+ }
+ return base.getAdaptedSigningColumnImage(data);
+ }
+ }
+
+ /** Is 'element' an AboutBundleData object representing a bundle that is adapted by an OT/Equinox bundle? */
+ public static boolean isAdaptedBaseBundle(Object element) {
+ // use qualified name, because AboutBundleData is a role's base class thus considered alien to this team:
+ if (element instanceof org.eclipse.ui.internal.about.AboutBundleData) {
+ String symbolicName = ((org.eclipse.ui.internal.about.AboutBundleData)element).getId();
+ return TransformerPlugin.getDefault().isAdaptedBasePlugin(symbolicName);
+ }
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingMessages.java b/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingMessages.java
new file mode 100644
index 0000000..0898d80
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingMessages.java
@@ -0,0 +1,33 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ *
+ * Copyright 2009 Stephan Herrmann.
+ *
+ * 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
+ * $Id: BrandingMessages.java 23461 2010-02-04 22:10:39Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ *
+ * Contributors:
+ * Stephan Herrmann - Initial API and implementation
+ **********************************************************************/
+package org.eclipse.objectteams.otequinox.internal.branding;
+
+import org.eclipse.osgi.util.NLS;
+
+public class BrandingMessages extends NLS {
+ private static final String BUNDLE_NAME = BrandingMessages.class.getName();
+ public static String BrandingAdaptor_Loading_Workbench;
+
+ public static String BrandingAdaptor_OT_adapted_by;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, BrandingMessages.class);
+ }
+
+ private BrandingMessages() {
+ }
+}
diff --git a/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingMessages.properties b/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingMessages.properties
new file mode 100644
index 0000000..2591bbd
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.branding/src/org/eclipse/objectteams/otequinox/internal/branding/BrandingMessages.properties
@@ -0,0 +1,2 @@
+BrandingAdaptor_Loading_Workbench=Loading Object Teams Workbench with OT/Equinox enabled
+BrandingAdaptor_OT_adapted_by=\n**** OT-adapted by: