Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/internal')
-rw-r--r--plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/internal/extensions/TcfServiceProvidersExtensionPointManager.java67
-rw-r--r--plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/internal/nls/TcfPluginMessages.java37
-rw-r--r--plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/internal/nls/TcfPluginMessages.properties8
3 files changed, 112 insertions, 0 deletions
diff --git a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/internal/extensions/TcfServiceProvidersExtensionPointManager.java b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/internal/extensions/TcfServiceProvidersExtensionPointManager.java
new file mode 100644
index 000000000..14dd87f9b
--- /dev/null
+++ b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/internal/extensions/TcfServiceProvidersExtensionPointManager.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Wind River Systems, Inc. and others.
+ * 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:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.tcf.internal.extensions;
+
+import java.util.Map;
+
+import org.eclipse.tm.tcf.extensions.TcfAbstractExtensionPointManager;
+import org.eclipse.tm.tcf.extensions.TcfExtensionProxy;
+import org.eclipse.tm.tcf.protocol.IServiceProvider;
+import org.eclipse.tm.tcf.protocol.Protocol;
+
+/**
+ * Extension point manager implementation for "org.eclipse.tm.tcf.serviceProviders".
+ */
+public class TcfServiceProvidersExtensionPointManager extends TcfAbstractExtensionPointManager<IServiceProvider> {
+ /*
+ * Thread save singleton instance creation.
+ */
+ private static class LazyInstanceHolder {
+ public static TcfServiceProvidersExtensionPointManager fInstance = new TcfServiceProvidersExtensionPointManager();
+ }
+
+ /**
+ * Returns the singleton instance for the manager.
+ */
+ public static TcfServiceProvidersExtensionPointManager getInstance() {
+ return LazyInstanceHolder.fInstance;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.tcf.extensions.TcfAbstractExtensionPointManager#getExtensionPointId()
+ */
+ @Override
+ protected String getExtensionPointId() {
+ return "org.eclipse.tm.tcf.serviceProviders"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.tcf.extensions.TcfAbstractExtensionPointManager#getConfigurationElementName()
+ */
+ @Override
+ protected String getConfigurationElementName() {
+ return "serviceProvider"; //$NON-NLS-1$
+ }
+
+ /**
+ * Register the contributed service provider extensions with the framework.
+ */
+ public void registerServiceProviders() {
+ // Load the extensions
+ Map<String, TcfExtensionProxy<IServiceProvider>> extensions = getExtensions();
+ // Loop the extensions and get the service provider instance.
+ // This will activate the contributing plugin.
+ for (TcfExtensionProxy<IServiceProvider> proxy : extensions.values()) {
+ IServiceProvider provider = proxy.getInstance();
+ if (provider != null) Protocol.addServiceProvider(provider);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/internal/nls/TcfPluginMessages.java b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/internal/nls/TcfPluginMessages.java
new file mode 100644
index 000000000..299f05e45
--- /dev/null
+++ b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/internal/nls/TcfPluginMessages.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Wind River Systems, Inc. and others.
+ * 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:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.tcf.internal.nls;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * TCF plugin externalized strings management.
+ */
+public class TcfPluginMessages extends NLS {
+
+ // The plug-in resouce bundle name
+ private static final String BUNDLE_NAME = "org.eclipse.tm.tcf.internal.tcf.TcfPluginMessages"; //$NON-NLS-1$
+
+ /**
+ * Static constructor.
+ */
+ static {
+ // Load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, TcfPluginMessages.class);
+ }
+
+ // **** Declare externalized string id's down here *****
+
+ public static String Extension_error_missingRequiredAttribute;
+ public static String Extension_error_duplicateExtension;
+ public static String Extension_error_invalidExtensionPoint;
+
+}
diff --git a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/internal/nls/TcfPluginMessages.properties b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/internal/nls/TcfPluginMessages.properties
new file mode 100644
index 000000000..4945e1861
--- /dev/null
+++ b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/internal/nls/TcfPluginMessages.properties
@@ -0,0 +1,8 @@
+#
+# org.eclipse.tm.tcf
+# Externalized Strings.
+#
+
+Extension_error_missingRequiredAttribute=Required attribute "{0}" missing for extension "{1}"!
+Extension_error_duplicateExtension=Duplicate extension with id ''{0}''. Ignoring duplicated contribution from contributor ''{1}''!
+Extension_error_invalidExtensionPoint=Failed to instanciate the executable extension from extension point ''{0}''.

Back to the top