Bug 16265 Disable empty refactor menu in context menu
Build 20020515 - select default package - open context menu
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/RefactorActionGroup.java
disposeAction(fExtractMethodAction, provider);
		super.dispose();
	}
	
	private void disposeAction(ISelectionChangedListener action, ISelectionProvider provider) {
		if (action != null)
			provider.removeSelectionChangedListener(action);
	}
	
	private void addRefactorSubmenu(IMenuManager menu) {
		IMenuManager refactorSubmenu= new MenuManager(ActionMessages.getString("RefactorMenu.label"));  
		addAction(refactorSubmenu, fRenameAction);
		addAction(refactorSubmenu, fMoveAction);
		addAction(refactorSubmenu, fPullUpAction);
		addAction(refactorSubmenu, fModifyParametersAction);
		refactorSubmenu.add(new Separator());
		addAction(refactorSubmenu, fExtractMethodAction);
		addAction(refactorSubmenu, fExtractTempAction);
		addAction(refactorSubmenu, fInlineTempAction);
		addAction(refactorSubmenu, fSelfEncapsulateField);
		if (!refactorSubmenu.isEmpty())
			menu.appendToGroup(fGroupName, refactorSubmenu);
	}
	
	private void addAction(IMenuManager menu, IAction action) {
		if (action != null && action.isEnabled())
			menu.add(action);
	}
}