Package org.fife.rsta.ac
Class GoToMemberAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- javax.swing.text.TextAction
-
- org.fife.rsta.ac.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.TextActionDisplays 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 anAbstractSourceTreerepresenting that source, and add this action toRSyntaxTextArea'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<?>outlineTreeClassThe outline tree class appropriate for the current language.
-
Constructor Summary
Constructors Constructor Description GoToMemberAction(java.lang.Class<?> outlineTreeClass)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent e)private AbstractSourceTreecreateTree()Creates the outline tree.private voidsetLocationBasedOn(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
-
-
-
-
Constructor Detail
-
GoToMemberAction
public GoToMemberAction(java.lang.Class<?> outlineTreeClass)
Constructor.- Parameters:
outlineTreeClass- A class extendingAbstractSourceTree. 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.
-
-