Eclipse RCPãšã¯
ãã©ãããã©ãŒã ã®é·æãšçæ
ä»äºãå§ãã
å¿ èŠãªãã©ã°ã€ã³ãã€ã³ã¹ããŒã«ãã
ãããžã§ã¯ãäœæ
ãããžã§ã¯ãæ§é
ãããžã§ã¯ãã®éå§
ãã¥ãŒãè¿œå ãã
æ¡åŒµæ©èœãè¿œå
ã«ã¹ã¿ãã€ãºã衚瀺
ãã¥ãŒã®ã¬ã€ã¢ãŠãèšå®
ãã¥ãŒãè¿œå ããã¢ããªã±ãŒã·ã§ã³ã®èµ·å
圹ç«ã€ãªãœãŒã¹ãžã®ãªã³ã¯
Eclipse RCPãšã¯
ãããããEclipse RCPãšã¯äœããæ£ç¢ºã«èšãå¿ èŠããããŸãã Eclipseã¯ãEclipse FoundationïŒIBMãSAPãOracleãEclipse RCPããŒã¹ã®è£œåãæäŸããGoogleãRedHatãAdobeãCiscoãIntelã®ãšã³ã·ã¹ãã ã®éçºã«åå ããŠããäŒæ¥ãå«ãïŒã«ãã£ãŠéçºããã³ãµããŒããããŠããJavaã§æžãããéçºç°å¢ã§ãã Eclipse RCPã¯ããããããªããã¯ã©ã€ã¢ã³ãã¢ããªã±ãŒã·ã§ã³ãäœæããããã®ãã©ã°ã€ã³ã®ã»ããã§ãã Eclipse IDEãéãããšãã«ãŠãŒã¶ãŒã«è¡šç€ºãããã®ã¯ããã®ãã©ãããã©ãŒã ã«åºã¥ããŠäœæããããã©ã°ã€ã³ã®ã¿ã§ãã ãŠãŒã¶ãŒã¯æ¢åã®èšå€§ãªæ°ã®ãã©ã°ã€ã³ã«åºã¥ããŠãã©ã°ã€ã³ãäœæã§ããå¿ èŠã«å¿ããŠãHibernateãGoogle GuiceãGoogle GuavaãJUnitãTestNGãªã©ã®äžè¬çãªãã¬ãŒã ã¯ãŒã¯ã®ã»ãšãã©ããã©ã°ã€ã³ã®åœ¢åŒã§èŠã€ããããšãã§ããŸãã ãŸããã©ã³ã¿ã€ã ã¢ãŒããã¯ãã£ãOSGIãµãŒãã¹ãã©ãããã©ãŒã ã®ä»æ§ã«åºã¥ããŠããããšã«ã泚æããŠãã ããããã®ä»æ§ã§ã¯ãã¢ãžã¥ã©ãŒã¢ããªã±ãŒã·ã§ã³ã®äœæããã³æäœæ¹æ³ã«ã€ããŠèª¬æããŸãã åè¿°ã®ããã«ãEclipseã¯Javaã§èšè¿°ãããã¯ãã¹ãã©ãããã©ãŒã 補åãšããŠäœçœ®ä»ããããŠããŸãïŒ90ïŒ ã®å ŽåãRCPã¢ããªã±ãŒã·ã§ã³ã¯WindowsãLinuxãããã³Macäžã«æ§ç¯ãããŸãïŒã ãã©ãããã©ãŒã ã®ã³ã¢ãæ§æãããã¹ãŠã®ãã©ã°ã€ã³ãããã³ã»ãšãã©ã®ãµãŒãããŒãã£ãã©ã°ã€ã³ã¯ãEPLïŒEclipse Public LicenseïŒã®äžã§é åžãããŸãã RCPã¢ããªã±ãŒã·ã§ã³ã®ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ã¯ãSWTããã³JFaceãã¬ãŒã ã¯ãŒã¯ã®ããžã¥ã¢ã«ã³ã³ããŒãã³ããšãç¬èªã®EclipseãŠã£ãžã§ããã«åºã¥ããŠããŸãã 以äžã®å³ã¯ãRCPãã©ãããã©ãŒã ã¢ããªã±ãŒã·ã§ã³ã®æ§æèŠçŽ ãšEclipseãã©ãããã©ãŒã èªäœã®æ§é ã瀺ããŠããŸãã
å³1-RCPã¢ããªã±ãŒã·ã§ã³ã§äœ¿çšãããã³ã³ããŒãã³ãïŒãã®ãµã€ãããååŸããå³ïŒ
å³2-Eclipseã¢ãŒããã¯ãã£ïŒãã®ãµã€ãããåŒçšããå³ïŒ
ãã©ãããã©ãŒã ã®é·æãšçæ
äž»ãªçåã¯ããã®ãã©ãããã©ãŒã ãåªããŠããçç±ãšããã¹ã¯ãããã¢ããªã±ãŒã·ã§ã³ã®éçºã«äœ¿çšããçç±ã§ãïŒãšããã§ãã¢ãã€ã«ãã©ãããã©ãŒã çšã®Webã¢ããªã±ãŒã·ã§ã³ãã¢ããªã±ãŒã·ã§ã³ãéçºããããšã¯å¯èœã§ãïŒã ã¢ãžã¥ãŒã«æ§ãã¯ãã¹ãã©ãããã©ãŒã ãå€èšèªãµããŒããç¡æãèšå€§ãªæ°ã®æ¢åã®ãã©ã°ã€ã³ãã©ã€ãã©ãªããã¬ãŒã ã¯ãŒã¯ã ããã«ãããåçšã¬ãã«ã®ã¢ããªã±ãŒã·ã§ã³ãäœæã§ããŸãïŒãã®ãã©ãããã©ãŒã ã§éçºãããæ¢åã®ã¢ããªã±ãŒã·ã§ã³ã®ãªã¹ããžã®ãªã³ã¯ã¯ãèšäºã®æåŸã«ãããŸãïŒã é倧ãªã¢ããªã±ãŒã·ã§ã³ãéçºããã«ã¯ãå°ãªããšãäžè¬çãªçšèªã§OSGIãã¬ãŒã ã¯ãŒã¯ãã©ã®ããã«æ©èœããããç¥ã£ãŠãSWTããã³JFaceã®ã³ã³ããŒãã³ããšãŠã£ãžã§ãããæäœã§ããããã«ããå¿ èŠããããããæ¬ ç¹ã«ã¯ããªãé«ãã¬ãã«ã®ãšã³ããªãå«ãŸããŸãã ãŸãããã·ã¢èªã話ãéçºè ã«ãšã£ãŠã®åé¡ã¯ãäžèšã®ãã¬ãŒã ã¯ãŒã¯ãšã©ã€ãã©ãªã«é¢ããè³æãæžç±ãèŠã€ããããšã§ãïŒãã·ã¢èªãå«ãèŠã€ãã£ããªãœãŒã¹ãžã®ãªã³ã¯ã¯ãèšäºã®æåŸã«èšèŒãããŠããŸãïŒããã€ãã®Eclipse Foundationã§ã¯ãæ°ãããã©ã°ã€ã³ã«ã€ããŠèªãç¹å¥ãªéèªãçºè¡ãããŠããããã®ã¢ããªã±ãŒã·ã§ã³ã®å€ãã®äŸãšãéçºã®ãã¹ãŠã®ãã¥ã¢ã³ã¹ãšåŸ®åŠãã説æãããã€ãèªã®æžç±ã·ãªãŒãºãå«ãŸããŠããŸãã è±èªã§ã¯ãAddison-Wesleyã«ããæ¥é£ã·ãªãŒãºã®ç¹å¥ãªã·ãªãŒãºã®æ¬ãèŠã€ããããšãã§ããŸãããŸããApressã®æ¬ãããã€ãèŠã€ããããšãã§ããŸãã ããããç§ãã¡ã®æ¯åœèªã§ã¯ãè³æãšæ¬ã¯ãããããã§ãã
ä»äºãå§ãã
å¿ èŠãªãã©ã°ã€ã³ãã€ã³ã¹ããŒã«ãã
æåã®RCPã¢ããªã±ãŒã·ã§ã³ã®äœæã«çŽæ¥é²ã¿ãŸãããã åäœãããã«ã¯ãå ¬åŒãµã€ãããã¢ã»ã³ããªïŒ RCPããã³RAPéçºè åãã®EclipseïŒãããŠã³ããŒãããå¿ èŠããããŸã ã Eclipse IDEããã§ã«ã€ã³ã¹ããŒã«ãããŠããå Žåã¯ãæŽæ°ãããŒãžã£ãŒã䜿çšã§ããŸãã ã¡ã€ã³ã¡ãã¥ãŒã§[ãã«ã]-> [æ°ãããœãããŠã§ã¢ã®ã€ã³ã¹ããŒã«]ãéžæããŸãã 衚瀺ããã[ã€ã³ã¹ããŒã«]ãŠã£ã³ããŠã§ãæŽæ°ãå¿ èŠãªãµã€ããããããããŠã³ãªã¹ãããéžæããŸã-download.eclipse.org/releases/indigoããªã¹ãã«ãã®ãããªãµã€ãããªãå Žåã¯ãå³åŽã®[è¿œå ]ãã¿ã³ãã¯ãªãã¯ãã[åå]ãã£ãŒã«ãã®[å Žæ]ãã£ãŒã«ãã«Indigo Update Site -äžèšã®[OK]ã¢ãã¬ã¹ãã¯ãªãã¯ããŸãïŒã¢ãã¬ã¹ãè¿œå ããå Žå-éè€ããå Žæã衚瀺ãããã¢ãã¬ã¹ãå©çšå¯èœãªãœãããŠã§ã¢ãµã€ããªã¹ãã«æ¢ã«ååšããå ŽåãããããããŠã³ã®äžã«ãã[å©çšå¯èœãªãœãããŠã§ã¢ãµã€ã]ãªã³ã¯ãã¯ãªãã¯ããŠãæŽæ°ãµã€ãã®ãªã¹ãã以åã®ã€ã³ã¹ããŒã«ãŠã£ã³ããŠã§è¡šç€ºã§ããŸãïŒãªã¹ãïŒã æŽæ°ãµã€ããéžæãããšãããªãŒãªã¹ããäžéšã«è¡šç€ºããïŒã«ããŽãªããšã«ã¢ã€ãã ãã°ã«ãŒãåãããã§ãã¯ããã¯ã¹ããã§ãã¯ãããŠããå ŽåïŒãæ±çšããŒã«ã¢ã€ãã ãéãã Eclipseãã©ã°ã€ã³éçºç°å¢ãéžæããEclipseRTã¿ãŒã²ãããã©ãããã©ãŒã ã³ã³ããŒãã³ãã¢ã€ãã ãéãããã©ã°ã€ã³ããã§ãã¯ããŸã-Eclipse RCP Plug-in DeveloperãªãœãŒã¹ ããããžã§ã¯ããäœæããããã«å¿ èŠãªã®ã¯ããã2ã€ã®ãã©ã°ã€ã³ã§ãã 次ã«ã[次ãž]ã2åã¯ãªãã¯ããã©ã€ã»ã³ã¹å¥çŽã«åæããŠ[å®äº]ãã¿ã³ãã¯ãªãã¯ããŸãã ãã¹ãŠãå¿ èŠãªãã©ã°ã€ã³ã®ã€ã³ã¹ããŒã«ãéå§ãããŸãã ã€ã³ã¹ããŒã«åŸãEclipseãåèµ·åããããæ±ããããŸããããããè¡ããŸãã
å³3-ãã©ã°ã€ã³ã®ã€ã³ã¹ããŒã«ãŠã£ã³ããŠ
ãããžã§ã¯ãäœæ
åèµ·ååŸãã¡ã€ã³ã¡ãã¥ãŒã§[ãã¡ã€ã«]-> [æ°èŠ]-> [ãã®ä»]ãéžæãã[ãã©ã°ã€ã³éçº]ãéžæããŠãããããããããŠã³ã¡ãã¥ãŒã§[ãã©ã°ã€ã³ãããžã§ã¯ã]ãéžæããŸãã
å³4-äœæãããããžã§ã¯ãã®ã¿ã€ããéžæããã¡ãã¥ãŒ
[次ãž]ãã¯ãªãã¯ããŸãããããžã§ã¯ãã«ååãä»ããfirst.rcp.applicationãšããååãä»ããŠãããäžåºŠ[次ãž]ãã¯ãªãã¯ããŸãã 次ã®ãŠã£ã³ããŠã§ãã¢ããªã±ãŒã·ã§ã³ã®ååãæå®ãã[åå]ãã£ãŒã«ãã«First RCP Applicationãšå ¥åããå¿ èŠããããŸãã ãã©ã°ã€ã³ã®ã©ã€ããµã€ã¯ã«ãå¶åŸ¡ããJavaã¯ã©ã¹ã§ããã¢ã¯ãã£ããŒã¿ãŒã®çæã®ãã§ãã¯ãå€ããŸãã åçŽãªã¢ããªã±ãŒã·ã§ã³ã§ã¯ãã¢ã¯ãã£ããŒã¿ãŒã¯ã©ã¹ã¯å¿ èŠãããŸããã ã¢ã€ãã ã«ãã§ãã¯ããŒã¯ãä»ããŸã-ã¢ããªã±ãŒã·ã§ã³ã«ã¯ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ãŒã¹ãå«ãŸããããããã®ãã©ã°ã€ã³ã¯UIã«è²¢ç®ããŸãã 3çªç®ã®[APIåæãæå¹ã«ãã]é ç®ã¯ãªãã®ãŸãŸã«ããŸãã 質åã«å¯ŸããŠ-ãªããã¯ã©ã€ã¢ã³ãã¢ããªã±ãŒã·ã§ã³ãäœæããŸããïŒ ã¯ããšçããŸãã
å³5-ãã©ã°ã€ã³äœæãŠã£ã³ããŠ
[次ãž]ãã¯ãªãã¯ããŸããä»åŸã®ã¢ããªã±ãŒã·ã§ã³ã®ãã³ãã¬ãŒããéžæããããæ±ããããŸãã[Hello RCP]ãéžæãã[次ãž]ãã¯ãªãã¯ããŸãã
å³6-ãããžã§ã¯ãRCPãã³ãã¬ãŒããéžæããããã®ãŠã£ã³ããŠ
æåŸã®ãŠã£ã³ããŠã®[ã¢ããªã±ãŒã·ã§ã³]ãŠã£ã³ããŠã®ã¿ã€ãã«ãã£ãŒã«ãã«ã[ãŠãŒã¶ãŒãã©ãŒã ]ã[ã¢ããªã±ãŒã·ã§ã³ã¯ã©ã¹]ãã£ãŒã«ãã«-MyApplicationãšå ¥åããŸãã [ãã©ã³ããè¿œå ]ãã§ãã¯ããã¯ã¹ã¯ç¡å¹ã®ãŸãŸã«ãªããŸãã [å®äº]ãã¿ã³ãã¯ãªãã¯ããŸãã ãã©ã°ã€ã³éçºã®èŠ³ç¹ã«åãæ¿ããããæ±ããããŸããããã®ææ¡ã«åæããŸãã
å³7-ãããžã§ã¯ãRCPãã³ãã¬ãŒãæ§æãŠã£ã³ããŠ
ãããžã§ã¯ãæ§é
ãã®ãããç§ãã¡ã®åã«ãæ°ããäœæããããããžã§ã¯ãã®æ§é ããããŸãã
å³8-ãããžã§ã¯ãã®æ§é
ããã±ãŒãžfirst.rcp.applicationã®5ã€ã®ã¯ã©ã¹ã®å 容ã¯çŸæç¹ã§ã¯èå³ããããŸãããMyApplicationã¯ã©ã¹ã¯äœããã®åœ¢ã§éåžžã®Javaããã°ã©ã ã®mainïŒïŒã¡ãœããã§ãããšèšããŸãããã®ã¯ã©ã¹ã¯ãã©ã°ã€ã³ã®èµ·åæ¹æ³ãšåæ¢æ¹æ³ãæ åœããŸãã ApplicationWorkbenchWindowAdvisorã¯ã©ã¹ã§ã¯ã次ã®ã³ãŒãè¡ã䜿çšããŠã¢ããªã±ãŒã·ã§ã³ãŠã£ã³ããŠã®ãµã€ãºãèšå®ã§ããŸãã
configurer.setInitialSize(new Point(400, 300));
ãŸããããã©ã«ãã§ã¯ããŒã«ããŒãšã¹ããŒã¿ã¹ããŒã衚瀺ãããªãããšãããããŸãã
configurer.setShowCoolBar(false);
configurer.setShowStatusLine(false);
æåŸã®è¡ã¯ãã¡ã€ã³ãŠã£ã³ããŠã®ã¿ã€ãã«ããŒãèšå®ããŸãã
configurer.setTitle("User Form");
ApplicationActionBarAdvisorã¯ã©ã¹ã¯ãã¢ããªã±ãŒã·ã§ã³ã®ã¡ãã¥ãŒããŒã®ã«ã¹ã¿ãã€ãºãæ åœããŸãã Perspectiveã¯ã©ã¹ã¯ãç¹å®ã®ããŒã¹ãã¯ãã£ãã«ãããšãã£ã¿ãŒãšãã¥ãŒã®å Žæãšãµã€ãºãæ åœããRCPã¢ããªã±ãŒã·ã§ã³ã«ã¯å°ãªããšã1ã€ã®ããŒã¹ãã¯ãã£ããå¿ èŠã§ãã
ãããžã§ã¯ãã®éå§
äœæããã¢ããªã±ãŒã·ã§ã³ãèµ·åããã«ã¯ãMETA-INFãã©ã«ããŒã«ç§»åããŠãçªç¶MANIFEST.MFãã¡ã€ã«ãéãå¿ èŠããããŸãïŒãã®ãã¡ã€ã«ã¯ããããžã§ã¯ãã®äœææã«ããã©ã«ãã§éããŸãïŒã
å³9-RCPã¢ããªã±ãŒã·ã§ã³ããããã£ãšãã£ã¿ãŒ
ãã®ãã¡ã€ã«ã«ãããå€ãã®ãããžã§ã¯ãèšå®ã®å€æŽãè¿œå ã®ãã©ã°ã€ã³ã®æ¥ç¶ãæ¡åŒµæ©èœã®æ¥ç¶ãšç®¡çããã©ã°ã€ã³ã®ã¢ã»ã³ããªã®æ§æãªã©ãè¡ãããšãã§ããŸãã [æŠèŠ]ã¿ãã®[ãã¹ã]ã»ã¯ã·ã§ã³ã§ããªã³ã¯ãã¯ãªãã¯ããŸã-Eclipseã¢ããªã±ãŒã·ã§ã³ãèµ·åããŸããããã«ã¢ããªã±ãŒã·ã§ã³ãŠã£ã³ããŠãç»é¢ã«è¡šç€ºãããéããŠæ¬¡ã®æ®µéã«é²ã¿ãŸãã
å³10-ã¢ããªã±ãŒã·ã§ã³ã®ãŠã£ã³ããŠ
ãã¥ãŒãè¿œå ãã
æ¡åŒµæ©èœãè¿œå
ç§ãã¡ã®ã¿ã¹ã¯ã¯ãã°ã©ãã£ã«ã«ã€ã³ã¿ãŒãã§ã€ã¹ã®èŠçŽ ãé 眮ã§ãããã¥ãŒãäœæããããšã§ãã MANIFEST.MFãã¡ã€ã«ã«ç§»åããŠãäžã®[æ¡åŒµæ©èœ]ã¿ããéžæããŸãã ããã©ã«ãã§ã¯ãorg.eclipse.core.runtime.applicationsãšorg.eclipse.ui.perspectivesã®2ã€ã®æ¡åŒµæ©èœããããŸãã æåã®æ¡åŒµæ©èœã¯MyApplicationã¢ããªã±ãŒã·ã§ã³ã®ã¯ã©ã¹ã«é¢é£ä»ããããŠããŸãããã®æ¡åŒµæ©èœãéžæããããªãŒãªã¹ããfirst.rcp.application.MyApplicationïŒå®è¡ïŒããŒãã«å±éãããšãã¯ã©ã¹ãã£ãŒã«ãã«ãã®ç¹å®ã®ã¯ã©ã¹ã®ååãå«ãŸããŠããããšãããããŸãã ãã®ãªã¹ãã®ã«ãŒãããŒãã«æ»ããšã[æ¡åŒµæ©èœã®è©³çŽ°]ã»ã¯ã·ã§ã³ã®å³åŽã«ãå€ãå€æŽã§ãã2ã€ã®ãã£ãŒã«ãã衚瀺ãããŸãïŒä»ã¯å€æŽããŸããïŒïŒID-ã¢ããªã±ãŒã·ã§ã³èå¥åãšName-ã¢ããªã±ãŒã·ã§ã³åã
2çªç®ã®æ¡åŒµæ©èœã¯ãã¢ããªã±ãŒã·ã§ã³ã®ããŒã¹ãã¯ãã£ããèšå®ããŸãã MANIFEST.MFãã¡ã€ã«ã䜿çšãããšãPerspectiveã¯ã©ã¹ã®ã³ãŒãã調ã¹ãããšãªãããã®ããŒã¹ãã¯ãã£ãã«å«ãŸããã¿ã€ãããšãã£ã¿ãŒããã®äœçœ®ããµã€ãºãæ¯çã瀺ãããšãã§ããŸãã ãã®æ¡åŒµæ©èœãã¯ãªãã¯ããŠåã¢ã€ãã ã«ç§»åãããšã[æ¡åŒµèŠçŽ ã®è©³çŽ°]ã»ã¯ã·ã§ã³ã§ãããŒã¹ãã¯ãã£ãã¯ã©ã¹ãèå¥åãããã³ååãæå®ã§ããããšãããããŸãã äžèšã®ãããªå€æŽã¯ããã®æ¡åŒµæ©èœã«é¢é£ä»ããããŠããã¯ã©ã¹ã³ãŒããçŽæ¥ç·šéãã plugin.xmlãã¡ã€ã«ãç·šéããããšã§è¡ãããšãã§ããŸãããæåã®ãããžã§ã¯ãã®äœæãè€éã«ããããšã¯ã§ããŸããã
å³11-ãããžã§ã¯ãã®æ¡åŒµæ©èœãå«ãã¿ã
ãã¥ãŒãäœæããã«ã¯ãæ°ããæ¡åŒµåãè¿œå ããå¿ èŠããããŸãã ãããè¡ãã«ã¯ã[è¿œå ]ãã¿ã³ãã¯ãªãã¯ãã衚瀺ããããŠã£ã³ããŠã®[æ¡åŒµãã€ã³ããã£ã«ã¿ãŒ]ãã£ãŒã«ãã«ãã¥ãŒãå ¥åããŸããæ¡åŒµæ©èœã¯org.eclipse.ui.viewsã®ã¿ã§ãéžæããŠ[å®äº]ãã¿ã³ãã¯ãªãã¯ããŸãã
å³12-æ°ããæ¡åŒµåãéžæããããã®ãŠã£ã³ããŠ
æ¡åŒµæ©èœã®ãªã¹ãã«ã¯ãå¥ã®3çªç®ã®æ¡åŒµæ©èœãå¿ èŠã§ãã
ã«ã¹ã¿ãã€ãºã衚瀺
è¿œå ããæ¡åŒµæ©èœãããŠã¹ã®å³ãã¿ã³ã§ã¯ãªãã¯ãããšãã³ã³ããã¹ãã¡ãã¥ãŒã衚瀺ããããã®äžã®[æ°èŠ]-> [ãã¥ãŒ]ãéžæããŠãæ¡åŒµæ©èœã«èŠçŽ ãè¿œå ããŸãïŒãã®èŠçŽ ã¯å¿ èŠãªãã¥ãŒã§ãïŒã ãã®ã¢ã€ãã ã®èšå®ã¯å³åŽã«è¡šç€ºãããŸãã ãŸãããã¥ãŒã®ã¯ã©ã¹ãäœæããŸãã ãããè¡ãã«ã¯ãã¯ã©ã¹*ãªã³ã¯ãã¯ãªãã¯ããŸãã
å³13-ãã¥ãŒèšå®
Javaã¯ã©ã¹ãäœæããããã®æšæºãã€ã¢ãã°ãéããååãä»ããŠMainViewã衚瀺ãããŸãã ã芧ã®ãšãã ããã®ã¯ã©ã¹ã¯ããã¹ãŠã®çš®é¡ã®èŠªã¯ã©ã¹ã§ããã¯ã©ã¹org.eclipse.ui.part.ViewPartãç¶æ¿ããŠããŸãã [å®äº]ãã¿ã³ãã¯ãªãã¯ããŠãã¯ã©ã¹ã®äœæãçµäºããŸãã ãã¥ãŒã®ã¯ã©ã¹ãäœæããåŸããã®ã³ãŒãã¯ç§ãã¡ã®åã«éãããã®åã®èå¥åãå«ãéçå€æ°ãäœæãããã®ã¯ã©ã¹ã®æ£èŠåãèå¥åãšããŠèšå®ããŸãã 以äžãèšè¿°ããŸãã
âŠ
public class MainView extends ViewPart {
public static final String ID = MainView.class.getCanonicalName();
âŠ
}
MANIFEST.MFãã¡ã€ã«ã«æ»ãã[æ¡åŒµæ©èœ]ã¿ããéããã¯ã©ã¹*ãã£ãŒã«ãã®å 容ãã³ããŒããŠãIDãã£ãŒã«ãã«è²Œãä»ããŸãã ãã®çš®ã®ã¯ã©ã¹åãšèå¥åã¯åãã«ãªããŸãããç®çã®ãã¥ãŒããã°ããèŠã€ããŠãã®èå¥åãèŠã€ããããšãã§ããããããã®ææ³ã¯è¯ãç¿æ £ã§ãã ãã£ãŒã«ãå*ã«æžã蟌ã¿ãŸã-ãŠãŒã¶ãŒãã©ãŒã ã ãã¥ãŒå šäœã¯äœæãããŸãããããã¥ãŒã ãã䜿çšããããšã¯ã§ããŸãããã€ãŸããããããŒã¹ãã¯ãã£ãã«å±ããŠããå¿ èŠãããããããã¥ãŒãšããŒã¹ãã¯ãã£ããæ¥ç¶ããŸãã
ãã¥ãŒã®ã¬ã€ã¢ãŠãèšå®
æ¡åŒµãšãã£ã¿ãŒã«ãšã©ãŸãããããŒã¹ãã¯ãã£ãã¯ã©ã¹ã®ã³ãŒãPerspective.javaãéãããšã§ãããã«æäœãè¡ãããšãã§ããŸãã Perspectiveã¯ã©ã¹ã§ãã¡ãœããcreateInitialLayoutïŒïŒã«é²ã¿ãŸãããããã®ã¡ãœããã¯ããã¥ãŒãšãšãã£ã¿ãŒã®åæäœçœ®ãèšå®ããŸãã ãã®ã¡ãœããã§ã¯ã次ã®2è¡ã®ã³ãŒããèšè¿°ããŸãã
layout.setEditorAreaVisible(false);
layout.addStandaloneView(MainView.ID, true, IPageLayout.LEFT, 1.0f, layout.getEditorArea());
æåã®è¡ã¯ããã¥ãŒã1ã€ãããªãããšãã£ã¿ãŒããªããããç·šéãªããžã§ã¯ããäžèŠã§ããããšãã¬ã€ã¢ãŠããªããžã§ã¯ãã«äŒããŸãã 2è¡ç®ã¯ããã¥ãŒãã¹ã¿ã³ãã¢ãã³ãšããŠè¿œå ããŸãã æåã®ãã©ã¡ãŒã¿ãŒã¯ãçš®ã®èå¥åã§ãã 2çªç®ã®ãã©ã¡ãŒã¿ãŒã¯ããŒã«å€ã§ããã¥ãŒã®ã¿ã€ãã«ïŒãŠãŒã¶ãŒãã©ãŒã ïŒã衚瀺ãããã©ããã決å®ããŸãã 3çªç®ã®ãã©ã¡ãŒã¿ãŒã¯ãèŠç¹ã1ã€ãããèŠç¹ã®ã¹ããŒã¹å šäœãå ãããããèŠç¹ã®èŠç¹ã®æ¹åã瀺ãããšãç®çãšããŠããŸãããã®å€ã¯ä»»æã§ãã 4çªç®ã®ãã©ã¡ãŒã¿ãŒã¯ãä»ã®ãã¥ãŒãŸãã¯ãšãã£ã¿ãŒã«å¯Ÿãããã®ãã¥ãŒã®äœçœ®ã決å®ããŸããããã¯ããã®å ŽåãããŒã¹ãã¯ãã£ãã®ã¹ããŒã¹å šäœãå ããå¯äžã®ãã¥ãŒã§ãªããã°ãªããªãããã§ãã æåŸã®5çªç®ã®ãã©ã¡ãŒã¿ãŒã¯ããšãã£ã¿ãŒé åã®èå¥åã§ãã å€æŽãä¿åããŸãã
ãã¥ãŒãè¿œå ããã¢ããªã±ãŒã·ã§ã³ã®èµ·å
MANIFEST.MFãã¡ã€ã«ã«æ»ããã¢ããªã±ãŒã·ã§ã³ãå床å®è¡ããã«ã¯ã[æŠèŠ]ã¿ãã®[ãã¹ã]ã»ã¯ã·ã§ã³ã§ã[Eclipseã¢ããªã±ãŒã·ã§ã³ã®èµ·å]ãªã³ã¯ãã¯ãªãã¯ããŸãã ååã®éå§æã®ãã©ãŒã ã®å€èŠ³ã«ã¯å€§ããªéãã¯ãããŸããããã¥ãŒãè¿œå ãããã¿ãïŒãŠãŒã¶ãŒãã©ãŒã ïŒã®ã¿ãè¿œå ãããŸããã
å³14-ãã¥ãŒãè¿œå ãããã¢ããªã±ãŒã·ã§ã³ã®ãŠã£ã³ããŠ
ä»æ¥ã¯ããã§çµããã§ãã次ã®èšäºã§ç¶ããŸãã
ãããžã§ã¯ãã®ãœãŒã¹ã³ãŒãã§ã¢ãŒã«ã€ããã
圹ç«ã€ãªãœãŒã¹ãžã®ãªã³ã¯
ãã·ã¢èªè©±è ïŒ
- å€ããã¥ãŒããªã¢ã« ããã®ãµã€ãã§ã¯ãEclispeãã©ã°ã€ã³ãšRCPã¢ããªã±ãŒã·ã§ã³ã®éçºã«é¢ããå¥ã®6ã€ã®åªããèšäºãèŠã€ããããšãã§ããŸãã
- SWTãã¬ãŒã ã¯ãŒã¯ã³ã³ããŒãã³ãã®ã¬ã€ã¢ãŠãã«é¢ããåªããèšäº ã
- å³ãããã§ãªã£ãã³ã¹ã¯ã®ããã°ã©ããŒã®ããã°ã«ã¯ã Eclipse RCPããã³OSGIã«é¢ããèå³æ·±ããããã¯ãå€æ°å«ãŸããŠããŸãã
è±èªã話ãïŒ
- éåžžã«å€ãã®åªãããã¥ãŒããªã¢ã« ãæã人æ°ã®ãããã¹ãŠã®ãã©ã°ã€ã³ãšãã¬ãŒã ã¯ãŒã¯ã«ã€ããŠããã¹ãŠãéåžžã«è©³çŽ°ã«èšè¿°ãããŠãããåçŽã¬ãã«ã®è±èªã§ãç解ã§ããŸãã
- Eclipse RCPã§æžãããåçšãããžã§ã¯ã ã