Package org.eclipse.core.filebuffers

Examples of org.eclipse.core.filebuffers.ITextFileBuffer.commit()


      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 {
      monitor.done();
    }
  }
View Full Code Here


      monitor.beginTask(TextEditorMessages.TextFileDocumentProvider_beginTask_saving, 2000);
      IFileStore fileStore= EFS.getStore(uri);
      FileBuffers.getTextFileBufferManager().connectFileStore(fileStore, monitor);
      ITextFileBuffer buffer= FileBuffers.getTextFileBufferManager().getFileStoreTextFileBuffer(fileStore);
      buffer.getDocument().set(document.get());
      buffer.commit(monitor, true);
      FileBuffers.getTextFileBufferManager().disconnectFileStore(fileStore, monitor);
    } finally {
      monitor.done();
    }
  }
View Full Code Here

      document.set(writer.toString());
    } catch (Exception e) {
      throw new IOException(e.getMessage());
    }

    fileBuffer.commit(monitor, true);
    if (dispose) {
      FileBuffers.getTextFileBufferManager().disconnect(fullPath,
          LocationKind.IFILE, monitor);
    }
  }
View Full Code Here

      document.set(writer.toString());
    } catch (Exception e) {
      throw new IOException(e.getMessage());
    }

    fileBuffer.commit(monitor, true);
    if (dispose) {
      FileBuffers.getTextFileBufferManager().disconnect(fullPath,
          LocationKind.IFILE, monitor);
    }
View Full Code Here

      // apply the changes to the document
      edit.apply(document);

      // write the changes from the buffer to the file
      textFileBuffer
          .commit(null /* ProgressMonitor */, false /* Overwrite */);

    } catch (MalformedTreeException e) {
      e.printStackTrace();
    } catch (BadLocationException e) {
View Full Code Here

      FileBuffers.getTextFileBufferManager().connectFileStore(fileStore,
          monitor);
      ITextFileBuffer buffer = FileBuffers.getTextFileBufferManager()
          .getFileStoreTextFileBuffer(fileStore);
      buffer.getDocument().set(document.get());
      buffer.commit(monitor, true);
      FileBuffers.getTextFileBufferManager().disconnectFileStore(
          fileStore, monitor);
    }
    else
    {
View Full Code Here

                    doc.replace(offset, length, replacementString);
                    fMarkers.remove(match);
                    fPage.getInput().removeMatch(match);
                }
                if (!wasDirty) {
                    fb.commit(new SubProgressMonitor(pm, 1), true);
                    fSaved = true;
                }
            } finally {
                bm.disconnect(file.getFullPath(), new SubProgressMonitor(pm, 1));
            }
View Full Code Here

    ITextFileBuffer buffer = FileBuffers.getTextFileBufferManager()
        .getTextFileBuffer(file.getFullPath(), LocationKind.NORMALIZE);
    if (buffer != null && buffer.isDirty() && buffer.isStateValidated()
        && buffer.isSynchronized()) {
      pm.beginTask("", 2); //$NON-NLS-1$
      buffer.commit(new SubProgressMonitor(pm, 1), false);
      file.refreshLocal(IResource.DEPTH_ONE,
          new SubProgressMonitor(pm, 1));
      pm.done();
    } else {
      pm.beginTask("", 1); //$NON-NLS-1$
View Full Code Here

      monitor.beginTask(EditorMessages.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 {
      monitor.done();
    }
  }
View Full Code Here

      monitor.beginTask(EditorMessages.TextFileDocumentProvider_beginTask_saving, 2000);
      IFileStore fileStore= EFS.getStore(uri);
      FileBuffers.getTextFileBufferManager().connectFileStore(fileStore, monitor);
      ITextFileBuffer buffer= FileBuffers.getTextFileBufferManager().getFileStoreTextFileBuffer(fileStore);
      buffer.getDocument().set(document.get());
      buffer.commit(monitor, true);
      FileBuffers.getTextFileBufferManager().disconnectFileStore(fileStore, monitor);
    } finally {
      monitor.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.