swt

How to scroll a scrolled composite using mouse wheels in SWT

孤者浪人 提交于 2019-12-11 02:50:38
问题 I would like to know if it is possible to scroll a ScrolledComposite using mouse wheels. By default it is not working. 回答1: Apparently, it is necessary to create mouse wheel listener for your composite. You can use something like this as the basis: scrolledComposite = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL); GridData scrollGridData = new GridData(SWT.FILL, SWT.FILL, true, true); scrolledComposite.setLayoutData(scrollGridData); layout = new GridLayout(); scrolledComposite

How to align two composites in a parent composite without using widthHint and heightHint

℡╲_俬逩灬. 提交于 2019-12-11 02:43:14
问题 I want two composites (one below the other) inside a parent component. This is how my code looks like: Composite composite = (Composite) super.createDialogArea(parent); Composite rowComposite = new Composite(composite, SWT.NONE); rowComposite.setLayout(new GridLayout(2, false)); GridData gd1 = new GridData(SWT.LEFT, SWT.CENTER, false, false); gd1.widthHint = 760; gd1.heightHint = 240; rowComposite.setLayoutData(gd1); Composite columnComposite = new Composite(composite, SWT.NONE);

JFace - How can I make only one column editable in TreeViewer based on checkbox value from another column in the same row?

穿精又带淫゛_ 提交于 2019-12-11 02:37:23
问题 I have a TreeViewer which has two columns: ProximityClustersColumn : which has names as String, selectionColumn: which has checkbox as shown in the figure TreeViewer I have two questions: On clicking the selection column's checkbox, the corresponding name of ProximityClustersColumn should become editable. For eg: When I click on the checkbox corresponding to "Studium organisieren-Formelles", the cell "Studium organisieren-Formelles" should become editable. Also, as seen in the figure, a check

How to attach data to TreeItem in SWT/Java?

谁说胖子不能爱 提交于 2019-12-11 02:24:34
问题 I'm starting to use the SWT GUI toolkit in Java. I have a need to attach some data to the TreeItems. Each toolkit I've previously used had a tree item, which contained a raw pointer or a base object reference to provide basic data containment, but I cannot find one in TreeItem in SWT. How can I attach data to the TreeItem? 回答1: The answer is: with pure SWT you cant't. The Standard Widget Toolkit only takes care of the widgets, their hierarchy and the visual representation. Binding data to

How to select an element in the ListViewer

↘锁芯ラ 提交于 2019-12-11 02:23:44
问题 I'm trying to find and select an element in the ListViewer , I compare a string with every element in the ListViewer . I can get the index of the element but I don't know how to select it in the Listviewer . String pattern = elementText.gettext(); String[] listViewerValues = mListViewer.getList().getItems(); List<String> valuesList = Arrays.asList(listViewerValues); int index = -1; for(int i=0; i < valuesList.size(); i++) { valuesList.set(i, valuesList.get(i).toLowerCase()); } index =

treeviewer does not deselect the tree item

倾然丶 夕夏残阳落幕 提交于 2019-12-11 02:22:10
问题 I wanted to create dynamic tree struture in my application. There my requirement is When the user selects any tree node and click insert the child should be inserted below the selected parent. That is working fine. Now the problem is i am unable to deselect the currently selected tree item in order to change tree item . I clicked the background of the view and tried to insert a new tree item, but still it goes to the previously selected tree node as still it highlight as the selected one. How

What is the state of SWT to WPF port?

依然范特西╮ 提交于 2019-12-11 02:11:56
问题 A while ago I read about a WPF port of Eclipse and SWT. I can't find any recent information about it. What is the current status of the WPF port? Will it be available before E4? Any other details about the implementation also welcome. 回答1: The Eclipse project has a Windows/WPF implementation of SWT since its 3.3 version. This doesn't mean something like XAML-Support or such things. It simply provides a way to render SWT widgets with WPF instead of the Win32 API. If you're looking for

SWT Load Font in a RCP App

有些话、适合烂在心里 提交于 2019-12-11 02:04:38
问题 Here's what I want to do: Display.getCurrent().loadFont("fonts/helveticaNeueBold_iOS7.ttf") Works in a tester ( i.e. class with entry point ). Doesn't work in an RCP app. How do the loading mechanisms differ? Should I get the ttf file, then extract the path to it? 回答1: Eclipse bundles have different paths (something like "bundleentry://bundle_number/path_to_your_file"). You might want to use FileLocator to load files properly. For example: Bundle bundle = Activator.getDefault().getBundle();

SWT anti-aliasing control shapes

∥☆過路亽.° 提交于 2019-12-11 01:57:48
问题 I have a NO_TRIM shell with rounded corners, created by applying a Region. The problem is, I'd like the edges of the shell to be anti-aliased, which I don't know how to do with applying a Region or any other way. Right now I have this: shell.addPaintListener(new PaintListener() { public void paintControl(PaintEvent e) { setRoundedShape(shell, 10); } }); //... void setRoundedShape(Control control, int r) { Region region = new Region(control.getDisplay()); // ... control.setRegion(region);

Scroll NatTable programmatically

社会主义新天地 提交于 2019-12-11 01:54:19
问题 First question on stackoverflow ;-) Similar question to here, only I am trying to scroll a NAT-Table programmatically. I can neither show a selected Item, nor set a value to the Scrollbar itself (via getHorizontalBar or similar). The internet wields no answers, as far as I could see, and solutions suggested for other swt controls do not seem to apply... 回答1: That depends on what you are trying to achieve. Do you want to select a cell and move it into the viewport, or do you simply want to