计算机专业毕业论文外文翻译.docx

上传人:b****6 文档编号:15528298 上传时间:2023-07-05 格式:DOCX 页数:15 大小:87.43KB
下载 相关 举报
计算机专业毕业论文外文翻译.docx_第1页
第1页 / 共15页
计算机专业毕业论文外文翻译.docx_第2页
第2页 / 共15页
计算机专业毕业论文外文翻译.docx_第3页
第3页 / 共15页
计算机专业毕业论文外文翻译.docx_第4页
第4页 / 共15页
计算机专业毕业论文外文翻译.docx_第5页
第5页 / 共15页
计算机专业毕业论文外文翻译.docx_第6页
第6页 / 共15页
计算机专业毕业论文外文翻译.docx_第7页
第7页 / 共15页
计算机专业毕业论文外文翻译.docx_第8页
第8页 / 共15页
计算机专业毕业论文外文翻译.docx_第9页
第9页 / 共15页
计算机专业毕业论文外文翻译.docx_第10页
第10页 / 共15页
计算机专业毕业论文外文翻译.docx_第11页
第11页 / 共15页
计算机专业毕业论文外文翻译.docx_第12页
第12页 / 共15页
计算机专业毕业论文外文翻译.docx_第13页
第13页 / 共15页
计算机专业毕业论文外文翻译.docx_第14页
第14页 / 共15页
计算机专业毕业论文外文翻译.docx_第15页
第15页 / 共15页
亲,该文档总共15页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

计算机专业毕业论文外文翻译.docx

《计算机专业毕业论文外文翻译.docx》由会员分享,可在线阅读,更多相关《计算机专业毕业论文外文翻译.docx(15页珍藏版)》请在冰点文库上搜索。

计算机专业毕业论文外文翻译.docx

计算机专业毕业论文外文翻译

附录

(英文翻译)

RichClientTutorialPart1

TheRichClientPlatform(RCP)isanexcitingnewwaytobuildJavaapplicationsthatcancompetewithnativeapplicationsonanyplatform.ThistutorialisdesignedtogetyoustartedbuildingRCPapplicationsquickly.IthasbeenupdatedforEclipse3.1.2

ByEdBurnette,SAS

July28,2004

Updatedfor3.1.2:

February6,2006

Introduction

Trythisexperiment:

ShowEclipsetosomefriendsorco-workerswhohaven'tseenitbeforeandaskthemtoguesswhatlanguageitiswrittenin.Chancesare,they'llguessVB,C++,orC#,becausethoselanguagesareusedmostoftenforhighqualityclientsideapplications.ThenwatchthelookontheirfaceswhenyoutellthemitwascreatedinJava,especiallyiftheyareJavaprogrammers.

Becauseofitsuniqueopensourcelicense,youcanusethetechnologiesthatwentintoEclipsetocreateyourowncommercialqualityprograms.Beforeversion3.0,thiswaspossiblebutdifficult,especiallywhenyouwantedtoheavilycustomizethemenus,layouts,andotheruserinterfaceelements.Thatwasbecausethe"IDE-ness"ofEclipsewashard-wiredintoit.Version3.0introducedtheRichClientPlatform(RCP),whichisbasicallyarefactoringofthefundamentalpartsofEclipse'sUI,allowingittobeusedfornon-IDEapplications.Version3.1updatedRCPwithnewcapabilities,and,mostimportantly,newtoolingsupporttomakeiteasiertocreatethanbefore.

Ifyouwanttocuttothechaseandlookatthecodeforthispartyoucanfinditintheaccompanyingzipfile.Otherwise,let'stakealookathowtoconstructanRCPapplication.

Gettingstarted

