public void run(ITextSelection selection) {
if (!ActionUtil.isEditable(fEditor))
return;
ITypeRoot typeRoot= SelectionConverter.getInputAsTypeRoot(fEditor);
if (typeRoot == null)
return;
CompilationUnit node= RefactoringASTParser.parseWithASTProvider(typeRoot, true, null);
if (typeRoot instanceof ICompilationUnit) {
ICompilationUnit cu= (ICompilationUnit) typeRoot;
if (fInlineTemp.isEnabled() && fInlineTemp.tryInlineTemp(cu, node, selection, getShell()))
return;
if (fInlineConstant.isEnabled() && fInlineConstant.tryInlineConstant(cu, node, selection, getShell()))
return;
}
if (fInlineMethod.isEnabled() && fInlineMethod.tryInlineMethod(typeRoot, node, selection, getShell()))
return;
MessageDialog.openInformation(getShell(), RefactoringMessages.InlineAction_dialog_title, RefactoringMessages.InlineAction_select);
}