swt

Opening a LWJGL window from a SWT app on Mac

雨燕双飞 提交于 2019-12-10 20:02:00
问题 I have a SWT app that opens a OpenGL window (using the LWJGL library) after a button is pressed. It is supposed to close it's main SWT window and open a new one with an OpenGL context. Works fine on Windows. On Mac, I get this error: 2010-03-05 02:28:25.315 java[1315:a07] [Java CocoaComponent compatibility mode]: Enabled 2010-03-05 02:28:25.316 java[1315:a07] [Java CocoaComponent compatibility mode]: Setting timeout for SWT to 0.100000 2010-03-05 02:28:25.317 java[1315:a07] Apple AWT Startup

Detecting when a user is finished resizing SWT shell

99封情书 提交于 2019-12-10 19:27:50
问题 I've got an SWT shell that's resizable. Every time it is resized, I have to do something computationally intensive. I can register a ControlListener on my shell, but this generates events continuously throughout the resize operation, and I have no idea when a resize drag type mouse operation ends. I'd like to be able to detect when the user is finished resizing the shell and then initiate my computationally intensive operation. Any ideas how to go about that? 回答1: How about using a timer and

Hiding empty parents - JFace's TreeViewer

时光毁灭记忆、已成空白 提交于 2019-12-10 18:34:41
问题 I'm creating a tree viewer in JFace and I want to achieve something. I use filter in it. The filter works well, but not perfectly. When I use filter.expandAll() method, the filter filters all of the tree's items, but there's something really annoying. Although it filters all of the tree's items, it doesn't hide item parents, that become now empty. Example: As you can see, there's only one item that matches the filter: "General/Map/New". But all of the parents are now shown although that they

Display some part of text in bold and some part in italic in SWT label

浪子不回头ぞ 提交于 2019-12-10 18:05:05
问题 I have to show some warning message to the user like "If you restore data the updated changes will be lost , So recheck once" In german language also I have to same string with bold and italic. In both languages the dialog height and width should be same public class BoldTextMessageDialog extends ZedisTrayDialog { private Composite container; private String firstSring; private String secondString; private String boldString; private Button restoreButton; private Button cancelButton; public

SWT Actions with Keyboard Shortcuts… without having to add them to the menu

女生的网名这么多〃 提交于 2019-12-10 17:42:07
问题 We currently have implemented a lot of SWT Actions, because it is a nice way to bind a single command to be added to the menubars and toolbars, and to have Keyboard Shortcuts for these commands. Now... how can I register an Action in plain SWT/JFace without having to add it to a menubar, but in a way that it still can be called by a keyboard shortcut? 回答1: I use to solve this in plain SWT by using Display.addFilter on the KeyDown event. See this question for an example. 回答2: Use the org

How to left-align text in a SWT ToolItem?

☆樱花仙子☆ 提交于 2019-12-10 17:19:15
问题 I am upgrading an RCP application to use Eclipse 4.2.1. One of the problems I am having is that the alignment of text in toolbars has changed. I can reproduce the issue with the following snippet, adapted from a standard SWT snippet. It simply creates a vertical ToolBar with 3 ToolItems. Each item has an image and some text. When I run this snippet in Eclipse 3.7.2, the text of each ToolItem is left-aligned. In Eclipse 4.2.1, it is centre-aligned. I would like the text to remain left-aligned.

RAP: How to access Object in ViewPart

天大地大妈咪最大 提交于 2019-12-10 17:15:10
问题 how do I access to an Object of a View from somewhere else? (Following code is just to sketch what i want to do) public class View extends ViewPart { public static final String ID = "view"; private static List list; public View() { } @Override public void createPartControl(Composite parent) { list = new List(parent, SWT.BORDER); } @Override public void setFocus() { } public static void addToList(String string) { list.add(string); } } Now I want be able to use View.addToList("Message")

Is there an RTF display widget in SWT

房东的猫 提交于 2019-12-10 16:50:13
问题 I would like to display an RTF document in an SWT (actually Eclipse RCP) application. I know there is a Swing widget for displaying and editing RTF text, but it is Swing and quite alien in look and feel when used in the otherwise platform (not to mention that to the last of my knowledge it did not display images and had only limited support for formatting) Other options is to use COM interface on windows, but that works only on the windows platform and requires that an ActiveX RichEdit contol

swt table change selection item color

人走茶凉 提交于 2019-12-10 16:19:14
问题 I'm using a standard swt table which, as you may know, by default when an item is selected is colored blue (windows standard). When the selection is inactive, it turns light gray. I would like to override both colors... I've searched all over the web but could only find some very old code which no longer seems to work with the table widget. Below is some sample code I was trying to overwrite the default color but it doesn't seem to be working (please excuse the dirty code, was just trying to

在swt中下载文件打开文件目录实现

被刻印的时光 ゝ 提交于 2019-12-10 15:48:49
话不多说直接上代码 FileDialog fileDialog = new FileDialog(shell, SWT.SAVE); // 设置默认打开的路径 fileDialog.setFilterPath(System.getProperty("user.home") + File.separator + "Downloads"); // 设置所打开文件的扩展名 fileDialog.setFilterExtensions(new String[] { "*." + "exe" }); // 设置显示在下拉框中的扩展名的名称 fileDialog.setFilterNames(new String[] { "*." + "exe", "*.*" }); // 设置默认文件名 fileDialog.setFileName("安装包"); //文件路径 String targetFile = fileDialog.open(); if (StringUtils.isNotEmpty(targetFile)) { //下载的业务逻辑 } 来源: CSDN 作者: 杰灬杰 链接: https://blog.csdn.net/qq_42493452/article/details/103475949