Bug 34124 [implementation] Java outline viewer does not use element map
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java
* <code>null</code> if is does not have one
	 */
	protected IType getMainType(ICompilationUnit compilationUnit) {
		
		if (compilationUnit == null)
			return null;
		
		String name= compilationUnit.getElementName();
		int index= name.indexOf('.');
		if (index != -1)
			name= name.substring(0, index);
		IType type= compilationUnit.getType(name);
		return type.exists() ? type : null;
	}
	/**
	 * Returns the primary type of a class file.
	 * 
	 * @param classFile the class file
	 * @return returns the primary type of the class file, or <code>null</code>
	 * if is does not have one
	 */
	protected IType getMainType(IClassFile classFile) {
		try {
			IType type= classFile.getType();
			return type != null && type.exists() ? type : null;
		} catch (JavaModelException e) {
			return null;	
		}
	}