private IDocument getElementDocument(char type, Object element) { if (element instanceof IDocument) { return (IDocument) element; } ITypedElement te= Utilities.getLeg(type, element); // First check the contributors for the document IDocument document = null; switch (type) { case ANCESTOR_CONTRIBUTOR: document = getDocument(te, fAncestorContributor); break; case LEFT_CONTRIBUTOR: document = getDocument(te, fLeftContributor); break; case RIGHT_CONTRIBUTOR: document = getDocument(te, fRightContributor); break; default: break; } if (document != null) return document; // The document is not associated with the input of the viewer so try to find the document return Utilities.getDocument(type, element, isUsingDefaultContentProvider(), canHaveSharedDocument()); }
private IDocument getElementDocument(char type, Object element) { if (element instanceof IDocument) { return (IDocument) element; } ITypedElement te= Utilities.getLeg(type, element); // First check the contributors for the document IDocument document = null; switch (type) { case ANCESTOR_CONTRIBUTOR: document = getDocument(te, fAncestorContributor); break; case LEFT_CONTRIBUTOR: document = getDocument(te, fLeftContributor); break; case RIGHT_CONTRIBUTOR: document = getDocument(te, fRightContributor); break; } if (document != null) return document; // The document is not associated with the input of the viewer so try to find the document return Utilities.getDocument(type, element, isUsingDefaultContentProvider(), canHaveSharedDocument()); }