Tải bản đầy đủ - 0 (trang)
Chapter 18. Features, Branding, and Updates

Chapter 18. Features, Branding, and Updates

Tải bản đầy đủ - 0trang

Chapter18.Features,Branding,and

Updates

OneormoreEclipseplug-inscanbegroupedtogetherintoan

Eclipsefeaturesothatausercaneasilyload,manage,and

brandthoseplug-insasasingleunit.Thischapterincludesan

overviewoftheEclipsefeatureframeworkandshowshowto

createasimplefeatureusingthebuilt-infeature-creation

wizard.

Itwillalsodiscussusingfeaturestocommercializeorbranda

plug-in-basedproductandwillconcludewithadescriptionof

howtopackageanddeliverfeaturesviaanupdate-enabledWeb

site.

Sofar,severalplug-inshavebeencreated,whichhave

contributeddifferentfeaturestotheFavoritesview.Eachpluginhasbeenlooselycoupledtootherplug-ins,andcollectively

havenotexhibitedanyunifyingstructureoridentity.Afeature

providesthisstructureandahomeforbrandingelementssuch

astheAboutpagesandimages(seeFigure18-1).



Figure18-1.Featurefilerelationshipsand

brandingelements.



[Viewfullsizeimage]



Oncepackagedasafeature,youwillthenbeabletoloadand

unloadyourplug-insasasingleunitusingtheEclipseUpdate

Manager.







18.1.FeatureProjects

TheFavoritesexampleincludesthreeprojects"FavoritesPlugin,""FavoritesHelp,"and"FavoritesNLSFragment"thatyou

wouldliketocombinetogetherintoasinglefeature.



18.1.1.Creatinganewfeatureproject

Tocreatethenewfeature,youwillbeginbyusingtheNew

ProjectwizardtocreateanewFeatureProject(seeFigure

18-2).



Figure18-2.TheNewProjectwizard.



[Viewfullsizeimage]



OnthefirstpageoftheNewFeaturewizard(seeFigure18-3),

enter"com.qualityeclipse.favorites.feature"astheproject

name.ClicktheNextbutton.



Figure18-3.TheNewFeaturewizard.



[Viewfullsizeimage]



Onthesecondpageofthewizard(seeFigure18-4),changethe

featureIDto"com.qualityeclipse.favorites"sothatitmatches

theIDofthemainplug-in.Thisisimportantbecausethe

generallyacceptedpracticeintheEclipseworldistolocate

featurebrandingfiles(suchasabout.iniandabout.properties)in

theplug-inwiththesameIDasthefeature(asyouwillseea

bitlater,thisisnotstrictlyrequiredseeSection18.1.3,Feature

manifesteditor,onpage624).



Figure18-4.FeaturePropertiespageoftheNew

Featurewizard.



[Viewfullsizeimage]



Acoupleofotherfieldsshouldbefilledinonthispageaswell:

ChangetheFeatureNameto"FavoritesFeature";leavethe

FeatureVersionsetto"1.0.0";andsettheFeatureProvider

to"QualityEclipse".Thesectionatthebottomofthispagedeals

withsettingupacustominstallhandler.Thisisanadvanced

feature,whichwon'tbecoveredinthisbook.Leavethose

settingsunchangedandclicktheNextbutton.

Onthelastpageofthewizard(seeFigure18-5),youwillseea

listofalltheloadedplug-insandfragmentsdefinedinyour

workspacealongwiththeirversionnumbers.Findthetwopluginsandonefragmentcreatedearlierandselectthem.Click

Finishtocreatetheprojectandgeneratethefeaturemanifest

file.



Figure18-5.ReferencedPlug-insandFragments



pageoftheNewFeaturewizard.



[Viewfullsizeimage]



18.1.2.Featuremanifestfiles

Thewizardcreatedasinglefileofinterest:thefeaturemanifest

file.Basedontheoptionsselectedinthewizard,thefeature

manifestfile(feature.xml)willlooklikethis:






id="com.qualityeclipse.favorites"

label="FavoritesFeature"

version="1.0.0"

