swt

SWT Table checkbox for all columns

走远了吗. 提交于 2019-12-23 10:28:29
问题 I am trying to create a two-column-table with checkboxes in both of them I have created a table with the following snippet: Table table = new Table(parent, SWT.CHECK | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); TableColumn tableColumn = new TableColumn(table, SWT.NONE); tableColumn.setWidth(300); tableColumn.setText("Check Column1"); TableColumn tableColumn1 = new TableColumn(table, SWT.NONE); tableColumn1.setWidth(300); tableColumn1.setText("Check Column2"); TableItem tableItem=new TableItem

How do I make part of a TreeViewer cell bold?

回眸只為那壹抹淺笑 提交于 2019-12-23 09:42:58
问题 I currently want to write an Eclipse editor based on a JFace TreeViewer . I added a CellLabelProvider to the TreeViewer . If I set the font of a cell with directly in the update method of the CellLabelProvider to a bold font the label is shown bold. But I want only part of the label to be shown as bold. So I apply StyleRange s to the cell. Selected colors in the 'StyleRange's work perfectly, but setting the font of a StyleRange to a bold one, does not seem to work. Why is that and how do I

Java SWT shell window closing event

江枫思渺然 提交于 2019-12-23 09:33:47
问题 I just have a quick question. How do you override the window closing event for a shell in an swt application? I want the X-Button to simple hide the shell, not close the program. I tried something simple: shell.addListener(SWT.Close, new Listener() { public void handleEvent(Event event) { shell.setVisible(false); } }); Still terminates the program. Thanks in advance. 回答1: You could try shell.addListener(SWT.Close, new Listener() { public void handleEvent(Event event) { event.doit = false; } }

Change the order of element in RowLayout SWT Java

别说谁变了你拦得住时间么 提交于 2019-12-23 09:32:19
问题 Is there a way to change the order of the elements which are created in Row layout , I want to display it in the elements as first in first displayed. For example if I create element1 ,then element2 element3, element4 I want to see the layout as element4 element3 element2 element1 that mean the elements that last to be created will be the first element which will be displayed in the shell. Is there easy way to work with the row layout and do it. I want to change the following example to

JFace/SWT: Change the labels for buttons in InputDialog

一世执手 提交于 2019-12-23 07:47:43
问题 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

Changes not reflecting after Editing tree in SWT

强颜欢笑 提交于 2019-12-23 06:07:16
问题 I have a tree in SWT, to which I have added a edit listener as below - private void addEditListener() { final TreeEditor editor = new TreeEditor(tree); editor.horizontalAlignment = SWT.LEFT; editor.grabHorizontal = true; tree.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent event) { // Make sure one and only one item is selected when F2 is // pressed if (event.keyCode == SWT.F2 && tree.getSelectionCount() == 1) { // Create a text field to do the editing final Text text = new

Changes not reflecting after Editing tree in SWT

℡╲_俬逩灬. 提交于 2019-12-23 06:07:08
问题 I have a tree in SWT, to which I have added a edit listener as below - private void addEditListener() { final TreeEditor editor = new TreeEditor(tree); editor.horizontalAlignment = SWT.LEFT; editor.grabHorizontal = true; tree.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent event) { // Make sure one and only one item is selected when F2 is // pressed if (event.keyCode == SWT.F2 && tree.getSelectionCount() == 1) { // Create a text field to do the editing final Text text = new

SWT error on OSX with Maven

纵饮孤独 提交于 2019-12-23 04:43:55
问题 I made a sample application where I want to test swt under osx using maven. I've read hundreds of articles and create the display on main thread, but the app throws the same exception. Could you check my pom file and my sample application? pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId

How to load a part of composite keeping others static?

半腔热情 提交于 2019-12-23 04:26:50
问题 I have a form in SWT where I have five different composites based on one parent composite.Each of the composite contains different widgets like a single textbox / a combo box / a combination of text and combo etc. Now the problem is when I click on the button I want to change my third composite to carry a different widget keeping others static.Now I can't reload from the beginning as I want current values of the other widgets to be displayed.How can I fetch only that composite,dispose it and

MQ Explorer - Could not load SWT library

ⅰ亾dé卋堺 提交于 2019-12-23 04:15:22
问题 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