Bug 41313 "Link with Editor" in Java Outline should link on activation
I normally work with "Link with Editor" switched off. When editing a long method whose head is out of view, I want to know in which method I am without leaving the editing position. I'd like to *double*click on "Link with Editor" in the Java Outline to synchronize it with the current position (the second click just disables "Link with Editor" again). This works nicely with the Package Explorer, where a doubleclick on "Link with Editor" reveals the current file. I think this doubleclick behavior should be consistently supported by all "Link with Editor" actions.
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;	
		}
	}