Package org.eclipse.core.filebuffers

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


        IPath fileLocation =
            ((IFileEditorInput) editor.getEditorInput()).getFile().getLocation();
       
        ITextFileBufferManager bm = FileBuffers.getTextFileBufferManager();
        bm.connect(fileLocation, new NullProgressMonitor());
       
        try
        {
            IDocument doc = editor.getViewer().getDocument();
            doc.replace(0, 0, "abc");
View Full Code Here


      OperationCanceledException {

    ITextFileBufferManager bufferManager = FileBuffers
        .getTextFileBufferManager();
    IPath path = fSourceModule.getPath();
    bufferManager.connect(path, LocationKind.IFILE, null);
    ITextFileBuffer textFileBuffer = bufferManager.getTextFileBuffer(path,
        LocationKind.IFILE);
   
    IDocument document = textFileBuffer.getDocument();
   
View Full Code Here

    if (cu.getOwner() == null) {
      IFile file = (IFile) cu.getResource();
      if (file.exists()) {
        ITextFileBufferManager bufferManager = FileBuffers.getTextFileBufferManager();
        IPath path = cu.getPath();
        bufferManager.connect(path, LocationKind.IFILE, monitor);
        return bufferManager.getTextFileBuffer(path, LocationKind.IFILE).getDocument();
      }
    }
    monitor.done();
    return new Document(cu.getSource());
View Full Code Here

  }

  private ITextFileBuffer textFileBuffer(IProgressMonitor monitor, IFileEditorInput editorInput) throws CoreException {
    IPath location = editorInput.getFile().getFullPath();
    ITextFileBufferManager textFileBufferManager = getTextFileBufferManager();
    textFileBufferManager.connect(location, NORMALIZE, monitor);
    try {
      return textFileBufferManager.getTextFileBuffer(location, IFILE);
    } finally {
      textFileBufferManager.disconnect(location, NORMALIZE, monitor);
    }
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

   */
  protected void createFileFromDocument(IProgressMonitor monitor, IFile file, IDocument document) throws CoreException {
    try {
      monitor.beginTask(TextEditorMessages.TextFileDocumentProvider_beginTask_saving, 2000);
      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 {
View Full Code Here

            try {
                /*
                 * FIXME This call to connect never has a matching call to
                 * disconnect
                 */
                tfbm.connect(fullPath, LocationKind.IFILE,
                    new NullProgressMonitor());
            } catch (CoreException e) {
                EditorManager.log
                    .error("Could not connect to file " + fullPath);
                return null;
View Full Code Here

        ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager();
        ITextFileBuffer buffer = null;
       
        try {
          if(manager != null) {
            manager.connect(file.getFullPath(), LocationKind.IFILE, new SubProgressMonitor(monitor, 1));
            buffer = manager.getTextFileBuffer(resource.getFullPath(), LocationKind.IFILE);
          }
         
          if(buffer != null && buffer.isShared()) {
            Display display = getDisplay();
View Full Code Here

        ITextFileBufferManager manager= FileBuffers.getTextFileBufferManager();
        ITextFileBuffer buffer = null;
       
        try {
          if(manager != null) {
            manager.connect(file.getFullPath(), LocationKind.IFILE, monitor);
            buffer = manager.getTextFileBuffer(resource.getFullPath(), LocationKind.IFILE);
          }
         
          if(buffer != null && buffer.isShared()) {
            Display display = getDisplay();
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.