新聞中心
本文繼續(xù)上節(jié)文章介紹Subversion插件在Eclipse中是如何使用的,希望大家能學(xué)到更多知識(shí),同時(shí)也請(qǐng)各位多提寶貴意見,以便共同進(jìn)步。以下是介紹Subversion插件

創(chuàng)新互聯(lián)專注于雨城企業(yè)網(wǎng)站建設(shè),響應(yīng)式網(wǎng)站設(shè)計(jì),商城網(wǎng)站制作。雨城網(wǎng)站建設(shè)公司,為雨城等地區(qū)提供建站服務(wù)。全流程定制網(wǎng)站設(shè)計(jì),專業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,創(chuàng)新互聯(lián)專業(yè)和態(tài)度為您提供的服務(wù)
【Displayhook銷毀機(jī)制】
在Displaydevice中我們看了如下個(gè)hook接口:
- /** *Causestherunmethodoftherunnableto
- *beinvokedbytheuser-erfacethreadjustbeforethe
- *receiverisdisposed.
- */ publicvoiddisposeExec(Runnablerunnable){
- //注冊(cè)用戶自定義runnable在displayrelease時(shí)候回調(diào)此runnable
- 將runnable注冊(cè)到disposeList
- }
- disposeList中線程會(huì)在displayrelease時(shí)候被如下:
- /***Releasesanyernalresourcesbacktotheoperating
- *systemandclearsallfieldsexceptthedevicehandle.
- */ protectedvoidrelease{……
- //會(huì)執(zhí)行用戶注冊(cè)銷毀線程
- (disposeList!=null){
- for(i=0;i (disposeList[i]!=null)disposeList[i].run;
- }}
- ……}
看來SWT并沒有把事情做絕了還是給開發(fā)者留下條后路Display允許開發(fā)者注冊(cè)個(gè)自定義線程hook到Displayrelease過程開發(fā)者可以用如下方式來確保開發(fā)者使用系統(tǒng)資源在Displayrelease時(shí)候被銷毀:
- display.disposeExec(Runnable{
- publicvoidrun{//銷毀系統(tǒng)資源邏輯代碼
- image.dispose;
- ……}});
以上方式其實(shí)也是JFace中圖片資源管理(ImageRegistry、ResourceManager)能夠確保Displayrelease時(shí)候能夠徹底釋放被ImageRegistry托管圖片資源.到這里回顧下SWT中資源釋放途徑吧:
1、覆寫相應(yīng)Component對(duì)應(yīng)dispose思路方法這有別于Displayhook機(jī)制其能夠在Display運(yùn)行期間(未被release的前)就釋放掉系統(tǒng)資源***方式。
2、利用Displayhook機(jī)制確保在Display被release時(shí)候能夠銷毀資源注意請(qǐng)不要過多依賴此方式很容易造成在Display被release的前已經(jīng)發(fā)生了系統(tǒng)crash問題。
Eclipse的本身只是一個(gè)框架平臺(tái),但是眾多插件的支持使得Eclipse擁有其他功能相對(duì)固定的IDE軟件很難具有的靈活性。許多軟件開發(fā)商以Eclipse為框架開發(fā)自己的IDE。
【JFace中圖片資源管理--ImageDescriptor】
前面我們已經(jīng)見過SWT中Image和ImageData類型了在繼續(xù)下面內(nèi)容的前我們先看下在JFace中我們最常用來創(chuàng)建圖片資源個(gè)工廠類:ImageDescriptor在ImageDescriptor類型介紹說明中告訴我們有兩種使用ImageDescriptor創(chuàng)建圖片方式分別通過createImage和createResource接口“TherearetwowaystogetanImagefromanImageDescriptor.ThemethodcreateImagewillalwaysaImagewhichmustbedisposedbythecaller.Alternatively,createResourcesasharedImage.WhenthecallerisdonewithanimageobtainedfromcreateResource,theymustcalldestroyResourceratherthandisposingtheImagedirectly.”分析如下:
首先看下createResource方式ImageDescriptor是種DeviceResourceDescriptor后者對(duì)外操作如下:
- /** *Createstheresourcedescribedbythisdescriptor */
- publicabstractObjectcreateResource(Devicedevice)throwsDeviceResourceException; /**
- *Undoeseverythingthatwasdonebyapreviouscalltocreate(...) */
- publicabstractvoiddestroyResource(ObjectpreviouslyCreatedObject);
本篇對(duì)Eclipse中如何使用Subversion插件已經(jīng)全部介紹完畢。請(qǐng)關(guān)注本文的其他相關(guān)報(bào)道。
【編輯推薦】
- CentOS系統(tǒng)中安裝subversion并使用svn+ssh訪問
- Subversion mod_authz_svn驗(yàn)證用戶查看受限資源漏洞
- 在Linux下subversion和apache安裝配置
- 揭露MyEclipse Subversion環(huán)境建立的內(nèi)幕
- 學(xué)習(xí)筆記:剖析Collabnet Subversion集成
分享標(biāo)題:學(xué)習(xí)筆記:Eclipse中Subversion插件如何使用詳解下篇
網(wǎng)站鏈接:http://www.dlmjj.cn/article/dpcddij.html


咨詢
建站咨詢
