IWorkbenchAdapter element= (IWorkbenchAdapter)((IAdaptable)o).getAdapter(IWorkbenchAdapter.class); if (element != null) result= new SearchPatternData(TYPE, REFERENCES, element.getLabel(o), null);
IJavaElement element= (IJavaElement)((IAdaptable)o).getAdapter(IJavaElement.class); if (element != null) { result= determineInitValuesFrom(element); } else { IWorkbenchAdapter adapter= (IWorkbenchAdapter)((IAdaptable)o).getAdapter(IWorkbenchAdapter.class); result= new SearchPatternData(TYPE, REFERENCES, adapter.getLabel(o), null); }
	private SearchPatternData trySelection(ISelection selection) {		SearchPatternData result= null;		if (selection == null)			return result;		Object o= null;		if (selection instanceof IStructuredSelection)			o= ((IStructuredSelection)selection).getFirstElement();		if (o instanceof IJavaElement) {			fJavaElement= (IJavaElement)o;			result= determineInitValuesFrom(fJavaElement);		} else if (o instanceof ISearchResultViewEntry) {			fJavaElement= getJavaElement(((ISearchResultViewEntry)o).getSelectedMarker());			result= determineInitValuesFrom(fJavaElement);		} else if (o instanceof IAdaptable) {			IWorkbenchAdapter element= (IWorkbenchAdapter)((IAdaptable)o).getAdapter(IWorkbenchAdapter.class);			if (element != null)				result= new SearchPatternData(TYPE, REFERENCES, element.getLabel(o), null);		}		return result;	}