swt

JFace dialog button translation

☆樱花仙子☆ 提交于 2019-12-04 10:31:16
I am creating a standalone SWT/JFace application. I used to use plain old SWT MessageBox: int style = SWT.APPLICATION_MODAL | SWT.YES | SWT.NO; MessageBox messageBox = new MessageBox (getShell(), style); messageBox.setText ("Question"); messageBox.setMessage ("So?"); boolean result = messageBox.open() == SWT.YES; I try to switch to JFace MessageDialog boolean result = MessageDialog.openQuestion(getShell(), "Question", "So?"); The problem I have is that in SWT, the Yes and No button labels are translated in my language, while in JFace it is not the case. Any idea? My referenced jars are swt 3.8

What is the most functional and ready-to-use SWT API in Scala?

那年仲夏 提交于 2019-12-04 09:21:28
问题 Is there a Scala SWT wrapper/API that has the most features and is most ready to be used? I see a couple what appear to be informal wrappers but can't tell if they're maintained. Also, one or two I see on multiple places and I'm not sure where the canonical place for them. 回答1: I've been using Dave Orme's XScalaWT with my own additions for JFace viewers for a while, and I find it great. Be sure to read the very interesting introductory blog post. 回答2: I'm also aware of SSWT but have no

Java SWT: widgetSelected vs widgetDefaultSelected

本小妞迷上赌 提交于 2019-12-04 09:02:35
For example I want to execute something when user clicks on a button. Which do I use? The documentation didn't appear to make it very clear UPDATE A quick test shows that Widget Selected is triggered but not Default Selected. In TasksView.main() TasksView view = new TasksView(shell, SWT.None); TasksController controller = new TasksController(view); In TasksController public class TasksController extends ControllerAbstract { protected TasksView view; public TasksController(TasksView view) { this.view = view; view.addTaskListener(new AddTaskListener()); } protected class AddTaskListener

Updating SWT periodically causes GUI to freeze

两盒软妹~` 提交于 2019-12-04 07:30:25
问题 Problem : SWT freezes when GUI field is periodically updated. I would like to have a SWT-based GUI with text field were values are periodically incremented. Initially I accessed textField from separate Thread what led to throwing exception: Exception in thread "Thread-0" org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4533) at org.eclipse.swt.SWT.error(SWT.java:4448) at org.eclipse.swt.SWT.error(SWT.java:4419) at org.eclipse.swt.widgets.Widget.error

How to change SWT Tree plus/minus icons

可紊 提交于 2019-12-04 06:56:29
I am working on a SWT Tree similar to the one here , however, I want to be able to show + signs in some cases instead of - for an expanded tree item. Is this possible ? If not, is there Windows API to have custom icons for the expanded/collapsed state of a tree item ? The SWT Tree component makes use of native Tree widget if available, for example in case of Windows - it uses native widget while on Linux (depends on the UI engine being used), it may create custom tree on its own. On the OS where it uses native Tree widget, it's not possible to customize the + and - icons. As Ali suggested (see

Combining Aero Glass effects and SWT

℡╲_俬逩灬. 提交于 2019-12-04 06:33:53
As a pet project, I've been playing with the concept of integrating Aero Glass effects into my SWT application. Łukasz Milewski has an excellent blog post explaining how this can be accomplished, which pretty much boils down to this: final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new FormLayout()); final MARGINS margins = new MARGINS(); margins.cyTopHeight = -1; final Composite c = new Composite(shell, SWT.NORMAL); c.setBackground(new Color(shell.getDisplay(), new RGB(0, 0, 0))); final FormData fd = new FormData(); fd.top = new FormAttachment(0,

Swt combobox name/key pair

痞子三分冷 提交于 2019-12-04 05:58:29
I want to have the text say one thing, but have the value say another Text Key But it only takes a string for adding items. How do Java programmers typically store text/id pairs in comboboxes countcb Maybe you can use the setData(String key, Object value) method of the combobox to achive what you want. Example: Combo box = new Combo(parent, SWT.DROP_DOWN); String s = "Item 1"; box.add(s); box.setData(s, "Some other info or object here"); s = "Item 2"; box.add(s); box.setData(s, "This is item two"); String value = (String)box.getData("Item 2"); // value is now "This is item two" Note that the

HTML Editor with Java and And webkit - SWT Browser

你离开我真会死。 提交于 2019-12-04 05:12:31
i want to add WYSIWYG HTML editor to my Java program. my idea is to do Something like this but not with python - with Java. i know about couple of options and their problems : HTMLEditorKit - not sophisticated enough. JWebpane - fairy tale. QtWebKit - not open source. JWebEngine - not open source. metaphaseeditor - to simple. The Lobo Project - not support the contenteditable attribute. JavaXPCOM - I don't Succeed to operate it on my mac OS X 10.6. Anyway, I just prefer not to use it because Gecko is slower then webkit. That's way I chose to work with Browser Object from org.eclipse.swt

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

别来无恙 提交于 2019-12-04 04:27:51
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 synchronisation issue between the changing of table items and the refresh of the viewer. Any ideas what i can do to

SWT Browser not working?

拟墨画扇 提交于 2019-12-04 04:00:20
问题 I'm having a little trouble with the SWT Browser component. I am running Ubuntu 11.04 AMD64 and Eclipse 3.7, with Java SE 1.6 from Sun My problem is that my browser won't initialize. When I make it with the SWT.NONE flag, I get errors Exception in thread "main" org.eclipse.swt.SWTError: No more handles (java.lang.UnsatisfiedLinkError: no swt-mozilla-gtk-3346 or swt-mozilla-gtk in swt.library.path, java.library.path or the jar file) at org.eclipse.swt.SWT.error(SWT.java:3589) at org.eclipse