简体   繁体   中英

Using default command in Eclipse RCP 4.X

I want to use some default commands that the Eclipse Framework provide for us. For example I want to use a default command (Handler) which are implementing the Copy/Paste/Cut etc. mechanism.

I found some information, that eclipse define some default keys like these:

  • Save: org.eclipse.ui.file.save
  • Save All: org.eclipse.ui.file.saveAll
  • Undo: org.eclipse.ui.edit.undo
  • Copy: org.eclipse.ui.edit.copy

Now I have use these keys to define some commands etc. in the Application.e4xmi file.

Application.e4xmi命令

Application.e4xmi命令类别

Application.e4xmi MenuHandleItem

But this configuration is not working, did I have miss some config setting, or did I make something complete wrong?

An Eclipse e4 application does not define default handlers for anything. You must provide handlers for everything.

The commands you mention (such as org.eclipse.ui.file.save ) have predefined ids because some things in the Eclipse code reference them by the id.

You may see references to 'default handlers' but this will be talking about Eclipse 3.x style command handling.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM