idea插件编写之二

做人要有始有终,答应的下一篇一定会给你们写,虽然以后可能不再会做插件这类的技术了,但也很开心给我这个机会,让我做机试题。

idea插件自定义按钮打开EditRunConfigurations

上一篇教大家学会了创建idea的自定义按钮,这一节在action创建完毕的基础上,给大家讲一下点击事件。

1.打开一个idea已有的面板,离不开这四句话,而第一句,想必不用解释了,看不懂得,请看一下getInstance()的用法,以及单例模式;第二句是根据点击事件的id查找action,这个Id是定死的,给大家提供一些Id在文章末端,喜欢的宝宝,请关注

ActionManager instance = ActionManager.getInstance();
AnAction action1 = instance.getAction("editRunConfigurations");
InputEvent inputEvent1 = ActionCommand.getInputEvent("editRunConfigurations");
ActionCallback callback1 = ActionManager.getInstance().tryToExecute(action1, inputEvent1, null, null, true);


然后点击打开的时候,就会弹出下面的框


是不是很简单呢

ActionId

Built-in Action ID's

These are the names of the actions built into IntelliJ IDEA. You can use these ID's and group names in <add-to-group> tags in your plugin's plugin.xml.

Each table shows the actions in a group, whose ID is shown in fixed-width font, along with the ID of its parent groups (for reference) and its displayed name. You can use the group ID in <add-to-group>'s group-idattribute.

Each row in the table represents an action, whose ID can be used in <add-to-group>'s relative-to-action attribute.

Last updated: IDEA 5.0.2 build 3511.

