if (editorInput instanceof FileEditorInput) {
IFile file = ((FileEditorInput) editorInput).getFile();
project = file.getProject();
}
IRule rule = rulePosition.getRule();
if (rule instanceof ElementTypeRule) {
String elementTypeName = rulePosition.getText();
ComponentLocateScope componentLocateScope = new ComponentLocateScope(project, elementTypeName, true);
LocalizedComponentsLocateResult localizedComponentsLocateResult = new LocalizedComponentsLocateResult();
Locate locate = new Locate(componentLocateScope, localizedComponentsLocateResult);