swt

Drag & drop not working on Mac

爱⌒轻易说出口 提交于 2019-12-05 15:58:17
问题 I'm trying to make it possible to drag files from the Finder into my SWT application. On Windows and Ubuntu, the following bit of code works: public class DndTest { public static void main(final String[] args) { final Display display = new Display(); final Shell shell = new Shell(display, SWT.DIALOG_TRIM); shell.setText("Drag & drop test"); shell.setSize(200, 200); final FormLayout layout = new FormLayout(); shell.setLayout(layout); final Label lbl = new Label(shell, SWT.NORMAL); lbl

Converting an AWT application to SWT/JFace

坚强是说给别人听的谎言 提交于 2019-12-05 13:19:16
I am currently toying with the idea of converting a small/medium sized project from AWT to SWT, although Swing is not totally out of the picture yet. I was thinking about converting the main window to an SWT_AWT bridge object, but I have no idea how the semantics for this work. After that, I plan to update dialog for dialog, but not necessarily within one release. Is this possible? Has someone done a conversion like this and can give me some hints? Is there maybe even a tutorial somewhere out there? Is there maybe even a tool that can automate parts of this? I have tried googling, but to no

Overcoming Windows User Object Handle Limit

巧了我就是萌 提交于 2019-12-05 13:17:12
I'm looking for advanced strategies for dealing with User Object Handle limits when building heavy-weight windows interfaces. Please explain how you overcame or bypassed this issue using SWT or direct Windows GUI APIs. The only thing I am not interested in is strategies to optimize widget usage as I have done this extensively and it does not solve the problem, only makes it less likely. My Situation: I have an SWT based GUI that allows for multiple sessions within the same parent shell and within each session their are 3 separate places where a list of user generated comments are displayed. As

SWT: single vs. multiple displays

无人久伴 提交于 2019-12-05 12:33:12
SWT is designed to support multiple Display instances, each one with its own event loop. For what purpose this is useful or required? Isn't one Display instance (e.g. Display.getDefault() sufficient? The docs for the Display class says "Applications which are built with SWT will almost always require only a single display". The Display instance is closely tied to the UI thread, and has certain restrictions on it in order to allow the SWT event model to work on top of the native UI event model. The only case is if you have multiple (native) UI threads, but I am not sure in which cases this is

Is there an equivalent in Java for fieldset (HTML)?

不问归期 提交于 2019-12-05 12:00:19
问题 Is there an element in Java (i.e. Swing/AWT or SWT) that is equivalent to the HTML element fieldset ? 回答1: Create a Panel, create a titled border and you will be able to put inside all your field components. JPanel panel = new JPanel(); panel.add(new JLabel("foo")); panel.setBorder(BorderFactory.createTitledBorder("bar")); 回答2: Have a look at javax.swing.border.TitledBorder . You can set them on panels and are similar in appearance to HTML fieldsets. Border titleBorder = new TitledBorder(new

How to always show vertical scroll bar in SWT table?

爷,独闯天下 提交于 2019-12-05 10:49:55
Is it possible to always show the vertical scroll bar in a SWT table even if the table is empty? By always showing a (possible disabled) vertical scroll bar one can avoid that the last column get partially hidden when the columns use ColumnWeightData for layouting. I tried to initialize the table with SWT.V_SCROLL or to use table.getVerticalBar().setVisible(true) - both without success. There is a method setAlwaysShowScrollBars in ScrollableComposite . What I am looking for is a similar method in Table . UPDATE: I suppose that the scroll bars which are visible when the table contains enough

Positioning Toolbars in Eclipse/RCP

偶尔善良 提交于 2019-12-05 10:48:11
I was working on my tiny RCP app, which needs a custom perspective switcher to control which views the user can access. So here I am, trying to add a toolbar with a couple of buttons to switch perspectives. I figured the best way to have some control over the stuff would be to add a second toolbar in ApplicationActionBarAdvisor which would call my thee actions/commands to switch perspectives. So let's say I create a second ToolBarContributionItem in the fillCoolBar method, which would look like this: protected void fillCoolBar(ICoolBarManager coolBar) { IToolBarManager toolbar = new

SWT x64 with xulrunner 3.6.28 x86

ぃ、小莉子 提交于 2019-12-05 08:30:37
is there any way to run xulrunner 3.6.28 (x86 there is no other) with swt x64? I cant use the newer xulrunner 10.4esr becouse i have some issues with it. The old one runs like a charm, but there is no x64 of it. If i try loading 3.6.28 i get some weird errors: org.eclipse.swt.SWTError: XPCOM error 0x80004005 at org.eclipse.swt.browser.Mozilla.error(Unknown Source) at org.eclipse.swt.browser.Mozilla.initXULRunner(Unknown Source) at org.eclipse.swt.browser.Mozilla.create(Unknown Source) at org.eclipse.swt.browser.Browser.<init>(Unknown Source) at GUI.TFSBrowser$1.run(TFSBrowser.java:54) Any

Set the window of an eclipse e4 application to have the whole screen size

一世执手 提交于 2019-12-05 07:50:52
How do I define in the Application.e4xmi that I want my window to have as size the whole available screen? What values should we add to the Bounds(x,y,w,h) of the Trimmed Window ? I tried -1,-1,-1,-1 but it does not work. Any ideas? Add the tag shellMaximized to the supplementary tab of your TrimmedWindow like this: See the Eclipse 4 RCP - Tutorial by Lars Vogel for more information. 来源: https://stackoverflow.com/questions/12543858/set-the-window-of-an-eclipse-e4-application-to-have-the-whole-screen-size

package GDAL JAVA Binding and native library in a SWT plugin

為{幸葍}努か 提交于 2019-12-05 05:22:40
I want to package GDAL and its JAVA binding into a SWT plug-in. (P.S. GDAL use swig to generate Java binding) I have all necessary native libraries and want to pack them into my Eclipse plug-in to let other people use it without installing GDAL on their computer. The problem is that the JAVA Binding (or native lib itself) will lookup necessary native libraries from PATH (Window) or LD_LIBRARY_PATH (Linux) instead looking up those libs in a relative location. Furthermore, GDAL will look up some necessary geo definition data from the environment variable GDAL_DATA as well. How can I solve those