Bug 263544 [context] Add dependency injection context -> user object
examples/org.eclipse.e4.demo.e4photo/src/org/eclipse/e4/demo/e4photo/Preview.java
public void controlResized(ControlEvent e) {
				final Point newSize = parent.getSize();
				bgRealm.asyncExec(new Runnable() {
					public void run() {
						parentSize.setValue(newSize);
					}
				});
			}
		});
	}
	public Class getInputType() {
		return IFile.class;
	}
	public void setInput(final Object input) {
		bgRealm.asyncExec(new Runnable() {
			public void run() {
				inputFile.setValue(input);
			}
		});
	}
	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) - (frameWidth * 2);
		int newHeight = (int) ((double) originalY / bestRatio)  - (topImageMargin + bottomImageMargin + (frameWidth * 2));
		return new Point(newWidth, newHeight);
	}
}