Class GoToMemberAction

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

    public class GoToMemberAction
    extends javax.swing.text.TextAction
    Displays a popup dialog with the "Go to member" tree. Language support implementations that can do in-depth parsing of the source code in an editor can create an AbstractSourceTree representing that source, and add this action to RSyntaxTextArea's input/action maps, so users can easily navigate to functions, methods, etc.

    The preferred keystroke to bind this action to is Ctrl+Shift+O (Cmd+Shift+O on Mac). Language supports should also be sure to uninstall this shortcut when they are uninstalled themselves.

    Version:
    1.0
    See Also:
    GoToMemberWindow, Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Class<?> outlineTreeClass
      The outline tree class appropriate for the current language.
      • Fields inherited from class javax.swing.AbstractAction

        changeSupport, enabled
      • Fields inherited from interface javax.swing.Action

        ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
    • Constructor Summary

      Constructors 
      Constructor Description
      GoToMemberAction​(java.lang.Class<?> outlineTreeClass)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent e)  
      private AbstractSourceTree createTree()
      Creates the outline tree.
      private void setLocationBasedOn​(GoToMemberWindow gtmw, org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea)
      Centers the window in the text area.
      • Methods inherited from class javax.swing.text.TextAction

        augmentList, getFocusedComponent, getTextComponent
      • Methods inherited from class javax.swing.AbstractAction

        addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.swing.Action

        accept
    • Field Detail

      • outlineTreeClass

        private java.lang.Class<?> outlineTreeClass
        The outline tree class appropriate for the current language.
    • Constructor Detail

      • GoToMemberAction

        public GoToMemberAction​(java.lang.Class<?> outlineTreeClass)
        Constructor.
        Parameters:
        outlineTreeClass - A class extending AbstractSourceTree. This class must have a no-argument constructor.
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)
      • createTree

        private AbstractSourceTree createTree()
        Creates the outline tree.
        Returns:
        An instance of the outline tree.
      • setLocationBasedOn

        private void setLocationBasedOn​(GoToMemberWindow gtmw,
                                        org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea)
        Centers the window in the text area.
        Parameters:
        gtmw - The window to center.
        textArea - The parent text area to center it in.