package no.uio.ifi.refaktor.views;
-import no.uio.ifi.refaktor.analyze.PrefixViewAnalyzer;
-import no.uio.ifi.refaktor.analyze.collectors.SelectionValidator;
-import no.uio.ifi.refaktor.changers.RefaktorChangerException;
-import no.uio.ifi.refaktor.utils.CompilationUnitTextSelection;
+import no.uio.ifi.refaktor.analyze.analyzers.PrefixViewAnalyzer;
+import no.uio.ifi.refaktor.analyze.analyzers.SelectionValidator;
+import no.uio.ifi.refaktor.textselection.CompilationUnitTextSelection;
import no.uio.ifi.refaktor.utils.DocumentUtils;
import no.uio.ifi.refaktor.utils.ParseUtils;
import no.uio.ifi.refaktor.utils.RefaktorHandleUtils;
doc.set(r.getMessage());
return;
}
- ICompilationUnit compilationUnit = RefaktorHandleUtils.getCompilationUnitFromEditor(editor);
- CompilationUnitTextSelection compilationUnitTextSelection = new CompilationUnitTextSelection(compilationUnit, strippedTextSelection);
- final PrefixViewAnalyzer analyzer = new PrefixViewAnalyzer(compilationUnitTextSelection);
+
try {
+ ICompilationUnit compilationUnit = RefaktorHandleUtils.getCompilationUnitFromEditor(editor);
+ CompilationUnitTextSelection compilationUnitTextSelection = new CompilationUnitTextSelection(compilationUnit, strippedTextSelection);
+ final PrefixViewAnalyzer analyzer = new PrefixViewAnalyzer(compilationUnitTextSelection);
SelectionValidator.checkIfSelectionIsValid(compilationUnitTextSelection);
analyzer.analyze();
String dialogText = analyzer.toString();
doc.set(dialogText);
- } catch (RefaktorChangerException e) {
+ } catch (Throwable e) {
doc.set(e.getMessage());
- }
+ }
}
}
\ No newline at end of file