Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2015-02-02 01:44:15 -0500
committerUwe Stieber2015-02-02 01:44:15 -0500
commit89854750d8415b740e9fb9bfc4276c0638ec98cf (patch)
treed9e83122003789e69de1132142d8c6cb43e0fa4f
parent521fe42bf3464929e5f839c6b2616a89609c1a1d (diff)
downloadorg.eclipse.tcf-89854750d8415b740e9fb9bfc4276c0638ec98cf.tar.gz
org.eclipse.tcf-89854750d8415b740e9fb9bfc4276c0638ec98cf.tar.xz
org.eclipse.tcf-89854750d8415b740e9fb9bfc4276c0638ec98cf.zip
Target Explorer: Cleanup remote contribution to match Target Explorer code style and fix reported Findbugs
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/META-INF/MANIFEST.MF8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/Activator.java35
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/TCFConnection.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/TCFFileStore.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/activator/CoreBundleActivator.java76
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/nls/Messages.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/Messages.java)26
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/nls/Messages.properties (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/Messages.properties)3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/PeerInfo.java5
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/TCFFileStoreOperation.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/TCFOperation.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/TCFOperationGetEnvironment.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/META-INF/MANIFEST.MF6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/Activator.java35
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/TCFFileSystemContributor.java11
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/activator/UIPlugin.java66
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/nls/Messages.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/Messages.java)20
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/nls/Messages.properties (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/Messages.properties)1
17 files changed, 208 insertions, 100 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/META-INF/MANIFEST.MF
index f554aafb4..06d6f296e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tcf.te.tcf.remote.core;singleton:=true
Bundle-Version: 1.3.0.qualifier
-Bundle-Activator: org.eclipse.tcf.te.tcf.remote.core.Activator
+Bundle-Activator: org.eclipse.tcf.te.tcf.remote.core.activator.CoreBundleActivator
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
org.eclipse.remote.core;bundle-version="1.0.0",
@@ -18,5 +18,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
-Export-Package: org.eclipse.tcf.te.tcf.remote.core;x-friends:="org.eclipse.tcf.te.tcf.remote.ui",
- org.eclipse.tcf.te.tcf.remote.core.operation;x-friends:="org.eclipse.tcf.te.tcf.remote.ui"
+Export-Package: org.eclipse.tcf.te.tcf.remote.core,
+ org.eclipse.tcf.te.tcf.remote.core.activator;x-internal:=true,
+ org.eclipse.tcf.te.tcf.remote.core.nls;x-internal:=true,
+ org.eclipse.tcf.te.tcf.remote.core.operation
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/Activator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/Activator.java
deleted file mode 100644
index 2fbb3cd99..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/Activator.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2014 Wind River Systems, 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:
- * Markus Schorn - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.remote.core;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator {
-
- public static String ID = "org.eclipes.tcf.te.tcf.remote.core"; //$NON-NLS-1$
-
- @Override
- public void start(BundleContext context) throws Exception {
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- }
-
- public static void logError(String msg, Throwable th) {
- Platform.getLog(Platform.getBundle(ID)).log(new Status(IStatus.ERROR, ID, msg, th));
- }
-
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/TCFConnection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/TCFConnection.java
index ac68fb743..7e19cb5e3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/TCFConnection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/TCFConnection.java
@@ -23,6 +23,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.Job;
@@ -37,6 +38,7 @@ import org.eclipse.remote.core.exception.RemoteConnectionException;
import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.te.core.interfaces.IConnectable;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
+import org.eclipse.tcf.te.tcf.remote.core.activator.CoreBundleActivator;
import org.eclipse.tcf.te.tcf.remote.core.operation.TCFOperationGetEnvironment;
public class TCFConnection extends TCFConnectionBase {
@@ -106,7 +108,7 @@ public class TCFConnection extends TCFConnectionBase {
fEnvironment = new TCFOperationGetEnvironment(fPeerNode.getPeer()).execute(SubMonitor.convert(null));
} catch (OperationCanceledException e) {
} catch (CoreException e) {
- Activator.logError(Messages.TCFConnection_errorNoEnvironment, e);
+ Platform.getLog(CoreBundleActivator.getContext().getBundle()).log(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), Messages.TCFConnection_errorNoEnvironment, e));
}
}
return fEnvironment;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/TCFFileStore.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/TCFFileStore.java
index 278ccfd97..5ab91c74c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/TCFFileStore.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/TCFFileStore.java
@@ -23,11 +23,15 @@ import org.eclipse.core.filesystem.provider.FileStore;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.tcf.services.IFileSystem.FileAttrs;
+import org.eclipse.tcf.te.tcf.remote.core.activator.CoreBundleActivator;
import org.eclipse.tcf.te.tcf.remote.core.operation.TCFOperationChildStores;
import org.eclipse.tcf.te.tcf.remote.core.operation.TCFOperationDelete;
import org.eclipse.tcf.te.tcf.remote.core.operation.TCFOperationFetchInfo;
@@ -51,7 +55,7 @@ public final class TCFFileStore extends FileStore {
try {
return new TCFFileStore(connection, path, TCFEclipseFileSystem.getURIFor(connection, path.toString()), parent);
} catch (URISyntaxException e) {
- Activator.logError(Messages.TCFFileManager_errorFileStoreForPath, e);
+ Platform.getLog(CoreBundleActivator.getContext().getBundle()).log(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), Messages.TCFFileManager_errorFileStoreForPath, e));
}
return EFS.getNullFileSystem().getStore(path);
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/activator/CoreBundleActivator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/activator/CoreBundleActivator.java
new file mode 100644
index 000000000..72d30b3ae
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/activator/CoreBundleActivator.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Wind River Systems, 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:
+ * Markus Schorn - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.remote.core.activator;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class CoreBundleActivator implements BundleActivator {
+
+ // The bundle context
+ private static BundleContext context;
+ // The shared instance
+ private static CoreBundleActivator plugin;
+
+ /**
+ * Returns the bundle context
+ *
+ * @return the bundle context
+ */
+ public static BundleContext getContext() {
+ return context;
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static CoreBundleActivator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Convenience method which returns the unique identifier of this plugin.
+ */
+ public static String getUniqueIdentifier() {
+ if (getContext() != null && getContext().getBundle() != null) {
+ return getContext().getBundle().getSymbolicName();
+ }
+ return "org.eclipes.tcf.te.tcf.remote.core"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext bundleContext) throws Exception {
+ context = bundleContext;
+ plugin = this;
+ }
+
+ /* (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext bundleContext) throws Exception {
+ context = null;
+ plugin = null;
+ }
+
+// public static void logError(String msg, Throwable th) {
+// Platform.getLog(Platform.getBundle(ID)).log(new Status(IStatus.ERROR, ID, msg, th));
+// }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/nls/Messages.java
index c55e6e325..2dc16de6f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/nls/Messages.java
@@ -8,23 +8,31 @@
* Contributors:
* Markus Schorn - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.tcf.remote.core.operation;
+package org.eclipse.tcf.te.tcf.remote.core.nls;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.tcf.te.tcf.remote.core.operation.Messages"; //$NON-NLS-1$
+
+ // The plug-in resource bundle name
+ private static final String BUNDLE_NAME = "org.eclipse.tcf.te.tcf.remote.core.nls.Messages"; //$NON-NLS-1$
+
+ /**
+ * Static constructor.
+ */
+ static {
+ // Load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ // **** Declare externalized string id's down here *****
+
public static String PeerInfo_errorCannotOpenChannel;
public static String PeerInfo_errorNoFileSystemService;
public static String PeerInfo_errorPeerNotConnected;
+
public static String TCFFileStoreOperation_errorNotConnected;
+
public static String TCFOperationGetEnvironment_errorNoChannel;
public static String TCFOperationGetEnvironment_errorNoProcessesService;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/nls/Messages.properties
index 31eb8ed01..52ebaf654 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/nls/Messages.properties
@@ -8,9 +8,12 @@
# Contributors:
# Markus Schorn - initial API and implementation
################################################################################
+
PeerInfo_errorCannotOpenChannel=Cannot open channel to {0}
PeerInfo_errorNoFileSystemService=Cannot obtain file system service for {0}
PeerInfo_errorPeerNotConnected={0} is currently not connected
+
TCFFileStoreOperation_errorNotConnected={0} is not connected
+
TCFOperationGetEnvironment_errorNoChannel=Cannot obtain shared channel for {0}
TCFOperationGetEnvironment_errorNoProcessesService=Cannot obtain processes service for {0}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/PeerInfo.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/PeerInfo.java
index 88163b19f..6b759a9f9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/PeerInfo.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/PeerInfo.java
@@ -35,7 +35,8 @@ import org.eclipse.tcf.te.tcf.core.Tcf;
import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager;
import org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager.DoneOpenChannel;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
-import org.eclipse.tcf.te.tcf.remote.core.Activator;
+import org.eclipse.tcf.te.tcf.remote.core.activator.CoreBundleActivator;
+import org.eclipse.tcf.te.tcf.remote.core.nls.Messages;
public final class PeerInfo implements IChannelListener {
private IFileSystem fFileSystem;
@@ -100,7 +101,7 @@ public final class PeerInfo implements IChannelListener {
}
private IStatus errorStatus(String msg, Throwable cause) {
- return new Status(IStatus.ERROR, Activator.ID, msg, cause);
+ return new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), msg, cause);
}
@Override
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/TCFFileStoreOperation.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/TCFFileStoreOperation.java
index 93641907c..9c901379d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/TCFFileStoreOperation.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/TCFFileStoreOperation.java
@@ -21,6 +21,7 @@ import org.eclipse.tcf.services.IFileSystem.DoneStat;
import org.eclipse.tcf.services.IFileSystem.FileAttrs;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;
import org.eclipse.tcf.te.tcf.remote.core.TCFFileStore;
+import org.eclipse.tcf.te.tcf.remote.core.nls.Messages;
import org.eclipse.tcf.te.tcf.remote.core.operation.PeerInfo.DoneGetFileSystem;
import org.eclipse.tcf.te.tcf.remote.core.operation.PeerInfo.DoneGetUser;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/TCFOperation.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/TCFOperation.java
index bfaf8dac6..60926969a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/TCFOperation.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/TCFOperation.java
@@ -16,7 +16,7 @@ import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.tcf.remote.core.Activator;
+import org.eclipse.tcf.te.tcf.remote.core.activator.CoreBundleActivator;
public abstract class TCFOperation <R> {
private IStatus fError;
@@ -53,7 +53,7 @@ public abstract class TCFOperation <R> {
}
protected final Status createStatus(String msg, Throwable error) {
- return new Status(IStatus.ERROR, Activator.ID, msg, error);
+ return new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), msg, error);
}
protected final void setError(IStatus error) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/TCFOperationGetEnvironment.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/TCFOperationGetEnvironment.java
index dbad15519..523aead4f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/TCFOperationGetEnvironment.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.core/src/org/eclipse/tcf/te/tcf/remote/core/operation/TCFOperationGetEnvironment.java
@@ -21,6 +21,7 @@ import org.eclipse.tcf.services.IProcesses;
import org.eclipse.tcf.services.IProcesses.DoneGetEnvironment;
import org.eclipse.tcf.services.IProcessesV1;
import org.eclipse.tcf.te.tcf.core.Tcf;
+import org.eclipse.tcf.te.tcf.remote.core.nls.Messages;
public class TCFOperationGetEnvironment extends TCFOperation<Map<String,String>> {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/META-INF/MANIFEST.MF
index 552f73d21..a261be3fb 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.tcf.te.tcf.remote.ui;singleton:=true
Bundle-Version: 1.3.0.qualifier
-Bundle-Activator: org.eclipse.tcf.te.tcf.remote.ui.Activator
+Bundle-Activator: org.eclipse.tcf.te.tcf.remote.ui.activator.UIPlugin
Bundle-Vendor: %providerName
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
org.eclipse.remote.ui;bundle-version="1.1.0",
@@ -16,4 +16,6 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
-Export-Package: org.eclipse.tcf.te.tcf.remote.ui
+Export-Package: org.eclipse.tcf.te.tcf.remote.ui,
+ org.eclipse.tcf.te.tcf.remote.ui.activator;x-internal:=true,
+ org.eclipse.tcf.te.tcf.remote.ui.nls;x-internal:=true
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/Activator.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/Activator.java
deleted file mode 100644
index 5c50c86f9..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/Activator.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2014 Wind River Systems, 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:
- * Markus Schorn - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.remote.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator {
-
- public static final String ID = "org.eclipse.tcf.te.tcf.remote.ui"; //$NON-NLS-1$
-
- @Override
- public void start(BundleContext context) throws Exception {
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- }
-
- public static void logError(String msg, Throwable th) {
- Platform.getLog(Platform.getBundle(ID)).log(new Status(IStatus.ERROR, ID, msg, th));
- }
-
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/TCFFileSystemContributor.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/TCFFileSystemContributor.java
index 83afcb8d8..d76ebd78e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/TCFFileSystemContributor.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/TCFFileSystemContributor.java
@@ -10,13 +10,15 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.remote.ui;
-import static java.text.MessageFormat.format;
-
import java.net.URI;
import java.net.URISyntaxException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.remote.core.IRemotePreferenceConstants;
import org.eclipse.remote.core.IRemoteServices;
@@ -28,6 +30,8 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.tcf.te.tcf.remote.core.TCFConnection;
import org.eclipse.tcf.te.tcf.remote.core.TCFEclipseFileSystem;
import org.eclipse.tcf.te.tcf.remote.core.TCFRemoteServices;
+import org.eclipse.tcf.te.tcf.remote.ui.activator.UIPlugin;
+import org.eclipse.tcf.te.tcf.remote.ui.nls.Messages;
import org.eclipse.ui.ide.fileSystem.FileSystemContributor;
public class TCFFileSystemContributor extends FileSystemContributor {
@@ -49,7 +53,8 @@ public class TCFFileSystemContributor extends FileSystemContributor {
try {
return TCFEclipseFileSystem.getURIFor(tcfConn, path);
} catch (URISyntaxException e) {
- Activator.logError(format(Messages.TCFFileSystemContributor_errorCreateURIForPath, conn.getName(), path), e);
+ Platform.getLog(UIPlugin.getDefault().getBundle()).log(
+ new Status(IStatus.ERROR, UIPlugin.getUniqueIdentifier(), NLS.bind(Messages.TCFFileSystemContributor_errorCreateURIForPath, conn.getName(), path), e));
}
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/activator/UIPlugin.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/activator/UIPlugin.java
new file mode 100644
index 000000000..c4ac4afaa
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/activator/UIPlugin.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Wind River Systems, 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:
+ * Markus Schorn - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.tcf.remote.ui.activator;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class UIPlugin extends AbstractUIPlugin {
+ // The shared instance
+ private static UIPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public UIPlugin() {
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static UIPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Convenience method which returns the unique identifier of this plugin.
+ */
+ public static String getUniqueIdentifier() {
+ if (getDefault() != null && getDefault().getBundle() != null) {
+ return getDefault().getBundle().getSymbolicName();
+ }
+ return "org.eclipse.tcf.te.tcf.remote.ui"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/nls/Messages.java
index 5c88d0aab..25d4bc8c4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/nls/Messages.java
@@ -8,19 +8,25 @@
* Contributors:
* Markus Schorn - initial API and implementation
*******************************************************************************/
-package org.eclipse.tcf.te.tcf.remote.ui;
+package org.eclipse.tcf.te.tcf.remote.ui.nls;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.tcf.te.tcf.ui.remote.ui.messages"; //$NON-NLS-1$
- public static String TCFFileSystemContributor_browseFileSystem_title;
- public static String TCFFileSystemContributor_errorCreateURIForPath;
+
+ // The plug-in resource bundle name
+ private static final String BUNDLE_NAME = "org.eclipse.tcf.te.tcf.remote.ui.nls.Messages"; //$NON-NLS-1$
+
+ /**
+ * Static constructor.
+ */
static {
- // initialize resource bundle
+ // Load message values from bundle file
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
- private Messages() {
- }
+ // **** Declare externalized string id's down here *****
+
+ public static String TCFFileSystemContributor_browseFileSystem_title;
+ public static String TCFFileSystemContributor_errorCreateURIForPath;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/nls/Messages.properties
index c04e2da7a..80019ee4f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.remote.ui/src/org/eclipse/tcf/te/tcf/remote/ui/nls/Messages.properties
@@ -8,5 +8,6 @@
# Contributors:
# Markus Schorn - initial API and implementation
################################################################################
+
TCFFileSystemContributor_browseFileSystem_title=Browse File System
TCFFileSystemContributor_errorCreateURIForPath=Cannot create URI for path: {0}, {1}

Back to the top