Skip to content

Tag: swt

How do I write a JUnit test for a custom SWT-Column-Ratio-Layout?

I found a custom SWT-Column-Ratio Layout on the internet which puts the children of a composite/control into a user-defined ratio. Unfortunately I cannot find the source of the implementation of the Column-Ratio Layout, but here’s how the code looks like: I want to test this layout. I am writing a JUnit test to test if the ratio is true when

SWT Labels not displaying after disposal and recreation

In the following code, clicking on one of the three display list buttons will first dispose of any labels in a composite and then create labels for each row in a list of Strings. The problem is that if you click on the same button a second time the text all dispersal. When you switch to one of the other

How can I create a checkbox in a TableViewer of JFace?

I have created a tableViewer with two columns and I want to make one of them a checkbox. To do that I have created a CheckBoxCellEditor, but I don´t know why it isn´t working. The column called tableName displays it´s values OK. The column specification is the following. And the EditingSupport is the following: The TableMetaData object decides if the

Java SWT make a Label Scrollable

I have a Label in a Group in SWT and if it contains many lines of text, I would like to make it scrollable vertically. Setting the style parameter with SWT.V_SCROLL doesn’t seem to do it. How can I do …