Package org.eclipse.ui.texteditor

Examples of org.eclipse.ui.texteditor.IDocumentProvider


    return getDocument(getActiveEditor());
  }
 
  public static IDocument getDocument(IEditorPart editor) {
    if (editor != null) {
      IDocumentProvider dp = null;
      if (editor instanceof ITextEditor)
        dp = ((ITextEditor) editor).getDocumentProvider();
     
      if (dp == null)
        dp = DocumentProviderRegistry.getDefault().getDocumentProvider(editor.getEditorInput());
     
      if (dp != null)
        return (IDocument) dp.getDocument(editor.getEditorInput());
    }
   
    return null;
  }
View Full Code Here


    final RunScript runScript = context.mock(RunScript.class);
    final IFile file = context.mock(IFile.class);
    final IWorkbenchWindow window = context.mock(IWorkbenchWindow.class);
    final ITextEditor editor = context.mock(ITextEditor.class);
    final IFileEditorInput editorInput = context.mock(IFileEditorInput.class);
    final IDocumentProvider documentProvider = context.mock(IDocumentProvider.class);
    final IDocument document = context.mock(IDocument.class);
   
    ExecutionEvent event = new ExecutionEvent();
    final String contents = "contents";
    final String filename = "filename";
View Full Code Here

                .getAdapter(ProjectionAnnotationModel.class);
        if (model == null) {
            return;
        }

        final IDocumentProvider provider = fEditor.getDocumentProvider();

        try {
            fCachedModel = model;
            fCachedDocument = provider.getDocument(fEditor.getEditorInput());
            if (fCachedDocument.getNumberOfLines() > PerformanceTuning.get()
                    .getFoldingLimit()) {
                // disable folding for files larger than this
                model.removeAllAnnotations();
                return;
View Full Code Here

    @Override
    public void elementChanged(final IErlElement element) {
        if (fEditor == null) {
            return;
        }
        final IDocumentProvider provider = fEditor.getDocumentProvider();
        if (provider == null) {
            return;
        }
        final IEditorInput input = fEditor.getEditorInput();
        if (input == null) {
            return;
        }
        fCachedDocument = provider.getDocument(input);
        if (fCachedDocument == null) {
            return;
        }
        // fFirstType= null;
        // fHasHeaderComment = false;
View Full Code Here

    void removeOccurrenceAnnotations() {
        fMarkOccurrenceModificationStamp = IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP;
        fMarkOccurrenceTargetRegion = null;

        final IDocumentProvider documentProvider = editor.getDocumentProvider();
        if (documentProvider == null) {
            return;
        }

        final IAnnotationModel annotationModel = documentProvider
                .getAnnotationModel(editor.getEditorInput());
        if (annotationModel == null || fOccurrenceAnnotations == null) {
            return;
        }
View Full Code Here

            final IDocument document = textViewer.getDocument();
            if (document == null) {
                return Status.CANCEL_STATUS;
            }

            final IDocumentProvider documentProvider = editor.getDocumentProvider();
            if (documentProvider == null) {
                return Status.CANCEL_STATUS;
            }

            final IAnnotationModel annotationModel = documentProvider
                    .getAnnotationModel(editor.getEditorInput());
            if (annotationModel == null) {
                return Status.CANCEL_STATUS;
            }
View Full Code Here

            final ISourceViewer sourceViewer = editor.getViewer();
            if (sourceViewer != null) {
                sourceViewer.removeTextInputListener(this);
            }

            final IDocumentProvider documentProvider = editor.getDocumentProvider();
            if (documentProvider != null) {
                final IDocument document = documentProvider.getDocument(editor
                        .getEditorInput());
                if (document != null) {
                    document.removeDocumentListener(this);
                }
            }
View Full Code Here

        }
    }

    @Override
    protected void doSetInput(final IEditorInput input) throws CoreException {
        final IDocumentProvider provider = getDocumentProvider();
        if (input != getEditorInput()) {
            disposeModule();
            resetReconciler();
        }

        super.doSetInput(input);

        final IDocument document = provider.getDocument(input);
        if (!(input instanceof IPathEditorInput) && document != null) {
            final ErlangDocumentSetupParticipant setupParticipant = new ErlangDocumentSetupParticipant();
            setupParticipant.setup(document);
        }
View Full Code Here

    try {
      Object _xblockexpression = null;
      {
        if ((element instanceof ISourceReference)) {
          final ISourceRange range = ((ISourceReference)element).getSourceRange();
          IDocumentProvider _documentProvider = editor.getDocumentProvider();
          IEditorInput _editorInput = editor.getEditorInput();
          IDocument _document = _documentProvider.getDocument(_editorInput);
          int _offset = range.getOffset();
          int _length = range.getLength();
          final String elementText = _document.get(_offset, _length);
          String _name = openResult.getName();
          return this.modelFindService.findVariable(range, _name, elementText);
View Full Code Here

    public boolean isDirty() {
        return false;
    }

    public void markCall() {
        final IDocumentProvider documentProvider = getDocumentProvider();
        final IAnnotationModel annotationModel = documentProvider
                .getAnnotationModel(getEditorInput());

        final ITextSelection pos = (ITextSelection) getSelectionProvider().getSelection();
        final MarkCallLocation location = new MarkCallLocation(getSourceViewer()
                .getDocument(), pos.getStartLine());
View Full Code Here

TOP

Related Classes of org.eclipse.ui.texteditor.IDocumentProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.