Package editor

Class EditorHost

All Implemented Interfaces:
IEditorHost, ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
GosuEditor, StandardEditor

public abstract class EditorHost extends JPanel implements IEditorHost
See Also:
  • Field Details

    • TAB_SIZE

      public static final int TAB_SIZE
      The number of spacess assigned to a tab
      See Also:
    • INTELLISENSE_TASK_QUEUE

      public static final String INTELLISENSE_TASK_QUEUE
      See Also:
    • COMPLETION_DELAY

      static int COMPLETION_DELAY
      Delay in millis for code completion to wait for key presses before displaying.
    • _completionPopup

      private JPopupMenu _completionPopup
    • _undoMgr

      private AtomicUndoManager _undoMgr
    • _uel

      private UndoableEditListener _uel
    • _partId

      private IScriptPartId _partId
    • _bParserSuspended

      private boolean _bParserSuspended
    • _bEnterPressedConsumed

      private boolean _bEnterPressedConsumed
    • _bAltDown

      private boolean _bAltDown
    • _bCompleteCode

      private boolean _bCompleteCode
    • _iTimerCount

      private int _iTimerCount
    • _timerPool

      private static EditorHost.TimerPool _timerPool
    • _highlightMode

      private EditorHost.HighlightMode _highlightMode
  • Constructor Details

  • Method Details

    • getScriptPart

      public IScriptPartId getScriptPart()
      Specified by:
      getScriptPart in interface IEditorHost
    • setScriptPart

      public void setScriptPart(IScriptPartId partId)
      Specified by:
      setScriptPart in interface IEditorHost
    • getUndoManager

      public AtomicUndoManager getUndoManager()
      Specified by:
      getUndoManager in interface IEditorHost
    • read

      public void read(IScriptPartId partId, String strSource) throws IOException
      Specified by:
      read in interface IEditorHost
      Throws:
      IOException
    • parseAndWaitForParser

      public void parseAndWaitForParser()
    • waitForParser

      public void waitForParser()
    • addKeyHandlers

      protected void addKeyHandlers()
    • showFileInTree

      public void showFileInTree()
    • getLineNumberAtCaret

      public int getLineNumberAtCaret()
    • getLineOffset

      public int getLineOffset(int iLine)
    • handleBulkIndent

      void handleBulkIndent(boolean bOutdent)
    • _handleBulkIndent

      void _handleBulkIndent(boolean bOutdent)
    • setLabel

      public void setLabel(String label)
      Specified by:
      setLabel in interface IEditorHost
    • getDocument

      public AbstractDocument getDocument()
      Specified by:
      getDocument in interface IEditorHost
    • setUndoableEditListener

      public void setUndoableEditListener(UndoableEditListener uel)
      Sets the one and only undoable edit listener for this editor section. The primary use case for this method is to establish an undo manager connection.
      Specified by:
      setUndoableEditListener in interface IEditorHost
      Parameters:
      uel - The UndoableEditListener to connect to this section's document.
    • addDocumentListener

      protected void addDocumentListener()
    • getText

      public String getText()
      Specified by:
      getText in interface IEditorHost
    • getParsedClass

      public IType getParsedClass()
      Specified by:
      getParsedClass in interface IEditorHost
    • dismissCompletionPopup

      void dismissCompletionPopup()
    • getCompletionPopup

      public JPopupMenu getCompletionPopup()
    • setCompletionPopup

      public void setCompletionPopup(JPopupMenu completionPopup)
    • isCompletionPopupShowing

      public boolean isCompletionPopupShowing()
    • displayGotoLinePopup

      public void displayGotoLinePopup()
    • gotoLine

      public void gotoLine(int iLine)
    • gotoLine

      public void gotoLine(int iLine, int iColumn)
    • gotoOffset

      public void gotoOffset(int offset)
    • duplicate

      public void duplicate()
    • _duplicate

      private void _duplicate()
    • recordCaretPositionForUndo

      private void recordCaretPositionForUndo() throws BadLocationException
      Throws:
      BadLocationException
    • delete

      public void delete()
      delete the currently selected text, or the current line if nothing is selected
    • getExpandedSelection

      public String getExpandedSelection()
      Returns:
      the selected text in the editor, expanding to the entire current line if no selection exists
    • deleteWord

      void deleteWord()
    • deleteWordForwards

      void deleteWordForwards()
    • deleteLine

      void deleteLine()
    • unindent

      void unindent()
    • joinLines

      public void joinLines()
    • _joinLines

      private void _joinLines()
    • swallowSpaces

      private int swallowSpaces(Document document, int i) throws BadLocationException
      Throws:
      BadLocationException
    • jumpRight

      void jumpRight()
    • centerView

      public void centerView()
    • highlightLocations

      public void highlightLocations(List<SearchLocation> locations)
      Specified by:
      highlightLocations in interface IEditorHost
    • gotoNextUsageHighlight

      public void gotoNextUsageHighlight()
      Specified by:
      gotoNextUsageHighlight in interface IEditorHost
    • gotoPrevUsageHighlight

      public void gotoPrevUsageHighlight()
      Specified by:
      gotoPrevUsageHighlight in interface IEditorHost
    • removeAllHighlights

      public void removeAllHighlights()
      Specified by:
      removeAllHighlights in interface IEditorHost
    • removeHightlights

      private void removeHightlights()
    • getHighlightMode

      protected EditorHost.HighlightMode getHighlightMode()
    • setHighlightMode

      protected void setHighlightMode(EditorHost.HighlightMode mode)
    • hideMiscPopups

      protected void hideMiscPopups()
    • clipCut

      public void clipCut(Clipboard clipboard)
      Specified by:
      clipCut in interface IEditorHost
    • clipCopy

      public void clipCopy(Clipboard clipboard)
      Specified by:
      clipCopy in interface IEditorHost
    • clipPaste

      public void clipPaste(Clipboard clipboard, boolean asGosu)
      Specified by:
      clipPaste in interface IEditorHost
    • getClipCopyContents

      private Transferable getClipCopyContents()
    • handleEnter

      void handleEnter()
    • _handleEnter

      void _handleEnter()
    • handleOpenBrace

      private boolean handleOpenBrace(String strLine)
    • fixCloseBraceIfNecessary

      private void fixCloseBraceIfNecessary(String previousLine) throws BadLocationException
      Throws:
      BadLocationException
    • handleBackspace

      void handleBackspace()
    • indentIfOpenBracePrecedes

      private void indentIfOpenBracePrecedes(String strLine)
    • getIndentWhitespace

      private String getIndentWhitespace()
    • handleBulkComment

      void handleBulkComment()
    • _handleBulkComment

      void _handleBulkComment()
    • handleBraceRight

      void handleBraceRight()
    • handleBraceRightNow

      private void handleBraceRightNow(int caretPosition)
    • _handleBraceRightNow

      private void _handleBraceRightNow(int caretPosition, boolean wasBraceTyped)
    • parse

      public void parse()
    • parse

      protected void parse(boolean forceCodeCompletion)
    • postTaskInParserThread

      public static void postTaskInParserThread(Runnable task)
    • getParserTaskQueue

      public static TaskQueue getParserTaskQueue()
    • isParserSuspended

      public boolean isParserSuspended()
    • setParserSuspended

      public void setParserSuspended(boolean bParserSuspended)
    • getParseTask

      private EditorHost.ParseTask getParseTask(boolean forceCodeCompletion)
    • areAnyParserTasksPending

      public static boolean areAnyParserTasksPending()
    • areMoreThanOneParserTasksPendingForThisEditor

      protected boolean areMoreThanOneParserTasksPendingForThisEditor()
    • areMoreThanOneParserTasksGoingToUpdateContainingType

      protected boolean areMoreThanOneParserTasksGoingToUpdateContainingType()
    • isCompleteCode

      public boolean isCompleteCode()
    • setCompleteCode

      public void setCompleteCode(boolean bCompleteCode)
    • handleDot

      public void handleDot()
    • handleColon

      public void handleColon()
    • handleCompleteCode

      public void handleCompleteCode()
    • handleDot

      protected abstract void handleDot(ISymbolTable transientSymTable)
    • getSymbolTableAtCursor

      public abstract ISymbolTable getSymbolTableAtCursor()
    • runIfNoKeyPressedInMillis

      void runIfNoKeyPressedInMillis(long lMillis, Runnable task)
    • waitOnParserThread

      public static void waitOnParserThread()
    • getTimerCount

      public int getTimerCount()
    • waitForIntellisenseTimers

      public static void waitForIntellisenseTimers()
    • isAltDown

      public boolean isAltDown()