Package org.eclipse.core.filebuffers

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


            String bufText = bm.getTextFileBuffer(fileLocation).getDocument().get();          
            assertEquals(doc.get(), bufText);
        }
        finally
        {
            bm.disconnect(fileLocation, new NullProgressMonitor());
            closeEditor(editor);
        }
    }
   
    public void testFindReplace() throws Exception
View Full Code Here


  private static void releaseDocument(ICompilationUnit cu, IDocument document, IProgressMonitor monitor) throws CoreException {
    if (cu.getOwner() == null) {
      IFile file = (IFile) cu.getResource();
      if (file.exists()) {
        ITextFileBufferManager bufferManager = FileBuffers.getTextFileBufferManager();
        bufferManager.disconnect(file.getFullPath(), LocationKind.IFILE, monitor);
        return;
      }
    }
    cu.getBuffer().setContents(document.get());
    monitor.done();
View Full Code Here

    ITextFileBufferManager textFileBufferManager = getTextFileBufferManager();
    textFileBufferManager.connect(location, NORMALIZE, monitor);
    try {
      return textFileBufferManager.getTextFileBuffer(location, IFILE);
    } finally {
      textFileBufferManager.disconnect(location, NORMALIZE, monitor);
    }
  }
}
View Full Code Here

      ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager();
      manager.connect(file.getFullPath(), LocationKind.IFILE, monitor);
      ITextFileBuffer buffer= ITextFileBufferManager.DEFAULT.getTextFileBuffer(file.getFullPath(), LocationKind.IFILE);
      buffer.getDocument().set(document.get());
      buffer.commit(monitor, true);
      manager.disconnect(file.getFullPath(), LocationKind.IFILE, monitor);
    } finally {
      monitor.done();
    }
  }
View Full Code Here

          else
            format(new SubProgressMonitor(monitor, 18), file);
        }
        finally {
          if(manager != null)
            manager.disconnect(file.getFullPath(), LocationKind.IFILE, new SubProgressMonitor(monitor, 1));
        }
        monitor.done();
      }
      catch(CoreException e) {
        String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{file.getFullPath().toString()});
View Full Code Here

          else
            format(monitor, file);
        }
        finally {
          if(manager != null)
            manager.disconnect(file.getFullPath(), LocationKind.IFILE, new SubProgressMonitor(monitor, 1));
        }
      }
      catch(CoreException e) {
        String message = NLS.bind(SSEUIMessages.FormatActionDelegate_4, new String[]{file.getFullPath().toString()});
        fErrorStatus.add(new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.ERROR, message, e));
View Full Code Here

      e.printStackTrace();
    } catch (BadLocationException e) {
      e.printStackTrace();
    } finally {
      // disconnect the path
      bufferManager.disconnect(path, null);
    }
  }

  /**
   * Convenience method that saves changes that have been made directly to an
View Full Code Here

      e.printStackTrace();
    } catch (BadLocationException e) {
      e.printStackTrace();
    } finally {
      // disconnect the path
      bufferManager.disconnect(path, null);
    }
  }

  /**
   * Convenience method that saves changes that have been made directly to an
View Full Code Here

      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);
    }
    pm.done();
    return result;
  }
View Full Code Here

                if (!wasDirty) {
                    fb.commit(new SubProgressMonitor(pm, 1), true);
                    fSaved = true;
                }
            } finally {
                bm.disconnect(file.getFullPath(), new SubProgressMonitor(pm, 1));
            }
        } finally {
            pm.done();
        }
    }
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.