Examples of Document


Examples of com.flaptor.indextank.rpc.Document

                    client.updateTimestampBoost(docId, userTimestamp);
                    client.updateCategories(docId, categories);
                } else {
                    //System.out.println("Adding  docid:" + docId);
                    if (boostedDocument.getDocument().asMap().size() > 0) {
                        Document doc = new Document();
                        doc.set_fields(boostedDocument.getDocument().asMap());
                        client.addDoc(docId, doc, userTimestamp, doubleBoosts);
                    } else {
                        client.updateBoost(docId, doubleBoosts);
                    }
                    client.updateCategories(docId, categories);
View Full Code Here

Examples of com.fourspaces.couchdb.Document

        Target target = request.getTarget();
        String feed = target.getParameter("feed");
        String entry = target.getParameter("entry");
        Session session = new Session(host, port);
        Database db = session.getDatabase(feed);
        Document doc = null;
        try {
            doc = db.getDocument(entry);
        } catch (Exception e) {
            // error if the doc isn't found, we deal with the null result below
        }
View Full Code Here

Examples of com.gcrm.domain.Document

            if (contacts == null) {
                contacts = new HashSet<Contact>();
            }
            contacts.add(contact);
        } else if ("Document".equals(this.getRelationKey())) {
            Document document = documentService.getEntityById(Document.class,
                    Integer.valueOf(this.getRelationValue()));
            Set<Document> documents = opportunity.getDocuments();
            if (documents == null) {
                documents = new HashSet<Document>();
            }
View Full Code Here

Examples of com.github.sommeri.less4j.core.ast.Document

  }

  @Override
  public Document handleDocument(HiddenTokenAwareTree token) {
    Iterator<HiddenTokenAwareTree> children = token.getChildren().iterator();
    Document result = new Document(token, children.next().getText());
    result.addUrlMatchFunctions(handleUrlMatchFunctionsDeclaration(children.next()));
    result.setBody(handleGeneralBody(children.next()));

    return result;
  }
View Full Code Here

