mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-12 19:45:22 +02:00
Fix externalized strings warnings in tracer
This commit is contained in:
parent
73f204a7c8
commit
04251c8bcd
4 changed files with 28 additions and 19 deletions
|
@ -15,7 +15,7 @@ import org.osgi.framework.BundleContext;
|
||||||
public class Activator extends AbstractUIPlugin {
|
public class Activator extends AbstractUIPlugin {
|
||||||
|
|
||||||
// The plug-in ID
|
// The plug-in ID
|
||||||
public static final String PLUGIN_ID = "org.eclipse.rse.connectorservice.ssh";
|
public static final String PLUGIN_ID = "org.eclipse.rse.connectorservice.ssh"; //$NON-NLS-1$
|
||||||
|
|
||||||
// The shared instance
|
// The shared instance
|
||||||
private static Activator plugin;
|
private static Activator plugin;
|
||||||
|
@ -53,12 +53,25 @@ public class Activator extends AbstractUIPlugin {
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an image descriptor for the image file at the given
|
||||||
|
* plug-in relative path.
|
||||||
|
*
|
||||||
|
* @param path the path
|
||||||
|
* @return the image descriptor
|
||||||
|
*/
|
||||||
|
public static ImageDescriptor getImageDescriptor(String path) {
|
||||||
|
return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
|
||||||
|
}
|
||||||
|
|
||||||
|
//<tracing code>----------------------------------------------------
|
||||||
|
|
||||||
private static Boolean fTracingOn = null;
|
private static Boolean fTracingOn = null;
|
||||||
public static boolean isTracingOn() {
|
public static boolean isTracingOn() {
|
||||||
if (fTracingOn==null) {
|
if (fTracingOn==null) {
|
||||||
String id = plugin.getBundle().getSymbolicName();
|
String id = plugin.getBundle().getSymbolicName();
|
||||||
String val = Platform.getDebugOption(id + "/debug"); //$NON-NLS-1$
|
String val = Platform.getDebugOption(id + "/debug"); //$NON-NLS-1$
|
||||||
if ("true".equals(val)) {
|
if ("true".equals(val)) { //$NON-NLS-1$
|
||||||
fTracingOn = Boolean.TRUE;
|
fTracingOn = Boolean.TRUE;
|
||||||
} else {
|
} else {
|
||||||
fTracingOn = Boolean.FALSE;
|
fTracingOn = Boolean.FALSE;
|
||||||
|
@ -79,20 +92,12 @@ public class Activator extends AbstractUIPlugin {
|
||||||
}
|
}
|
||||||
public static void trace(String msg) {
|
public static void trace(String msg) {
|
||||||
if (isTracingOn()) {
|
if (isTracingOn()) {
|
||||||
String fullMsg = getTimestamp() + " | " + Thread.currentThread().getName() + " | " + msg;
|
String fullMsg = getTimestamp() + " | " + Thread.currentThread().getName() + " | " + msg; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
System.out.println(fullMsg);
|
System.out.println(fullMsg);
|
||||||
System.out.flush();
|
System.out.flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
//</tracing code>---------------------------------------------------
|
||||||
* Returns an image descriptor for the image file at the given
|
|
||||||
* plug-in relative path.
|
|
||||||
*
|
|
||||||
* @param path the path
|
|
||||||
* @return the image descriptor
|
|
||||||
*/
|
|
||||||
public static ImageDescriptor getImageDescriptor(String path) {
|
|
||||||
return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,12 +62,14 @@ public class Activator extends Plugin {
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//<tracing code>----------------------------------------------------
|
||||||
|
|
||||||
private static Boolean fTracingOn = null;
|
private static Boolean fTracingOn = null;
|
||||||
public static boolean isTracingOn() {
|
public static boolean isTracingOn() {
|
||||||
if (fTracingOn==null) {
|
if (fTracingOn==null) {
|
||||||
String id = plugin.getBundle().getSymbolicName();
|
String id = plugin.getBundle().getSymbolicName();
|
||||||
String val = Platform.getDebugOption(id + "/debug"); //$NON-NLS-1$
|
String val = Platform.getDebugOption(id + "/debug"); //$NON-NLS-1$
|
||||||
if ("true".equals(val)) {
|
if ("true".equals(val)) { //$NON-NLS-1$
|
||||||
fTracingOn = Boolean.TRUE;
|
fTracingOn = Boolean.TRUE;
|
||||||
} else {
|
} else {
|
||||||
fTracingOn = Boolean.FALSE;
|
fTracingOn = Boolean.FALSE;
|
||||||
|
@ -88,10 +90,12 @@ public class Activator extends Plugin {
|
||||||
}
|
}
|
||||||
public static void trace(String msg) {
|
public static void trace(String msg) {
|
||||||
if (isTracingOn()) {
|
if (isTracingOn()) {
|
||||||
String fullMsg = getTimestamp() + " | " + Thread.currentThread().getName() + " | " + msg;
|
String fullMsg = getTimestamp() + " | " + Thread.currentThread().getName() + " | " + msg; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
System.out.println(fullMsg);
|
System.out.println(fullMsg);
|
||||||
System.out.flush();
|
System.out.flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//</tracing code>---------------------------------------------------
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ public class SftpHostFile implements IHostFile {
|
||||||
return getName();
|
return getName();
|
||||||
} else {
|
} else {
|
||||||
StringBuffer path = new StringBuffer(getParentPath());
|
StringBuffer path = new StringBuffer(getParentPath());
|
||||||
if (!fParentPath.endsWith("/"))
|
if (!fParentPath.endsWith("/")) //$NON-NLS-1$
|
||||||
{
|
{
|
||||||
path.append('/');
|
path.append('/');
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ public class SftpHostFile implements IHostFile {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renameTo(String newAbsolutePath) {
|
public void renameTo(String newAbsolutePath) {
|
||||||
int i = newAbsolutePath.lastIndexOf("/");
|
int i = newAbsolutePath.lastIndexOf("/"); //$NON-NLS-1$
|
||||||
if (i == -1) {
|
if (i == -1) {
|
||||||
fName = newAbsolutePath;
|
fName = newAbsolutePath;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class SshHostShell extends AbstractHostShell {
|
||||||
fStdinHandler = new PrintWriter(fChannel.getOutputStream());
|
fStdinHandler = new PrintWriter(fChannel.getOutputStream());
|
||||||
|
|
||||||
fChannel.connect();
|
fChannel.connect();
|
||||||
writeToShell("cd "+initialWorkingDirectory);
|
writeToShell("cd "+initialWorkingDirectory); //$NON-NLS-1$
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
//TODO Forward exception to RSE properly
|
//TODO Forward exception to RSE properly
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
Loading…
Add table
Reference in a new issue