Class TextEditComponent

All Implemented Interfaces:
KeyboardInputHandler, MouseInteractionController, ClipboardOwner

public class TextEditComponent extends GuiComponent implements ClipboardOwner
  • Field Details

    • scrolledCharacters

      public int scrolledCharacters
    • scrolledLines

      public int scrolledLines
    • selecting

      public boolean selecting
    • selectionStart

      public TextPointer selectionStart
      Selection start and end pointers.
    • selectionEnd

      public TextPointer selectionEnd
    • cursorLocation

      public TextPointer cursorLocation
  • Constructor Details

  • Method Details

    • clearSelection

      public void clearSelection()
      Clear text selection.
    • copyToClipboard

      public void copyToClipboard()
      Copies selected text to the clipboard.
    • cutToClipboard

      public void cutToClipboard()
    • deleteSelection

      public void deleteSelection()
    • ensureSelectionOrder

      public void ensureSelectionOrder()
      Ensures that selectionStart is smaller than selectionEnd.
    • getClipboardContents

      public String getClipboardContents()
    • setClipboardContents

      public void setClipboardContents(String contents)
      Place string into system clipboard so that it can be pasted into other applications.
    • goToLine

      public void goToLine(int Line)
    • insertText

      public void insertText(String txt)
    • keyPressed

      public boolean keyPressed(KeyEvent event, ViewPanel viewPanel)
      Parse key presses.
      Specified by:
      keyPressed in interface KeyboardInputHandler
      Overrides:
      keyPressed in class GuiComponent
      Returns:
      true if view needs to be re-rendered.
    • lostOwnership

      public void lostOwnership(Clipboard aClipboard, Transferable aContents)
      Empty implementation of the ClipboardOwner interface.
      Specified by:
      lostOwnership in interface ClipboardOwner
    • markRowDirty

      public void markRowDirty()
    • pasteFromClipboard

      public void pasteFromClipboard()
    • processDel

      public void processDel()
    • repaintPage

      public void repaintPage()
    • repaintRow

      public void repaintRow(int rowNumber)
    • scroll

      public void scroll(int charactersToScroll, int linesToScroll)
      Scroll full page to given amount of lines or charancters.
    • setText

      public void setText(String text)