public void connect(IDocument document) { if(delegate != null) { delegate.connect(document); } }
@Override public void addAnnotationModel(Object key, IAnnotationModel attachment) { Assert.isNotNull(attachment); if (!fAttachments.containsValue(attachment)) { fAttachments.put(key, attachment); for (int i= 0; i < fOpenConnections; i++) attachment.connect(fDocument); attachment.addAnnotationModelListener(fModelListener); } }
@Override public void addAnnotationModel(Object key, IAnnotationModel attachment) { Assert.isNotNull(attachment); if (!fAttachments.containsValue(attachment)) { fAttachments.put(key, attachment); for (int i= 0; i < fOpenConnections; i++) attachment.connect(fDocument); attachment.addAnnotationModelListener(fModelListener); } }
@Override protected void connected() { super.connected(); if (fAnnotationModel != null) fAnnotationModel.connect(fDocument); }
@Override protected void connected() { super.connected(); if (fAnnotationModel != null) fAnnotationModel.connect(fDocument); }
protected void connected() { super.connected(); if (fAnnotationModel != null) fAnnotationModel.connect(fDocument); }
protected void connected() { super.connected(); if (fAnnotationModel != null) fAnnotationModel.connect(fDocument); }
public IAnnotationModel getAnnotationModel() { synchronized (fAnnotationModelCreationLock) { if (fAnnotationModel == null && !isDisconnected()) { fAnnotationModel= fManager.createAnnotationModel(fFile); if (fAnnotationModel != null) fAnnotationModel.connect(fDocument); } } return fAnnotationModel; }
@Override public IAnnotationModel getAnnotationModel() { synchronized (fAnnotationModelCreationLock) { if (fAnnotationModel == null && !isDisconnected()) { fAnnotationModel= getManager().createAnnotationModel(fFile); if (fAnnotationModel != null) fAnnotationModel.connect(fDocument); } } return fAnnotationModel; }
@Override public IAnnotationModel getAnnotationModel() { synchronized (fAnnotationModelCreationLock) { if (fAnnotationModel == null && !isDisconnected()) { fAnnotationModel= fManager.createAnnotationModel(getLocationOrName(), LocationKind.LOCATION); if (fAnnotationModel != null) fAnnotationModel.connect(fDocument); } } return fAnnotationModel; }
public IAnnotationModel getAnnotationModel() { synchronized (fAnnotationModelCreationLock) { if (fAnnotationModel == null && !isDisconnected()) { fAnnotationModel= fManager.createAnnotationModel(getLocationOrName(), LocationKind.LOCATION); if (fAnnotationModel != null) fAnnotationModel.connect(fDocument); } } return fAnnotationModel; }
@Override public void connect(IDocument document) { Assert.isTrue(fDocument == null || fDocument == document); if (fDocument == null) { fDocument= document; Iterator<Position> e= getAnnotationMap().valuesIterator(); while (e.hasNext()) try { addPosition(document, e.next()); } catch (BadLocationException x) { // ignore invalid position } } ++ fOpenConnections; if (fOpenConnections == 1) { document.addDocumentListener(fDocumentListener); connected(); } for (Iterator<Object> it= fAttachments.keySet().iterator(); it.hasNext();) { IAnnotationModel model= fAttachments.get(it.next()); model.connect(document); } }
@Override public void connect(IDocument document) { Assert.isTrue(fDocument == null || fDocument == document); if (fDocument == null) { fDocument= document; Iterator<Position> e= getAnnotationMap().valuesIterator(); while (e.hasNext()) try { addPosition(document, e.next()); } catch (BadLocationException x) { // ignore invalid position } } ++ fOpenConnections; if (fOpenConnections == 1) { document.addDocumentListener(fDocumentListener); connected(); } for (IAnnotationModel model : fAttachments.values()) { model.connect(document); } }
private void initializeDocumentProvider() throws CoreException { fDocumentProvider.connect(fEditorInput); IAnnotationModel amodel = fDocumentProvider.getAnnotationModel(fEditorInput); if (amodel != null) { amodel.connect(fDocumentProvider.getDocument(fEditorInput)); } fDocumentProvider.addElementStateListener(fElementListener); }
/** * Connect the CompilationUnitDocumentProvider to the * * @input and connect the annotation model from the provider to the IDocument of the * @input. */ protected void connect(IEditorInput input, ICompilationUnit cu) throws CoreException { if (input != null && javaWorkingCopyManager != null && cuDocumentProvider != null ) { javaWorkingCopyManager.connect(input); getEditorInputs().put(cu, input); IDocument doc = cuDocumentProvider.getDocument(input); if (doc != null && cuDocumentProvider.getAnnotationModel(input)!= null) cuDocumentProvider.getAnnotationModel(input).connect(doc); } }
@Override public void setDocument(IDocument document, IAnnotationModel annotationModel, int modelRangeOffset, int modelRangeLength) { disposeVisualAnnotationModel(); if (annotationModel != null && document != null) { this.fVisualAnnotationModel= createVisualAnnotationModel(annotationModel); // Make sure the visual model uses the same lock as the underlying model if (annotationModel instanceof ISynchronizable && this.fVisualAnnotationModel instanceof ISynchronizable) { ISynchronizable sync= (ISynchronizable)this.fVisualAnnotationModel; sync.setLockObject(((ISynchronizable)annotationModel).getLockObject()); } this.fVisualAnnotationModel.connect(document); } if (modelRangeOffset == -1 && modelRangeLength == -1) super.setDocument(document); else super.setDocument(document, modelRangeOffset, modelRangeLength); }
@Override public void setDocument(IDocument document, IAnnotationModel annotationModel, int modelRangeOffset, int modelRangeLength) { disposeVisualAnnotationModel(); if (annotationModel != null && document != null) { fVisualAnnotationModel= createVisualAnnotationModel(annotationModel); // Make sure the visual model uses the same lock as the underlying model if (annotationModel instanceof ISynchronizable && fVisualAnnotationModel instanceof ISynchronizable) { ISynchronizable sync= (ISynchronizable)fVisualAnnotationModel; sync.setLockObject(((ISynchronizable)annotationModel).getLockObject()); } fVisualAnnotationModel.connect(document); } if (modelRangeOffset == -1 && modelRangeLength == -1) super.setDocument(document); else super.setDocument(document, modelRangeOffset, modelRangeLength); if (fVerticalRuler != null) fVerticalRuler.setModel(fVisualAnnotationModel); if (fOverviewRuler != null) fOverviewRuler.setModel(fVisualAnnotationModel); }
@Override public void setDocument(IDocument document, IAnnotationModel annotationModel, int modelRangeOffset, int modelRangeLength) { disposeVisualAnnotationModel(); if (annotationModel != null && document != null) { fVisualAnnotationModel= createVisualAnnotationModel(annotationModel); // Make sure the visual model uses the same lock as the underlying model if (annotationModel instanceof ISynchronizable && fVisualAnnotationModel instanceof ISynchronizable) { ISynchronizable sync= (ISynchronizable)fVisualAnnotationModel; sync.setLockObject(((ISynchronizable)annotationModel).getLockObject()); } fVisualAnnotationModel.connect(document); } if (modelRangeOffset == -1 && modelRangeLength == -1) super.setDocument(document); else super.setDocument(document, modelRangeOffset, modelRangeLength); if (fVerticalRuler != null) fVerticalRuler.setModel(fVisualAnnotationModel); if (fOverviewRuler != null) fOverviewRuler.setModel(fVisualAnnotationModel); }
amodel.connect(fDocumentProvider.getDocument(fEditorInput)); fDocumentProvider.addElementStateListener(fElementListener); } catch (CoreException e) {
public void createPartControl(Composite parent) { super.createPartControl(parent); if(annotationModel != null) { if(annotationModel instanceof CompilationUnitAnnotationModelWrapper) { ((CompilationUnitAnnotationModelWrapper)annotationModel).setDelegate(getSourceViewer().getAnnotationModel()); } if(fGlobalAnnotationModelListener == null) { fGlobalAnnotationModelListener = new CompilationUnitAnnotationModelWrapper.GlobalAnnotationModelListener(); fGlobalAnnotationModelListener.addListener(JavaPlugin.getDefault().getProblemMarkerManager()); } annotationModel.addAnnotationModelListener(fGlobalAnnotationModelListener); IDocument document = getDocumentProvider().getDocument(getEditorInput()); ISourceViewer sourceViewer= getSourceViewer(); sourceViewer.setDocument(document, annotationModel); IAnnotationModel model = getDocumentProvider().getAnnotationModel(getEditorInput()); if(model != null) { // this is null in a linked source folder due to an eclipse bug.. model.connect(document); } } }