Tag Archives: eclipse

怎么把Eclipse的perspective dock放到右上角?

Eclipse很强大,osgi很灵活,PDE扩展性很强,但是,PDE实在太huge了,加上各种各样的plugin提供的extension point,以及仅仅org.eclipse.ui提供的workbench,workbenchwindow,menumanager,coolbarmanager,toolbarmanager……文档、javadoc就够你受的。今天在修一个issue,很简单,我们实现了一个standalone的基于PDE的界面,可不知道为什么,perspective dock默认出现在了左边(图一),而用户希望出现在常见的右边(图二) 看上去很简单,但是搞了半天没有搞定,上网google,找到了这篇和这篇,结论很简单,要想把dock放到右边,得调用IWorkbenchWindowConfigurer.setShowCoolBar(true);;要拿到IWorkbenchWindowConfigurer的对象,得继承IApplication,然后继承WorkbenchAdvisor,然后继承WorkbenchWindowAdvisor,最后覆盖WorkbenchWindowAdvisor.preWindowOpen()……反正就是得搞出三个类,覆盖三个方法……虽然看着麻烦点,但是能搞定的。然而,对于非standalone的PDE应用,你是不可能继承IApplication的,因为程序入口由Eclipse接管,而不是IApplication……于是上面这些research都是白做…… 于是开始看源代码,然后静态分析上面各个方法的调用关系,最后找到了这么一个方法:WorkbenchWindow.setPerspectiveBarLocation(IWorkbenchPreferenceConstants.TOP_RIGHT);,于是把着个方法放到Activator的子类里,比如这样: public class CompActivator extends AbstractUIPlugin {       @Override     public void start(BundleContext context) throws Exception {         super.start(context);           …           // put perspective dock to top-right         ((WorkbenchWindow) this.getWorkbench().getActiveWorkbenchWindow())       read more »

Apache给EJB 3.1(JSR #318)投了否决票

刚才在Glassfish的Google Group上收到有关Apache在EJB 3.1 JSR表决上投了否决票的消息。过去看了一下,发现只有Apache投了否决票,Eclipse、Spring弃权,而且Apache的理由相当牛逼: On 2009-11-30 Apache Software Foundation voted No with the following comment: The Apache Software Foundation’s vote is based on the point of view that this spec lead – Sun – is in violation of the JSPA http://www.apache.org/jcp/sunopenletter.html and therefore shouldn’t be allowed to lead other JSRs until the above matter is read more »

无觅相关文章插件,快速提升流量