Sets the text completer for this tag widget to the inputed completer.
        
        :param      completer | <QCompleter>
968620
def setCompleter( self, completer ):
        
        if ( self._completer == completer ):
            return
        elif ( self._completer ):
            self._completer.activated.disconnect(self.finishEditing)
        
        self._completer = completer
        
        if ( completer ):
            completer.activated.connect(self.finishEditing)
1196138
public void complete() throws CompletionFailure {
        if (completer != null) {
            Completer c = completer;
            completer = null;
            c.complete(this);
        }
    }
1225354
def _create_async_completer(self, buffer):
        
        complete_thread_running = [False]  # By ref.

        def completion_does_nothing(document, completion):
            """
            Return `True` if applying this completion doesn't have any effect.
            (When it doesn't insert any new text.
            """
            text_before_cursor = document.text_before_cursor
            replaced_text = text_before_cursor[
                len(text_before_cursor) + completion.start_position:]
            return replaced_text == completion.text

        def async_completer(select_first=False, select_last=False,
                            insert_common_part=False, complete_event=None):
            document = buffer.document
            complete_event = complete_event or CompleteEvent(text_inserted=True)

            # Don't start two threads at the same time.
            if complete_thread_running[0]:
                return

            # Don't complete when we already have completions.
            if buffer.complete_state or not buffer.completer:
                return

            # Otherwise, get completions in other thread.
            complete_thread_running[0] = True

            def run():
                completions = list(buffer.completer.get_completions(document, complete_event))

                def callback():
                    """
                    Set the new complete_state in a safe way. Don't replace an
                    existing complete_state if we had one. (The user could have
                    pressed 'Tab' in the meantime. Also don't set it if the text
                    was changed in the meantime.
                    """
                    complete_thread_running[0] = False

                    # When there is only one completion, which has nothing to add, ignore it.
                    if (len(completions) == 1 and
                            completion_does_nothing(document, completions[0])):
                        del completions[:]

                    # Set completions if the text was not yet changed.
                    if buffer.text == document.text and \
                            buffer.cursor_position == document.cursor_position and \
                            not buffer.complete_state:

                        set_completions = True
                        select_first_anyway = False

                        # When the common part has to be inserted, and there
                        # is a common part.
                        if insert_common_part:
                            common_part = get_common_complete_suffix(document, completions)
                            if common_part:
                                # Insert the common part, update completions.
                                buffer.insert_text(common_part)
                                if len(completions) > 1:
                                    # (Don't call `async_completer` again, but
                                    # recalculate completions. See:
                                    # https://github.com/ipython/ipython/issues/9658)
                                    completions[:] = [
                                        c.new_completion_from_position(len(common_part))
                                        for c in completions]
                                else:
                                    set_completions = False
                            else:
                                # When we were asked to insert the "common"
                                # prefix, but there was no common suffix but
                                # still exactly one match, then select the
                                # first. (It could be that we have a completion
                                # which does * expansion, like '*.py', with
                                # exactly one match.)
                                if len(completions) == 1:
                                    select_first_anyway = True

                        if set_completions:
                            buffer.set_completions(
                                completions=completions,
                                go_to_first=select_first or select_first_anyway,
                                go_to_last=select_last)
                        self.invalidate()
                    elif not buffer.complete_state:
                        # Otherwise, restart thread.
                        async_completer()

                if self.eventloop:
                    self.eventloop.call_from_executor(callback)

            self.eventloop.run_in_executor(run)
        return async_completer
1109045
def set_completion_list(self, completion_list):
        
        self._completion_list = sorted(completion_list, key=str.lower)  # Work with a sorted list
        self._hits = []
        self._hit_index = 0
        self.position = 0
        self.bind('<KeyRelease>', self.handle_keyrelease)
143153
def complete(self, text, state):
        """"""
        if state == 0:
            local._pdbpp_completing = True
            mydict = self.curframe.f_globals.copy()
            mydict.update(self.curframe_locals)
            completer = Completer(mydict)
            self._completions = self._get_all_completions(
                completer.complete, text)

            real_pdb = super(Pdb, self)
            for x in self._get_all_completions(real_pdb.complete, text):
                if x not in self._completions:
                    self._completions.append(x)

            self._filter_completions(text)

            del local._pdbpp_completing

            # Remove "\t" from fancycompleter if there are pdb completions.
            if len(self._completions) > 1 and self._completions[0] == "\t":
                self._completions.pop(0)

        try:
            return self._completions[state]
        except IndexError:
            return None
