use of eu.esdihumboldt.hale.ui.views.resources.internal.ResourcesContentProvider in project hale by halestudio.
the class ResourcesView method createViewControl.
@Override
protected void createViewControl(Composite parent) {
viewer = new TreeViewer(parent);
viewer.setContentProvider(new ResourcesContentProvider());
viewer.setLabelProvider(new ResourcesLabelProvider());
ProjectService ps = PlatformUI.getWorkbench().getService(ProjectService.class);
ps.addListener(projectServiceListener = new ProjectServiceAdapter() {
@Override
public void resourceAdded(String actionId, Resource resource) {
updateInDisplayThread();
}
@Override
public void resourcesRemoved(String actionId, List<Resource> resources) {
updateInDisplayThread();
}
@Override
public void afterLoad(ProjectService projectService) {
updateInDisplayThread();
}
@Override
public void projectInfoChanged(ProjectInfo info) {
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
viewer.update(ProjectToken.TOKEN, null);
}
});
}
});
viewer.setUseHashlookup(true);
viewer.setAutoExpandLevel(3);
update();
new ViewerMenu(getSite(), viewer);
getSite().setSelectionProvider(viewer);
}
Aggregations