swt

How to combine and validate two text fields for a swt dialog?

允我心安 提交于 2019-12-07 07:44:34
问题 i have another question. I use a ModifyListener for one textfield to activate and deactivate the OK-Button in a swt dialog. It works great. Now I want to add a ModifyListener for another textfield. I want that the OK-Button only is activated if in both text fields is min one char. This is the code of the two fields: descriptionText.addModifyListener(new ModifyListener(){ public void modifyText(ModifyEvent e) { Text text = (Text) e.widget; if (text.getText().length() == 0) { getButton

How to change parent of components with SWT?

泪湿孤枕 提交于 2019-12-07 04:03:04
问题 My window should allow two different kind of layouts (it's a simple example to better illustrate it), e.g. +-------------+-------------+-------------+ | Component 1 | Component 2 | Component 3 | | | | | | | | | | | | | | | | | +-------------+-------------+-------------+ and +-------------+---------------------------+ | Component 1 | Component 2 | | | | | +---------------------------+ | | Component 3 | | | | +-------------+---------------------------+ where the user can switch between both, e

SWT x64 with xulrunner 3.6.28 x86

让人想犯罪 __ 提交于 2019-12-07 02:37:31
问题 is there any way to run xulrunner 3.6.28 (x86 there is no other) with swt x64? I cant use the newer xulrunner 10.4esr becouse i have some issues with it. The old one runs like a charm, but there is no x64 of it. If i try loading 3.6.28 i get some weird errors: org.eclipse.swt.SWTError: XPCOM error 0x80004005 at org.eclipse.swt.browser.Mozilla.error(Unknown Source) at org.eclipse.swt.browser.Mozilla.initXULRunner(Unknown Source) at org.eclipse.swt.browser.Mozilla.create(Unknown Source) at org

SWT: prevent Tree from expanding by doubleclick?

为君一笑 提交于 2019-12-06 22:11:36
I have a problem with SWT Tree. My situation is like this: I have a SWT Tree, which contains many TreeItems (Log entries), which contain TreeItems too. Those log entries have really long messages, which could not be shown in the TreeColumns at all. So my idea was: adding a Listener to the tree, which opens a new Dialog by DoubleClick, which shows the entries' details. So far so good. If I do a double click on a item, it works. BUT: If I do a double click on a parent Item, it will expand (and thats good), but my double click Listener is active then as well and the Dialog will open. That's not,

How best to use ViewerFilter on a TreeViewer?

[亡魂溺海] 提交于 2019-12-06 21:22:41
问题 I am applying a ViewerFilter to a tree of a few branches, but mostly leaves. The filter really applies to the leaves, using properties within the leaf. All branches are left untouched so that their leaves can appear. However I would like to filter out branches that contain no selected leaves, and I can see no mechanism within ViewerFilter that allows this. Is this possible at all? For example, given the notional tree below (where b is a branch, a L is a leaf) b0 b1 L2 L4 L8 b2 L1 L3 L5 I

SWT/JFace: remove widgets

非 Y 不嫁゛ 提交于 2019-12-06 18:19:53
问题 Group group = new Group(parent, SWT.NONE); StyledText comment = new StyledText(group, SWT.BORDER_DASH); This creates a group with a text area inside. How can I later delete the text (remove it from the screen so that I can replace it with something else)? 回答1: Use Widget.dispose. public class DisposeDemo { private static void addControls(final Shell shell) { shell.setLayout(new GridLayout()); Button button = new Button(shell, SWT.PUSH); button.setText("Click to remove all controls from shell"

MQ Explorer - Could not load SWT library

妖精的绣舞 提交于 2019-12-06 15:37:42
Installed IBM MQ 8.0.0.4 developer instance in Linux VM (Centos). When launching MQ explorer, using command strmqcfg (getting the following error). !ENTRY org.eclipse.osgi 4 0 2016-01-14 13:33:43.226 !MESSAGE Application error !STACK 1 java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: /home/mqm/.eclipse/com.ibm.mq.explorer.ui.rcp.RcpApplication_8.0.0.201510171407_1624510073_linux_gtk_x86_64/configuration/org.eclipse.osgi/bundles/500/1/.cp/libswt-pi-gtk-4333.so (libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory) swt-pi-gtk (Not found in java

How do you utilize SWT's Hi-DPI support for icons?

痴心易碎 提交于 2019-12-06 15:05:29
According to Eclipse Project Neon - New and Noteworthy , SWT supports auto-scaling for Hi-DPI monitors. Does SWT only support "auto-scaling", or does it provide additional features such as defining different images for various DPIs or zoom levels? If so, what are the classes I need to be looking into? SWT's Image has a new constructor that accepts an ImageDataProvider in order to provide image data for different zoom levels. if the application is moved to a monitor with different DPI or the zoom level is changed, the provider will be asked to return an image for the new zoom level (e.g. 150 or

Java SWT Refresh Multiple Shells From Button

Deadly 提交于 2019-12-06 13:44:58
问题 I am building an app that accesses a database and currently I have a SWT Shell that displays the main table. From this table users can open individual records and from inside the records form the user can open a second form that is of the same type but contains different data. If the record in either form is updated the update is reflected in the main form. My problem is I can't update the first record form that is opened. Is there a way to force an update or redraw for all open forms of a

Background color of widgets in JFace PopupDialog

元气小坏坏 提交于 2019-12-06 13:43:25
问题 I want to use the JFace PopupDialog as lightweight dialog for user input. But I have some problems with the background color of text widgets. As you can see below in 1, a SWT.MULTI text widget has no background and border, a SWT.SINGLE text widget has no background. I tried to override the background color with: Text comment = new Text(composite, SWT.MULTI|SWT.BORDER); comment.setFocus(); comment.setBackground(new Color(Display.getDefault(), new RGB(000, 000, 000))); // method of PopupDialog