Examples of com.google.appengine.api.search.Document

  public static void index(News obj) {
    try {
      Document.Builder docBuilder = Document.newBuilder();
      objectToSearchDocument(docBuilder, obj);
      Document doc = docBuilder.build();
      INDEX.put(doc);
    } catch (Exception e) {
      log.warning(e.toString());
      e.printStackTrace();
    }
View Full Code Here

Examples of com.google.code.mojo.license.document.Document

            try {
                for (final String file : listSelectedFiles()) {
                    completionService.submit(new Runnable() {
                        public void run() {
                            Document document = documentFactory.createDocuments(file);
                            debug("Selected file: %s [header style: %s]", document.getFile(), document.getHeaderDefinition());
                            if (document.isNotSupported()) {
                                warn("Unknown file extension: %s", document.getFile());
                            } else if (document.is(h)) {
                                debug("Skipping header file: %s", document.getFile());
                            } else if (document.hasHeader(h, strictCheck)) {
                                callback.onExistingHeader(document, h);
                            } else {
                                boolean headerFound = false;
                                for (Header validHeader : validHeaders) {
                                    if (headerFound = document.hasHeader(validHeader, strictCheck)) {
                                        callback.onExistingHeader(document, h);
                                        break;
                                    }
                                }
                                if (!headerFound)
View Full Code Here

Examples of com.google.collide.shared.document.Document

     */
    commandMode.addShortcut(new EventShortcut(ModifierKeys.NONE, 'O') {
      @Override
      public boolean event(InputScheme scheme, SignalEvent event) {
        SelectionModel selectionModel = getInputController().getEditor().getSelection();
        Document document = getInputController().getEditor().getDocument();
        Line cursorLine = selectionModel.getCursorLine();
        int cursorLineNumber = selectionModel.getCursorLineNumber();
        document.insertText(cursorLine, 0, "\n");
        selectionModel.setCursorPosition(new LineInfo(cursorLine, cursorLineNumber), 0);
        switchMode(Modes.INSERT);
        return true;
      }
    });

    /*
     * o - Insert line below, enter insert mode.
     */
    commandMode.addShortcut(new EventShortcut(ModifierKeys.NONE, 'o') {
      @Override
      public boolean event(InputScheme scheme, SignalEvent event) {
        SelectionModel selectionModel = getInputController().getEditor().getSelection();
        Document document = getInputController().getEditor().getDocument();
        Line cursorLine = selectionModel.getCursorLine();
        int cursorLineNumber = selectionModel.getCursorLineNumber();
        document.insertText(cursorLine, LineUtils.getLastCursorColumn(cursorLine), "\n");
        selectionModel.setCursorPosition(new LineInfo(cursorLine.getNextLine(),
            cursorLineNumber + 1), 0);
        switchMode(Modes.INSERT);
        return true;
      }
    });

    /*
     * : - Switch to colon capture mode for commands.
     */
    commandMode.addShortcut(new EventShortcut(ModifierKeys.NONE, ':') {
      @Override
      public boolean event(InputScheme scheme, SignalEvent event) {
        switchMode(Modes.COMMAND_CAPTURE);
        return true;
      }
    });

    /*
     * "/" - Switch to search mode.
     */
    commandMode.addShortcut(new EventShortcut(ModifierKeys.NONE, '/') {
      @Override
      public boolean event(InputScheme scheme, SignalEvent event) {
        switchMode(Modes.SEARCH_CAPTURE);
        return true;
      }
    });

    commandMode.addShortcut(new EventShortcut(ModifierKeys.NONE, '*') {
      @Override
      public boolean event(InputScheme scheme, SignalEvent event) {
        SelectionModel selectionModel = getInputController().getEditor().getSelection();
        String word =
            TextUtils.getWordAtColumn(selectionModel.getCursorLine().getText(),
                selectionModel.getCursorColumn());
        if (word == null) {
          return true;
        }
        switchMode(Modes.SEARCH_CAPTURE);
        searchTerm.append(word);
        doPartialSearch();
        drawSearchTerm();
        return true;
      }
    });

    /*
     * Movement
     */
    /*
     * ^,0 - Move to first character in line.
     */
    commandMode.addShortcut(new EventShortcut(ModifierKeys.NONE, '^') {
      @Override
      public boolean event(InputScheme scheme, SignalEvent event) {
        SelectionModel selectionModel = getInputController().getEditor().getSelection();
        LineInfo cursorLineInfo =
            new LineInfo(selectionModel.getCursorLine(), selectionModel.getCursorLineNumber());
        selectionModel.setCursorPosition(cursorLineInfo, 0);
        return true;
      }
    });
    commandMode.addShortcut(new EventShortcut(ModifierKeys.NONE, '0') {
      @Override
      public boolean event(InputScheme scheme, SignalEvent event) {
        if (tryAddNumericPrefix('0')) {
          return true;
        }
        SelectionModel selectionModel = getInputController().getEditor().getSelection();
        LineInfo cursorLineInfo =
            new LineInfo(selectionModel.getCursorLine(), selectionModel.getCursorLineNumber());
        selectionModel.setCursorPosition(cursorLineInfo, 0);
        return true;
      }
    });

    /*
     * $ - Move to end of line.
     */
    commandMode.addShortcut(new EventShortcut(ModifierKeys.NONE, '$') {
      @Override
      public boolean event(InputScheme scheme, SignalEvent event) {
        SelectionModel selectionModel = getInputController().getEditor().getSelection();
        Line cursorLine = selectionModel.getCursorLine();
        LineInfo cursorLineInfo = new LineInfo(cursorLine, selectionModel.getCursorLineNumber());
        selectionModel.setCursorPosition(cursorLineInfo, LineUtils.getLastCursorColumn(cursorLine));
        return true;
      }
    });

    /*
     * w - move the cursor to the first character of the next word.
     */
    commandMode.addShortcut(new EventShortcut(ModifierKeys.NONE, 'w') {
      @Override
      public boolean event(InputScheme scheme, SignalEvent event) {
        SelectionModel selectionModel = getInputController().getSelection();
        LineInfo cursorLineInfo =
            new LineInfo(selectionModel.getCursorLine(), selectionModel.getCursorLineNumber());
        String text = selectionModel.getCursorLine().getText();
        int column = selectionModel.getCursorColumn();
        column = TextUtils.moveByWord(text, column, true, false);
        if (column == -1) {
          Line cursorLine = cursorLineInfo.line().getNextLine();
          if (cursorLine != null) {
            cursorLineInfo = new LineInfo(cursorLine, cursorLineInfo.number() + 1);
            column = 0;
          } else {
            column = LineUtils.getLastCursorColumn(cursorLine); // at last character
                                                          // in document
          }
        }

        selectionModel.setCursorPosition(cursorLineInfo, column);
        return true;
      }
    });

    /*
     * b - move the cursor to the first character of the previous word.
     */
    commandMode.addShortcut(new EventShortcut(ModifierKeys.NONE, 'b') {
      @Override
      public boolean event(InputScheme scheme, SignalEvent event) {
        SelectionModel selectionModel = getInputController().getSelection();
        LineInfo cursorLineInfo =
            new LineInfo(selectionModel.getCursorLine(), selectionModel.getCursorLineNumber());
        String text = selectionModel.getCursorLine().getText();
        int column = selectionModel.getCursorColumn();
        column = TextUtils.moveByWord(text, column, false, false);
        if (column == -1) {
          Line cursorLine = cursorLineInfo.line().getPreviousLine();
          if (cursorLine != null) {
            cursorLineInfo = new LineInfo(cursorLine, cursorLineInfo.number() - 1);
            column = LineUtils.getLastCursorColumn(cursorLine);
          } else {
            column = 0; // at first character in document
          }
        }

        selectionModel.setCursorPosition(cursorLineInfo, column);
        return true;
      }
    });

    /*
     * e - move the cursor to the last character of the next word.
     */
    commandMode.addShortcut(new EventShortcut(ModifierKeys.NONE, 'e') {
      @Override
      public boolean event(InputScheme scheme, SignalEvent event) {
        SelectionModel selectionModel = getInputController().getSelection();
        LineInfo cursorLineInfo =
            new LineInfo(selectionModel.getCursorLine(), selectionModel.getCursorLineNumber());
        String text = selectionModel.getCursorLine().getText();
        int column = selectionModel.getCursorColumn();
        column = TextUtils.moveByWord(text, column, true, true);
        if (column == -1) {
          Line cursorLine = cursorLineInfo.line().getNextLine();
          if (cursorLine != null) {
            cursorLineInfo = new LineInfo(cursorLine, cursorLineInfo.number() + 1);
            column = 0;
          } else {
            // at the last character in the document
            column = LineUtils.getLastCursorColumn(cursorLine);
          }
        }

        selectionModel.setCursorPosition(cursorLineInfo, column);
        return true;
      }
    });

    /*
     * % - jump to the next matching {}, [] or () character if the cursor is
     * over one of the two.
     */
    commandMode.addShortcut(new EventShortcut(ModifierKeys.NONE, '%') {
      @Override
      public boolean event(InputScheme scheme, SignalEvent event) {
        final SelectionModel selectionModel = getInputController().getSelection();
        Document document = getInputController().getEditor().getDocument();
        LineInfo cursorLineInfo =
            new LineInfo(selectionModel.getCursorLine(), selectionModel.getCursorLineNumber());
        String text = selectionModel.getCursorLine().getText();
        final char cursorChar = text.charAt(selectionModel.getCursorColumn());
        final char searchChar;
        final boolean searchingForward = OPENING_GROUPS.indexOf(cursorChar) >= 0;
        final Position searchingTo;
        if (searchingForward) {
          searchChar = CLOSING_GROUPS.charAt(OPENING_GROUPS.indexOf(cursorChar));
          searchingTo =
              new Position(new LineInfo(document.getLastLine(), document.getLastLineNumber()),
                  document.getLastLine().length());
        } else if (CLOSING_GROUPS.indexOf(cursorChar) >= 0) {
          searchChar = OPENING_GROUPS.charAt(CLOSING_GROUPS.indexOf(cursorChar));
          searchingTo = new Position(new LineInfo(document.getFirstLine(), 0), 0);
        } else {
          return true; // not on a valid starting character
        }


View Full Code Here

Examples of com.google.enterprise.connector.spi.Document

    // Get the first set of documents.
    tm.setBatchHint(20);
    DocumentList docList = tm.startTraversal();
    assertNotNull("startTraversal returned a null document list", docList);
    while (docList != null) {
      Document doc;
      while (null != (doc = docList.nextDocument())) {
        documents.add((NotesConnectorDocument) doc);
      }
      String checkpoint = docList.checkpoint();
      // Resume traversal.
View Full Code Here

Examples of com.google.gwt.dom.client.Document

     */
    public HTMLNodeWrapper wrap(Node node) {
        if (node == this.node) {
            return this;
        }
        Document doc = node.getOwnerDocument();
        if (doc == this.node) {
            return makeWrapper(node, this);
        } else {
            throw new IllegalArgumentException(
                "XMLDocumentWrapper#wrap: supplied node does not belong to the wrapped DOM document");
View Full Code Here

Examples of com.google.gwt.xml.client.Document

    info_id++;
  }
 
  private void onDiscoItems(final XmppPacket query)
  {
    Document doc = XMLParser.parse(query.toXML());
      Element queryEl = XMLHelper.queryTag(doc.getDocumentElement());
      NodeList items = queryEl.getChildNodes();
      disco.clear();
      for(int index = 0;index < items.getLength();index++)
      {
        Element item = (Element)items.item(index);
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.