RCPapplicationsarebasedonthefamiliarEclipseplug-inarchitecture,(ifit'snotfamiliartoyou,seethereferencessection).Therefore,you'llneedtocreateaplug-intobeyourmainprogram.Eclipse'sPlug-inDevelopmentEnvironment(PDE)providesanumberofwizardsandeditorsthattakesomeofthedrudgeryoutoftheprocess.PDEisincludedwiththeEclipseSDKdownloadsothatisthepackageyoushouldbeusing.Herearethestepsyoushouldfollowtogetstarted.

First,bringupEclipseandselectFile>New>Project,thenexpandPlug-inDevelopmentanddouble-clickPlug-inProjecttobringupthePlug-inProjectwizard.Onthesubsequentpages,enteraProjectnamesuchasorg.eclipse.ui.tutorials.rcp.part1,indicateyouwantaJavaproject,selecttheversionofEclipseyou'retargeting(atleast3.1),andenabletheoptiontoCreateanOSGibundlemanifest.ThenclickNext>.

BeginninginEclipse3.1youwillgetbestresultsbyusingtheOSGibundlemanifest.Incontrasttopreviousversions,thisisnowthedefault.

InthenextpageoftheWizardyoucanchangethePlug-inIDandotherparameters.Ofparticularimportanceisthequestion,"Wouldyouliketocreatearichclientapplication?

".SelectYes.Thegeneratedplug-inclassisoptionalbutforthisexamplejustleavealltheotheroptionsattheirdefaultvalues.ClickNext>tocontinue.

IfyougetadialogaskingifEclipsecanswitchtothePlug-inDevelopmentPerspectiveclickRemembermydecisionandselectYes(thisisoptional).

StartingwithEclipse3.1,severaltemplateshavebeenprovidedtomakecreatinganRCPapplicationabreeze.We'llusethesimplestoneavailableandseehowitworks.MakesuretheoptiontoCreateaplug-inusingoneofthetemplatesisenabled,thenselecttheHelloRCPtemplate.ThisisRCP'sequivalentof"Hello,world".ClickFinishtoacceptallthedefaultsandgeneratetheproject(seeFigure1).EclipsewillopenthePlug-inManifestEditor.ThePlug-inManifesteditorputsafriendlyfaceonthevariousconfiguration

filesthatcontrolyourRCPapplication.

Figure1.TheHelloWorldRCPprojectwascreatedbyaPDEwizard.

Takingitforaspin

TryingoutRCPapplicationsusedtobesomewhattedious.Youhadtocreateacustomlaunchconfiguration,entertherightapplicationname,andtweaktheplug-insthatwereincluded.ThankfullythePDEkeepstrackofallthisnow.AllyouhavetodoisclickontheLaunchanEclipseApplicationbuttoninthePlug-inManifesteditor'sOverviewpage.Youshouldseeabare-bonesWorkbenchstartup(seeFigure2).

Figure2.ByusingthetemplatesyoucanbeupandrunninganRCPapplicationinminutes.

Makingitaproduct

InEclipsetermsaproductiseverythingthatgoeswithyourapplication,includingalltheotherplug-insitdependson,acommandtoruntheapplication(calledthenativelauncher),andanybranding(icons,etc.)thatmakeyourapplicationdistinctive.Althoughaswe'vejustseenyoucanrunaRCPapplicationwithoutdefiningaproduct,havingonemakesitawholeloteasiertoruntheapplicationoutsideofEclipse.ThisisoneofthemajorinnovationsthatEclipse3.1broughttoRCPdevelopment.

SomeofthemorecomplicatedRCPtemplatesalreadycomewithaproductdefined,buttheHelloRCPtemplatedoesnotsowe'llhavetomakeone.

Inordertocreateaproduct,theeasiestwayistoaddaproductconfigurationfiletotheproject.Rightclickontheplug-inprojectandselectNew>ProductConfiguration.Thenenterafilenameforthisnewconfigurationfile,suchaspart1.product.Leavetheotheroptionsattheirdefaultvalues.ThenclickFinish.TheProductConfigurationeditorwillopen.Thiseditorletsyoucontrolexactlywhatmakesupyourproductincludingallitsplug-insandbrandingelements.

IntheOverviewpage,selecttheNew...buttontocreateanewproductextension.Typeinorbrowsetothedefiningplug-in(org.eclipse.ui.tutorials.rcp.part1).EnteraProductIDsuchasproduct,andfortheProductApplicationselectorg.eclipse.ui.tutorials.rcp.part1.application.ClickFinishtodefinetheproduct.BackintheOverviewpage,typeinanewProductName,forexampleRCPTutorial1.

InEclipse3.1.0ifyoucreatetheproductbeforefillingintheProductNameyoumayseeanerrorappearintheProblemsview.TheerrorwillgoawaywhenyouSynchronize(seebelow).Thisisaknownbugthatisfixedinnewerversions.AlwaysusethelatestavailablemaintenancereleasefortheversionofEclipseyou'retargeting!

NowselecttheConfigurationtabandclickAdd....Selecttheplug-inyoujustcreated(org.eclipse.ui.tutorials.rcp.part1)andthenclickonAddRequiredPlug-ins.ThengobacktotheOverviewpageandpressCtrl+SorFile>Savetosaveyourwork.

Ifyourapplicationneedstoreferenceplug-insthatcannotbedetermineduntilruntime(forexamplethetomcatplug-in),thenaddthemmanuallyintheConfigurationtab.

Atthispointyoushouldtestouttheproducttomakesureitrunscorrectly.IntheTestingsectionoftheOverviewpage,clickonSynchronizethenclickonLaunchtheproduct.Ifallgoeswell,theapplicationshouldstartupjustlikebefore.

Plug-insvs.features

OntheOverviewpageyoumayhavenoticedanoptionthatsaystheproductconfigurationisbasedoneitherplug-insorfeatures.Thesimplestkindofconfigurationisonebasedonplug-ins,sothat'swhatthistutorialuses.IfyourproductneedsautomaticupdateorJavaWebStartsupport,theneventuallyyoushouldconvertittousefeatures.Buttakemyadviceandgetitworkingwithoutthemfirst.

RunningitoutsideofEclipse

Thewholepointofallthisistobeabletodeployandrunstand-aloneapplicationswithouttheuserhavingtoknowanythingabouttheJavaandEclipsecodebeingusedunderthecovers.Forarealapplicationyoumaywanttoprovideaself-containedexecutablegeneratedbyaninstallprogramlikeInstallShieldorNSIS.That'sreallybeyondthescopeofthisarticlethough,sowe'lldosomethingsimpler.

TheEclipseplug-inloaderexpectsthingstobeinacertainlayoutsowe'llneedtocreateasimplifiedversionoftheEclipseinstalldirectory.Thisdirectoryhastocontainthenativelauncherprogram,configfiles,andalltheplug-insrequiredbytheproduct.Thankfully,we'vegiventhePDEenoughinformationthatitcanputallthistogetherforusnow.

IntheExportingsectionoftheProductConfigurationeditor,clickthelinktoUsetheEclipseProductexportwizard.SettherootdirectorytosomethinglikeRcpTutorial1.ThenselecttheoptiontodeployintoaDirectory,andenteradirectorypathtoatemporary(scratch)areasuchasC:

\Deploy.ChecktheoptiontoIncludesourcecodeifyou'rebuildinganopensourceproject.PressFinishtobuildandexporttheprogram.

ThecompileroptionsforsourceandclasscompatibilityintheEclipseProductexportwizardwilloverrideanyoptionsyouhavespecifiedonyourprojectorglobalpreferences.AspartoftheExportprocess,theplug-iniscodeisrecompiledbyanAntscriptusingtheseoptions.

TheapplicationisnowreadytorunoutsideEclipse.Whenyou'redoneyoushouldhaveastructurethatlookslikethisinyourdeploymentdirectory:

RcpTutorial1

|.eclipseproduct

|eclipse.exe

|startup.jar

+---configuration

|config.ini

+---plugins

mands_3.1.0.jar

org.eclipse.core.expressions_3.1.0.jar

org.eclipse.core.runtime_3.1.2.jar

org.eclipse.help_3.1.0.jar

org.eclipse.jface_3.1.1.jar

org.eclipse.osgi_3.1.2.jar

org.eclipse.swt.win32.win32.x86_3.1.2.jar

org.eclipse.swt_3.1.0.jar

org.eclipse.ui.tutorials.rcp.part1_1.0.0.jar

org.eclipse.ui.workbench_3.1.2.jar

org.eclipse.ui_3.1.2.jar

Notethatalltheplug-insaredeployedasjarfiles.ThisistherecommendedformatstartinginEclipse3.1.Amongotherthingsthissavesdiskspaceinthedeployedapplication.

PreviousversionsofthistutorialrecommendedusingabatchfileorshellscripttoinvokeyourRCPprogram.Itturnsoutthisisabadideabecauseyouwillnotbeabletofullybrandyourapplicationlateron.Forexample,youwon'tbe

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 经管营销 > 经济市场

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2