swt

How can I create a checkbox in a TableViewer of JFace?

回眸只為那壹抹淺笑 提交于 2019-12-08 02:04:29
问题 I have created a tableViewer with two columns and I want to make one of them a checkbox. To do that I have created a CheckBoxCellEditor, but I don´t know why it isn´t working. The column called tableName displays it´s values OK. The column specification is the following. String[] COLUMN_HEADINGS = {"Select", "Table name"}; TableColumnLayout tableLayout = new TableColumnLayout(); parent.setLayout(tableLayout); //Set what would display each column TableViewerColumn selectCheckBox =

Supporting SWT on Windows/Mac & 32bit/64bit

爱⌒轻易说出口 提交于 2019-12-08 01:38:35
问题 I'm currently working with the DJProject to put a browser into my Java Swing application. DJProject uses SWT to run and I have very little experience with SWT. I want to support Windows and Mac both 32bit and 64bit. I understand there is a swt.jar file for each of these platforms. I have all 4 swt.jar libraries added to my classpath as a library to the main application. My problem is when I try running the application on a Mac for example I get the error: Exception in thread "main" java.lang

How to show a rapidly changing image in an SWT canvas? ( paintControl() listener method is not being called rapidly)

牧云@^-^@ 提交于 2019-12-08 00:08:46
问题 I'm using a MouseMoveListener on a composite to update the image on another canvas. Basically, if the user drags Composite1 to somewhere on his screen, that will call the mouseMoveEventListener everytime the mouse moves, which will get the x,y location of the mouse, take a screenshot using Awt.robot.captureScreenRegion , and try to update the image of Canvas1 by calling its repaint() method. The purpose is just to show the user a preview of what's under the composite as he's dragging it. Here

SWT Shell is not raised above in xfwm4

空扰寡人 提交于 2019-12-07 23:42:29
I have problem with xfwm4. Using following code: Shell s = windowVector.get(0).getShell(); s.setActive(); Shell window that is covered by other shells is not raised above. Using kwin (KDE window manager) it works correctly. Shell is created using following constructor: shell = new Shell(mainShell, SWT.NO_TRIM | SWT.MODELESS); In both cases SWT method: OS.gdk_window_focus (window, OS.GDK_CURRENT_TIME); is called but in xfwm4 shell get focus and is NOT raised above all other shell windows (in my application). Is this bug in xfwm4? Maybe some configuration issue or I am missig something. EDIT: I

ColumnViewerTooltipSupport in SWT

↘锁芯ラ 提交于 2019-12-07 19:09:21
问题 What is the exact use of ColumnViewerTooltipSupport ? I know that it provides tooltip support for ColumnViewers but does it mean that it provides tooltip for treeViewers? How can I use this feature to provide tooltip support individually different tooltips for my each tree item when the mouse hovers over each item? Do I require a MouseListener for this or does the ColumnViewerTooltipSupport class provide it by default? Can someone please help me out here as I'm relatively new to SWT concepts.

Highlight particular string in SWT Tree node

隐身守侯 提交于 2019-12-07 18:14:19
问题 I have a requirement like first of all tree will be loaded, tree contains 4 levels. There is a text field, where user can enter "filterText" and he can press search button. In tree, in any of four levels if there is a match with filter text, then that particular string only should be highlighted with yellow color but not whole node and its corresponding tree will be expanded. Unmatched tree nodes should not expand. 回答1: I assume you are using TreeViewer . You can use a StyledCellLabelProvider

java SWT transparent composite background

谁说我不能喝 提交于 2019-12-07 17:45:43
问题 i have composite object Composite composite = new Composite(shell, SWT.NONE); composite.setBounds(new Rectangle(10,10,100,100); How do i make this composite to have transparent background? I will need to have widgets(non transparent) placed in this composite... 回答1: That not possible to create a Composite with transparent background. You can use a Shell with a transparent background (see example), and put widgets inside it. 来源: https://stackoverflow.com/questions/9542524/java-swt-transparent

How can I use the system's context menu for files in a Java application?

坚强是说给别人听的谎言 提交于 2019-12-07 16:23:19
问题 I want to display results of a file search. I want to enable a context menu for a file selection, which will be the system's context menu. For example, if the user right-clicks a file in Windows - I want to display the popup-menu with the options: Open Open with... Edit Send to... Copy Cut etc... And, if possible - this menu will be generated automatically, depending on the operating system. If that is not possible or too complex - I'd like to at least enable a "Locate on disk" option which

Import SWT as a Gradle dependency

好久不见. 提交于 2019-12-07 16:05:36
I am looking at how to import the SWT UI library into my Java project. I found the pom file for SWT on maven at: https://repo1.maven.org/maven2/org/eclipse/swt/3.3.0-v3346/swt-3.3.0-v3346.pom From the file I added the following line to my build.gradle file compile "org.eclipse:swt:3.3.0" however when I added it to my build.gradle I received the following error: Project 'L-CAD Main' is missing required library: '/home/ashley/unresolved dependency - org.eclipse swt 3.3.0' If I understand this right this means it can't find the dependency, so I don't know what I'm doing wrong. My IDE is Eclipse.

Embed custom widget in SWT Tree or Table

て烟熏妆下的殇ゞ 提交于 2019-12-07 15:53:27
Using SWT, Is it possible to create a custom widget and insert it to a Table or Tree as if it was a TreeItem or TableItem ? I tried to create a class and extend TreeItem but I'm getting this warning: MyClass illegally extends TreeItem Is there a way to do this? Most SWT widgets are not designed to be extended and enforce this by checking that the current class is in the org.eclipse.swt.widgets package. This can be worked around but is very strongly discouraged. Widgets generally contain a lot of platform specific code, an override class might very easily end up using code which will only work