private SearchPatternData determineInitValuesFrom(final IErlModule module,
final int offset, final OpenResult res) throws ErlModelException {
if (res == null) {
return null;
}
final ErlangSearchPattern pattern = SearchUtil
.getSearchPatternFromOpenResultAndLimitTo(res, module, offset,
LimitTo.REFERENCES, true);
final String patternString = pattern == null ? "" : pattern.patternString();
final SearchFor searchFor = pattern == null ? SearchFor.FUNCTION : pattern
.getSearchFor();
final SearchPatternData searchPatternData = new SearchPatternData(patternString,
ISearchPageContainer.WORKSPACE_SCOPE, LimitTo.REFERENCES, searchFor,
null, SearchUtil.SEARCH_IN_SOURCES);
return searchPatternData;