/** * Return the document key used to obtain a shared document. A <code>null</code> * is returned in the following cases: * <ol> * <li>This contributor does not have a shared document adapter.</li> * <li>This text merge viewer has a document partitioner but uses the default partitioning.</li> * <li>This text merge viewer does not use he default content provider.</li> * </ol> * @return the document key used to obtain a shared document or <code>null</code> */ private IEditorInput getDocumentKey() { if (fDocumentKey != null) return fDocumentKey; if (isUsingDefaultContentProvider() && fElement != null && canHaveSharedDocument()) { ISharedDocumentAdapter sda = (ISharedDocumentAdapter)Utilities.getAdapter(fElement, ISharedDocumentAdapter.class, true); if (sda != null) { return sda.getDocumentKey(fElement); } } return null; }
/** * Return the document key used to obtain a shared document. A <code>null</code> * is returned in the following cases: * <ol> * <li>This contributor does not have a shared document adapter.</li> * <li>This text merge viewer has a document partitioner but uses the default partitioning.</li> * <li>This text merge viewer does not use he default content provider.</li> * </ol> * @return the document key used to obtain a shared document or <code>null</code> */ private IEditorInput getDocumentKey() { if (fDocumentKey != null) return fDocumentKey; if (isUsingDefaultContentProvider() && fElement != null && canHaveSharedDocument()) { ISharedDocumentAdapter sda = Adapters.adapt(fElement, ISharedDocumentAdapter.class); if (sda != null) { return sda.getDocumentKey(fElement); } } return null; }
private boolean canHaveSharedDocument() { return fViewer.canHaveSharedDocument(); }
private boolean canHaveSharedDocument() { return fViewer.canHaveSharedDocument(); }