Bug 8581 Switch J Search to StructuredContentProvider
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementAction.java
for (int i= 0; i < fValidTypes.length; i++) {
				if (fValidTypes[i].isInstance(element))
					return true;
			}
		}
		return false;
	}
	public void run() {
		if (!canOperateOn(getSelection())) {
			beep();
			return;
		}
		
		IJavaElement element= getJavaElement(getSelection(), false);
		if (element == null) {
			beep();
			return;
		} 
		else if (element == RETURN_WITHOUT_BEEP)
			return;
		
		run(element);
	}
	protected abstract void run(IJavaElement element);
	private IJavaElement getJavaElement(IJavaElement o, boolean silent) {
		if (o == null)
			return null;
		switch (o.getElementType()) {
			case IJavaElement.COMPILATION_UNIT:
				return findType((ICompilationUnit)o, silent);