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

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

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

    精彩的人生

    好好工作,好好生活

    BlogJava 首頁 新隨筆 聯系 聚合 管理
      147 Posts :: 0 Stories :: 250 Comments :: 0 Trackbacks

    #

    其實很多人都問到了這個問題。目前插件的安裝是需要重啟的,但是很多情況下是有不重啟而安裝插件的需求。我找到的一點資料,應該會有幫助



    FAQ How do I make my plug-in dynamic aware?

    From Eclipsepedia




    Dynamic awareness requires extra steps that were not required prior to the introduction of dynamic plug-ins. Dynamic awareness requires that you remove all references to classes defined in other plug-ins when those plug-ins are removed from the system. In particular, if your plug-in defines extension points that load classes from other plug-ins—executable extensions—you need to discard those references when other plug-ins are dynamically removed. The extension registry allows you to add a listener that notifies you when extensions are being added or removed from the system. If your plug-in maintains its own cache of extensions that are installed on your extension point, your listener should update this cache for each added or removed extension.



    The following is an example of a simple class that maintains its own cache of the set of extensions installed for a given extension point. This example is a bit contrived as simply caching the extension objects has no value. Typically, your plug-in will process the extensions to extract useful information and possibly load one or more classes associated with that extension. The basic structure of this cache example is as follows:

       public class ExtCache implements IRegistryChangeListener {
          private static final String PID = "my.plugin";
          private static final String PT_ID = 
             PID + "." + "extension.point";
          private final HashSet extensions = new HashSet();
          ...
       }
    

    The extensions field stores the set of installed extensions for a particular extension point.



    The cache has a startup method that loads the initial set of extensions and then adds an extension registry listener in order to be notified of future changes:

       public void startup() {
          IExtensionRegistry reg = Platform.getExtensionRegistry();
          IExtensionPoint pt = reg.getExtensionPoint(PT_ID);
          IExtension[] ext = pt.getExtensions();
          for (int i = 0; i < ext.length; i++)
             extensions.add(ext[i]);
          reg.addRegistryChangeListener(this);
       }
    

    The class implements the IRegistryChangeListener interface, which has a single method that is called whenever the registry changes:

       public void registryChanged(IRegistryChangeEvent event) {
          IExtensionDelta[] deltas = 
                              event.getExtensionDeltas(PID, PT_ID);
          for (int i = 0; i < deltas.length; i++) {
             if (deltas[i].getKind() == IExtensionDelta.ADDED)
                extensions.add(deltas[i].getExtension());
             else
                extensions.remove(deltas[i].getExtension());
          }
       }
    

    This class is now dynamic aware but is not yet dynamic enabled; that is, the class does not yet support itself being dynamically removed. The final step is to implement a shutdown method that clears all values from the cache and removes the listener from the extension registry:

       public void shutdown() {
          extensions.clear();
          IExtensionRegistry reg = Platform.getExtensionRegistry();
          reg.removeRegistryChangeListener(this);
       }
    

    This shutdown method must be called from the shutdown method of the plug-in that defines the cache. For the complete source code of this example, see the ExtCache class in the FAQ Examples plug-in.



    Note that not only extensions points acquire and maintain references to classes defined in other plug-ins. You need to be especially aware of static fields and caches that contain references to objects whose class is defined in other plug-ins.

    If you hold onto classes defined in other plug-ins through different mechanisms, you also need to discard those references when those other plug-ins are removed.


    原文地址:http://wiki.eclipse.org/index.php/FAQ_How_do_I_make_my_plug-in_dynamic_aware%3F

    posted @ 2006-03-23 11:16 hopeshared 閱讀(2581) | 評論 (0)編輯 收藏

    添加我到您的MSN Messenger?

    似乎仍然有bug

    源代碼:
    <script src="http://edad.com.cn/datou/msn.js" type="text/javascript" language="JavaScript"></script>

    <a href=javascript:DoInstantMessage("[MSN帳戶(例如billgaisi@hotmail.com)]","Bill Gaisi")><img border="0" src="http://edad.com.cn/datou/icon_messenger.gif" alt="添加我到您的MSN Messenger"></a>

    轉自http://www.cathome01.com/asiapan/archives/2005/07/msn_messenger.html

    posted @ 2006-03-21 12:45 hopeshared 閱讀(147) | 評論 (0)編輯 收藏

    MSN?Messenger?6.0?這個版本中相比以前增加了很多激動人心的功能,如:更漂亮的界面,更多的表情符號,可設置個人頭像,聊天窗口的背景圖片支持,P2P功能支持,聯機游戲等,在這個版本中增強了的標簽功能,對于廣大?MSN?Messenger?愛好者來說,尤其帶來了許多樂趣,本文將主要對?MSN?Messenger?的標簽的使用和開發進行探討。


    什么是?MSN?Messenger?標簽??


    MSN?Messenger?標簽是對?MSN?Messenger?功能的一種擴展,如圖1所示。MSN?Messenger?已經內置了許多功能擴展,如?MSN?Alerts等?.NET?My?Services?,除此之外,還將?www.msn.com?提供的許多個性服務都集成到?MSN?Messenger?里面了,如股票行情、新聞、旅游、汽車、購物、游戲等。?



    除了這些內置的標簽之外,我們還可以增加自己特殊的標簽,將常用的一些在線功能(閱讀新聞、查看天氣預報等)集成到?MSN?Messenger?中,將其變為一個功能豐富而強大的客戶端工具。筆者曾經見到過?Microsoft?演示新加坡政府的電子政務系統,就是將許多客戶端的功能置入?MSN?Messenger?的標簽中,為工作人員提供了一個使用極其方便的工具。?



    (注:默認情況下,MSN?Messenger?標簽只有兩個,要想顯示全部內置標簽,用戶需要在?www.passport.net?登錄,并在Member?Services?中修改?Profile?文件,將自己的?Country/Region?修改為美國,或者直接下載此文件:?::URL::http://www.china-actuary.com/temp/configcache.zip ?,解開后覆蓋原配置文件即可,原配置文件的路徑在下文列出)?




    如何增加標簽?




    MSN?Messenger?中所有標簽都是定義在一個?XML?配置文件中,這個文件位于?C:\Documents?and?Settings\[User]\Application?Data\Microsoft\MSN?Messenger\[Passport?ID]?目錄下,如果安裝的是?MSN?Messenger?6.0中文版,則可能位于?C:\Documents?and?Settings\[USER]\Application?Data\Microsoft\MSN?Messenger下面的目錄名是一串數字的子目錄中,文件名為?ConfigCache.xml(注:?[User]?是登錄?Windows?系統的用戶名,Passport?ID?是指登錄?MSN?Messenger?的ID,如?muslem@msn.com,另外,如果你的?Windows?系統安裝在?C:?以外的其它驅動器,則上述路徑要做相應改變)。


    打開這個?XML?文件,就可以看到在?\MsgrConfig\TabConfig\msntabdata?節點內就是所有標簽的定義,現舉例對其中的主要元素加以說明:?



    <tab>
    ??<image>res:moneyimage>
    ??<name>CNBC?on?MSN?Moneyname>
    ??<tooltip>CNBC?on?MSN?Moneytooltip>
    ??<contenturl>::URL::http://moneycentral.msn.com/messenger/tab.aspxcontenturl>
    </tab>?




    了解了標簽的定義方式后,我們就可以定義自己的標簽了,考慮到?MSN?Messenger?窗口的大小和?PocketPC?或?Palm?等PDA?類似,所以適合?PDA?的網站置入到標簽中比較合適。例如我們把新浪站點的?PDA版(::URL::http://pda.sina.com.cn)做成一個標簽,則應定義如下一個 ?XML?結點:


    <tab>
    ???<image>res:bellimage>
    ???<name>SINA?PDAname>
    ???<tooltip>SINA?PDA?Sitetooltip>
    ???<contenturl>::URL::http://pda.sina.com.cncontenturl>
    </tab>




    然后將結點定義的全部文本插入到配置文件的?\MsgrConfig\TabConfig\msntabdata?節點里面,注銷并重新登錄?MSN?Messenger?,則效果圖2所示。

    除此之外,在?PDA?上很受歡迎的?AvantGO?頻道都可以作為標簽內容的來源,在?::URL::http://www.avantgo.com ?中注冊登錄后,會列出各種各樣的頻道及其?URL?地址,然后就可以自己的需要選擇利用了。


    如何開發標簽




    除了引用已有的站點,如AvantGO頻道或PDA站點外,能不能制做自己的功能標簽呢?答案是完全肯定的,可以看到,標簽配置中的?ContentURL?既可以引用外部?URL?資源,也可以引用本地資源,最常用的就是引用本地的?HTML?文件。

    利用?HTML?文件,你的所有與?HTML?有關的開發技術/技巧都能派上用場,如CSS、HTML?Component、VBScript/JavaScript、Java?Applet、DHTML,ActiveX,MSXML(包括XMLHttp組件),XSLT等。如果是開發一個內容采集(如新聞或天氣預報信息抓?。┑臉撕?,則一般要經過以下步驟:

    1、尋找內容來源,此頁面一般要求格式相對固定,如新浪的滾動新聞頁面等?



    2、利用?MSXML?包中的?XMLHttp?對象來獲取內容?



    3、在本地利于腳本結合?HTML?DOM(文檔對象模型)技術對獲取的內容進行分析和過濾,取出有用內容?



    4、以適合的方式顯示這些的內容,并可以結合?CSS?進行內容的格式化?




    另外,如果引用本地的?HTML?文件,則腳本安全性級別較低,對本地文件系統進行讀寫是允許的,因此開發一些具有高級特性的應用,如本地緩存內容,顯示本計算機的某些信息(如?Outlook?的郵件,聯系人列表等)。


    下圖是筆者開發的一個標簽的實例,主要功能是查閱新聞、電視節目單、天氣預報等,可以從?::URL::http://www.china-actuary.com/temp/rordown.asp ?下載,通過閱讀里面的內容和程序腳本來進一步了解如何開發標簽。


    除此之外,可以利于?Windows?系統和第三方豐富的組件和控件,嘗試進行一些MSN?Messenger?標簽的高級開發,如利用?JMail?組件來讀取?POP3?郵箱的內容或發送郵件;利用通訊網關發送手機短消息;利用?XML?解析器來讀取和顯示?RSS?內容;甚至可以通過?MSXML?中的?XMLHTTP?來讀取?Hotmail/MSN?郵箱中的內容,使用?ADO?來存取數據庫信息等,當然開發人員也可以將此功能延伸到企業應用開發中,如小組協作,日程安排等。


    開發標簽注意事項




    1、圖標的引用

    標簽的圖標即可以采用內置的資源圖標,也可以引用外部(URL形式,如?::URL::http://www.china-actuary.com/temp/news.png)的 ?PNG?文件(必須是32位色),圖標大小為?32X32,也可以使用?ResHacker?等工具將自己的圖標加入到?MSN?Messenger?可執行文件?MsnMsgr.exe?中,然后使用?res:[ID]?的方式來引用。?



    2、界面開發

    由于標簽的內容顯示在?MSN?Messenger?窗口的內部,所以在界面開發時要注意以下原則:

    1)?標簽中元素的采用相對大小,而非絕對大小。這樣當?MSN?Messenger?窗口縮放的時候,里面的內容能夠自適應地進行調整。此外如果可能,對超過窗口寬度的內容進行手工縮放(在筆者的例子里,對新聞中的圖片進行了縮放,以便能夠在任意大小的窗口都看到全圖),從而避免出現水平滾動條。

    2)?使用小字體,以顯示更多內容

    3)?使用元素的邊框和間隔不要太大,不要采用較大的圖片按鈕

    4)?使用簡單控件

    5)?盡量避免重新刷新整個頁面

    3、程序的開發與調試

    可以使用常用的?HTML/VBScript/Jscript?開發工具,結合?Internet?Explorere?進行測試,測試無誤后再加入到?MSN?Messenger?的標簽中,要不然每次更改頁面后都要重新登錄?MSN?Messenger?,無疑是一件很痛苦的事。?



    4、配置文件與標簽圖標

    經常發現登錄?MSN?Messenger?后,除了最上面好友列表的標簽外,其它標簽到都不見了,此問題一般都是錯誤地修改?ConfigCache.xml?文件而使其成為一個不合法的?XML?文件導致的。所以在修改此文件后,最好使用?Internet?Explorer?打開查看一下,以確認?XML?文件的格式無誤。?



    另外,有時候即使不修改配置文件,標簽也會“消失”,這是由于?MSN?Messenger?自動更新配置文件而覆蓋和自定義的標簽,要防止此類情況,最好將配置文件中的過期設置元素的值改為0,即:0。


    另外,msn?shell也可以實現此功能,而且功能更為強大



    原文地址:http://www.blogcn.com/user31/nhdj/blog/7190344.html
    posted @ 2006-03-21 12:32 hopeshared 閱讀(494) | 評論 (0)編輯 收藏

    以前做的RCP沒有注意如何將外觀作漂亮,都作為遺留問題保存了下來

    今天在Eclipse社區找到了答案,貼上來做個備份.

    原文地址:http://www.eclipseworld.org/bbs/read.php?tid=2689&keyword=


    問題:
    不好意思,剛開始看RCP,有個小問題,怎么樣才能把外觀設置為和


    上圖中,‘系統主菜單’這里的tab一樣,帶有圓弧形,而不是rcp默認的方的那種樣式呢?

    答:

    得把org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false加在plugin_customization.ini里頭

    plugin_customization.ini還可以定制不少東西,這個文件要自己創建的吧,RCP程序里面沒有

    在plugin.xml,org.eclipse.core.runtime.products下的產品加上一個屬性。
    name: preferenceCustomization
    value: plugin_customization.ini

    然后在工程中加上plugin_customization.ini 這文件。內容是:
    org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false

    posted @ 2006-03-16 16:34 hopeshared 閱讀(1454) | 評論 (1)編輯 收藏

         摘要: 本文檔取自IBM Websphere的幫助文檔 此方案集由名為 Plants by WebSphere 的在線零售商設計。 Plants by WebSphere 使用 WebSphere Application Server 中的 Web service ...  閱讀全文
    posted @ 2006-03-15 15:34 hopeshared 閱讀(776) | 評論 (0)編輯 收藏

    僅列出標題
    共30頁: First 上一頁 15 16 17 18 19 20 21 22 23 下一頁 Last 
    主站蜘蛛池模板: 久久青草91免费观看| 久久毛片免费看一区二区三区| 日本卡1卡2卡三卡免费| 亚洲自偷自偷图片| 99麻豆久久久国产精品免费| 精品亚洲视频在线观看| 国产日韩AV免费无码一区二区三区 | 两个人日本免费完整版在线观看1| 免费一级肉体全黄毛片| 国产91成人精品亚洲精品| 亚洲电影日韩精品| 亚洲精品第一国产综合境外资源 | 成年网在线观看免费观看网址| 免费在线观看黄色毛片| 免费精品国产自产拍在线观看| 亚洲精品tv久久久久久久久久| 国产精品成人啪精品视频免费| 成人免费视频69| 激情五月亚洲色图| 国产免费观看黄AV片| 51午夜精品免费视频| 亚洲最大福利视频网站| 成视频年人黄网站免费视频| 亚洲精品久久无码| 在线观看亚洲精品福利片| 亚洲成人免费在线| 亚洲人成网国产最新在线| 免费少妇a级毛片人成网| 全黄大全大色全免费大片| 亚洲图片激情小说| 一本久到久久亚洲综合| 老汉精品免费AV在线播放| 亚洲国产精品成人一区| 中文精品人人永久免费| 亚洲国产成人超福利久久精品| 日本v片免费一区二区三区| 国产综合免费精品久久久| 国产成人精品亚洲日本在线| 亚洲av午夜成人片精品电影| 久久综合九色综合97免费下载| 中文字幕无码亚洲欧洲日韩|