mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
fix for bug 172023: when RXTX library is not installed, a warning is printed to the error log which includes the install instructions
This commit is contained in:
parent
a31509ca8e
commit
d533122199
5 changed files with 72 additions and 5 deletions
|
@ -13,3 +13,4 @@ Eclipse-BuddyPolicy: ext
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Bundle-RequiredExecutionEnvironment: J2SE-1.4
|
Bundle-RequiredExecutionEnvironment: J2SE-1.4
|
||||||
Bundle-ClassPath: .
|
Bundle-ClassPath: .
|
||||||
|
Bundle-Activator: org.eclipse.tm.terminal.internal.serial.Activator
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
package org.eclipse.tm.terminal.internal.serial;
|
||||||
|
|
||||||
|
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||||
|
import org.osgi.framework.BundleContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The activator class controls the plug-in life cycle
|
||||||
|
*/
|
||||||
|
public class Activator extends AbstractUIPlugin {
|
||||||
|
|
||||||
|
// The plug-in ID
|
||||||
|
public static final String PLUGIN_ID = "org.eclipse.tm.terminal.serial";
|
||||||
|
|
||||||
|
// The shared instance
|
||||||
|
private static Activator plugin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -16,13 +16,15 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.terminal.internal.serial;
|
package org.eclipse.tm.terminal.internal.serial;
|
||||||
|
|
||||||
|
import gnu.io.CommPortIdentifier;
|
||||||
|
import gnu.io.SerialPort;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
||||||
import gnu.io.CommPortIdentifier;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import gnu.io.SerialPort;
|
import org.eclipse.core.runtime.Status;
|
||||||
|
|
||||||
import org.eclipse.tm.terminal.ISettingsPage;
|
import org.eclipse.tm.terminal.ISettingsPage;
|
||||||
import org.eclipse.tm.terminal.ISettingsStore;
|
import org.eclipse.tm.terminal.ISettingsStore;
|
||||||
import org.eclipse.tm.terminal.ITerminalConnector;
|
import org.eclipse.tm.terminal.ITerminalConnector;
|
||||||
|
@ -44,8 +46,8 @@ public class SerialConnector implements ITerminalConnector {
|
||||||
try {
|
try {
|
||||||
settins=new SerialSettings();
|
settins=new SerialSettings();
|
||||||
} catch (NoClassDefFoundError e) {
|
} catch (NoClassDefFoundError e) {
|
||||||
// the comm library is not installed
|
// tell the user how to install the library
|
||||||
e.printStackTrace();
|
Activator.getDefault().getLog().log(new Status(IStatus.WARNING,Activator.PLUGIN_ID,SerialMessages.ERROR_LIBRARY_NOT_INSTALLED,e));
|
||||||
}
|
}
|
||||||
fSettings=settins;
|
fSettings=settins;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,4 +32,6 @@ public class SerialMessages extends NLS {
|
||||||
public static String PORT_IN_USE;
|
public static String PORT_IN_USE;
|
||||||
public static String TIMEOUT;
|
public static String TIMEOUT;
|
||||||
|
|
||||||
|
public static String ERROR_LIBRARY_NOT_INSTALLED;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,3 +24,15 @@ STOPBITS = Stop Bits
|
||||||
PARITY = Parity
|
PARITY = Parity
|
||||||
FLOWCONTROL = Flow Control
|
FLOWCONTROL = Flow Control
|
||||||
TIMEOUT = Timeout (sec)
|
TIMEOUT = Timeout (sec)
|
||||||
|
ERROR_LIBRARY_NOT_INSTALLED = The RXTX library has not been installed properly! \n\
|
||||||
|
Installation:\n\
|
||||||
|
-------------\n\
|
||||||
|
* Get RXTX binaries from\n\
|
||||||
|
ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip\n\
|
||||||
|
* Copy RXTXcomm.jar into $JRE/lib/ext\n\
|
||||||
|
* Copy the native libs for your Platform (*.so, *.jnilib, *.dll) into the respective native lib folder of your RSE \n\
|
||||||
|
* More installation instructions are at\n\
|
||||||
|
http://rxtx.qbang.org/wiki/index.php/Main_Page\n\
|
||||||
|
* More downloads for other platforms (currently about 30)\n\
|
||||||
|
are available from the "ToyBox" link on\n\
|
||||||
|
http://users.frii.com/jarvi/rxtx/download.html
|
||||||
|
|
Loading…
Add table
Reference in a new issue