public boolean isToProcessTab() {
    if (isCaretOutsideCurrentSegment(null)) {
      return false;
    }
    if (myLiveTemplateProcessor.isLookupShown()) {
      final Lookup lookup = LookupManager.getActiveLookup(getEditor());
      if (lookup != null && !lookup.isFocused()) {
        return true;
      }
    }

    return !myLiveTemplateProcessor.isLookupShown();
  }
public boolean isToProcessTab()