Java Code Examples for org.eclipse.xtext.ui.editor.outline.impl.OutlinePage#getTreeViewer()

The following examples show how to use org.eclipse.xtext.ui.editor.outline.impl.OutlinePage#getTreeViewer() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SortOutlineContribution.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void register(OutlinePage outlinePage) {
	super.register(outlinePage);
	outlineFilterAndSorter = outlinePage.getFilterAndSorter();
	this.treeViewer = outlinePage.getTreeViewer();
	outlineFilterAndSorter.setComparator(comparator);
}
 
Example 2
Source File: OutlineWithEditorLinker.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
public void activate(OutlinePage outlinePage) {
	this.outlinePage = outlinePage;
	treeViewer = outlinePage.getTreeViewer();
	treeListener = new TreeListener();
	treeViewer.addPostSelectionChangedListener(treeListener);
	treeViewer.addDoubleClickListener(treeListener);
	textViewer = outlinePage.getSourceViewer();
	textListener = new TextListener();
	ISelectionProvider textSelectionProvider = textViewer.getSelectionProvider();
	if (textSelectionProvider instanceof IPostSelectionProvider)
		((IPostSelectionProvider) textSelectionProvider).addPostSelectionChangedListener(textListener);
	else
		textSelectionProvider.addSelectionChangedListener(textListener);
}
 
Example 3
Source File: IOutlineContribution.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void register(OutlinePage outlinePage) {
	for(IOutlineContribution contribution: contributions)
		contribution.register(outlinePage);
	TreeViewer treeViewer = outlinePage.getTreeViewer();
	if(!treeViewer.getTree().isDisposed()) 
		treeViewer.refresh();
}
 
Example 4
Source File: AbstractFilterOutlineContribution.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void register(OutlinePage outlinePage) {
	super.register(outlinePage);
	outlineFilterAndSorter = outlinePage.getFilterAndSorter();
	outlineFilterAndSorter.addFilter(getFilter());
	treeViewer = outlinePage.getTreeViewer();
}
 
Example 5
Source File: AbstractOutlineWorkbenchTest.java    From xsemantics with Eclipse Public License 1.0 5 votes vote down vote up
protected TreeViewer getOutlineTreeViewer() throws PartInitException {
	document = editor.getDocument();
	outlineView = editor.getEditorSite().getPage()
			.showView("org.eclipse.ui.views.ContentOutline");
	executeAsyncDisplayJobs();
	Object adapter = editor.getAdapter(IContentOutlinePage.class);
	assertTrue(adapter instanceof OutlinePage);
	outlinePage = (OutlinePage) adapter;
	TreeViewer treeViewer = outlinePage.getTreeViewer();

	awaitForTreeViewer(treeViewer);

	assertTrue(treeViewer.getInput() instanceof IOutlineNode);
	return treeViewer;
}
 
Example 6
Source File: HideReturnTypesContribution.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void register(OutlinePage outlinePage) {
	super.register(outlinePage);
	this.treeViewer= outlinePage.getTreeViewer();
}