/** * the resource path to the resource of this outline item * * @param resourcePath * the resource path, or null if it's unknown. */ public void setResourcePath(String resourcePath) { if (getParent() != null) { getParent().setResourcePath(resourcePath); } else { this.resourcePath = resourcePath; } }
@Override protected void doSetInput(IEditorInput input) throws CoreException { super.doSetInput(input); updateDocument(); IFile file = getFile(); if (sourceViewerConfiguration != null) { sourceViewerConfiguration.setFile(file); } initializeMarkupLanguage(input); outlineModel.setResourcePath(file == null ? null : file.getFullPath().toString()); }
private void updateOutline(int contentGeneration, OutlineItem rootItem) { if (getSourceViewer().getTextWidget().isDisposed()) { return; } synchronized (this) { if (contentGeneration != documentGeneration) { return; } } outlineDirty = false; outlineModel.clear(); outlineModel.moveChildren(rootItem); IFile file = (IFile) getAdapter(IFile.class); outlineModel.setResourcePath(file == null ? null : file.getFullPath().toString()); firePropertyChange(PROP_OUTLINE); }
private void updateOutline(int contentGeneration, OutlineItem rootItem) { if (!isSourceViewerValid()) { return; } synchronized (this) { if (contentGeneration != documentGeneration) { return; } } outlineDirty = false; outlineModel.clear(); outlineModel.moveChildren(rootItem); IFile file = getFile(); outlineModel.setResourcePath(file == null ? null : file.getFullPath().toString()); if (isOutlinePageValid()) { outlinePage.refresh(); outlinePage.getControl().getDisplay().asyncExec(new Runnable() { public void run() { if (isOutlinePageValid()) { updateOutlineSelection(); } } }); } updateProjectionAnnotations(); }
public Object getInformation2(ITextViewer textViewer, IRegion subject) { if (outline == null) { // If the outline was not set then parse it. This can happen in a task editor if (markupLanguage != null) { IDocument document = textViewer.getDocument(); if (document != null && document.getLength() > 0) { MarkupLanguage language = markupLanguage.clone(); OutlineParser outlineParser = new OutlineParser(); outlineParser.setMarkupLanguage(language.clone()); String markup = document.get(); final OutlineItem outline = outlineParser.parse(markup); if (MarkupSourceViewerConfiguration.this.file != null) { outline.setResourcePath(MarkupSourceViewerConfiguration.this.file.getFullPath().toString()); } return outline; } } } return outline; }