swt

Setting number of rows to be displayed for Multi line text in swt

那年仲夏 提交于 2019-12-10 02:20:46
问题 I am using following for TextArea ToolBar bar = new ToolBar(box,SWT.NONE); ToolItem item = new ToolItem(bar, SWT.SEPARATOR); Text text = new Text(bar, SWT.BORDER | SWT.MULTI); item.setWidth(width); item.setControl(text); GridData data = new GridData(); data.verticalAlignment = SWT.CENTER; data.grabExcessHorizontalSpace = true; data.grabExcessVerticalSpace = true; text.setLayoutData(data); I want to display a multi line text box, currently its accepting multi line text but showing only a

Deploying an SWT application on Java Webstart

北慕城南 提交于 2019-12-09 23:45:46
问题 Is it possible to deploy SWT applications using JNLP. Especially loading the swt native library (dll in Windows, so in Linux)? Any links? I found one at IBM Developer Works, however it just describes using swt.jar. In addition to that, is it possible to load the native dll files over JNLP? 回答1: The IBM developer works article you linked to contains everything you need to know including how to load the native dll files. Notice the nativelib element in the resources. The jar file referred to

Show local HTML file with JavaScript in SWT Browser widget in RAP

亡梦爱人 提交于 2019-12-09 23:15:44
问题 For my RAP-project I need to show some charts. Because I haven't found any widget for this purpose, my plan was to use the browser widget, so I can use JavaScript-Plugins like Highcharts or Chartsjs. But I can't get it working. If I set an HTML-File in browser.setUrl, the browser widget don't show anything, not even simple HTML. The JavaScript-Console in Chrome says Not allowed to load local resource If I enter the HTML-Code with the setText method it shows the HTML, but JavaScript is not

Why can not i run a google app engine project on localhost?

眉间皱痕 提交于 2019-12-09 18:18:24
问题 I am using macbook pro for development. I just installed eclipse indigo. Google app engine Java SDK is 1.8.2. I am trying to run an appengine project on localhost. But i am getting the following error: 2013-08-04 13:14:03.193 java[2146:707] [Java CocoaComponent compatibility mode]: Enabled 2013-08-04 13:14:03.194 java[2146:707] [Java CocoaComponent compatibility mode]: Setting timeout for SWT to 0.100000 Usage: <dev-appserver> [options] <app directory> Options: --help, -h Show this help

org.eclipse.swt.SWTException: “Widget is disposed” from table refresh

ε祈祈猫儿з 提交于 2019-12-09 16:07:42
问题 The app is an Eclipse 3.6 based RCP (so jface version 3.5.2) running on windows 7. I have a custom View class that contains a TableViewer and calls refresh() on it. Sometimes, but not very often it results in the stack trace below. It's called from within the UI thread. I suspected the problem was with other code that changes the backing list to the table, but that any code that does this is also run in either a syncExec or asyncExec method so I don't understand how it could be a

Display parent modal dialog with SWT

爷,独闯天下 提交于 2019-12-09 08:32:07
问题 AWT/Swing allows to show application modal (blocking the whole application) and parent modal (blocking only the parents) dialogs. How can I achieve the same with SWT? 回答1: In order to block the whole application, you can create the dialog Shell with the style SWT.APPLICATION_MODAL , open it, and then pump the UI events until the shell is disposed: Display display = Display.getDefault(); Shell dialogShell = new Shell(display, SWT.APPLICATION_MODAL); // populate dialogShell dialogShell.open();

How to open files in Java Swing without JFileChooser

落花浮王杯 提交于 2019-12-09 03:20:33
问题 I'm using Java Swing (GUI) and I want to add a button to my project for opening files. I don't like the JFileChooser since it opens a small window for browsing through the files of the directories. Can I use something else instead of the JFileChooser under Java Swing ? I've tried to use elements of SWT but it didn't work, meaning is the use of the button object and then use it inside the JFrame , but that failed, so I guess SWT and Swing don't mix together? Here is the example of Java Swing

SWT RowLayout with last element grabbing excess horizontal space?

烂漫一生 提交于 2019-12-08 20:04:29
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 columns in the grid layout, depending on the size of the elements)? public class RowLayoutDemo { public

SWT Combo and CCombo as CellEditor

拈花ヽ惹草 提交于 2019-12-08 17:27:35
Why is the last item blank? I only have 3 items (it's a tri-state boolean editor). Can a CCombo achieve this solid Combo look and feel? As a combo cell editor, I would prefer the regular Combo , BUT: Can this Combo be used as CellEditor , while fitting the table row height? (maybe making the Font smaller?) The default visible item count for CCombo is 5, try calling setVisibleItemCount(3) . CCombo does not support much customization. It always sets the same colors for the list and the text for example. The look of Combo varies a lot between platforms, the Mac version might look odd in a table

Java SWT show Line numbers for StyledText

独自空忆成欢 提交于 2019-12-08 15:58:12
问题 I was wondering if there is a straightforward way to display line numbers with StyledText text field - even if lines are wrapped. I'm using it in my application and if content gets to big, some line numbers would be nice. Thank you. 回答1: The key is org.eclipse.swt.custom.Bullet . It's basically a symbol (or in our case a number) you can add to the beginning of a line. //text is your StyledText text.addLineStyleListener(new LineStyleListener() { public void lineGetStyle(LineStyleEvent e) { /