/** * This is a callback that will allow us to create the viewer and initialize * it. */ @Override public void createPartControl(Composite parent) { Optional<Model> m = ModelRegistryPlugin.getModelRegistry().getActiveTaxonomy(); contentProvider = new ViewContentProvider(viewer); viewer = new ContainerCheckedTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); viewer.setContentProvider(contentProvider); viewer.setLabelProvider(new DefaultEObjectLabelProvider()); viewer.addCheckStateListener(this); viewer.setSorter(null); if(m.isPresent()){ viewer.setInput(m.get()); } viewer.expandAll(); getSite().setSelectionProvider(viewer); // Create the help context id for the viewer's control PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "de.tudresden.slr.model.taxonomy.ui.viewer"); getSite().getWorkbenchWindow().getSelectionService().addPostSelectionListener(this); }
public Class<? extends ILabelProvider> bindILabelProvider() { return DefaultEObjectLabelProvider.class; }