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

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

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

    子在川上曰

      逝者如斯夫不舍晝夜
    隨筆 - 71, 文章 - 0, 評(píng)論 - 915, 引用 - 0
    數(shù)據(jù)加載中……

    Eclipse插件及RCP開(kāi)發(fā)中的第三方庫(kù)的設(shè)置

    文/陳剛?from www.chengang.com.cn?at 2005-12-14
    ?
      很多人在開(kāi)發(fā)RCP時(shí),發(fā)現(xiàn)開(kāi)發(fā)時(shí)都沒(méi)問(wèn)題,但導(dǎo)出成包時(shí)卻報(bào)找不到第三方庫(kù)中類的錯(cuò)誤。主要原因就是沒(méi)有將第三方庫(kù)配置好。現(xiàn)在我給出一個(gè)實(shí)現(xiàn)項(xiàng)目的配置為示例,以供參考。
     
      環(huán)境:Eclipse3.2M3 一個(gè)RCP的實(shí)際項(xiàng)目,插件項(xiàng)目同樣適用此方法
      
    一、最關(guān)鍵的就是plugin.xml和MANIFEST.MF
      所有界面上的最后操作,結(jié)果都是保存在這兩個(gè)文件中。注意:“.classpath”文件只是開(kāi)發(fā)時(shí)對(duì)引用第三庫(kù)有用,打包發(fā)行之后它的作用就沒(méi)有了,還得靠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="事件細(xì)節(jié)"
    ??????????? 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="事件統(tǒng)計(jì)"
    ??????????? 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定義了項(xiàng)目依賴的插件。
    (2)Bundle-ClassPath定義了引用的第三方庫(kù),別忘了把AdminConolse項(xiàng)目自己console.jar加進(jìn)去,否則連自己項(xiàng)目里的類都會(huì)找不到。
    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文件。這個(gè)文件主要是用Eclipse導(dǎo)出包的時(shí)候用。
    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,這個(gè)放一些上面幾個(gè)文件用到的變量。
    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
     
    ?
    二、圖形方式
     有時(shí)直接編輯plugin.xml等文件容易出錯(cuò)(全角空格什么的),那么可以用圖形編輯方式來(lái),不過(guò)最后結(jié)果還是反映到plugin.xml等文件中的。我把plugin.xml打開(kāi),然后一個(gè)項(xiàng)一個(gè)項(xiàng)的把圖截下來(lái),以供大家參考。
     
    1134538761302_5236.gif?

    1134538769117_7853.gif?

    1134538790864_4652.gif?

    1134538806626_1515.gif?

    1134538814862_3413.gif 

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

     
    ?最好在項(xiàng)目屬性的庫(kù)用引項(xiàng)的效果如下:
    1134535421290_7544.gif?


     
    作者簡(jiǎn)介

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

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

    主站蜘蛛池模板: 午夜爱爱免费视频| 亚洲一区综合在线播放| 99精品全国免费观看视频..| 亚洲精品成人片在线播放| 在线看片v免费观看视频777| 亚洲av成人无码网站…| 亚洲色欲色欲www| 国产又粗又长又硬免费视频| 一级一级一片免费高清| 亚洲高清中文字幕综合网| 免费国产小视频在线观看| 亚洲av综合av一区二区三区| 在线观看免费污视频| www永久免费视频| 亚洲伊人久久大香线蕉结合| 亚洲人成网站18禁止一区| 亚洲一区在线免费观看| 亚洲入口无毒网址你懂的| 国产成人亚洲综合| 久久久久国产精品免费免费搜索 | 91黑丝国产线观看免费| 色偷偷亚洲男人天堂| 亚洲色图在线播放| 亚洲国产精品尤物yw在线| 国产精品视频免费观看| 三年在线观看免费观看完整版中文| 亚洲同性男gay网站在线观看| 亚洲中文无韩国r级电影| 成人免费视频软件网站| 久久免费的精品国产V∧| 免费看黄网站在线看| 亚洲一区二区三区成人网站| 国产男女猛烈无遮档免费视频网站| av永久免费网站在线观看| 粉色视频免费入口| 亚洲综合无码一区二区痴汉| 亚洲天堂中文字幕| 亚洲精品色午夜无码专区日韩| 免费国产在线观看不卡| 免费看美女被靠到爽| 三根一起会坏掉的好痛免费三级全黄的视频在线观看 |