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

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

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

    West Farm
    吾本布衣,生于川北,躬耕于代碼的田地上。
    posts - 16,  comments - 15,  trackbacks - 0
    本文用英文寫的,主要是考慮到本文分享的內容即使在google上也搜索不到(至少我是沒有搜索到)。

    My English is at a very low level, don't care about this fact, just focus on the idea shared here.

    The idea comes from the source code of ConfigurationElement which is located in package org.eclipse.core.internal.registry, If you read through the source code, you can also get it. But I found there is no documentation about this topic, so I wrote this.

    Sometimes we need to contribute java class to a extension point. And we can use ConfigurationElement#
    createExecutableExtension(String attributeName) to create an instance of it, if such a class is just a normal class, eclipse will  call class#newInstance(). But there is obvious restriction for using this approach, can't pass parameter in to create instance for example.

    There are three different way how eclipse create instance of your class.

    1. normal, call class#newInstance()
    2. if your calss implements IExecutableExtension interface, IExecutableExtension#setInitializationData(IConfigurationElement config, String propertyName, Object data) will be called on the instance returned by class#newInstance()
    3. if your calss implements IExecutableExtensionFactory interface, IExecutableExtensionFactory#create() will be called

    When you use the second method or the third method, you can pass in parameters, check the source code of ConfigurationElement, you will know how to do that. :D forgive me, I'm lazy. 
    posted on 2012-04-15 16:33 West Farmer 閱讀(329) 評論(0)  編輯  收藏

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


    網站導航:
     

    <2012年4月>
    25262728293031
    1234567
    891011121314
    15161718192021
    22232425262728
    293012345

    常用鏈接

    留言簿

    隨筆分類

    隨筆檔案

    相冊

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: gogo全球高清大胆亚洲| 亚洲国产精品yw在线观看| 亚洲AV女人18毛片水真多| 少妇高潮太爽了在线观看免费| 久久久亚洲AV波多野结衣| 亚洲欧洲免费视频| 亚洲黄色在线视频| 日韩视频在线精品视频免费观看| 亚洲视频在线免费播放| 天天影院成人免费观看| 色婷五月综激情亚洲综合| 成年午夜视频免费观看视频 | 国产一区二区三区在线免费| 亚洲精华国产精华精华液好用| 暖暖在线日本免费中文| 人人爽人人爽人人片A免费| 国产亚洲精品精品国产亚洲综合| aa在线免费观看| 久久精品国产亚洲AV嫖农村妇女| 日本最新免费网站| 亚洲AV色欲色欲WWW| 亚洲国产精品无码久久青草| 国产中文字幕在线免费观看| 久久亚洲精品无码VA大香大香| 免费可以看黄的视频s色| 黄人成a动漫片免费网站| 亚洲精品狼友在线播放| 久久久久久精品成人免费图片| 亚洲中文字幕乱码熟女在线| 国产AⅤ无码专区亚洲AV| 最近2019免费中文字幕6| 亚洲欧洲无码一区二区三区| 免费一级毛片在级播放| 亚洲免费在线播放| 亚洲AV性色在线观看| 亚洲色精品aⅴ一区区三区| 亚洲高清中文字幕免费| 人人鲁免费播放视频人人香蕉| 亚洲视频中文字幕在线| 国产免费av一区二区三区| 无码国产精品一区二区免费模式 |