Package org.eclipse.core.filebuffers

Examples of org.eclipse.core.filebuffers.ITextFileBufferManager.connect()


    while (iterator.hasNext()) {
      try {
        CompilationUnit cu = iterator.next();
        ITextFileBufferManager bufferManager = FileBuffers.getTextFileBufferManager();
        IPath path = cu.getJavaElement().getPath();
        bufferManager.connect(path, null);

        ITextFileBuffer textFileBuffer = bufferManager.getTextFileBuffer(path);
        IDocument document = textFileBuffer.getDocument();

        TextEdit edit = cu.rewrite(document, javaProject.getOptions(true));
View Full Code Here


    ITextFileBufferManager bufferManager = FileBuffers
        .getTextFileBufferManager();
    IPath path = unit.getJavaElement().getPath();
    try {
      // connect the path
      bufferManager.connect(path, null);

      ITextFileBuffer textFileBuffer = bufferManager.getTextFileBuffer(path);
      // retrieve the buffer
      IDocument document = textFileBuffer
          .getDocument();
View Full Code Here

    ITextFileBufferManager bufferManager = FileBuffers
        .getTextFileBufferManager();
    IPath path = unit.getJavaElement().getPath();
    try {
      // connect the path
      bufferManager.connect(path, null);

      // retrieve the buffer
      IDocument document = bufferManager.getTextFileBuffer(path)
          .getDocument();
View Full Code Here

    IDocument result = null;
    pm.beginTask("", 2); //$NON-NLS-1$
    ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager();
    try {
      IPath path = fCurrentFile.getFullPath();
      manager.connect(path, LocationKind.NORMALIZE, pm);
      ITextFileBuffer buffer = manager.getTextFileBuffer(path, LocationKind.NORMALIZE);
      result = buffer.getDocument();
    } finally {
      if (result != null)
        manager.disconnect(fCurrentFile.getFullPath(), LocationKind.NORMALIZE, pm);
View Full Code Here

                        return;
                }
            }
            ITextFileBufferManager bm = FileBuffers.getTextFileBufferManager();
            try {
                bm.connect(file.getFullPath(), new SubProgressMonitor(pm, 1));
                ITextFileBuffer fb = bm.getTextFileBuffer(file.getFullPath());
                boolean wasDirty = fb.isDirty();
                IDocument doc = fb.getDocument();
                for (int i = 0; i < markers.length; i++) {
                    PositionTracker tracker = InternalSearchUI.getInstance().getPositionTracker();
View Full Code Here

  }

  private void initialize() {
    ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager();
    try {
      manager.connect(fPath, LocationKind.NORMALIZE,
          new NullProgressMonitor());
      fTextFileBuffer = manager.getTextFileBuffer(fPath,
          LocationKind.NORMALIZE);
      fDocument = fTextFileBuffer.getDocument();
    } catch (CoreException x) {
View Full Code Here

    try {
      ITextFileBuffer buffer =
        manager.getTextFileBuffer(location, LocationKind.LOCATION);
      if (buffer == null) {
        //no existing file buffer..create one
        manager.connect(location, LocationKind.LOCATION, new NullProgressMonitor());
        connected = true;
        buffer = manager.getTextFileBuffer(location, LocationKind.LOCATION);
        if (buffer == null) {
          return null;
        }
View Full Code Here

        TextFileChange change = new PyTextFileChange(Messages.format(
                SearchMessages.ReplaceRefactoring_group_label_change_for_file, file.getName()), file);
        change.setEdit(new MultiTextEdit());

        ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager();
        manager.connect(file.getFullPath(), LocationKind.IFILE, null);
        try {
            ITextFileBuffer textFileBuffer = manager.getTextFileBuffer(file.getFullPath(), LocationKind.IFILE);
            if (textFileBuffer == null) {
                resultingStatus.addError(Messages.format(SearchMessages.ReplaceRefactoring_error_accessing_file_buffer,
                        file.getName()));
View Full Code Here

    file= (IFile)adaptable.getAdapter(IFile.class);
    if (file != null) {
      IPath location= file.getFullPath();
      locationKind= LocationKind.IFILE;
      manager.connect(location, locationKind,getProgressMonitor());
      fileBuffer= manager.getTextFileBuffer(location, locationKind);
    } else {
      ILocationProvider provider= (ILocationProvider) adaptable.getAdapter(ILocationProvider.class);
      if (provider instanceof ILocationProviderExtension) {
        URI uri= ((ILocationProviderExtension)provider).getURI(element);
View Full Code Here

      if (fileBuffer == null && provider != null) {
        IPath location= provider.getPath(element);
        if (location == null)
          return null;
        locationKind= LocationKind.NORMALIZE;
        manager.connect(location, locationKind, getProgressMonitor());
        fileBuffer= manager.getTextFileBuffer(location, locationKind);
        file= FileBuffers.getWorkspaceFileAtLocation(location);
      }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.