Ejemplo n.º 1
0
 public void test_toUI_ChangeCorrectionProposal() throws Exception {
   Source source = createTestFileSource();
   // fill SourceChange
   SourceChange sourceChange = new SourceChange("My change", source);
   sourceChange.addEdit(new Edit(10, 1, "a"));
   sourceChange.addEdit(new Edit(20, 1, "a"));
   sourceChange.addEdit(new Edit(30, 3, "b"));
   // create ChangeCorrectionProposal
   CorrectionProposal proposal =
       new ChangeCorrectionProposal(sourceChange, CorrectionKind.QA_ADD_TYPE_ANNOTATION);
   //
   com.google.dart.tools.ui.internal.text.correction.proposals.ChangeCorrectionProposal
       uiProposal =
           (com.google.dart.tools.ui.internal.text.correction.proposals.ChangeCorrectionProposal)
               ServiceUtils.toUI(proposal);
   ReflectionUtils.invokeMethod(uiProposal, "getChange()");
   CompilationUnitChange ltkChange = (CompilationUnitChange) uiProposal.getChange();
   assertEquals("My change", ltkChange.getName());
 }
 public WizardDialogHelper(UiContext context) {
   super(context);
   Dialog dialog = (Dialog) context.getShell().getData();
   Object messageBox = ReflectionUtils.getFieldObject(dialog, "fMessageBox");
   messageTextWidget = ReflectionUtils.getFieldObject(messageBox, "fText");
 }