<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    9910

    單飛

       :: 首頁 :: 聯系 :: 聚合  :: 管理
    發現有一些令人討厭的菜單存在自己的RCP程序,我想到的是應該能拿到MenuManager類,然后遍歷一下,去掉Search 菜單,可惜實在腦袋木了,就google了一下,找到解決的代碼:
    最近越來越懶了,自我批評一下: 平時不練功,關鍵的時候就只能靠Google這根救命草了。


    http://www.richclient2.eu/2006_03_20/getting-rid-of-convert-line-delimiters-to/

    Getting rid of “Convert Line Delimiters to”


    20. March 2006
    Tom Seidel @ 09:42

    If you're having dependencies to org.eclipse.ui.ide and you launch your RCP you'll automatically get an entry in the menu-bar that is called "Convert Line Delimiters to" and also "Last Edit Location", although you don't need it. To remove this entries place the following lines in your ApplicationActionBarAdvisor

    JAVA:
    1. ActionSetRegistry reg = WorkbenchPlugin.getDefault().getActionSetRegistry();
    2. IActionSetDescriptor[] actionSets = reg.getActionSets();
    3. // removing annoying gotoLastPosition Message.
    4. String actionSetId = "org.eclipse.ui.edit.text.actionSet.navigation"; //$NON-NLS-1$
    5. for (int i = 0; i <actionSets.length; i++)
    6. {
    7.     if (!actionSets[i].getId().equals(actionSetId))
    8.         continue;
    9.         IExtension ext = actionSets[i].getConfigurationElement()
    10.             .getDeclaringExtension();
    11.         reg.removeExtension(ext, new Object[] { actionSets[i] });
    12. }
    13. // Removing convert line delimiters menu.
    14. actionSetId = "org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo"; //$NON-NLS-1$
    15. for (int i = 0; i <actionSets.length; i++)
    16. {
    17.     if (!actionSets[i].getId().equals(actionSetId))
    18.         continue;
    19.     IExtension ext = actionSets[i].getConfigurationElement()
    20.             .getDeclaringExtension();
    21.    reg.removeExtension(ext, new Object[] { actionSets[i] });
    22. }
  • thanks Tom Seidel

    we tried it and , its working fine..great job

    thanks again

    Comment by biju — 29. September 2006 @ 09:09

  • Hi,

    thanks for this one - worked great. I enhanced it to get rid of “open file” as well and changed it so that walked only once through the loop. Takes about 15 millisec for three ids - so I think its quite fast :)

    And it seems to work in Eclipse 3.2 as well.

    Cheers,
    Christoph

    Comment by Christoph — 29. September 2006 @ 15:38

  • thanks.
    your tips really help me!
    finally I could remove “org.eclipse.ui.WorkingSetActionSet”

    Comment by aki — 9. April 2007 @ 16:12

  • This was very helpful thanks.

    I refactored it to avoid the duplication (DRY) as follows:

    private void removeExtraneousActions() {

    ActionSetRegistry reg = WorkbenchPlugin.getDefault().getActionSetRegistry();

    // removing gotoLastPosition message
    removeStandardAction(reg, “org.eclipse.ui.edit.text.actionSet.navigation”);

    // Removing “Convert Line Delimiters To” menu
    removeStandardAction(reg, “org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo”);
    }

    private void removeStandardAction(ActionSetRegistry reg, String actionSetId) {

    IActionSetDescriptor[] actionSets = reg.getActionSets();

    for (int i = 0; i

    Comment by Edward Garson — 23. April 2007 @ 15:37

  • Ah, there is some filtering going on.

    The implementationof “removeStandardAction” is like the original for loop.

    Have fun

    Comment by Edward Garson — 23. April 2007 @ 15:38

  • Great Job Thanks!!!

    Comment by GC — 9. July 2007 @ 17:18

  • Thanks a lot.

    Comment by Thanker — 28. December 2007 @ 21:08

  • Hi, i try to get rid of the”Open File” menu in the menubar which appeared with the “Convert Line Delimiters to”, how can i do this??
    I can’t fing the “actionSetId”

    Comment by cansen — 5. March 2008 @ 08:49

  • cool site man

    Comment by ben — 6. March 2008 @ 20:44

  • The actionsetid can be found in the plugin “org.eclipse.ui.ide” as extension at the “org.eclipse.ui.actionSets” extensionpoint. Its id is “org.eclipse.ui.actionSet.openFiles”

    Greets, Mike

     

  • posted on 2008-08-01 13:50 單飛 閱讀(791) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 在线不卡免费视频| 大香人蕉免费视频75| 亚洲午夜国产精品无码| 香蕉视频免费在线播放| 国产jizzjizz视频全部免费| 亚洲人成图片网站| 成年女人看片免费视频播放器| 久久久久精品国产亚洲AV无码| 日本成年免费网站| 一本天堂ⅴ无码亚洲道久久 | 久久99热精品免费观看动漫| 国产成A人亚洲精V品无码性色| 在线免费观看伊人三级电影| 亚洲人成影院在线无码按摩店| 一级毛片免费毛片一级毛片免费| 78成人精品电影在线播放日韩精品电影一区亚洲 | 亚洲成av人在片观看| 久久久免费观成人影院| 久久精品7亚洲午夜a| 91人成网站色www免费下载| 亚洲丰满熟女一区二区v| 国产成人高清精品免费软件| 美女被免费网站视频在线| 国产精品亚洲综合一区| 日韩免费高清播放器| 亚洲午夜电影在线观看| 在线观看免费国产视频| 国产高清对白在线观看免费91| 亚洲AV日韩精品久久久久久久| 18观看免费永久视频| 亚洲精品无码专区在线播放| 亚洲精品成人在线| 亚洲人成在线免费观看| 免费播放美女一级毛片| 亚洲AV无码一区东京热| 毛片免费全部播放一级| a国产成人免费视频| 亚洲一区二区无码偷拍| 亚洲综合在线另类色区奇米| 亚洲黄色免费电影| 一区二区视频在线免费观看|