<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

    主站蜘蛛池模板: 亚洲国产午夜福利在线播放| 59pao成国产成视频永久免费 | www成人免费观看网站| 免费无码又爽又刺激毛片| 久久精品国产亚洲av麻豆蜜芽| 最近免费中文字幕mv在线电影| 亚洲AV日韩AV天堂久久| 久久国产乱子伦精品免费不卡| 午夜亚洲国产理论秋霞| 67194成手机免费观看| 亚洲jjzzjjzz在线观看| 天天操夜夜操免费视频| 亚洲变态另类一区二区三区| 免费涩涩在线视频网| 美女免费视频一区二区三区| 亚洲av中文无码| 国产在线国偷精品免费看| 亚洲va久久久噜噜噜久久天堂| 久久国产乱子伦精品免费看| 亚洲日韩乱码中文无码蜜桃| 我要看免费的毛片| 美女黄频免费网站| 亚洲日韩精品A∨片无码| 97国产在线公开免费观看| 亚洲综合一区国产精品| 日本无卡码免费一区二区三区| 免费毛片毛片网址| 久久亚洲成a人片| 在线观看视频免费完整版| 在线观看亚洲精品专区| 亚洲高清国产拍精品26U| 青娱乐免费在线视频| 羞羞视频免费观看| 久久亚洲国产精品一区二区| 国产99视频精品免费观看7| 国产精品亚洲va在线观看| 亚洲AV本道一区二区三区四区| 青青青国产在线观看免费 | 西西人体免费视频| 亚洲kkk4444在线观看| 亚洲乱码国产一区网址|