Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/internal/core')
-rw-r--r--core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/internal/core/natives/CNativePlugin.java92
-rw-r--r--core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/internal/core/natives/Messages.java28
-rw-r--r--core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/internal/core/natives/messages.properties16
3 files changed, 136 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/internal/core/natives/CNativePlugin.java b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/internal/core/natives/CNativePlugin.java
new file mode 100644
index 00000000000..98eb24cf92e
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/internal/core/natives/CNativePlugin.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2014 IBM Corporation 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:
+ * IBM Corporation - initial API and implementation
+ * Martin Oberhuber (Wind River) - [303083] Split out from CCorePlugin
+ *******************************************************************************/
+package org.eclipse.cdt.internal.core.natives;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
+
+/**
+ * CNativePlugin is the life-cycle owner of the plug-in, and also holds
+ * utility methods for logging.
+ *
+ * @noextend This class is not intended to be subclassed by clients.
+ * @noinstantiate This class is not intended to be instantiated by clients.
+ */
+public class CNativePlugin extends Plugin {
+
+ public static final String PLUGIN_ID = "org.eclipse.cdt.core.native"; //$NON-NLS-1$
+
+ private static CNativePlugin fgPlugin;
+
+ // NON-API
+
+ /**
+ * @noreference This constructor is not intended to be referenced by clients.
+ */
+ public CNativePlugin() {
+ super();
+ fgPlugin = this;
+ }
+
+ public static CNativePlugin getDefault() {
+ return fgPlugin;
+ }
+
+ /**
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public static void log(String e) {
+ log(createStatus(e));
+ }
+
+ /**
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public static void log(Throwable e) {
+ String msg= e.getMessage();
+ if (msg == null) {
+ log("Error", e); //$NON-NLS-1$
+ } else {
+ log("Error: " + msg, e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public static void log(String message, Throwable e) {
+ log(createStatus(message, e));
+ }
+
+ /**
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public static IStatus createStatus(String msg) {
+ return createStatus(msg, null);
+ }
+
+ /**
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public static IStatus createStatus(String msg, Throwable e) {
+ return new Status(IStatus.ERROR, PLUGIN_ID, msg, e);
+ }
+
+ /**
+ * @noreference This method is not intended to be referenced by clients.
+ */
+ public static void log(IStatus status) {
+ getDefault().getLog().log(status);
+ }
+
+}
diff --git a/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/internal/core/natives/Messages.java b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/internal/core/natives/Messages.java
new file mode 100644
index 00000000000..ae5b834be9e
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/internal/core/natives/Messages.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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:
+ * Martin Oberhuber (Wind River) - [303083] Split out the Spawner
+ *******************************************************************************/
+package org.eclipse.cdt.internal.core.natives;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.natives.messages"; //$NON-NLS-1$
+ public static String Util_exception_cannotCreatePty;
+ public static String Util_exception_cannotSetTerminalSize;
+ public static String Util_error_cannotRun;
+ public static String Util_exception_closeError;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/internal/core/natives/messages.properties b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/internal/core/natives/messages.properties
new file mode 100644
index 00000000000..e1ab7f1ac42
--- /dev/null
+++ b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/internal/core/natives/messages.properties
@@ -0,0 +1,16 @@
+###############################################################################
+# Copyright (c) 2000, 2014 QNX Software Systems 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:
+# QNX Software Systems - Initial API and implementation
+# Martin Oberhuber (Wind River) - [303083] Split from CCorePluginResources.properties
+###############################################################################
+
+Util_exception_cannotCreatePty=Cannot create pty
+Util_exception_closeError=close error
+Util_exception_cannotSetTerminalSize=Setting terminal size is not supported
+Util_error_cannotRun=Cannot run program "{0}": {1}

Back to the top