Java 类org.eclipse.xtext.ui.editor.outline.impl.OutlinePage 实例源码

项目:n4js    文件:AbstractOutlineWorkbenchTest.java   
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);
}
项目:n4js    文件:SyncableOutlinePage.java   
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();
    }
}
项目:n4js    文件:SyncableOutlinePage.java   
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();
}
项目:bts    文件:SortOutlineContribution.java   
@Override
public void register(OutlinePage outlinePage) {
    super.register(outlinePage);
    outlineFilterAndSorter = outlinePage.getFilterAndSorter();
    this.treeViewer = outlinePage.getTreeViewer();
    outlineFilterAndSorter.setComparator(comparator);
}
项目:bts    文件:OutlineWithEditorLinker.java   
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);
}
项目:bts    文件:LinkWithEditorOutlineContribution.java   
@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);
}
项目:bts    文件:LinkWithEditorOutlineContribution.java   
@Override
public void deregister(OutlinePage outlinePage) {
    super.deregister(outlinePage);
    OutlineWithEditorLinker outlineWithEditorLinker = page2linker.remove(outlinePage);
    if (outlineWithEditorLinker != null) {
        outlineWithEditorLinker.deactivate();
        preferenceStore.removePropertyChangeListener(outlineWithEditorLinker);
    }
}
项目:bts    文件:IOutlineContribution.java   
public void register(OutlinePage outlinePage) {
    for(IOutlineContribution contribution: contributions)
        contribution.register(outlinePage);
    TreeViewer treeViewer = outlinePage.getTreeViewer();
    if(!treeViewer.getTree().isDisposed()) 
        treeViewer.refresh();
}
项目:bts    文件:AbstractFilterOutlineContribution.java   
@Override
public void register(OutlinePage outlinePage) {
    super.register(outlinePage);
    outlineFilterAndSorter = outlinePage.getFilterAndSorter();
    outlineFilterAndSorter.addFilter(getFilter());
    treeViewer = outlinePage.getTreeViewer();
}
项目:bts    文件:AbstractFilterOutlineContribution.java   
@Override
public void deregister(OutlinePage outlinePage) {
    super.deregister(outlinePage);
    if (filter != null) {
        outlineFilterAndSorter.removeFilter(getFilter());
        filter = null;
    }
    outlineFilterAndSorter = null;
    treeViewer = null;
}
项目:CooperateModelingEnvironment    文件:FlatOutlineViewContribution.java   
@Override
public void register(OutlinePage outlinePage) {
    super.register(outlinePage);
    outlineFilterAndSorter = outlinePage.getFilterAndSorter();
    outlineFilterAndSorter.addFilter(getFilter());
    treeViewer = outlinePage.getTreeViewer();
}
项目:CooperateModelingEnvironment    文件:FlatOutlineViewContribution.java   
@Override
public void deregister(OutlinePage outlinePage) {
    super.deregister(outlinePage);
    if (filter != null) {
        outlineFilterAndSorter.removeFilter(getFilter());
        filter = null;
    }
    outlineFilterAndSorter = null;
    treeViewer = null;
}
项目:xsemantics    文件:AbstractOutlineWorkbenchTest.java   
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;
}
项目:n4js    文件:SyncableOutlinePage.java   
SyncableOutlinePage(OutlinePage page) {
    this.page = page;
}
项目:bts    文件:DefaultUiModule.java   
public Class<? extends IContentOutlinePage> bindIContentOutlinePage() {
    return OutlinePage.class;
}
项目:bts    文件:SortOutlineContribution.java   
@Override
public void deregister(OutlinePage outlinePage) {
    outlineFilterAndSorter = null;
    treeViewer = null;
    super.deregister(outlinePage);
}
项目:bts    文件:AbstractToggleOutlineContribution.java   
public void register(OutlinePage outlinePage) {
    IToolBarManager toolBarManager = outlinePage.getSite().getActionBars().getToolBarManager();
    toolBarManager.add(getAction());
    addPropertyChangeListener();
}
项目:bts    文件:AbstractToggleOutlineContribution.java   
public void deregister(OutlinePage outlinePage) {
    removePropertyChangeListener();
}
项目:bts    文件:IOutlineContribution.java   
public void deregister(OutlinePage outlinePage) {
    for(IOutlineContribution contribution: contributions)
        contribution.deregister(outlinePage);
}
项目:PHDL    文件:ExpandToggleOutlineContribution.java   
@Override
public void deregister(OutlinePage outlinePage) {
    super.deregister(outlinePage);
}
项目:PHDL    文件:ExpandToggleOutlineContribution.java   
@Override
public void register(OutlinePage outlinePage) {
    super.register(outlinePage);
    treeViewer = outlinePage.getTreeViewer();
}
项目:bts    文件:IOutlineContribution.java   
void register(OutlinePage outlinePage);
项目:bts    文件:IOutlineContribution.java   
void deregister(OutlinePage outlinePage);