protected void openOutlineView() throws PartInitException, InterruptedException { outlineView = editor.getEditorSite().getPage().showView("org.eclipse.ui.views.ContentOutline"); executeAsyncDisplayJobs(); Object adapter = editor.getAdapter(IContentOutlinePage.class); assertTrue(adapter instanceof OutlinePage); outlinePage = new SyncableOutlinePage((OutlinePage) adapter); outlinePage.resetSyncer(); try { outlinePage.waitForUpdate(EXPECTED_TIMEOUT); } catch (TimeoutException e) { System.out.println("Expected timeout exceeded: " + EXPECTED_TIMEOUT);// timeout is OK here } treeViewer = outlinePage.getTreeViewer(); assertSelected(treeViewer); assertExpanded(treeViewer); assertTrue(treeViewer.getInput() instanceof IOutlineNode); IOutlineNode rootNode = (IOutlineNode) treeViewer.getInput(); List<IOutlineNode> children = rootNode.getChildren(); assertEquals(1, children.size()); modelNode = children.get(0); }
public void resetSyncer() throws InterruptedException { try { Method method = OutlinePage.class.getDeclaredMethod("getRefreshJob"); method.setAccessible(true); OutlineRefreshJob refreshPageJob = (OutlineRefreshJob) method.invoke(page); refreshPageJob.join(); syncer.start(); } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { e.printStackTrace(); } }
protected void treeUpdated() { try { Method method = OutlinePage.class.getDeclaredMethod("treeUpdated"); method.setAccessible(true); method.invoke(page); } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { e.printStackTrace(); } syncer.signal(); }
@Override public void register(OutlinePage outlinePage) { super.register(outlinePage); outlineFilterAndSorter = outlinePage.getFilterAndSorter(); this.treeViewer = outlinePage.getTreeViewer(); outlineFilterAndSorter.setComparator(comparator); }
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); }
@Override public void register(OutlinePage outlinePage) { super.register(outlinePage); OutlineWithEditorLinker outlineWithEditorLinker = outlineWithEditorLinkerProvider.get(); outlineWithEditorLinker.activate(outlinePage); outlineWithEditorLinker.setLinkingEnabled(isPropertySet()); preferenceStore = getPreferenceStoreAccess().getPreferenceStore(); preferenceStore.addPropertyChangeListener(outlineWithEditorLinker); page2linker.put(outlinePage, outlineWithEditorLinker); }
@Override public void deregister(OutlinePage outlinePage) { super.deregister(outlinePage); OutlineWithEditorLinker outlineWithEditorLinker = page2linker.remove(outlinePage); if (outlineWithEditorLinker != null) { outlineWithEditorLinker.deactivate(); preferenceStore.removePropertyChangeListener(outlineWithEditorLinker); } }
public void register(OutlinePage outlinePage) { for(IOutlineContribution contribution: contributions) contribution.register(outlinePage); TreeViewer treeViewer = outlinePage.getTreeViewer(); if(!treeViewer.getTree().isDisposed()) treeViewer.refresh(); }
@Override public void register(OutlinePage outlinePage) { super.register(outlinePage); outlineFilterAndSorter = outlinePage.getFilterAndSorter(); outlineFilterAndSorter.addFilter(getFilter()); treeViewer = outlinePage.getTreeViewer(); }
@Override public void deregister(OutlinePage outlinePage) { super.deregister(outlinePage); if (filter != null) { outlineFilterAndSorter.removeFilter(getFilter()); filter = null; } outlineFilterAndSorter = null; treeViewer = null; }
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; }
SyncableOutlinePage(OutlinePage page) { this.page = page; }
public Class<? extends IContentOutlinePage> bindIContentOutlinePage() { return OutlinePage.class; }
@Override public void deregister(OutlinePage outlinePage) { outlineFilterAndSorter = null; treeViewer = null; super.deregister(outlinePage); }
public void register(OutlinePage outlinePage) { IToolBarManager toolBarManager = outlinePage.getSite().getActionBars().getToolBarManager(); toolBarManager.add(getAction()); addPropertyChangeListener(); }
public void deregister(OutlinePage outlinePage) { removePropertyChangeListener(); }
public void deregister(OutlinePage outlinePage) { for(IOutlineContribution contribution: contributions) contribution.deregister(outlinePage); }
@Override public void deregister(OutlinePage outlinePage) { super.deregister(outlinePage); }
@Override public void register(OutlinePage outlinePage) { super.register(outlinePage); treeViewer = outlinePage.getTreeViewer(); }
void register(OutlinePage outlinePage);
void deregister(OutlinePage outlinePage);