swt

CheckboxTreeViewer: Can't expand nodes by default

风格不统一 提交于 2019-12-11 08:47:45
问题 I recently implemented a CheckboxTreeViewer in my own Dialog . This works fine so far except that the tree doesn't allow me to expand nodes by default. It only works when I check the checkbox, as you can see in the following images: This is by default. As you can see, it's not possible to expand the node, though it has children: After checking the check box, it works: I already tried to use setExpandPreCheckFilters , but with no success: Composite container = (Composite) super

How to do sorting on SWT column descending

蓝咒 提交于 2019-12-11 08:38:26
问题 How to do sorting ascending as well as descending. In the following SWT code ascending is working successfully, but descending not working when I click on the table header how to do? Here are my following code. package test; import java.text.DecimalFormat; import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.Date; import org.eclipse.swt.SWT; import org.eclipse.swt.layout

Running JQuery script in SWT browser

依然范特西╮ 提交于 2019-12-11 07:47:16
问题 I am developing an Java application with an embedded SWT browser in it.I want to run a jquery script on the SWT browser.I have placed by jquery library file in the src folder of the project.And here is the program. import org.eclipse.swt.SWT; import org.eclipse.swt.browser.AuthenticationEvent; import org.eclipse.swt.browser.AuthenticationListener; import org.eclipse.swt.browser.Browser; import org.eclipse.swt.browser.ProgressEvent; import org.eclipse.swt.browser.ProgressListener; import org

How to limit ModifyListener for user interaction only

穿精又带淫゛_ 提交于 2019-12-11 07:37:41
问题 I have a textbox with attached ModifyListener. In implemented modifyText(ModifyEvent e) I execute desired functionality. The problem with that, that this event is triggered on every text change. I don't want it to trigger if text was altered programmaticly (by setting text via code). I want it to trigger only when user changes the code (I can't use keylistener because it will be triggered also when user click on arrow buttons and etc, it also won't detect if user copy&paste text) 回答1: You

Displaying text on a swt button vertically

给你一囗甜甜゛ 提交于 2019-12-11 07:35:57
问题 I'm trying to display text on a button. Instead of displaying it as "Vertical", I'd like to display it as V e r t i c a l Any assistance is much appreciated. 回答1: You have to make your own widget to achieve it in SWT. Here is a complete example that you can try. Hope it helps. 回答2: SWT buttons do support wrapping (since 3.7). Button button = new Button(parent, SWT.PUSH | SWT.WRAP); button.setText("V\ne\nr\nt\ni\nc\na\nl"); But unfortunately the lines will be centered as a whole and not

why maximize and minimize option is missing in linux but working in windows

感情迁移 提交于 2019-12-11 07:08:02
问题 I written a Java SWT (GUI) program to just display the shell window and I running it in Eclipse and I am using Fedora 17 operating system. I am getting the output with maximize and minimize option missing in that window. But I tried it in Windows 7 and it gives me the correct output without missing anything. Please anyone tell me that why is it missing in Fedora 17 and what is the solution to correct it? This is the code: import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display;

How to asynchronous trigger JProgressBar?

為{幸葍}努か 提交于 2019-12-11 06:57:23
问题 I have a JButton ( swing ) in the JPanel , where if it is pressed I am performing a task on the for loop over the list in its EDT thread . While doing so I need to update the JProgressBar . Problem is, when I am pressing the JButton the task is performed in Event Dispatch Thread (EDT). So I can't update the JProgressBar which is triggered either in main or UI thread. Right now the source code is not available at me as I completely changed it and tried to use Eclipse SWT for JProgressBar when

SWT: notify a composite that it has a new child

*爱你&永不变心* 提交于 2019-12-11 06:39:43
问题 How to notify a Composite if a new child control has been created? The reason: by default, for the StackLayout no child is shown. I want to ensure that the first control which is added to our StackLayoutComposite (which is a Composite with set StackLayout and a few other helper methods) is shown by default. Currently, I solved it by overriding StackLayout 's layout method, but this looks ugly in my eyes. 回答1: If you want to re-layout the parent Composite based on the new child and any

Change eclipse menuitem color

不羁岁月 提交于 2019-12-11 06:36:47
问题 I would like to change some menuitems color ,for example yellow, dynamically with my plugin. is it possible? More details: Lets say I wanna change the file->import menuitem to yellow, which class is responsible for that? For simpleness, if I got SWT window, calculater with File menu in it, how to change the File->exit menuItem to yellow when I press or do something in this calculator windows?? thanks in advance 回答1: Any menu-related color settings are OS-dependent, since SWT is based on

How can I stop an SWT composite control from firing a MouseExit event when the mouse enters a component control?

点点圈 提交于 2019-12-11 06:15:36
问题 I have subclassed org.eclipse.swt.widgets.Composite to create a new composite control. I want to capture MouseEnter and MouseExit events in this control but the problem I have is that when the mouse is hovered over a component in the control (say, a Label) the MouseExit event is fired, even though the label is part of the whole Composite. Is there any way to stop this event being fired? I only want to see the event if the mouse leaves the total boundary of the control. Here is some example