swt

Scrolling TreeViewer Tree SWT

你。 提交于 2019-12-11 05:58:25
问题 My dialog have two TreeViewer components. The vertical scroll bars have to be synchronized. I have tried with setSelection and setTopItem methods but both have no effect to other tree. xViewerLeft = createXViewer(leftComposite, this); xViewerRight = createXViewer(rightComposite, this); xViewerLeft.getTree().getVerticalBar().addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event arg0) { //xViewerRight.getTree().setSelection(xViewerLeft.getTree().getSelection()); /

Use JFileChooser without using a main declaration

时光怂恿深爱的人放手 提交于 2019-12-11 05:50:04
问题 Following my previous post in this link I have another problem . Given the following code : public class GuiHandler extends javax.swing.JFrame { // GuiHandler is the class that runs the entire project // here are two private fields that I use in the code , I have more but they // irrelevant for the moment final JFileChooser openFiles = new JFileChooser(); private DataParser xmlParser = new DataParser(); // later on I have this method - XMLfilesBrowserActionPerformed private void

Set ScrollableComposite position to location

烂漫一生 提交于 2019-12-11 05:46:03
问题 Using the SWT ScrollableComposite, is there an easy way in which to set the scrollbar position to jump in such a way that a particular element will be positioned at the top? For example, if I had such a composite filled with 26 labels going down with the letters of the alphabet in order: ...then, say that I want to set my view to the "J" label and have the scrollbar position set like this: (This is only example - if I really wanted to do what I am describing here, I would clearly just use a

ALL black Pixels with SWT since Windows 10 Update 1809 and gc.print() / gc.copyArea(

白昼怎懂夜的黑 提交于 2019-12-11 05:44:53
问题 I have this piece of code that worked throug the ages (kepler to oxygen) for the last 4 Years, Since the Windows 10 1809 update this results in an all black picture. This happens on several PCs. public static Image renderToImage(Control control) { Shell imgShell = new Shell(control.getDisplay(), SWT.NO_TRIM); Composite oldParent = control.getParent(); Point size = control.getSize(); imgShell.setSize(size); control.setParent(imgShell); Image image = new Image(control.getShell().getDisplay(),

SWT: addFilter or addKeyListener on Composite

こ雲淡風輕ζ 提交于 2019-12-11 05:08:15
问题 i want to have some composite-wide keyboard-shortcuts. The composites in question are in a tab-folder. I have a little function, which traverses all children of my composite and adds a KeyboardAdapter to every one of them. The problem I have is that, when I open on of the tabs pressed keys aren't registered. I first have set the focus on some selectable widget in the tab, then it works. When i switch to another tab and then back, the focus is still kind of there (a grey selection instead of a

SWT TrayItem location

无人久伴 提交于 2019-12-11 04:46:26
问题 I use SWT + JFace and want to show my application window near the tray icon, like ToolTip. Is there a way to get the location of a TrayItem? 回答1: There's no platform-agnostic way to do this AFAIK. Ig you really need it, you'll likely need to code to the underlying SWT platform API as per your GTK example. One way I've done this which builds/runs everywhere is to use reflection to call the methods based on what SWT.getPlatform () returns. If the window is mouse-triggered (e.g. by hover) you

Eclipse RCP - how to add mouselistener on the titlebar of an eclipse ScrolledForm

筅森魡賤 提交于 2019-12-11 04:37:00
问题 I try to use the addmouselistener method of the form and check if the clicks are in the area of the title bar, but the mouse listener is not working. I tried to add the mouse listener on form and on form.getform() and on form.getBody() neither one works. Here is the code where I am creating the form and trying to add a mouse listener on it: toolKit = new FormToolkit(parent.getDisplay()); form = toolKit.createScrolledForm(parent); FillLayout layout = new FillLayout(); layout.type = SWT

Eclipse SWT : Multi Select Widget from left column to right column

感情迁移 提交于 2019-12-11 04:36:27
问题 I am developing a plugin that uses SWT. In one of the windows of the plugin I need to add widgets that look like the one above.I could not find an appropriate name, so, the image. What it does is, selects the items from left column to the right column and vice versa using the buttons in the middle. Once the items are moved, they are removed from the left column and added to the right column and vice versa. Question 1: What is the exact name for this setup? Question 2: Is there any existing

Java SWT: How to set the window to be resizable \ not resizable on the fly?

最后都变了- 提交于 2019-12-11 04:32:07
问题 After a lot of search and research, I couldn't find any answer. I will very appreciate the person that could help me. In SWT java, I want my window to be not resizable, so I define it like this: shell = new Shell(SWT.CLOSE | SWT.TITLE | SWT.MIN); But then I want to change it to be resizable (for example after I click a button). How can I change the style of the shell on the fly? 回答1: You can't change the style of a Shell once it has been created so you can't do this directly. What you can do

SWT: how to get selected value in Combo which embeded in Table

≡放荡痞女 提交于 2019-12-11 04:30:48
问题 i create a column of comboBoxes like this: for (int i = 0; i < 5; i++) { new TableItem(table_1, SWT.NONE); } TableItem[] itemsCombo = table_1.getItems(); for (int i = 0; i < 5; i++) { TableEditor editor_1 = new TableEditor(table_1); final CCombo comboXX = new CCombo(table_1, SWT.NONE); comboXX.setItems(allValues); editor_1.grabHorizontal = true; comboXX.select(getIndexInLOV(choosenItemList.get(i), allValues)); editor_1.setEditor (comboXX, itemsCombo[i], 0); } Then on clicking "Ok" i want to