250415
public void complete() throws CompletionFailure {
        if (completer != Completer.NULL_COMPLETER) {
            Completer c = completer;
            completer = Completer.NULL_COMPLETER;
            c.complete(this);
        }
    }
477086
def setContentFor(self, widget):
        """"""
        for i in range(self.count()):
            item = self.widget(i)
            if widget.isStatic:
                item.setStaticContent(widget)
            else:
                item.setContent(widget)
828372
def _complete(self, text, line, begin, end):
        
        line = line[:end]  # Ignore characters following the cursor.
        fullargs = self.split_line(line)[1:]
        args = fullargs[:]
        options = self.deep_scan_parser(self.argparser)

        # Walk into options tree if subcommands are detected.
        last_subcommand = None
        while True:
            for key, completers in options.items():
                if key in args and hasattr(completers[0], 'items'):
                    args.remove(key)
                    last_subcommand = key
                    options = completers[0]
                    break
            else:
                break

        if text == last_subcommand:
            # We have to specially catch the case where the last argument is
            # the key used to find our subparser.  More specifically when the
            # cursor is not preceded by a space too, as this prevents the
            # completion routines from continuing.  The simplest way without
            # complicating the algo for coming up with our options list is to
            # simply shortcut the completer by returning a single item.
            # Subsequent tabs will work normally.
            return {text}

        # Look for incomplete actions.
        choices = set(x for x in options
                      if x is not None and x.startswith(text))
        arg_buf = []
        pos_args = []
        trailing_action = None
        # The slice below skips the last arg if it is 'active'.
        for x in reversed(args[:-1 if text else None]):
            if x in options:
                action = options[x][0]
                action.consume(arg_buf)
                pos_args.extend(arg_buf)
                del arg_buf[:]
                if action.full:
                    choices -= {action.key}
                if not trailing_action:
                    trailing_action = action
                    if not action.full:
                        if action.reached_min:
                            choices |= action(self, text, fullargs)
                            choices -= {action.key}
                        else:
                            choices = action(self, text, fullargs)
                            break
            else:
                arg_buf.insert(0, x)
        pos_args.extend(arg_buf)

        # Feed any remaining arguments in the buffer to positionals so long as
        # there isn't a trailing action that can still consume.
        if None in options and (not trailing_action or trailing_action.full):
            for x_action in options[None]:
                x_action.consume(pos_args)
                if not x_action.reached_min:
                    choices = x_action(self, text, fullargs)
                    break
                elif not x_action.full:
                    choices |= x_action(self, text, fullargs)
        return choices
723872
private void setAutocomplete(final String value) {
		if (!Util.equals(getAutocomplete(), value)) {
			getOrCreateComponentModel().autocomplete = value;
		}
	}
182636
public void setAutocomplete(java.lang.String autocomplete) {
        getStateHelper().put(PropertyKeys.autocomplete, autocomplete);
    }
713070
def finishEditing(self, tag):
        
        curr_item = self.currentItem()
        create_item = self.createItem()
        self.closePersistentEditor(curr_item)
        
        if curr_item == create_item:
            self.addTag(tag)
        
        elif self.isTagValid(tag):
            curr_item.setText(tag)
350259
public synchronized void setComplete(boolean completed) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setComplete", completed);
        this.completed = completed;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setComplete");
    }
770137
def _remove_word(completer):
    
    def inner(word: str):
        try:
            completer.words.remove(word)
        except Exception:
            pass
    return inner
515709
@PostConstruct
    private void initCompleter() throws Exception{
        if( AUTO_COMPLETE_ENABLED ){
            log.debug( "Starting up HumanTaskAutoCompleter" );
            isStopped.set( false );
            thread = new Thread( new HTAutoCompleter() );
            thread.start();
        }
    }
1119128
def _add_word(completer):
    
    def inner(word: str):
        completer.words.add(word)
    return inner
1065031
def _closeCompletion(self):
        
        if self._widget is not None:
            self._widget.close()
            self._widget = None
            self._completionOpenedManually = False
102046
def terminate(self):
        
        self.text = ''
        self._completer.terminate()

        if self._highlighter is not None:
            self._highlighter.terminate()

        if self._vim is not None:
            self._vim.terminate()