Root Action Group
IDName
CaptureMemorySnapShotCapture memory snapshot
CaptureCPUUsageDataCapture cpu usage data
ContextHelpContext Help
RunConfigurationSelect Run/Debug Configuration
ShowIntentionActionsShow Intention Actions
ToggleReadOnlyAttributeToggle Read-Only Attribute
TogglePopupHintsToggle Popup Hints for Current File
RunGcRun Garbage Collector
ShowPopupMenuShow Context Menu
CloseWindowClose Active Window
Vcs.ShowHistoryShow File History
Vcs.ShowHistoryForBlockShow History for Selection
Vcs.ShowTabbedFileHistoryShow History
AddToFavoritesPopupAdd To Favorites
AddNewFavoritesListAdd New Favorites List
ExpandAllExpand All
CollapseAllCollapse All
ExportToTextFileExport to Text File
ExpandTreeNodeExpand Tree Node
CollapseTreeNodeCollapse Tree Node
FullyExpandTreeNodeFully Expand Tree Node
NextDiffMove to the next difference
PreviousDiffMove to the previous difference
RefreshRefresh
CheckinProjectCheck In Project
CheckinFilesCheck In
UpdateFilesUpdate
CheckStatusForFilesCheck Status
AnnotateAnnotate
Compare.SameVersionCompare with The Same Repository Version
Compare.LastVersionCompare with The Last Repository Version
Compare.SelectedCompare with...
Compare.SpecifiedCompare with Specified Revision...
CompareTwoFilesCompare Two Files
CompareFileWithEditorCompare File with Editor
ModuleSettingsModule Settings...
RunContextGroup
IDName
CreateRunConfigurationCreate Run Configuration
EditorActions (Editor Actions)
IDName
EditorChooseLookupItemChoose Lookup Item
EditorChooseLookupItemReplaceChoose Lookup Item Replace
NextTemplateVariableNext Template Variable
PreviousTemplateVariablePrevious Template Variable
NextParameterNext Parameter
PrevParameterPrev Parameter
EditorPageUpPage Up
EditorPageDownPage Down
EditorPageUpWithSelectionPage Up with Selection
EditorPageDownWithSelectionPage Up with Selection
EditorCopyCopy
EditorCutCut
EditorPastePaste
EditorPasteSimplePaste Simple
EditorPasteFromX11Paste from X clipboard
EditorDeleteDelete
EditorBackSpaceBackspace
EditorMoveToPageTopMove Caret to Page Top
EditorMoveToPageBottomMove Caret to Page Bottom
EditorMoveToPageTopWithSelectionMove Caret to Page Top with Selection
EditorMoveToPageBottomWithSelectionMove Caret to Page Bottom with Selection
EditorEnterEnter
EditorEscapeEscape
EditorUpUp
EditorDownDown
EditorLeftLeft
EditorRightRight
EditorUpWithSelectionUp with Selection
EditorDownWithSelectionDown with Selection
EditorLeftWithSelectionLeft with Selection
EditorRightWithSelectionRight with Selection
EditorIndentSelectionIndent Selection
EditorUnindentSelectionUnindent Selection
EditorTabTab
EmacsStyleIndentEmacs Tab
EditorScrollUpScroll Up
EditorScrollDownScroll Down
EditorMoveUpAndScrollMove Up and Scroll
EditorMoveDownAndScrollMove Down and Scroll
EditorMoveUpAndScrollWithSelectionMove Up and Scroll with Selection
EditorMoveDownAndScrollWithSelectionMove Down and Scroll with Selection
EditorLineStartMove Caret to Line Start
EditorLineEndMove Caret to Line End
EditorCutLineEndCut up to Line End
EditorTextStartMove Caret to Text Start
EditorTextEndMove Caret to Text End
EditorLineStartWithSelectionMove Caret to Line Start with Selection
EditorLineEndWithSelectionMove Caret to Line End with Selection
EditorTextStartWithSelectionMove Caret to Text Start with Selection
EditorTextEndWithSelectionMove Caret to Text End with Selection
EditorNextWordMove Caret to Next Word
EditorPreviousWordMove Caret to Previous Word
EditorNextWordWithSelectionMove Caret to Next Word with Selection
EditorPreviousWordWithSelectionMove Caret to Previous Word with Selection
EditorCodeBlockStartMove Caret to Code Block Start
EditorCodeBlockEndMove Caret to Code Block End
EditorCodeBlockStartWithSelectionMove Caret to Code Block Start with Selection
EditorCodeBlockEndWithSelectionMove Caret to Code Block End with Selection
EditorDeleteToWordStartDelete to Word Start
EditorDeleteToWordEndDelete to Word End
EditorDeleteLineDelete Line at Caret
EditorDuplicateDuplicate Line or Block
EditorSelectWordSelect Word at Caret
EditorUnSelectWordUnselect Word at Caret
EditorToggleInsertStateToggle Insert/Overwrite
EditorToggleColumnModeColumn Mode
EditorToggleShowWhitespacesShow Whitespaces
EditorToggleShowLineNumbersShow Line Numbers
EditorScrollToCenterScroll to Center
EditorToggleCaseToggle Case
EditorJoinLinesJoin Lines
EditorSelectLineSelect Line at Caret
EditorSplitLineSplit Line
EditorStartNewLineStart New Line
EditorCompleteStatementComplete Current Statement
J2EEGenerateGroup
IDName
CreateSessionBeanSession Bean
CreateContainerManagedEntityBeanActionCMP Entity Bean
CreateBeanManagedEntityBeanActionBMP Entity Bean
CreateMessageBeanMessage Bean
CreateTransferObjectTransfer Object
CreateCMPFieldCMP Field
CreateEJBRelationshipEJB Relationship
CreateJSPActionJsp
CreateJSPXActionJspx
CreateServletActionServlet
CreateFilterActionFilter
CreateListenerActionListener
GenerateGroup (Generate)
IDName
GenerateConstructorConstructor
GenerateGetterGetter
GenerateSetterSetter
GenerateGetterAndSetterGetter and Setter
GenerateEqualsequals() and hashCode()
OverrideMethodsOverride Methods...
ImplementMethodsImplement Methods...
DelegateMethodsDelegate Methods...
GenerateSuperMethodCallsuper method call
NewGroup (New)
IDName
NewClassClass
NewInterfaceInterface
NewEnumEnum
NewAnnotationType@Interface
NewFileFile
NewDirDirectory/Package
NewFromTemplateFrom Template
NewDialogDialog
LocalVcsGroup (Local History)
IDName
LocalVcs.ShowHistoryShow History
LocalVcs.HistoryForBlockShow History for Selection
LocalVcs.AddLabelAdd Label...
VcsGroups (Version Control)
IDName
Vcs.MarkSourcesAsCurrentMark Project as Current
VcsGroups > VcsGlobalGroup (Version Control Group)
IDName
Vcs.FileViewShow File View
Vcs.UpdateProjectUpdate Project
Vcs.ProjectStatusCheck Project Status
MainMenu > FileMenu (File)
IDName
NewProjectNew Project...
NewModuleNew Module...
OpenProjectOpen Project...
OpenFileOpen File...
CloseProjectClose Project
ShowSettingsSettings
TemplateProjectPropertiesTemplate Project Settings
SaveAllSave All
ExportSettingsExport Settings...
ImportSettingsImport Settings...
ImportFromJBuilderImport From JBuilder
SynchronizeSynchronize
ReloadFromDiskReload from Disk
ExportToHTMLExport to HTML...
PrintPrint...
ExitExit
MainMenu > EditMenu (Edit)
IDName
$UndoUndo
$RedoRedo
$SelectAllSelect All
NewElementNew...
$DeleteDelete
ToggleBookmarkToggle Bookmark
ShowBookmarksShow Bookmarks
MainMenu > EditMenu > CutCopyPasteGroup
IDName
$CutCut
$CopyCopy
CopyPathsCopy Paths
CopyReferenceCopy Reference
$PastePaste
PasteMultiplePaste...
MainMenu > SearchMenu (Search)
IDName
FindFind...
ReplaceReplace...
FindNextFind Next
FindPreviousFind Previous
FindWordAtCaretFind Word at Caret
IncrementalSearchIncremental Search
FindUsagesFind Usages...
FindUsagesInFileFind Usages in File...
HighlightUsagesInFileHighlight Usages in File
FindJoinpointsByPointcutActionFind Join Point Identified by Pointcut
FindInPathFind in Path...
ReplaceInPathReplace in Path...
MainMenu > ViewMenu (View)
IDName
ViewToolBarToolbar
ViewStatusBarStatus Bar
ToggleFullScreenModeFull Screen
EditSourceJump to Source
ViewSourceShow Source
OpenInBrowserOpen in Browser
ExternalJavaDocExternal JavaDoc
RecentFilesRecent Files...
QuickChangeSchemeQuick Switch Scheme...
TypeHierarchyType Hierarchy
MethodHierarchyMethod Hierarchy
CallHierarchyCall Hierarchy
RecentChangesRecent Changes...
MainMenu > ViewMenu > CodeEditorViewGroup
IDName
FileStructurePopupFile Structure Popup
SelectInSelect In...
QuickJavaDocQuick Documentation Lookup
QuickImplementationsQuick Definition Lookup
ParameterInfoParameter Info
EditorContextInfoContext Info
ShowErrorDescriptionError Description
MainMenu > ViewMenu > CommanderViewGroup
IDName
CommanderSyncViewsSynchronize Views
CommanderSwapPanelsSwap Panels
MainMenu > ViewMenu > ProjectViewGroup
IDName
ProjectViewChangeViewChange View
MainMenu > ViewMenu > FoldingGroup (Folding)
IDName
ExpandRegionExpand
CollapseRegionCollapse
ExpandAllRegionsExpand All
CollapseAllRegionsCollapse All
ExpandJavadocsExpand Javadocs
CollapseJavadocsCollapse Javadocs
CollapseSelectionFold Selection / Remove region
CollapseBlockFold Code Block
MainMenu > GoToMenu (Go To)
IDName
GotoClassClass...
GotoFileFile...
GotoSymbolSymbol...
GotoLineLine...
GotoDeclarationDeclaration
GotoDefinitionDefinition
GotoUsageUsage
GotoImplementationImplementation(s)
SmartGotoImplementationCalled Implementation(s)
GotoTypeDeclarationType Declaration
GotoSuperMethodSuper Method
GotoAspectAspect
GotoNextErrorNext Highlighted Error
GotoPreviousErrorPrevious Highlighted Error
MethodDownNext Method
MethodUpPrevious Method
GotoNextBookmarkNext Bookmark
GotoPreviousBookmarkPrevious Bookmark
BackBack
ForwardForward
JumpToLastChangeLast Edit Location
PreviousOccurencePrevious Occurrence
NextOccurenceNext Occurrence
VcsShowNextChangeMarkerGo To Next Change
VcsShowPrevChangeMarkerGo To Prev Change
MainMenu > CodeMenu (Code)
IDName
SurroundWithSurround With...
GenerateGenerate...
InsertLiveTemplateInsert Live Template...
SurroundWithLiveTemplateSurround with Live Template...
CommentByLineCommentComment with Line Comment
CommentByBlockCommentComment with Block Comment
ReformatCodeReformat Code...
AutoIndentLinesAuto-Indent Lines
OptimizeImportsOptimize Imports...
MoveStatementDownMove Statement Down
MoveStatementUpMove Statement Up
MainMenu > CodeMenu > CodeCompletionGroup (Complete Code)
IDName
CodeCompletionBasic
WordCompletionComplete Word
SmartTypeCompletionSmartType
ClassNameCompletionClass Name
MainMenu > AnalyzeMenu (Analyze)
IDName
InspectCodeInspect Code...
InspectCodeWithEditorProfileInspect Code With Editor Settings
ViewOfflineInspectionView Offline Inspection Results...
ShowPackageDepsAnalyze Dependencies...
ShowBackwardPackageDepsAnalyze Backward Dependencies...
ShowPackageCyclesAnalyze Cyclic Dependencies...
ShowModulesDependenciesAnalyze Module Dependencies...
DupLocateLocate Duplicates...
UnscrambleAnalyze Stacktrace...
MainMenu > RefactoringMenu (Refactor)
IDName
RenameElementRename...
ChangeSignatureChange Signature...
MakeStaticMake Static...
ConvertToInstanceMethodConvert To Instance Method...
MoveMove...
CopyElementCopy...
CloneElementClone...
SafeDeleteSafe Delete...
ExtractMethodExtract Method...
MethodDuplicatesReplace Method Code Duplicates...
IntroduceVariableIntroduce Variable...
IntroduceFieldIntroduce Field...
IntroduceConstantIntroduce Constant...
IntroduceParameterIntroduce Parameter...
ExtractInterfaceExtract Interface...
ExtractSuperclassExtract Superclass...
TurnRefsToSuperUse Interface Where Possible...
MembersPullUpPull Members Up...
MemberPushDownPush Members Down...
InheritanceToDelegationReplace Inheritance with Delegation...
InlineInline...
AnonymousToInnerConvert Anonymous to Inner...
EncapsulateFieldsEncapsulate Fields...
ReplaceTempWithQueryReplace Temp with Query...
ReplaceConstructorWithFactoryReplace Constructor with Factory Method...
GenerifyGenerify...
MigrateMigrate...
Type MigrationType Migration...
ExtractIncludeExtract Include File...
MainMenu > BuildMenu (Build)
IDName
CompileProjectRebuild Project
CompileDirtyMake Project
MakeModuleMake Module
CompileCompile
GenerateAntBuildGenerate Ant Build
BuildJarBuild Jars...
MainMenu > RunMenu (Run)
IDName
editRunConfigurationsEdit Configurations
StopStop
HotswapReload Changed Classes
StepOverStep Over
StepIntoStep Into
StepOutStep Out
ForceStepOverForce Step Over
ForceStepIntoForce Step Into
RunToCursorRun to Cursor
Debugger.PopFramePop Frame
PausePause Program
ResumeResume Program
EvaluateExpressionEvaluate Expression...
QuickEvaluateExpressionQuick Evaluate Expression
ShowExecutionPointShow Execution Point
ToggleLineBreakpointToggle Line Breakpoint
ToggleMethodBreakpointToggle Method Breakpoint
ToggleFieldBreakpointToggle Field Watchpoint
ToggleBreakpointEnabledToggle Breakpoint Enabled
ViewBreakpointsView Breakpoints
ExportThreadsExport Threads...
MainMenu > ToolsMenu (Tools)
IDName
SaveAsTemplateSave as Live Template...
SaveFileAsTemplateSave File as Template...
GenerateJavadocGenerate JavaDoc...
DataSourcesData Sources...
MainMenu > ToolsMenu > Macros > StanardMacroActions (Standard Macro Actions)
IDName
PlaybackLastMacroPlayback Last Macro
StartStopMacroRecordingStart/Stop Macro Recording
EditMacrosEdit Macros...
MainMenu > ToolsMenu >
IDName
ValidateXmlValidate
AddAntBuildFileAdd as Ant Build File
GenerateDTDGenerate DTD from XML file
MainMenu > ToolsMenu > (Internal Actions)
IDName
PsiViewerView PSI Structure
DebugListenThrow Debug Exception
VirtualFileInfoVirtual File Info
Merge3FilesMerge
DecodeBytesActionDecode Bytes
LocalVcs.ShowStatisticsShow Local VCS Statistics...
LocalVcs.ShowRepHistoryRepository History
DropAnErrorDrop an error
ShowUserActivitiesShow Activities
MainMenu > ToolsMenu > MemoryManagement (Memory Management)
IDName
DumpPsiMemoryCachesDump what is cached in PSI
MainMenu > WindowMenu (Window)
IDName
StoreDefaultLayoutStore Current Layout as Default
RestoreDefaultLayoutRestore Default Layout
HideActiveWindowHide Active Window
HideAllWindowsHide All Windows
JumpToLastWindowJump to Last Window
TogglePinnedModePinned Mode
ToggleDockModeDocked Mode
ToggleFloatingModeFloating Mode
NextTabSelect Next Tab
PreviousTabSelect Previous Tab
CloseActiveTabClose Active Tab
PinActiveTabPin Active Tab
CloseEditorClose Active Editor
CloseAllEditorsClose All Editors
CloseAllEditorsButActiveClose All Editors But Active
CloseAllUnmodifiedEditorsClose All Unmodified Editors
SplitVerticallySplit Vertically
SplitHorizontallySplit Horizontally
ChangeSplitOrientationChange Splitter Orientation
UnsplitUnsplit
UnsplitAllUnsplit All
NextSplitterGoto Next Splitter
PrevSplitterGoto Previous Splitter
MainMenu > HelpMenu (Help)
IDName
HelpTopicsHelp Topics
ShowTipsTip of the Day
ProductivityGudeProductivity Guide
OnlineDocActionOnline Documentation
WhatsNewActionWhat's New in IDEA 5.0
Help.KeymapReferenceDefault Keymap Reference
RegisterRegister...
CheckForUpdateCheck for Update...
AboutAbout
Bookmarks (Bookmarks)
IDName
ToggleBookmark0Toggle Bookmark 0
ToggleBookmark1Toggle Bookmark 1
ToggleBookmark2Toggle Bookmark 2
ToggleBookmark3Toggle Bookmark 3
ToggleBookmark4Toggle Bookmark 4
ToggleBookmark5Toggle Bookmark 5
ToggleBookmark6Toggle Bookmark 6
ToggleBookmark7Toggle Bookmark 7
ToggleBookmark8Toggle Bookmark 8
ToggleBookmark9Toggle Bookmark 9
GotoBookmark0Go to Bookmark 0
GotoBookmark1Go to Bookmark 1
GotoBookmark2Go to Bookmark 2
GotoBookmark3Go to Bookmark 3
GotoBookmark4Go to Bookmark 4
GotoBookmark5Go to Bookmark 5
GotoBookmark6Go to Bookmark 6
GotoBookmark7Go to Bookmark 7
GotoBookmark8Go to Bookmark 8
GotoBookmark9Go to Bookmark 9
DebuggerActions
IDName
Debugger.AdjustArrayRangeAdjust Range...
Debugger.InspectInspect
Debugger.CopyValueCopy Value
Debugger.CustomizeContextViewCustomize Data Views...
Debugger.CustomizeThreadsViewCustomize Threads View...
Debugger.NewWatchNew Watch...
Debugger.EditWatchEdit Watch
Debugger.EditFrameSourceEditFrameSource
Debugger.EditNodeSourceEditNodeSource
Debugger.EditTypeSourceJump to Object Source
Debugger.RemoveAllWatchesRemove All Watches
Debugger.RemoveWatchRemove Watch
Debugger.ViewAsGroupView as
Debugger.SetValueSet Value...
Debugger.ShowFrameShow Frame
Debugger.ResumeThreadResume
Debugger.FreezeThreadFreeze
Debugger.MuteBreakpointsMute Breakpoints
Debugger.ToggleStepThreadSuspendPolicySuspend All Threads While Stepping
Debugger.AddToWatchAdd to Watches
Debugger.Representation
IDName
Debugger.AutoRendererAuto
EditorPopupMenu (Editor Popup Menu)
IDName
Add to migration rootsAdd to migration roots
ValidateJspValidate JSP
PackageFilePackage file
CompareClipboardWithSelectionCompare with Clipboard
ShowAppliedStylesActionShow Applied Styles For Tag
ChangeScheme
IDName
ChangeColorSchemeSwitch Color Scheme
ChangeCodeStyleSchemeSwitch Code Style Scheme
ChangeKeymapSwitch Keymap
ChangeLafSwitch Look&Feel
ChangeInspectionProfileSwitch Editor Highlighting
ChangeCustomizationSchemaSwitch Customization Schema
EditorTabPopupMenu
IDName
MoveEditorToOppositeTabGroupMove Editor To Opposite Tab Group
ProjectViewPopupMenu
IDName
AssociateWithFileTypeAssociate with File Type
SynchronizeCurrentFileSynchronize selected file
J2EEViewPopupMenu
IDName
OpenCustomEditorEdit...
FavoritesViewPopupMenu
IDName
RemoveFromFavoritesRemove From Favorites
TypeHierarchyPopupMenu
IDName
TypeHierarchy.BaseOnThisTypeBase On This Type
TypeHierarchy.ClassClass Hierarchy
TypeHierarchy.SubtypesSubtypes Hierarchy
TypeHierarchy.SupertypesSupertypes Hierarchy
MethodHierarchyPopupMenu
IDName
MethodHierarchy.ImplementMethodActionImplement Method
MethodHierarchy.OverrideMethodActionOverride Method
MethodHierarchy.BaseOnThisTypeBase On This Type
CallHierarchyPopupMenu
IDName
CallHierarchy.BaseOnThisTypeBase On This Method
Lvcs.DirectoryHistoryPopup
IDName
Lvcs.ShowLvcsDiffActionCompare Versions
Lvcs.RollbackFileActionRollback File
Vcs.CheckinProjectPopup
IDName
Vcs.ShowDiffActionShow Changes
Vcs.RollbackChangesRollback Changes
Vcs.EditSourceActionEdit Source
Vcs.ExcludeActionExclude from Commit
Vcs.IncludeActionInclude into Commit
TestTreePopupMenu
IDName
openAssertEqualsDiffView assertEquals Difference
TestStatisticsTablePopupMenu
IDName
JUnitTesting.SelectInTreeSelect in Tree
UsageView.Popup
IDName
UsageView.IncludeInclude
UsageView.ExcludeExclude
GuiDesigner.EditorPopupMenu
IDName
GuiDesigner.PreviewFormPreview
GuiDesigner.DataBindingWizardData Binding Wizard...
GuiDesigner.LayOutHorizontallyLay Out Horizontally
GuiDesigner.LayOutVerticallyLay Out Vertically
GuiDesigner.LayOutInGridLay Out In a Grid
GuiDesigner.BreakLayoutBreak Layout
GuiDesigner.ExpandSelectionExpand Selection
GuiDesigner.ShrinkSelectionShrink Selection
GuiDesigner.PropertyInspectorPopupMenu
IDName
GuiDesigner.QuickJavadocQuick JavaDoc
StructuralSearchActions
IDName
StructuralSearchPlugin.StructuralSearchActionSearch Structurally...
StructuralSearchPlugin.StructuralReplaceActionReplace Structurally...

This file was generated by Keith Lea using this XSL stylesheet using the file ActionManager.xml . This file is located inside lib/resources.jar , in your IDEA installation folder. under its idea/ folder.


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值