Examples of saveDocument()


Examples of com.flaptor.indextank.index.storage.InMemoryStorage.saveDocument()

    @TestInfo(testType=TestType.UNIT)
    public void testTextOnlyDocument() throws InterruptedException, IOException {
        InMemoryStorage storage = new InMemoryStorage(FileUtil.createTempDir("testInMemoryStorage", ".tmp"), false);
        Document doc1 = new Document();
        doc1.setField("text", text);
        storage.saveDocument("a", doc1);
        Document dd1 = storage.getDocument("a");
        assertEquals("document retrieved didn't match document stored", doc1, dd1);
    }
    @TestInfo(testType=TestType.UNIT)
    public void testNonTextOnlyDocument() throws InterruptedException {
View Full Code Here

Examples of com.fourspaces.couchdb.Database.saveDocument()

            if (doc != null) {
                return ProviderHelper.conflict(request, "Entry with that key already exists");
            } else {
                doc = new Document(obj);
                doc.setId(key);
                db.saveDocument(doc);
                doc = db.getDocument(key);
                if (doc != null) {
                    Map<String, Object> params = new HashMap<String, Object>();
                    params.put("feed", feed);
                    params.put("entry", key);
View Full Code Here

Examples of com.fourspaces.couchdb.Database.saveDocument()

                return ProviderHelper.notfound(request);
            } else {
                db.deleteDocument(doc);
                doc = new Document(obj);
                doc.setId(key);
                db.saveDocument(doc);
                doc = db.getDocument(key);
                if (doc != null)
                    return new JsonObjectResponseContext(request.getAbdera(), config, doc).setStatus(200)
                        .setEntityTag(doc.getRev());
                else
View Full Code Here

Examples of com.fourspaces.couchdb.Database.saveDocument()

            request,
            "Entry with that key already exists");
        } else {
          doc = new Document(obj);
          doc.setId(key);
          db.saveDocument(doc);
          doc = db.getDocument(key);
          if (doc != null) {
            Map<String,Object> params = new HashMap<String,Object>();
            params.put("feed", feed);
            params.put("entry", key);
View Full Code Here

Examples of com.fourspaces.couchdb.Database.saveDocument()

          return ProviderHelper.notfound(request);
        } else {
          db.deleteDocument(doc);
          doc = new Document(obj);
          doc.setId(key);
          db.saveDocument(doc);
          doc = db.getDocument(key);
          if (doc != null)
            return new JsonObjectResponseContext(
              request.getAbdera(),
              config,
View Full Code Here

Examples of com.intellij.openapi.fileEditor.FileDocumentManager.saveDocument()

    private void formatWhenEditorIsClosed(PsiFile psiFile) throws InvalidPathToConfigFileException {
        VirtualFile virtualFile = psiFile.getVirtualFile();
        FileDocumentManager fileDocumentManager = FileDocumentManager.getInstance();
        Document document = fileDocumentManager.getDocument(virtualFile);
        fileDocumentManager.saveDocument(document); // when file is edited and editor is closed, it is needed to save
        // the text
        document.setText(reformat(document.getText()));
        postProcess(document, true, psiFile);
        fileDocumentManager.saveDocument(document);
    }
View Full Code Here

Examples of com.intellij.openapi.fileEditor.FileDocumentManager.saveDocument()

        Document document = fileDocumentManager.getDocument(virtualFile);
        fileDocumentManager.saveDocument(document); // when file is edited and editor is closed, it is needed to save
        // the text
        document.setText(reformat(document.getText()));
        postProcess(document, true, psiFile);
        fileDocumentManager.saveDocument(document);
    }

    private String reformat(String virtualFile) throws InvalidPathToConfigFileException {
        return codeFormatterFacade.format(virtualFile, Settings.LINE_SEPARATOR);
    }
View Full Code Here

Examples of com.intellij.openapi.fileEditor.FileDocumentManager.saveDocument()

  private void formatWhenEditorIsClosed(PsiFile psiFile) throws FileDoesNotExistsException {
    LOG.debug("#formatWhenEditorIsClosed " + psiFile.getName());
    VirtualFile virtualFile = psiFile.getVirtualFile();
    FileDocumentManager fileDocumentManager = FileDocumentManager.getInstance();
    Document document = fileDocumentManager.getDocument(virtualFile);
    fileDocumentManager.saveDocument(document); // when file is edited and editor is closed, it is needed to save
    // the text
    String text = document.getText();
    String reformat = reformat(0, text.length(), text);
    document.setText(reformat);
    postProcess(document, psiFile, new Range(-1, -1, true));
View Full Code Here

Examples of com.intellij.openapi.fileEditor.FileDocumentManager.saveDocument()

    // the text
    String text = document.getText();
    String reformat = reformat(0, text.length(), text);
    document.setText(reformat);
    postProcess(document, psiFile, new Range(-1, -1, true));
    fileDocumentManager.saveDocument(document);
  }

  /* when file is being edited, it is important to load text from editor, i think */
  private void formatWhenEditorIsOpen(Range range, PsiFile file) throws FileDoesNotExistsException {
    LOG.debug("#formatWhenEditorIsOpen " + file.getName());
View Full Code Here

Examples of com.intellij.openapi.fileEditor.FileDocumentManager.saveDocument()

        } else {
          FileDocumentManager instance = FileDocumentManager.getInstance();
          String iDocument = codeFormatterFacade.format(ioFile(file), LINE_SEPARATOR);
          Document writeTo = instance.getDocument(file);
          writeTo.setText(iDocument);
          instance.saveDocument(writeTo);
        }
      } else {
        notifyNothingWasFormatted();
        return;
      }
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.