swt

How to set SWT button foreground color?

妖精的绣舞 提交于 2019-11-27 09:45:13
The SWT Button class has a setForeground(Color) method but it seems to have no effect (the method is actually on Button's superclass). The javadoc says that this method is a hint and may be overridden by the platform. My platform is Windows. Does this mean that it is not possible to set button foreground color on Windows? Does it work on other platforms? Is there a workaround? On Windows, setForeground for Buttons has no effects. As a workaround, add a PaintListener to your Button . On this Listener's paintControl method, get the generated event's GC and, with it, re-write the text of your

Combo in columnheader with swt

佐手、 提交于 2019-11-27 08:22:52
问题 I want a table that has a combo as one of its columnheaders. I already found out that it is impossible with Table from this question: Controls (Combo, Radio, Text) in column header SWT Is there a way around that? I tried TableViewer but didn't find a way to do it with it either. Is there any way this can be achieved? 回答1: You could create your own column headers in a Composite above the table using normal controls. You will then need to adjust the size of these controls to match the table

SWT Cross-Platform Enter Detection

被刻印的时光 ゝ 提交于 2019-11-27 07:46:06
问题 I have a global filter ( Display.addFilter ) in SWT in which I want to detect Enter key. In Windows, pressing Enter generates SWT.CR in 'keyCode' part of KeyListener event. Is this assumption safe for all platforms, or should I check if keyCode == SWT.CR || keyCode == SWT.LF? Thanks. 回答1: If you want to catch the event when the user presses the Enter key while a widget is in focus, use a TraverseListener or a Listener with type SWT.Traverse . Then, you check if (event.detail == SWT.TRAVERSE

SDK manager does not find java

爷,独闯天下 提交于 2019-11-27 07:44:34
问题 Hey guys, I seem to continually be unable to fix the issue at hand and my head is continually becoming balder or balder. The issue at hand is that my SDK manager won't find my Java, nor my SWT file. I'm running Windows 7 64-bit and my SDK, Java, SWT are located as the following. Java JDK - C:\Program Files\Java\jdk1.6.0_24 Java location - C:\Program Files\Java\jdk1.6.0_24\jre\bin SDK manager - C:\android-sdk-windows I'm learning coding for the very first time, i've tried everything so far.

How to align image to center of table cell (SWT Table)

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 06:58:32
问题 I develop Eclipse RCP application and got a problem with a Table . We have some data in database in boolean format and users wants to see that field using checkbox . I tried to implement it using Button(SWT.CHECK) as Table-Editor , but it worked too slow :( I tried to use 2 images - checked and unchecked check-boxes, it works, but I can't align them to center, they are aligned to left automatically. I even found how to catch SWT.MeasureItem and SWT.PaintItem events and process them manually

SWT No More Handles

别来无恙 提交于 2019-11-27 06:34:27
Windows XP has the limit 10000 user handles for each process and total 32000 for each desktop session. However, when I run 4 or 5 SWT process, each consuming no more than 2000 user handles, the SWT No More handles exception will always be threw. Does anyone know why? Paul Lammertsma If I understand you correctly, you are probably getting the following exception: org.eclipse.swt.SWTError: No more handles You may be creating resources (such as Font , Image or GC objects) that you aren't correctly disposing. You might want to take a moment to read through the SWT guide on Managing Operating

How to add org.eclipse.swt (and other plugin dependencies) as an automatic Java9 module?

社会主义新天地 提交于 2019-11-27 06:33:50
问题 In order to be able to use my Eclipse plugin "treezCore" also as a Java9 module I created a module-info.java in my src folder. Furthermore, I moved the Plug-in Dependencies from the Classpath to the Modulepath. I can see a module "org.eclipse.swt.3.106.1.v20170926" in the plugin dependencies: However, I am not able to reference that module in my module-info.java. I tried require org.eclipse.swt.3.106.1.v20170926; require org.eclipse.swt; require swt; None of those options worked. The jar file

Why is subclassing not allowed for many of the SWT Controls?

一笑奈何 提交于 2019-11-27 05:57:04
问题 I often find myself wanting to do it. It can be very useful when you want to store some useful information or extra states. So my question is, is there a very good/strong reason why this is forbidden? Thanks EDIT: Thanks a lot for all these answers. So it sounds like there's no right-or-wrong answer to this. Assuming I accept the fact that these classes are not to be subclassed, what's the point of not marking a Control class final, but prohibiting subclassing - effectively demoting the

Cannot load 64-bit SWT libraries on 32-bit JVM ( replacing SWT file )

白昼怎懂夜的黑 提交于 2019-11-27 04:37:06
I'm trying to debug this problem but not sure where exactly i need to replace SWT jar file for Eclipse. Current System Config: Eclipse Helios 3.6 - 32 Bit JDK 1.6 JVM - 32 Bit Windows 7 - 64 Bit Error Message: java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194) at org.eclipse.swt.internal.Library.loadLibrary(Library.java:174) at org.eclipse.swt.internal.C.<clinit>(C.java:21) at org.eclipse.swt.widgets.Display.<clinit>(Display.java:138) at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java

How can we auto resize the size of components in SWT?

喜欢而已 提交于 2019-11-27 02:49:41
问题 In my SWT application i have certain components inside the SWT shell. Now how can i auto re-size this components according to the size of display window. Display display = new Display(); Shell shell = new Shell(display); Group outerGroup,lowerGroup; Text text; public test1() { GridLayout gridLayout = new GridLayout(); gridLayout.numColumns=1; shell.setLayout(gridLayout); outerGroup = new Group(shell, SWT.NONE); GridData data = new GridData(1000,400); data.verticalSpan = 2; outerGroup