You can now use dependency injection (di) in your Eclipse 3.x. views.You can enable this for a view via the new inject flag in the org.eclipse.ui.views
extension.
public class SampleView extends ViewPart {
@Inject IWorkbench workbench;
private TableViewer viewer;
@Override
public void createPartControl(Composite parent) {
viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
viewer.setContentProvider(ArrayContentProvider.getInstance());
viewer.setInput(new String[] { "One", "Two", "Three" });
viewer.setLabelProvider(new ViewLabelProvider());
// Create the help context id for the viewer's control
workbench.getHelpSystem().setHelp(viewer.getControl(), "test7.viewer");
}
// more stuff
}
I hope that this will help Eclipse IDE extenders to move towards the Eclipse 4.x programming approach.