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

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

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

    子在川上曰

      逝者如斯夫不舍晝夜
    隨筆 - 71, 文章 - 0, 評論 - 915, 引用 - 0
    數據加載中……

    Eclipse插件及RCP開發中的第三方庫的設置

    文/陳剛?from www.chengang.com.cn?at 2005-12-14
    ?
      很多人在開發RCP時,發現開發時都沒問題,但導出成包時卻報找不到第三方庫中類的錯誤。主要原因就是沒有將第三方庫配置好。現在我給出一個實現項目的配置為示例,以供參考。
     
      環境:Eclipse3.2M3 一個RCP的實際項目,插件項目同樣適用此方法
      
    一、最關鍵的就是plugin.xml和MANIFEST.MF
      所有界面上的最后操作,結果都是保存在這兩個文件中。注意:“.classpath”文件只是開發時對引用第三庫有用,打包發行之后它的作用就沒有了,還得靠plugin.xml和MANIFEST.MF。
    ?
    1、plugin.xml文件
    <?xml version="1.0" encoding="GB2312"?>
    <?eclipse version="3.0"?>
    <plugin>
    ?? <extension
    ???????? id="AdminConsole"
    ???????? point="org.eclipse.core.runtime.applications">
    ??????? <application>
    ??????????? <run class="com.wxxr.management.admin.console.AdminConsole"/>
    ??????? </application>
    ?? </extension>
    ?
    ?? <extension id="AdminConsole" point="org.eclipse.core.runtime.products">
    ??<product name="%productName" application="com.wxxr.management.admin.console.AdminConsole">
    ???<property name="appName" value="%swtAppName"/>
    ???<property name="windowImages" value="icons/eclipse.gif,icons/eclipse32.gif"/>
    ???<property name="aboutText" value="%aboutText"/>
    ???<property name="aboutImage" value="icons/eclipse_lg.gif"/>
    ???<property name="windowImages" value="icons/alt16.gif,icons/eclipse.gif"/>
    ??</product>
    ?? </extension>
    ??
    ?? <extension
    ????? point="org.eclipse.ui.perspectives">
    ????? <perspective
    ??????????? class="com.wxxr.management.admin.console.monitor.MonitorPerspective"
    ??????????? name="%perspectiveName"
    ??????????? id="com.wxxr.management.admin.console.monitor.MonitorPerspective"/>
    ????? <perspective
    ??????????? class="com.wxxr.management.admin.console.configure.ConfigurePerspective"
    ??????????? name="%configurePerspectiveName"
    ??????????? id="com.wxxr.management.admin.console.configure.ConfigurePerspective"/>
    ????? <perspective
    ??????????? class="com.wxxr.management.admin.console.jmx.JMXPerspective"
    ??????????? name="%jmxPerspectiveName"
    ??????????? id="com.wxxr.management.admin.console.jmx.JMXPerspective"/>
    ?? </extension>
    ?<extension
    ?? point="org.eclipse.ui.editors">
    ?? <editor
    ???name="事件列表"
    ???icon="icons/alt16.gif"
    ???class="com.wxxr.management.admin.console.log.ui.LogEditor"
    ???id="com.wxxr.management.admin.console.log.ui.LogEditor">
    ?? </editor>
    ?? <editor
    ???name="地圖"
    ???icon="icons/map_view.gif"
    ???class="com.wxxr.management.admin.console.map.MapEditor"
    ???id="com.wxxr.management.admin.console.map.MapEditor">
    ?? </editor>
    ?</extension>
    ?? <extension
    ???????? point="org.eclipse.ui.views">
    ????? <category
    ??????????? id="com.wxxr.management.admin.console.monitor.view"
    ??????????? name="%views.category.name"/>
    ????? <view
    ??????????? id="com.wxxr.management.admin.console.navigator.ui.StationExploreView"
    ??????????? name="工作站"
    ??????????? icon="icons/eclipse.gif"
    ??????????? class="com.wxxr.management.admin.console.navigator.ui.StationExploreView"
    ??????????? category="com.wxxr.management.admin.console.monitor.view"/>
    ????? <view
    ??????????? name="事件細節"
    ??????????? icon="icons/eclipse.gif"
    ??????????? category="com.wxxr.management.admin.console.monitor.view"
    ??????????? class="com.wxxr.management.admin.console.monitor.eventview.EventDetailView"
    ??????????? id="com.wxxr.management.admin.console.monitor.eventview.EventDetailView" />
    ????? <view
    ??????????? name="事件統計"
    ??????????? icon="icons/eclipse.gif"
    ??????????? category="com.wxxr.management.admin.console.monitor.view"
    ??????????? class="com.wxxr.management.admin.console.monitor.view.SystemEventStatisticsView"
    ??????????? id="com.wxxr.management.admin.console.monitor.view.SystemEventStatisticsView" />
    ????? <view
    ??????????? name="緊急事件處理"
    ??????????? icon="icons/eclipse.gif"
    ??????????? category="com.wxxr.management.admin.console.monitor.view"
    ??????????? class="com.wxxr.management.admin.console.emergency.ui.EmergencyEventReceiverView"
    ??????????? id="com.wxxr.management.admin.console.emergency.ui.EmergencyEventReceiverView" />
    ????? <category
    ??????????? id="com.wxxr.management.admin.console.jmx.view"
    ??????????? name="%views.category.name"/>
    ????? <view
    ??????????? name="JMX Connections"
    ??????????? icon="icons/eclipse.gif"
    ??????????? category="com.wxxr.management.admin.console.jmx.view"
    ??????????? class="com.wxxr.management.admin.console.jmx.ui.JMXExploreView"
    ??????????? id="com.wxxr.management.admin.console.jmx.ui.JMXExploreView" />
    ????? <view
    ??????????? name="JMX Attributes View"
    ??????????? icon="icons/eclipse.gif"
    ??????????? category="com.wxxr.management.admin.console.jmx.view"
    ??????????? class="com.wxxr.management.admin.console.jmx.ui.AttributesView"
    ??????????? id="com.wxxr.management.admin.console.jmx.ui.AttributesView" />
    ????? <view
    ??????????? name="JMX Operations View"
    ??????????? icon="icons/eclipse.gif"
    ??????????? category="com.wxxr.management.admin.console.jmx.view"
    ??????????? class="com.wxxr.management.admin.console.jmx.ui.OperationsView"
    ??????????? id="com.wxxr.management.admin.console.jmx.ui.OperationsView" />
    ????? <view
    ??????????? name="JMX MBean View"
    ??????????? icon="icons/eclipse.gif"
    ??????????? category="com.wxxr.management.admin.console.jmx.view"
    ??????????? class="com.wxxr.management.admin.console.jmx.ui.MBeanView"
    ??????????? id="com.wxxr.management.admin.console.jmx.ui.MBeanView" />
    ?? </extension>
    ?? <extension
    ???????? id="AdminConsole"
    ???????? point="org.eclipse.core.runtime.products">
    ????? <product
    ??????????? application="com.wxxr.management.admin.console.AdminConsole"
    ??????????? name="AdminConsole"/>
    ?? </extension>
    ??
    </plugin>
    ??
    2、META-INF\MANIFEST.MF文件
    注意:
    (1)這里require-bundle定義了項目依賴的插件。
    (2)Bundle-ClassPath定義了引用的第三方庫,別忘了把AdminConolse項目自己console.jar加進去,否則連自己項目里的類都會找不到。
    Manifest-Version: 1.0
    Bundle-ManifestVersion: 2
    Bundle-Name: %pluginName
    Bundle-SymbolicName: com.wxxr.management.admin.console; singleton:=true
    Bundle-Version: 1.0.0
    Bundle-Activator: com.wxxr.management.admin.console.AdminConsolePlugin
    Bundle-Localization: plugin
    Require-Bundle: org.eclipse.ui,
    ?org.eclipse.core.runtime,
    ?org.eclipse.core.resources,
    ?org.eclipse.gef,
    ?org.eclipse.ui.forms,
    ?org.eclipse.ui.console
    Eclipse-AutoStart: true
    Bundle-Vendor: %providerName
    Bundle-ClassPath: console.jar,
    ?lib/commons-codec-1.3.jar,
    ?lib/jboss.jar,
    ?lib/jbossall-client.jar,
    ?lib/jboss-jmx.jar,
    ?lib/jboss-system.jar,
    ?lib/log4j-1.2.8.jar,
    ?lib/wxxr-common-1.0-b1.jar,
    ?lib/wxxr-common-jboss-1.0-b1.jar,
    ?lib/wxxr-db-persistence-1.0-b1.jar,
    ?lib/wxxr-jboss-controller-1.0-b1.jar,
    ?lib/wxxr-jboss-workstation-1.0-b1.jar,
    ?lib/wxxr-remoting-1.0-b1.jar,
    ?lib/wxxr-security-1.0-b1.jar,
    ?lib/xerces-2.6.2.jar,
    ?lib/xmlParserAPIs-2.2.1.jar,
    ?lib/xmlrpc-2.0.jar
    ?
    3、build.properties文件。這個文件主要是用Eclipse導出包的時候用。
    source.console.jar = src/
    output.console.jar = bin/
    bin.includes = plugin.xml,\
    ???? *.jar,\
    ?????????????? console.jar, \
    ?????????????? plugin.properties
    ??????????????
    pluginName = Admin Console Plug-in
    providerName = WXXR.com.cn
    perspectiveName = Admin Console
    configurePerspectiveName= Configure
    jmxPerspectiveName= JMX Console
    ?????????????? 
    jars.extra.classpath = lib/commons-codec-1.3.jar,\
    ?????????????????????? lib/jboss.jar,\
    ?????????????????????? lib/jbossall-client.jar,\
    ?????????????????????? lib/jboss-jmx.jar,\
    ?????????????????????? lib/jboss-system.jar,\
    ?????????????????????? lib/log4j-1.2.8.jar,\
    ?????????????????????? lib/wxxr-common-1.0-b1.jar,\
    ?????????????????????? lib/wxxr-common-jboss-1.0-b1.jar,\
    ?????????????????????? lib/wxxr-db-persistence-1.0-b1.jar,\
    ?????????????????????? lib/wxxr-jboss-controller-1.0-b1.jar,\
    ?????????????????????? lib/wxxr-jboss-workstation-1.0-b1.jar,\
    ?????????????????????? lib/wxxr-security-1.0-b1.jar,\
    ?????????????????????? lib/wxxr-remoting-1.0-b1.jar,\
    ?????????????????????? lib/xerces-2.6.2.jar,\
    ?????????????????????? lib/xmlParserAPIs-2.2.1.jar,\
    ?????????????????????? lib/xmlrpc-2.0.jar
    ?
    4、plugin.properties,這個放一些上面幾個文件用到的變量。
    pluginName= WXXR Admin Console
    providerName= wxxr.com.cn
    ?
    productName= WXXR SMS Operation Platform
    appName= WXXR Admin Console
    perspectives.browser.name= WXXR Admin Console
    views.category.name= WXXR Admin Console
    views.browser.name= Browser
    views.history.name= History
    views.stationexplore.name= Stations
    views.tasklist.name= Task List
    views.loglist.name= Workstation Monitor
    monitor.message.detail=Monitor Message Detail
    monitor.message.statistics=????
    ?
    swtAppName= AdminConsole
    aboutText= WXXR Admin Console \n\n\
    (c) Copyright WXXR Ltd. and others 2003, 2004.? All rights reserved.\n\
    Visit http://www.wxxr.com.cn
     
    ?
    二、圖形方式
     有時直接編輯plugin.xml等文件容易出錯(全角空格什么的),那么可以用圖形編輯方式來,不過最后結果還是反映到plugin.xml等文件中的。我把plugin.xml打開,然后一個項一個項的把圖截下來,以供大家參考。
     
    1134538761302_5236.gif?

    1134538769117_7853.gif?

    1134538790864_4652.gif?

    1134538806626_1515.gif?

    1134538814862_3413.gif 

     
     這個界面是build.properties配置的反映
    1134538823973_7531.gif?

     
    ?最好在項目屬性的庫用引項的效果如下:
    1134535421290_7544.gif?


     
    作者簡介

    陳剛,廣西桂林人,著作有《Eclipse從入門到精通》
    您可以通過其博客了解更多信息和文章:http://www.chenGang.com.cn

    posted on 2006-03-07 14:48 陳剛 閱讀(2834) 評論(0)  編輯  收藏 所屬分類: Eclipse

    主站蜘蛛池模板: 久久久久亚洲精品中文字幕| 久久久久久99av无码免费网站| 亚洲国产成人久久综合碰| 亚洲日韩精品国产3区| 69天堂人成无码麻豆免费视频| 亚洲视频网站在线观看| 777爽死你无码免费看一二区| 亚洲AV无码一区二区二三区入口| 国产在线观看免费视频软件 | 妞干网免费视频在线观看| 久久精品国产亚洲av麻豆图片| 成人免费激情视频| 亚洲 日韩经典 中文字幕 | 免费不卡中文字幕在线| 日韩毛片免费一二三| 亚洲不卡AV影片在线播放| 国产99久久亚洲综合精品| 亚洲AV无码成H人在线观看| 羞羞漫画在线成人漫画阅读免费| 亚洲国产一级在线观看| 中文字幕无码免费久久9一区9| 亚洲精品午夜无码专区| 日本一卡精品视频免费| 久久亚洲最大成人网4438 | 亚洲AV之男人的天堂| 青青青视频免费观看| 亚洲国产另类久久久精品黑人| 99久久人妻精品免费二区| 亚洲一卡2卡3卡4卡国产网站| 午夜高清免费在线观看| 一个人免费观看视频在线中文 | 成人免费午间影院在线观看| 极品美女一级毛片免费| 亚洲av中文无码乱人伦在线播放 | 久久精品成人免费网站| 亚洲人成在线精品| 四虎永久免费影院在线| 日本高清免费观看| 亚洲日韩AV无码一区二区三区人| 亚洲熟女乱综合一区二区| 91高清免费国产自产|