Wednesday, March 28, 2012

Examine Eclipse via OSGi console


  • Launch eclipse with just the osgi console (eclipse -console -noexit) 
  • Run 'ss' to figure out what hasn't been resolved 
  • 'diag [bundle #]' will give you some details on the problem

Tuesday, March 20, 2012

Adding 'Collapse All' button to a view

Start by adding extension point to plugin.xml of plugin where View lives:

  1.    
  2. <extension point="org.eclipse.ui.menus">  
  3.     <menucontribution locationuri="toolbar:com.iwaysoftware.explorer.views.ExplorerView">  
  4.        <command commandid="org.eclipse.ui.navigate.collapseAll"></command>  
  5.     </menucontribution>  
  6.  </extension>  

Then add service code to the View's createPartControl method:

  1. IWorkbenchPartSite site = getSite();  
  2.        if (site != null) {  
  3.         IHandlerService handlerService = (IHandlerService) site.getService(  
  4.           IHandlerService.class);  
  5.         if (handlerService != null) {  
  6.          CollapseAllHandler fCollapseHandler = new CollapseAllHandler(viewer);  
  7.          handlerService.activateHandler(CollapseAllHandler.COMMAND_ID ,  
  8.            fCollapseHandler);  
  9.         }  
  10.        }  

Blogger Syntax Highliter