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

void org::gjt::sp::jedit::textarea::TextArea::userInput ( char  ch  )  [inline]

Handles the insertion of the specified character. It performs the following operations above and beyond simply inserting the text:

  • Inserting a TAB with a selection will shift to the right
  • Inserting a BACK_SPACE or a DELETE will remove a character
  • Inserting an indent open/close bracket will re-indent the current line as necessary

Parameters:
ch The character
See also:
setSelectedText(String)

isOverwriteEnabled()

Since:
jEdit 4.3pre7

Reimplemented in org::gjt::sp::jedit::textarea::JEditTextArea.

Definition at line 3312 of file TextArea.java.

References backspace(), doWordWrap(), getPainter(), getSelectionCount(), isEditable(), org::gjt::sp::jedit::buffer::JEditBuffer::isElectricKey(), and replaceSelection().

      {
            if(!isEditable())
            {
                  getToolkit().beep();
                  return;
            }

            /* Null before addNotify() */
            if(hiddenCursor != null)
                  getPainter().setCursor(hiddenCursor);

            switch(ch)
            {
            case '\t':
                  userInputTab();
                  break;
            case '\b':
                  backspace();
                  break;
            case '\u007F':
                  delete();
                  break;
            default:
                  boolean indent = buffer.isElectricKey(ch, caretLine);
                  String str = String.valueOf(ch);
                  if(getSelectionCount() == 0)
                  {
                        if(!doWordWrap(ch == ' '))
                              insert(str,indent);
                  }
                  else
                        replaceSelection(str);
                  break;
            }
      } //}}}


Generated by  Doxygen 1.6.0   Back to index