$B?y>e$G$9!#(B<br><br>trunk$B$K0J2<$NBP1~$r9T$$$^$7$?!#(B<br>$B!!!&!!(BURUMA-141: Workbench $B$KBP1~$9$k=i4|2=$r9T$($k$h$&$K$9$k(B <br>$B!!!&!!(BURUMA-140: IWorkbench $B$r%"%/%7%g%s$X(B DI $B$G$-$k$h$&$K$9$k(B <br>$B!!!&!!(BURUMA-151: $B0lEY%/%m!<%:$7$?%S%e!<$r:FEY%*!<%W%s$G$-$k$h$&$K$9$k(B <br><br>$B$3$N#3E@$r;HMQ$7$?%5%s%W%k$r(Btunk$B$N(BRSS$B$K%3%_%C%H$7$F$$$^$9!#(B<br>$B%5%s%W%k$NFbMF$O!"=i4|2=;~$K%a%K%e!<$K!V%S%e!<0lMw!W$rDI2C$7$F$$$^$9!#(B<br>
$B%S%e!<$r%/%m!<%:$7$F$b!"%a%K%e!<$+$i:FEY%S%e!<$rI=<($9$k$3$H$,$G$-$^$9!#(B<br><br>WorkbenchWindowAction $B$N%=!<%9%3!<%I!#(B<br>$B!!(Bconfig$B%a%=%C%I$N@_Dj$O!"!V%?%V%9%?%$%k$r(BEclipse 3.0$B$N$h$&$K$+$C$3$h$/$9$k!W$N$_(B<br>$B!!H?1G$5$l$k$_$?$$$G$9!#(B<br><br>public class WorkbenchWindowAction {<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; /* INJECT */<br>&nbsp;&nbsp;&nbsp; public IWorkbenchConfigurer workbenchConfigurer;<br>
&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; public IActionBarConfigurer actionBarConfigurer;<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; public IWorkbenchWindowConfigurer workbenchWindowConfigurer;<br><br>&nbsp;&nbsp;&nbsp; @InitializeMethod <br>&nbsp;&nbsp;&nbsp; public void initialize() {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; config();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; createViewMenu();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; createPerspectiveMenu();<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; private void config() {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // $B%&%#%s%I%&$N0LCV!&%5%$%:$rJ]B8$9$k(B<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; workbenchConfigurer.setSaveAndRestore(true);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // perspective $B$r@Z$jBX$($k(B perspective bar $B$rI=<((B<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; workbenchWindowConfigurer.setShowPerspectiveBar(true);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Eclipse$BI8=`$N!VJ]B8!W$r;H$&(B<br>//&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ActionFactory.SAVE.create( window );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Coolbar$B$H(Bperspectivebar$B$rF1$89T$KG[CV$9$k(B<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PlatformUI.getPreferenceStore().setValue( IWorkbenchPreferenceConstants.DOCK_PERSPECTIVE_BAR , &quot;top&quot; );<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // $B%?%V%9%?%$%k$r(BEclipse 3.0$B$N$h$&$K$+$C$3$h$/$9$k(B<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PlatformUI.getPreferenceStore().setValue( IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS , false );<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; /**<br>&nbsp;&nbsp;&nbsp; &nbsp;*&nbsp; $B%S%e!<(B $B%a%K%e!<$rDI2C$9$k!#(B<br>
&nbsp;&nbsp;&nbsp; &nbsp;* <br>&nbsp;&nbsp;&nbsp; &nbsp;*/<br>&nbsp;&nbsp;&nbsp; private void createViewMenu() {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IWorkbenchWindow workbenchWindow = workbenchWindowConfigurer.getWindow();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; MenuManager showViewMenu = new MenuManager(&quot;$B%S%e!<$NI=<((B(&amp;V)&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; showViewMenu.add(ContributionItemFactory.VIEWS_SHORTLIST.create(workbenchWindow));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; actionBarConfigurer.getMenuManager().add(showViewMenu);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // $BJ#?t$N%&%#%s%I%&$,3+$+$l$F$$$k>l9g$K$N$_I=<($5$l!"(B<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // $B%&%#%s%I%&$N@Z$jBX$($r9T$&%"%/%7%g%s(B<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; actionBarConfigurer.getMenuManager().add(ContributionItemFactory.OPEN_WINDOWS.create(workbenchWindow));<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; /**<br>&nbsp;&nbsp;&nbsp; &nbsp;* $B%Q!<%9%Z%/%F%#%V(B $B%a%K%e!<$rDI2C$9$k(B.<br>&nbsp;&nbsp;&nbsp; &nbsp;* <br>&nbsp;&nbsp;&nbsp; &nbsp;*/<br>&nbsp;&nbsp;&nbsp; private void createPerspectiveMenu() {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IWorkbenchWindow workbenchWindow = workbenchWindowConfigurer.getWindow();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IContributionItem perspectivesMenu = ContributionItemFactory.PERSPECTIVES_SHORTLIST.create(workbenchWindow);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; MenuManager layoutMenu = new MenuManager(&quot;$B%Q!<%9%Z%/%F%#%V$NI=<((B(&amp;P)&quot;, &quot;layoutId&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; actionBarConfigurer.getMenuManager().add(layoutMenu);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; layoutMenu.add(perspectivesMenu);<br>&nbsp;&nbsp;&nbsp; }<br>}<br>