Logo Search packages:      
Sourcecode: jline version File versions  Download package

final boolean jline::ConsoleReader::complete (  )  throws IOException [inline, private]

Use the completors to modify the buffer with the appropriate completions.

Returns:
true if successful

Definition at line 794 of file ConsoleReader.java.

References jline::CompletionHandler::complete(), and jline::Completor::complete().

Referenced by readLine().

      {
            // debug ("tab for (" + buf + ")");

            if (completors.size () == 0)
                  return false;

            List candidates = new LinkedList ();
            String bufstr = buf.buffer.toString ();
            int cursor = buf.cursor;

            int position = -1;

            for (Iterator i = completors.iterator (); i.hasNext (); )
            {
                  Completor comp = (Completor)i.next ();
                  if ((position = comp.complete (bufstr, cursor, candidates)) != -1)
                        break;
            }

            // no candidates? Fail.
            if (candidates.size () == 0)
                  return false;

            return completionHandler.complete (this, candidates, position);
      }


Generated by  Doxygen 1.6.0   Back to index