provider-name="QualityEclipse">



[EnterFeatureDescriptionhere.]





[EnterCopyrightDescriptionhere.]





[EnterLicenseDescriptionhere.]




id="com.qualityeclipse.favorites"

download-size="0"

install-size="0"

version="0.0.0"/>


id="com.qualityeclipse.favorites.help"

download-size="0"

install-size="0"

version="0.0.0"/>


id="com.qualityeclipse.favorites.nl1"

download-size="0"

install-size="0"

version="0.0.0"

fragment="true"/>





Thestructureisfairlysimple.Atthebeginningofthefile,you

willfindtheid,label,version,andprovider-nameattributes.The

description,copyright,andlicensesectionscontaininformation

meanttobepresentedtotheuserofthefeature.

Theremainderofthefileliststheindividualplug-insand

fragmentsthatcomposethisfeature.Eachplug-inisidentified

byitsplug-inID,andtheversionattributespecifiesthespecific

versionoftheplug-inthatispartofthisfeature.Ingeneral,the

versionnumbersoftheincludedplug-insshouldmatchthe

versionnumberofthefeature.Havingthefragmentattributeset

totrueidentifiesanyincludedfragments.



18.1.3.Featuremanifesteditor

Thefeaturemanifestgeneratedbythewizardcontainsthe

barestessentialelementsneededtodefineafeature.Numerous

otherattributescanbedefinedtoenhanceafeature.The

featuremanifesteditorprovidesaconvenientinterfacefor

editingtheexistingattributesofafeatureoraddingnew

attributes.

Double-clickingonthefeaturemanifestfile,feature.xml,will

openthefeaturemanifesteditor(seeFigure18-6).Theeditor

looksverysimilartotheplug-inmanifesteditorwithOverview,

Information,Plug-ins,IncludedFeatures,Dependencies,

Installation,Build,feature.xml,andbuild.properties

pages.



Figure18-6.Featuremanifesteditor.



[Viewfullsizeimage]



Therearealotofthingshappeningonthispage.Initially,the

ID,Version,Name,andProviderfieldswillbefilledinbased

oninputstothewizardpages.Thereareotherfieldstomake

noteofhere.BrandingPlug-incontainsthenameofthepluginthatwillcontainthefeaturebrandingfiles.UsetheBrowse...

buttontoselectthemainplug-inormanuallychangethevalue

to"com.qualityeclipse.favorites"sothatitmatchestheIDofthe

mainplug-in.

TheUpdateSiteURLandUpdateSiteNamefieldsareused

tospecifytheWebaddressandnameoftheupdatesitethat

willbeusedtoloadthefeatureusingtheEclipseUpdate

Manager.WhentheUpdateManagerislookingforupdatesto

yourplug-in,itwilllookatthesitesdefinedbyyourupdate

URLs.ThisisdiscussedinmoredetailinSection18.3,Update

Sites,onpage637.

Formostplug-inswrittenagainstthepublicEclipseAPI,

portabilitytodifferentEclipseplatformswon'tbeaproblem.

Eclipsedoesnotpreventyou,however,frommakinguseof



platform-specificfunctionality(suchasActiveXsupportunder

Windows).Insituationslikethat,youneedtobeabletospecify

whichenvironmentsareappropriateforyourplug-in.Inthe

SupportedEnvironmentssection,youcansupplyacommaseparatedlistofvalidvaluesforOperatingSystems,Window

Systems,Languages,andArchitecture.

ClickingontheBrowse...buttontotherightofeachfieldwill

openaselectiondialogappropriatetothechosenenvironment

type.Forexample,thechoicesavailableforOperating

Systemsincludeaix,hpux,linux,macosx,qnx,solaris,and

win32(seeFigure18-7).



Figure18-7.PortabilityChoicesforoperating

systems.



Ontherightsideofthepage,theExportingsectionincludesa

coupleofinterestingoptions.TheSynchronizebuttonisused

tosynchronizetheversionnumbersoftheincludedplug-insand



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Chapter 18. Features, Branding, and Updates

Tải bản đầy đủ ngay(0 tr)

×