Bug 296364 [context] The constructors used by the injection mechanism should have @Inject
examples/org.eclipse.e4.demo.e4photo/src/org/eclipse/e4/demo/e4photo/Library.java
public String getText(Object element) {
				if(element instanceof IResource)
					return ((IResource) element).getName();
				return element == null ? "" : element.toString();
			}
		});
		viewer.setSorter(new ViewerSorter());
		viewer.setInput(workspace.getRoot());
		GridLayoutFactory.fillDefaults().generateLayout(parent);
	}
	private void initializeWorkspace() {
		workspace.addResourceChangeListener(listener);
		IEclipsePreferences node = new InstanceScope().getNode(ResourcesPlugin.PI_RESOURCES);
		node.putBoolean(ResourcesPlugin.PREF_AUTO_REFRESH, true);
		try {
			node.flush();
		} catch (BackingStoreException e) {
			
			e.printStackTrace();
		}
	}
	
	public void contextSet(IEclipseContext context) {
		this.context = context;
	}
	public void dispose() {
		workspace.removeResourceChangeListener(listener);
	}
}