Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 491218 - SWT GTK3 Group does not show ControlDecoration
Summary: SWT GTK3 Group does not show ControlDecoration
Status: CLOSED DUPLICATE of bug 478618
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.6   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-07 05:21 EDT by Martin Platter CLA
Modified: 2016-04-07 10:21 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Platter CLA 2016-04-07 05:21:06 EDT
On a Fedora 23, GNOME 3.18.2 the ControlDecoration Image is not shown on a Group. The same code work on a Composite.


import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.jface.fieldassist.FieldDecoration;
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

public class SWTGTKGroup {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Display display = new Display();

		Shell s = testCase();
		s.open();
		while (!s.isDisposed()) {
			if( !display.readAndDispatch() ) {
				 display.sleep();
			}
		}
	}

	private static Shell testCase() {
		Shell parent = new Shell(Display.getCurrent(), SWT.DIALOG_TRIM);
		parent.setLayout(new FillLayout());
		{
			Composite g = new Composite(parent, SWT.BORDER);
			g.setLayout(new GridLayout(2, false));

			Label l = new Label(g, SWT.NONE);
			l.setText("Hi");

			Text t = new Text(g, SWT.BORDER);
			GridData gd = new GridData(GridData.FILL_HORIZONTAL);
			gd.horizontalIndent = 8;
			t.setLayoutData(gd);

			ControlDecoration controlDecoration = new ControlDecoration(t, SWT.LEFT | SWT.CENTER);
			FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault()
					.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
			controlDecoration.setImage(fieldDecoration.getImage());
			controlDecoration.show();
		}
		{
			Composite g = new Group(parent, SWT.BORDER);
			g.setLayout(new GridLayout(2, false));

			Label l = new Label(g, SWT.NONE);
			l.setText("Hi");

			Text t = new Text(g, SWT.BORDER);
			GridData gd = new GridData(GridData.FILL_HORIZONTAL);
			gd.horizontalIndent = 8;
			t.setLayoutData(gd);

			ControlDecoration controlDecoration = new ControlDecoration(t, SWT.LEFT | SWT.CENTER);
			FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault()
					.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
			controlDecoration.setImage(fieldDecoration.getImage());
			controlDecoration.show();
		}

		return parent;
	}

}
Comment 1 Eric Williams CLA 2016-04-07 08:23:42 EDT
Would you be able to try yesterday's nightly build? There was a fix for bug 478618 which deals with this case.

You can download the build here:
http://download.eclipse.org/eclipse/downloads/drops4/N20160406-2000/
Comment 2 Martin Platter CLA 2016-04-07 10:21:27 EDT
It works with the nightly.
Thank you

*** This bug has been marked as a duplicate of bug 478618 ***