swt

Get task manager list via SWT?

点点圈 提交于 2019-12-13 03:37:04
问题 Is there a way using SWT to get a list of all processes currently running (similar to executing tasklist.exe/tlist.exe on Windows)? If so, is there sample code available? Ideally this would be done programmatically only (no third party tools). My app monitors the process list and needs to support Windows 2000/Server 2003/XP Home/XP Pro/Vista Thanks in advance. 回答1: This does not seem to be possible using SWT or even Java for that matter is a poor fit across multiple platforms. I ended up

Refreshing table Editor with table item in swt

落花浮王杯 提交于 2019-12-13 03:08:29
问题 Hello i have a following code for swt table private Table folderAssociationTable; private TableItem item; private TableEditor editor; folderAssociationTable = componentsRenderer.createTableWidget(container, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION, 2, true); folderAssociationTable.addListener(SWT.MeasureItem, new Listener() { public void handleEvent(Event event) { event.height = 20; } }); componentsRenderer.createTableColumWidget(folderAssociationTable, SWT.CHECK, "Item", 80); // add a

SWT TableCombo disable highlighting of selected item

邮差的信 提交于 2019-12-13 02:58:18
问题 I am using TableCombo and when I push the dropdown button, the list of all items is shown. I would like to achieve that currently selected row is not highlighted in this list (because I use different background colors depending on type of item and the highlight hides the background color of selected item). I have tried creating the table with SWT.NO_FOCUS and SWT.HIDE_SELECTION flags, but it did not remove the highlight. Any ideas? I have tried to find out something like highlighter in swing,

How to dispose all children of Composite object?

不羁的心 提交于 2019-12-13 02:57:29
问题 I hava a Composite descComp with some stuff in it... basically it is a container for a form, consisting of number of labels, Combos and buttons, all aligned in a line. My form is not finite, I have a button that adds one extra line for extra input. However for that to work it seams I have to dispose old children of my descComp... private void populateConstantMain(ContentData tariffConstantsOfType, Composite descComp,GridLayout descCompLayout, Boolean resize) { int arraySize; if (resize ==

How to add an on/off sliders in SWT?

浪尽此生 提交于 2019-12-13 02:45:28
问题 I found a similar question on SO but it is in Swing. I want the same thing in SWT. So how can I make an ON/OFF slider in SWT? 回答1: The opal project has a SwitchButton which should be exactly what you are searching for. Here is a screenshot: You can use it like this: SwitchButton button = new SwitchButton(shell, SWT.NONE); button.setTextForSelect("ON"); button.setTextForUnselect("OFF"); 来源: https://stackoverflow.com/questions/14496663/how-to-add-an-on-off-sliders-in-swt

How to get Window Builder's SWT designer in 64-bit Eclipse

不问归期 提交于 2019-12-13 02:29:30
问题 I am trying to create a SWT WindowBuilder application in 64-bit Eclipse running on Windows 7. I removed both the 32-bit and 64-bit JRE on my computer along with the old Eclipse and old JDK, rebooted, downloaded the latest version yesterday evening, and then installed the latest 32/64 versions of the JRE and the JDK. Yes, I used a "professional" unzip utility, 7-zip, to unzip the "Eclipse IDE for Java Developers" and then copied the contents to the "C:\Program Files\Development\Tools\Eclipse",

Run Eclipse RCP application with Java instrumentation

删除回忆录丶 提交于 2019-12-13 01:23:54
问题 Using Java instrumentation, we can access a class that is loaded by the Java classloader from the JVM and modify its bytecode by inserting our custom code, all these done at runtime. We need not worry about security, these are governed by the same security context applicable for Java classes and respective classloaders. We are able to access some java application using this as they run in same classloader. Now what we are trying to do is to access eclipse RCP application using java

Zest: export diagram to an image/pdf

时光总嘲笑我的痴心妄想 提交于 2019-12-12 21:58:51
问题 I have created a network view diagram using zest framework, this uses SWT display/shell to display the UI. I want to export the UI to an image/pdf. How to do it? Any ideas? 回答1: You can use the SWT GC.copyArea() method to copy the contents of a Control to an Image, then save the Image to file. For example, if you have a Zest GraphViewer, viewer , the following code will copy its contents to a PNG file named out.png . GC gc = new GC(viewer.getControl()); Rectangle bounds = viewer.getControl()

Setting the width of the GridLayout columns

南楼画角 提交于 2019-12-12 20:02:36
问题 I have a GridLayout inside a Composite and I have two column inside that. I want to have column width 75 % and 25 % of the Shell width . How to do that? 回答1: Right, here you go: Use the GridData#widthHint values to force a certain width of the Composite s. Compute the width based on the width of the Shell : public static void main(String[] args) { Display display = Display.getDefault(); final Shell shell = new Shell(display); shell.setLayout(new GridLayout(2, false)); Composite left = new

Launching Java application on CENTOS yields “Could not find or load main class”

你。 提交于 2019-12-12 19:02:11
问题 I have 64-bit installation of CENTOS v6.5 final. I have a 32-bit compiled Java application, which I created with WindowBuilder/SWT Designer/SWT/Composite inside Eclipse. The application runs perfectly on Windows 7, where I created the Java application, from a Windows 7 command prompt: java -cp "bin/*;lib/*" PkgNetAccelerator32.netAcceleratorApp Inside the lib folder is swt.jar, and the Manifest.jar file that I automatically created. Yes, I downloaded the Linux version of swt.jar for use on