private static Color getForegroundColor() {
   IPreferenceStore preference = DartToolsPlugin.getDefault().getPreferenceStore();
   RGB rgb =
       PreferenceConverter.getColor(
           preference, PreferenceConstants.CODEASSIST_REPLACEMENT_FOREGROUND);
   DartTextTools textTools = DartToolsPlugin.getDefault().getDartTextTools();
   return textTools.getColorManager().getColor(rgb);
 }
 private IDocument newDocument(String source) {
   IDocument result = new Document(source);
   DartTextTools textTools = DartToolsPlugin.getDefault().getDartTextTools();
   textTools.setupJavaDocumentPartitioner(result);
   return result;
 }