How do I enable global actions such as Cut, Paste, and Print in my editor?
2011-12-11 14:20
441 查看
FAQHowdoIenableglobalactionssuchasCut,Paste,andPrintinmyeditor?
如何在Editor激活时关联全局的RetargetAction?
Youreditor'sIEditorActionBarContributor,definedintheeditordefinitionintheplugin.xmlfile,isresponsibleforenablingglobalactions.Wheneveryoureditorbecomestheactivepart,themethod
setActiveEditoriscalledontheactionbarcontributor.Thisiswhereyoucanretargettheglobalactionsforyoureditor.Keepinmindthateacheditortypehasonlyoneeditoractionbarcontributor,soyouneedtoupdateyouractionstoreflect
thecurrenteditor.Inthisexample,theglobalPrintactionisbeingretargetedtotheactiveeditor:
IActionprint=...; publicvoidsetActiveEditor(IEditorPartpart){ IActionBarsbars=getActionBars(); if(bars==null) return; print.setEditor(part); bars.setGlobalActionHandler( IWorkbenchActionConstants.PRINT,print); bars.updateActionBars(); }
来自EclipseRCPFAQ。
相关文章推荐
- How do I hook into global actions, such as Copy and Delete?
- How to Cut, Copy, and Paste in the Terminal
- How to Copy and Paste in the Ubuntu Gnome Terminal
- How to copy and paste quickly in the shell
- How-to: Enable User Authentication and Authorization in Apache HBase
- How to enable Apache, OC4J and OPMN logging in Oracle Applications R12
- How are the icon files in my application bundle used on iPad and iPhone
- How to enable time stamps for logs in 'dmesg' on Gaia and SecurePlatform
- How to select the data type in SQLserver database such as varchar, nvarchar
- How-to: Enable User Authentication and Authorization in Apache HBase
- What is Logical Volume Management and How Do You Enable It in Ubuntu?
- use noscript html tag when user disable the javascript in browser, guide user how to enable the js in different browser and retu
- Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
- How to Enable and Disable Root Login in Ubuntu
- How to Copy and Paste in the Ubuntu Gnome Terminal
- how to use a SQLite database in a standalone program with an HTML interface and VBScript as the programming language
- No refs in common and none specified; doing nothing. Perhaps you should specify a branch such as 'ma
- in a devstack Openstack env, how to start a service, such as aodh-listener
- Enable Clipboard Copy and Paste in vSphere
- How to Enable and Run a Payables Concurrent Program in Debug Mode