コード例 #1
0
  /**
   * skip initialGuarded
   *
   * @param offset
   * @param length
   * @return true if skip
   */
  protected boolean skipInitialGuarded(int offset) {
    Debug.log(
        this,
        "CollabJavaHandler, skipInitialGuarded, "
            + "	otherGuardedSections size: "
            + otherGuardedSections.size()); // NoI18n

    Iterator it = this.otherGuardedSections.values().iterator();
    while (it.hasNext()) {
      GuardedSection sect = (GuardedSection) it.next();
      int beginOffset = sect.getStartPosition().getOffset();
      int endOffset = sect.getEndPosition().getOffset();
      if ((offset >= beginOffset) && (offset <= endOffset)) return true;
    }
    return false;
  }
コード例 #2
0
  /** findInitialGuardedSections */
  protected void findInitialGuardedSections() throws CollabException {
    Debug.log(this, "CollabJavaHandler, findInitialGuardedSections"); // NoI18n

    StyledDocument docu = getDocument();
    synchronized (docu) {
      GuardedSectionManager man = GuardedSectionManager.getInstance(docu);
      if (man == null) return; // no guarded sections

      Iterator it = man.getGuardedSections().iterator();

      while (it.hasNext()) {
        GuardedSection sect = (GuardedSection) it.next();
        String name = sect.getName();
        this.otherGuardedSections.put(name, sect);

        if (sect instanceof SimpleSection) {
          Debug.log(this, "CollabJavaHandler, simple_sect: " + name); // NoI18n
        } else {
          Debug.log(this, "CollabJavaHandler, inter_sect: " + name); // NoI18n
        }
      }
    }
  }