swt

Close button in CTabFolderRenderer in SWT

江枫思渺然 提交于 2019-12-24 13:58:54
问题 I have a requirement to have a close Button (Native) in CTabFolder for close action. To say precisely I need a native Button with text " close ". I have a CustomCTabFolderRenderer with drawClose method being overidden. I did manage to draw an image, but client didn't like that. Rather than drawing any polygon or image using the GC is there any way to draw a native Button? I could have drawn a rectangle with some text, but I'm worried that it cant give a native look. I would be pretty much

Any workarounds to lack of PreSelection events in SWT/JFace?

為{幸葍}努か 提交于 2019-12-24 12:18:38
问题 In my application I want the user to save any changes before he leaves a tab (implemented as CTabFolder ). I tried to handle SelectionEvent , but it fires after the tab has been changed (so why does it even have a doit field? Does it fire before change for some other controls?) Looking on Bugzilla, I've found https://bugs.eclipse.org/bugs/show_bug.cgi?id=193453 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=193064, neither of which is fixed. Since this requirement is probably common, does

How-to Ubuntu 11.04 +Java Swing/SWT menu in header(like in Mac OS)?

雨燕双飞 提交于 2019-12-24 12:17:47
问题 Is there a way to put a menu on a panel in Java's Swing/SWT applications in Ubuntu 11.04 (like in Mac OS X)? I've seen that most (if not all) of native applications on Ubuntu use this feature. So, is there a way? 回答1: It took me a while to understand what you meant. If you mean you want to use the Unity desktop Global Menu, you will likely have to use the Java Gnome Bindings 来源: https://stackoverflow.com/questions/6865552/how-to-ubuntu-11-04-java-swing-swt-menu-in-headerlike-in-mac-os

Prevent system tray icon from stealing focus when clicked

﹥>﹥吖頭↗ 提交于 2019-12-24 12:12:37
问题 I am writing an application in Java that places an icon in the system tray (via SWT). When this icon is clicked, I wish to have it automatically type some keys (via the Robot class) into whatever text field is in focus at the time of clicking (could be in any window). Unfortunately, clicking the system tray icon steals the focus away from the previously focused window, thereby stealing the key strokes. Is there a way to cause the text to be typed into the previously focused window? 回答1:

Installing WindowBuilder on 64-bit Eclipse

人盡茶涼 提交于 2019-12-24 11:36:01
问题 I downloaded the Windows 64-bit version of Eclipse. I went to "Help | Install New Software..." and entered the following URL to get WindowBuilder. Kepler 4.3 (4.4 does not have a link yet) http://download.eclipse.org/windowbuilder/WB/release/R201309271200/4.3/ I then saw the following display: The text of the error is: Cannot complete the request. See the error log for details. "WindowBuilder GroupLayout Support" will be ignored because a newer version is already installed. "SWT Designer XWT

How to reuse images in SWT

一曲冷凌霜 提交于 2019-12-24 11:13:32
问题 I have a list of items which I display in a grid layout. Each row have couple of image buttons. When the row count reached over 1000 I am getting org.eclipse.swt.SWTError: No more handles exception. I used Sleak.java and found that there have been a number of images in the memory. Is it possible to reuse these buttons somehow? Below is the statistics from Sleak . Colors: 8 Cursors: 6 Fonts: 19 Images: 1317 Code: private void looper(List<File> dicomFiles, int start, int stop, int toShow){ for

JavaApplicationStub with CFBundleDocumentTypes

家住魔仙堡 提交于 2019-12-24 10:38:50
问题 I'm trying to use CFBundleDocumentTypes to associate a custom file extension with my application. As far as I can tell, this seems to "work" -- JavaApplicationStub launches my application when I double click the file. However, no callback is registered through the ApplicationListener events I setup in java. I used the code listed in Set Default file association Mac OS X Java Package Maker Installer to do the file association, and the file association itself appears fine, but it seems as if it

Get all TreeItems in an SWT Tree

僤鯓⒐⒋嵵緔 提交于 2019-12-24 09:37:47
问题 I want to get an array of all the TreeItems from my SWT Tree. However, the method included in the Tree class, getItems() only returns the items that are on the first level of the tree (i.e. that aren't children of anything). Can someone suggest a way to get all of the children/items? 回答1: The documentation of Tree#getItems() is very specific: Returns a (possibly empty) array of items contained in the receiver that are direct item children of the receiver . These are the roots of the tree.

How to fill a ScrolledComposite?

人盡茶涼 提交于 2019-12-24 08:55:35
问题 I have a class extending from ScrolledComposite, within this class I have created a Composite which is intended to fill the parent ScrolledComposite. But whenever I add labels to the inner composite it wraps to the upper right corner only. I want my inner Composite to completely fill the outer ScrolledComposite. Is there a way to do this? public class Container extends ScrolledComposite { final Composite comp; Label nameLabel, sizeLabel, dateLabel; ArrayList<Label> entrySize, date; ArrayList

How to fill a ScrolledComposite?

前提是你 提交于 2019-12-24 08:52:18
问题 I have a class extending from ScrolledComposite, within this class I have created a Composite which is intended to fill the parent ScrolledComposite. But whenever I add labels to the inner composite it wraps to the upper right corner only. I want my inner Composite to completely fill the outer ScrolledComposite. Is there a way to do this? public class Container extends ScrolledComposite { final Composite comp; Label nameLabel, sizeLabel, dateLabel; ArrayList<Label> entrySize, date; ArrayList