Bug 310199 Need logic to grant focus to parts when their tab item has been selected
Build Id: I20100421-2055 I'm not sure why, but I noticed that in e4 on the macosx-cocoa, selecting an element often causes a blue focus halo to appear. It's a bit ugly.
examples/org.eclipse.e4.demo.e4photo/src/org/eclipse/e4/demo/e4photo/Thumbnails.java
private volatile Runnable runnable;
	private final IStylingEngine stylingEngine;
	@Inject
	private ESelectionService selectionService;
	@Inject
	public Thumbnails(Composite parent, 
			ISchedulingExecutor backgroundRunner, IStylingEngine stylingEngine) {
		this.stylingEngine = stylingEngine;
		parent.setLayout(new FillLayout());
		gallery = new Gallery(parent, SWT.V_SCROLL | SWT.MULTI);
		gallery.setData("org.eclipse.e4.ui.css.id", "thumbnails");
		gallery.setGroupRenderer(new NoGroupRenderer());
		DefaultGalleryItemRenderer ir = new DefaultGalleryItemRenderer();
		ir.setShowLabels(false);
		ir.setDropShadowsSize(0);
		ir.setShowRoundedSelectionCorners(false);
		gallery.setItemRenderer(ir);
		group = new GalleryItem(gallery, SWT.NONE);
		group.setExpanded(true);
		gallery.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				Object data = e.item.getData();
				selectionService.setSelection(data);
			}
		});
	}
	private Point getBestSize(int originalX, int originalY, int maxX, int maxY) {
		double widthRatio = (double) originalX / (double) maxX;
		double heightRatio = (double) originalY / (double) maxY;
		double bestRatio = widthRatio > heightRatio ? widthRatio : heightRatio;