swt

SWT Section reserves too much vertical space when using a custom row layout for its children

℡╲_俬逩灬. 提交于 2019-12-08 06:24:30
问题 I use a GridLayout with one column inside a Section . There are three "rows" in the grid, having a white background. I would like the Section to grab horizontal space but only as much vertical space as needed : Each row uses a custom row layout and has two children. Furthermore, that row layout has two states: a) show on a single line (if total width is large enough) b) show second child (red) on an extra line (if total width of window is too small for both children) For both states I would

SWT Shell is not raised above in xfwm4

梦想的初衷 提交于 2019-12-08 06:08:57
问题 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

Focusable composite in SWT

依然范特西╮ 提交于 2019-12-08 05:17:49
问题 We have a custom control that is essentially a composite with label and a button. Currently when the user presses "Tab" the focus comes to the button. How can I make the composite to receive focus and the button to be excluded from the focus? E.g. the user should be able to tab through all custom controls and not stop at buttons. Updated: Our controls tree looks like this: Main pane CustomPanel1 Label Button CustomPanel2 Label Button CustomPanel3 Label Button All CustomPanel's are of the same

How to load font from InputStream in SWT?

时间秒杀一切 提交于 2019-12-08 05:17:16
问题 I need to load font ( .otf or .ttf ) file from java Resource or InputStream in SWT. org.eclipse.swt.graphics.Device.loadFont(String path) allows me (example) to load font from font file path (and it works), but there is no corresponding method to load it from any other source. I was thinking of using java.awt.Font.createFont(int fontFormat, InputStream fontStream) and then building org.eclipse.swt.graphics.FontData and org.eclipse.swt.graphics.Font objects out of AWT java.awt.Font object.

Eclipse RCP Toolbar buttons with the Eclipse Look

孤人 提交于 2019-12-08 05:08:19
问题 In Eclipse, its easy to specify buttons for your toolbar using the ActionSets extension point. However, when I need to specify some items programmatically, I can't get the same look. I don't believe that the framework is using native buttons for these, but so far, I can't find the right recipe to match the Eclipse look. I wanted to see if anyone has found the right snippet to duplicate this functionality in code. 回答1: It's difficult to tell from your question, but it sounds like you may be

Eclipse Plugin: Opening A New Window From The WorkBench

我的梦境 提交于 2019-12-08 05:06:41
问题 I am new in developing Eclipse plugin and i have manage to do a lot of work. This is where i have got stuck. I have a view with a button. When a user cklicks on the button i want a new window to be opened(The window is a form with Text areas, buttons and other SWT widgets). I have finished creating the window. After I compile the application, I get a new instance of the eclipse workbench(as expected) but when I open the view and clicks on the button, the window don't show up. This is the

SWT RowLayout with last element grabbing excess horizontal space?

隐身守侯 提交于 2019-12-08 04:26:05
问题 I have two elements in a horizontal RowLayout . I am able to specify a (minimal) with for the second element (e.g. 200 px). Furthermore... a) If the total width of the shell is too small, the second element wraps to a new line. That works fine with the RowLayout . b) If the total with is "large", the second (=last) element should grab the excess horizontal space . Is b) possible with the RowLayout ? Or do I need to use a GridLayout and implement the wrapping on my own (e.g. use one or two

Sorting of tree implemented with NatTable

不打扰是莪最后的温柔 提交于 2019-12-08 04:08:50
问题 I'm trying to implement sorting of tree implemented with NatTable but I can't really understand how it works. My problem is that after the sorting of any column other than 'tree' column child nodes can move to invalid parent. Though the order of elements is correct on all levels of hierarchy. So basically I don't understand the purpose of TreeList.Format.getComparator() and how it related to comparators registred for the columns, and I don't understand when and why node can change its parent.

How to draw selection box on SWT canvas?

谁说胖子不能爱 提交于 2019-12-08 02:56:32
问题 I have an SWT Canvas with some image on it. I want my user to select parts of the image by clicking, holding the left mouse button and opening a selection box by moving the mouse. As a visual feedback I want to show the selected rectangle as a transparent overlay over my image. The problem is I have not clue how to best achieve this? Can someone give me a hint? 回答1: My answer is somehow similar to the one I gave here: SWTChart mouse event handling The code below should give you an idea on

Copy Image to Clipboard not working on Linux (Java AWT & SWT)

天涯浪子 提交于 2019-12-08 02:51:38
问题 I am developing an Eclipse RCP Application which includes JFreeChart. One of its features is to copy graphs to the clipboard in order to paste them into other applications but it does not work on Linux, There is a SWT sample where you can find a snippet that does not work in Linux. On the other hand JFreeChart implemented this on AWT as: Clipboard systemClipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); Insets insets = getInsets(); int w = getWidth() - insets.left - insets.right;