swt

JFace/SWT: Change the labels for buttons in InputDialog

匿名 (未验证) 提交于 2019-12-03 00:46:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to create an InputDialog with custom labels for the OK/Cancel buttons. I'm using org.eclipse.jface.dialogs.InputDialog . I tried to override the button creation method: @Override protected void createButtonsForButtonBar(Composite parent) { super.createButtonsForButtonBar(parent); getButton(IDialogConstants.OK_ID).setText(myOkText); getButton(IDialogConstants.CANCEL_ID).setText(myCancelText); } and it works, but the buttons are not resized (and the custom text results cropped). I guess it's too late to set the text here, because the

Future of GUI development in Java? [closed]

不想你离开。 提交于 2019-12-03 00:44:18
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Considering that Sun/Oracle decided to not develop Swing any further after they "invented" JavaFX JavaFX doesn't really work and some consider it a failure already the not really platform-independent nature of SWT, the manual task to dispose GUI elements and

Any way to embed a Swing JFrame in the AWT Frame from the SWT_AWT bridge?

三世轮回 提交于 2019-12-02 23:22:26
问题 I'm integrating a Swing application into an Bioclipse/Eclipse plug-in, and since Eclipse uses SWT, I have to use the SWT_AWT bridge somehow. The problem is that the starting point I get from the SWT_AWT bridge is an AWT Frame, like so: java.awt.Frame awtFrame = SWT_AWT.new_Frame(composite); ... (which can be filled with AWT components), but the situation is that the Swing application contains much of it's functionality in it's main JFrame component. Now, a Swing JFrame can not be integrated

What does JFace add to SWT?

孤街醉人 提交于 2019-12-02 22:57:18
What is the difference betweem the following: TreeViewer & Tree TableViewer & Table TreeViewerColumn & TreeColumn TableViewerColumn & TableColumn When to use viewer & regular widget? PS: It would a great help if you can help me find a good resource for understanding them.Thanks in advance! You could have titled your question "What does JFace add to SWT ?". Viewers are from JFace, Widgets are from SWT. In summary, JFace make Widgets easy to manipulate and insert into a GUI. JFace frees you from all the drudgery of manipulating SWT widget elements to add behaviour to static widgets. SWT just

Why does Table.getItem(Point) always return the item from column zero?

本小妞迷上赌 提交于 2019-12-02 20:19:18
问题 I've implemented a class to give me a more flexible tooptip for the org.eclipse.swt.widgets.Table class. As I'm sure you all know, by default you get one tooltip for the whole table - and not individual tips for each cell. My object creates a number of listeners to implement it's own location sensitive tooltip, however, when I call Table.getItem(Point) to get the TableItem (or cell) over which the mouse is hovering it always returns the cell from column 0 of the correct row. The table in

How to display a hint message in an SWT StyledText

喜你入骨 提交于 2019-12-02 16:35:13
问题 SWT Text has a method called setMessage() which can be used to display a message as a hint for the user, indicating the purpose of the field. It seems that StyledText does not have a setMessage() method. Can something similar be done with StyledText nonetheless? 回答1: Recently, I had the need to display a hint within a StyledText. Thus I share my solution here. The setMessage() method of the StyledTextMessage shown below can be used to display a hint on a StyledText widget. The class adds a

What is the purpose of Layout in SWT applications?

允我心安 提交于 2019-12-02 14:38:08
问题 What is the usage of the Layout in SWT application, since, we can omit it in our applications. What is the benefit of having it? 回答1: Automatic layout requires less of your time than manual/absolute layout. First, it's less effort overall to specify a layout with desired properties than an absolute layout. You can quickly add, move or remove items in an automatic layout, without tweaking the absolute positions of all other items. Next, these factors sometimes make automatic layout necessary:

Java SwingWorker while using SWT

空扰寡人 提交于 2019-12-02 14:23:38
I have a problem as follows: I've written a simple minimalistic Application that utilizes the SWT for the GUI. In a specific tab, where it displays a table that get's filled with Informition via a REST Api Call. Additionaly, i have another method to export this table into a CSV-file. This works absolutely fine. Now I need some kind of autoupdate/-export for which I implemented a Swing-Worker like this: protected class AutoExportWorker extends SwingWorker<Integer, String> { @Override public Integer doInBackground() throws Exception { System.out.println("Worker Start!"); while (true) { System

How to load image to view in RCP?

耗尽温柔 提交于 2019-12-02 13:52:02
问题 I am developing an RCP plugin project that includes certain views.First view take employee details like name , address etc.There is an option to upload employee image using browse button.Second view shows the details that have entered in the first view.All details except photo is displaying fine. It shows a red square in the place of photo label. My code for setting photo is shown like this : Label photoLabel = new Label(parent, SWT.NONE); photoLabel.setBounds(420, 233, 100, 106); photoLabel

Updating SWT periodically causes GUI to freeze

半腔热情 提交于 2019-12-02 13:26:38
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(Widget.java:482) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:373) at org.eclipse.swt