Bug 263544 [context] Add dependency injection context -> user object
examples/org.eclipse.e4.demo.e4photo/src/org/eclipse/e4/demo/e4photo/Thumbnails.java
parent.setLayout(new FillLayout());
		gallery = new Gallery(parent, SWT.V_SCROLL | SWT.MULTI);
		gallery.setData("id", "thumbnails");
		Image itemImage = new Image(parent.getDisplay(), Program.findProgram(
				"jpg").getImageData());
		gallery.setGroupRenderer(new NoGroupRenderer());
		DefaultGalleryItemRenderer ir = new DefaultGalleryItemRenderer();
		ir.setShowLabels(false);
		ir.setDropShadowsSize(0);
		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();
				Thumbnails.this.selectionService.setValue(data);
			}
		});
	}
	public Class getInputType() {
		return IContainer.class;
	}
	
	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;
		int newWidth = (int) ((double) originalX / bestRatio);
		int newHeight = (int) ((double) originalY / bestRatio);