swt

Problems with loading resources during execution

▼魔方 西西 提交于 2019-12-03 18:06:03
问题 Here's the background of the underlying problem, I am collaborating with a group on a project which uses Swt libraries and I am trying to package the software for deployment. As it turns out SWT is very platform/architecture dependent. I would like to be able to package all six jar s (linux, mac, win and 32/64-bit) into the same package and use the appropriate library depending on the system. I realize that it is a tough challenge however, switching to Swing (or anything else) isn't really an

Easiest way to unit test SWT and Swing apps in a headless environment?

只愿长相守 提交于 2019-12-03 16:17:12
问题 I'm looking to unit test some SWT and Swing code for a project I'm working on and the tests run fine as long as I'm running them from eclipse. As soon as I run them in my hudson environment it fails since hudson runs the tests in headless mode. What's the best way of doing this? Open source solutions only please (since the project is open source). 回答1: You could run Xvfb (X virtual framebuffer, an X11 server that performs all graphical operations in memory) and this works fine. But there is

SWT: Getting notified of a system device change (USB device connection / disconnection)

泄露秘密 提交于 2019-12-03 15:23:29
I'm writing an SWT application which needs to sit in the system tray and pop up automatically whenever the user connects some USB device (the application serves as its control panel). The way to do this in the native environment (win32 in this case, but I should be platform-independent ultimately) is to listen to the WM_DEVICECHANGE event, then checking if my device has been disconnected. Googling the subject, it seems like SWT does not in fact handle this type of event. Does anyone have any idea as to how to achieve this? My fallback solution would be sampling the USB port every n seconds,

Can't get SWT Display on Mac OS X

你离开我真会死。 提交于 2019-12-03 14:38:02
问题 I'm running Mac OS X Snow Leopard and wan't to access the Display from the activator in an OSGi bundle. Below is the start method for my activator: @Override public void start(BundleContext context) throws Exception { ExecutorService service = Executors.newSingleThreadExecutor(); service.execute(new Runnable() { @Override public void run() { Display display = Display.getDefault(); Shell shell = new Shell(display); Text helloText = new Text(shell, SWT.CENTER); helloText.setText("Hello SWT!");

Java 7 update 45 broke my Web Start SWT application

左心房为你撑大大i 提交于 2019-12-03 13:54:21
问题 I maintain an Eclipse RCP application launched with WebStart. Java 7 u45 made some security changes, and now my application crashes on startup. I've added to the manifest: Permissions: all-permissions Codebase: * Trusted-Library: true This removed all of the warning messages from the Control Panel. But I still have a classloader issue when trying to load my IApplication implemenentation, probably the first of my classes to load. This is new to update 45. 回答1: I have experienced the same issue

Learning Eclipse RCP and SWT/JFace

。_饼干妹妹 提交于 2019-12-03 13:48:27
问题 I am new to to Eclipse RCP and SWT/JFace. I intend to purchase the Second Edition of the well known Eclipse Rich Client Platform book by Jeff McAffer, Jean-Michel Lemieux, Chris Aniszczyk. I wish to know from people who have read any of the editions of the book whether the book serves as a good introduction to both the topics (RCP and SWT/JFace)? Or would I need separate reading material for SWT/JFace? 回答1: I read the first edition of the book in 2007 when I started a project with Eclipse RCP

Eclipse look & feel customization

北城以北 提交于 2019-12-03 13:36:39
问题 I need to customize the look & feel of my RCP application. I took a look at Eclipse Presentation API and I suppose it allows to customize everything in workbench except controls. So is there any solution to customize controls? I made some research work and implemented some ad-hoc SWT cunstomization using control canvas drawning. May be there are better solutions? In Swing you can use Synth theme. It would be great if some 'skin' framework exists for SWT. 回答1: One way of customizing an RCP app

SWT: How to do High Quality Image Resize

北慕城南 提交于 2019-12-03 13:31:16
问题 My application needs to resize ImageData. Unfortunately, I haven't gotten the results I want with GC (with antialias on and interpolation on high), or ImageData.scaledTo(). The resulting image is of too low a quality to be acceptable. What's the best way to do a high quality ImageData resize? Edit: I'm scaling down. 回答1: AWT offers image scaling with different modes. For downscaling, Area Averaging offers the best quality. One could of course re-implement the area averaging scaling algorithm

Build multiple architecture SWT application with Maven

别说谁变了你拦得住时间么 提交于 2019-12-03 12:26:32
I've set up a Maven project for a SWT application. This application runs on several platforms (OS X, Windows 64-bit, Windows 32-bit, Linux 64-bit and Linux 32-bit) and I've set it up so that the platform is detected when Maven is run and the packaged application goes to different destination directories. Here are the relevant parts from pom.xml to achieve this: <profiles> <profile> <id>linux_x86_64</id> <activation> <os> <name>linux</name> <arch>amd64</arch> </os> </activation> <build> <directory>${project.basedir}/target/${project.version}/linux_x86_64</directory> </build> </profile> <profile

Java SWT application - Bring To Front

南笙酒味 提交于 2019-12-03 12:24:11
I am currently developing an SWT java application on Windows 7. Usually the application will be minimized, and when there is an event on the serial port the application should maximizes itself. The following code does the maximization part. private void bringToFront(final Shell shell) { shell.getDisplay().asyncExec(new Runnable() { public void run() { if(!shell.getMaximized()){ shell.setMaximized(true); } shell.forceActive(); } }); } But sometimes the SWT application is maximized behind another application. For example, if I have a powerpoint running in Fullscreen mode maximized application is