Bug 40780 [plan item] Improve context views
Declaration View and Javadoc View should compute their contents in background Both should provide a context menu containing at least Copy and F3 (where available).
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/infoviews/AbstractInfoView.java
* 
	 * @param cu	the compilation unit
	 * @return	the type with same name as the given CU or the first type in the CU 
	 */
	protected IType getTypeForCU(ICompilationUnit cu) {
		
		if (cu == null || !cu.exists())
			return null;
		
		cu= WorkingCopyUtil.getWorkingCopyIfExists(cu);
		
		
		IType primaryType= cu.findPrimaryType();
		if (primaryType != null)
			return primaryType;
		
		try {
			IType[] types= cu.getTypes();
			if (types.length > 0)
				return types[0];
			else
				return null;
		} catch (JavaModelException ex) {
			return null;
		}
	}	
	/**
	 * Sets this view's input based on the selection in the given part.
	 * 
	 * @param part the part from which to get the selected Java element