swt

How to restore default keybindings (Ctrl+A, Ctrl+C, etc) for widgets in SWT?

给你一囗甜甜゛ 提交于 2019-12-24 00:59:39
问题 When I edit a text field and press Ctrl + A , then instead of selecting all text in the field, the main menu's handler for Ctrl + A is called. How to restore the default behaviour, without losing the Ctrl + A accelerator in menu? 回答1: Ctrl + A doesn't do anything on my WinXP workstation using the following snippet. So there is no "default behaviour": import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.*; public class Snippet22 { public static void main( String[] args ) { Display

Is there a chance to get -splash:<image> work for SWT applications that require -XstartOnFirstThread?

这一生的挚爱 提交于 2019-12-24 00:14:46
问题 I am launching my Scala SWT application using: java -splash:splash.jpg -jar application.jar Using JDK 1.6.0 on Mac OS X 10.9.1 the splash screen was opened immediately (seconds before the actual application window opened). I used the following code to close the splash screen when the SWT application window opened: // When the window opens for the first time close the splash screen if exists val splash = SplashScreen.getSplashScreen if (splash != null) { shell.addShellListener(new ShellAdapter

Set color for SWT Combo

删除回忆录丶 提交于 2019-12-23 23:23:03
问题 I'm trying to turn color of my readonly combo to white as a non-readonly combo My code for the readonly Combo Combo myCombo = new Combo(sessionProperties, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY, ""); I also try to set background and foreground, but it not this thing. 回答1: The background color is a hint. On some platforms, some controls cannot change their background color. The SWT CCombo is a custom control that emulates the behavior of a combo box by using a text input field, a button, and

SWT on OS X: change application name

左心房为你撑大大i 提交于 2019-12-23 16:56:08
问题 My SWT-based Java application shows SWT as application name in the application menu. I've tried changing it in Info.plist and using Display.setAppName("myApp") but it does not help. What else can I try? BTW, I'm starting the application using a shell script which is located at MyApp.app/Contents/MacOS/MyApp . 回答1: Display.setAppName() should work, at the condition that it is called before any Display instance is created (either by you or implicitly, e.g. if you call Display.getDefault() ).

SWT Setting Column Height or insert new line

妖精的绣舞 提交于 2019-12-23 16:44:33
问题 I currently have a Table [org.eclipse.swt.widgets.Table] with several TableColumns; however, due to UI space restrictions I have a bit of an issue. Lets say for example I had a table column named "Target User" and this couldn't be named anything else AND the whole display "Target User" had to be displayed. Now lets say I also have several other Table Columns with the same problems. I was hoping I could add a new line or do something to set the height of the column so it could be Target \n

Setting the SWT Button to pressed state programmatically?

自作多情 提交于 2019-12-23 12:59:45
问题 I am trying to set a SWT Button into a "pressed" state programmatically. Is that possible somehow? Update: What I am trying to achieve - is render draw a Button in it's selected state onto an Image. Image buttonimg_mouseover = new Image(getDisplay(), 100, 100); Button button = new Button(parent.parent, SWT.PUSH); button.setAlignment(SWT.CENTER); button.setImage(arrowimg); button.setSize(100, 100); button.setSelection(true); // doesn't work GC gcbutton = new GC(buttonimg_mouseover); //draw an

Increasing the size of the Text field

隐身守侯 提交于 2019-12-23 12:41:19
问题 I am using org.eclipse.swt.widgets.Text 's type of Text field. I want to increase the length of the field. How would I do this? 回答1: For each field, if your general layout manager is GridLayout, your textbox layout data will be GridData. Pass width and height into the GridData constructor and set it to the textbox (textbox.setLayoutData()), along with the properties about how you want the layout manager to manipulate the field. 回答2: Since Text is a control, it inherits the method: Text

SWT - computingSize for Multi-line textfield inside ScrolledComposite

妖精的绣舞 提交于 2019-12-23 12:37:25
问题 I have a composite(innerComposite) within a ScrolledComposite(sc). At runtime, additional UI components can be added. So I'm using the code below to set the minimum size of the sc to enable scrolling, in case that the additional UI components "overflow" the sc. sc.setMinSize( innerComposite.computeSize( innerComposite.getSize().x, SWT.DEFAULT ) ); One issue is with the SWT Multi-Line textfield inside this sc/innerComposite. textBox = new org.eclipse.swt.widgets.Text(parent, SWT.MULTI | SWT

Is it possible to modify how Text swt widget wrap word?

梦想的初衷 提交于 2019-12-23 12:34:45
问题 The development platform is an Eclipse RCP 3.4 on Fedora (It's using Gtk native component). I need to avoid word wrapping. i.e.: "Hello World" is displayed as case N°1 but I need the case N°2. 1|Hello | 2|Hello Wor| |World | |ld | Is there a simple solution ? I've seen that swt Text handle is build with OS.GTK_WRAP_WORD_CHAR wrap mode. I would like to test the behaviour with constant like OS.GTK_WRAP_WORD or OS.GTK_WRAP_NONE but I don't know how to perform this miracle ? Is it possible to

Can't use JFace and SWT in eclipse without creating plugin

落爺英雄遲暮 提交于 2019-12-23 12:26:39
问题 DISCLAIMER : this is the classic case of .NET GUI trying to work his way around JAVA stuff. PROBLEM DESCRIPTION: I am trying to build a very simple GUI with JFace and SWT - the code is straightforward (there's plenty tutorials), what it's not so straightforward is that I can't seem to get JFace and SWT to work outside a plugin project. I would expect to be able to use JFace and SWT in my project no hassle, since I put "C:/eclipse 3.5/plugins" in my CLASSPATH (from my computer --> properties -