try {
ComponentEditorPart componentEditorPart = getComponentEditorPart();
if (componentEditorPart != null) {
IEditorPart activeEditorPart = componentEditorPart.getActiveEditor();
TemplateEditor templateEditor = getTemplateEditor();
WodEditor wodEditor = getWodEditor();
if (templateEditor != null && wodEditor != null) {
if (activeEditorPart == templateEditor) {
ITextSelection templateSelection = (ITextSelection) templateEditor.getSourceEditor().getSelectionProvider().getSelection();
int offset = templateSelection.getOffset();
WodParserCache cache = templateEditor.getSourceEditor().getParserCache();
QuickRenameRefactoring.renameHtmlSelection(offset, templateEditor.getSourceEditor().getViewer(), wodEditor.getViewer(), cache);
} else if (activeEditorPart == wodEditor) {
ITextSelection wodSelection = (ITextSelection) wodEditor.getSelectionProvider().getSelection();
int offset = wodSelection.getOffset();
WodParserCache cache = wodEditor.getParserCache();
QuickRenameRefactoring.renameWodSelection(offset, templateEditor.getSourceEditor().getViewer(), wodEditor.getViewer(), cache);
} else {
System.out.println("QuickRenameElementAction.run: " + activeEditorPart);
}
}
}