站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

MainMenuAction (Editor Module) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor/3 1.32.0

org.netbeans.modules.editor
Class MainMenuAction

java.lang.Object
  extended by org.netbeans.modules.editor.MainMenuAction
All Implemented Interfaces:
EventListener, ChangeListener, Presenter, Presenter.Menu, LookupListener
Direct Known Subclasses:
MainMenuAction.CommentAction, MainMenuAction.FindNextAction, MainMenuAction.FindPreviousAction, MainMenuAction.FindSelectionAction, MainMenuAction.FormatAction, MainMenuAction.GoToDeclarationAction, MainMenuAction.GoToSourceAction, MainMenuAction.GoToSuperAction, MainMenuAction.JumpBackAction, MainMenuAction.JumpForwardAction, MainMenuAction.PasteFormattedAction, MainMenuAction.RemoveTrailingSpacesAction, MainMenuAction.ShiftLineLeftAction, MainMenuAction.ShiftLineRightAction, MainMenuAction.ShowLineNumbersAction, MainMenuAction.ShowToolBarAction, MainMenuAction.StartMacroRecordingAction, MainMenuAction.StopMacroRecordingAction, MainMenuAction.UncommentAction, MainMenuAction.WordMatchNextAction, MainMenuAction.WordMatchPrevAction

public abstract class MainMenuAction
extends Object
implements Presenter.Menu, ChangeListener

Main menu action, like Edit/Go to Source, Edit/Go to Line..., View/Show Editor Toolbar, View/Show Line Numbers This is the action implements Presenter.Menu and delegates on specific actions like ExtKit.toggleToolbarAction or ExtKit.gotoSuperImplementationAction


Nested Class Summary
static class MainMenuAction.CommentAction
          Comment action in Source main menu, wrapper for ExtKit.commentAction
static class MainMenuAction.FindNextAction
          Find Next action in Edit main menu, wrapper for BaseKit.findNextAction
static class MainMenuAction.FindPreviousAction
          Find Previous action in Edit main menu, wrapper for BaseKit.findPreviousAction
static class MainMenuAction.FindSelectionAction
          Find Selection action in Edit main menu, wrapper for BaseKit.findSelectionAction
static class MainMenuAction.FormatAction
          Reformat Code action in Source main menu, wrapper for BaseKit.formatAction
static class MainMenuAction.GoToDeclarationAction
           
static class MainMenuAction.GoToSourceAction
           
static class MainMenuAction.GoToSuperAction
           
static class MainMenuAction.JumpBackAction
          Back action in Go To main menu, wrapper for BaseKit.jumpListPrevAction
static class MainMenuAction.JumpForwardAction
          Forward action in Go To main menu, wrapper for BaseKit.jumpListNextAction
static class MainMenuAction.PasteFormattedAction
          Paste Formatted action in Edit main menu, wrapper for BaseKit.pasteFormattedAction
static class MainMenuAction.RemoveTrailingSpacesAction
          Remove Trailing Spaces action in View main menu, wrapper for BaseKit.removeTrailingSpaces
static class MainMenuAction.ShiftLineLeftAction
          Shift Left action in Source main menu, wrapper for BaseKit.shiftLineLeftAction
static class MainMenuAction.ShiftLineRightAction
          Shift Right action in Source main menu, wrapper for BaseKit.shiftLineRightAction
static class MainMenuAction.ShowLineNumbersAction
           
static class MainMenuAction.ShowToolBarAction
           
static class MainMenuAction.StartMacroRecordingAction
          Start Macro Recording action in View main menu, wrapper for BaseKit.startMacroRecordingAction
static class MainMenuAction.StopMacroRecordingAction
          Stop Macro Recording action in View main menu, wrapper for BaseKit.stopMacroRecordingAction
static class MainMenuAction.UncommentAction
          Uncomment action in Source main menu, wrapper for ExtKit.uncommentAction
static class MainMenuAction.WordMatchNextAction
          Insert Next Matching Word action in Source main menu, wrapper for BaseKit.wordMatchNextAction
static class MainMenuAction.WordMatchPrevAction
          Insert Previous Matching Word action in Source main menu, wrapper for BaseKit.wordMatchPrevAction
 
Nested classes/interfaces inherited from interface org.openide.util.actions.Presenter
Presenter.Menu, Presenter.Popup, Presenter.Toolbar
 
Field Summary
static Icon BLANK_ICON
           
 boolean menuInitialized
           
 
Constructor Summary
MainMenuAction()
          Creates a new instance of ShowLineNumbersAction
MainMenuAction(boolean forceIcon, Icon forcedIcon)
           
 
Method Summary
protected static void addAccelerators(Action a, JMenuItem item, JTextComponent target)
          Adds accelerators to given JMenuItem taken from the action
protected abstract  String getActionName()
          Get the action name
protected  ActionMap getContextActionMap()
           
protected  KeyStroke getDefaultAccelerator()
          Get default accelerator
protected  Action getGlobalKitAction()
          If there is no kit sensitive action, some global kit action can be returned by subclasses.
 HelpCtx getHelpCtx()
           
protected abstract  String getMenuItemText()
          Get the text of the menu item
 String getName()
           
 boolean isEnabled()
           
 void resultChanged(LookupEvent ev)
           
protected  void setMenu()
          Sets the state of JMenuItem
 void stateChanged(ChangeEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openide.util.actions.Presenter.Menu
getMenuPresenter
 

Field Detail

BLANK_ICON

public static final Icon BLANK_ICON

menuInitialized

public boolean menuInitialized
Constructor Detail

MainMenuAction

public MainMenuAction()
Creates a new instance of ShowLineNumbersAction


MainMenuAction

public MainMenuAction(boolean forceIcon,
                      Icon forcedIcon)
Method Detail

resultChanged

public void resultChanged(LookupEvent ev)
Specified by:
resultChanged in interface LookupListener

stateChanged

public void stateChanged(ChangeEvent e)
Specified by:
stateChanged in interface ChangeListener

getHelpCtx

public HelpCtx getHelpCtx()

getName

public String getName()

addAccelerators

protected static void addAccelerators(Action a,
                                      JMenuItem item,
                                      JTextComponent target)
Adds accelerators to given JMenuItem taken from the action


isEnabled

public boolean isEnabled()

getGlobalKitAction

protected Action getGlobalKitAction()
If there is no kit sensitive action, some global kit action can be returned by subclasses. Returning null by default


setMenu

protected void setMenu()
Sets the state of JMenuItem


getMenuItemText

protected abstract String getMenuItemText()
Get the text of the menu item


getActionName

protected abstract String getActionName()
Get the action name


getDefaultAccelerator

protected KeyStroke getDefaultAccelerator()
Get default accelerator


getContextActionMap

protected ActionMap getContextActionMap()

org.netbeans.modules.editor/3 1.32.0

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.