use of org.eclipse.ui.texteditor.TextOperationAction in project eclipse.platform.text by eclipse.
the class ContextInfoTest method testContextInfo_hide_Bug512251.
@Test
public void testContextInfo_hide_Bug512251() throws Exception {
cleanFileAndEditor();
createAndOpenFile("foobar.txt", BarContentAssistProcessor.PROPOSAL);
final Set<Shell> beforeShells = Arrays.stream(editor.getSite().getShell().getDisplay().getShells()).filter(Shell::isVisible).collect(Collectors.toSet());
TextOperationAction action = (TextOperationAction) editor.getAction(ITextEditorActionConstants.CONTENT_ASSIST_CONTEXT_INFORMATION);
editor.selectAndReveal(4, 0);
action.update();
action.run();
waitAndDispatch(100);
this.completionShell = findNewShell(beforeShells);
editor.selectAndReveal(8, 0);
action.update();
action.run();
waitAndDispatch(100);
this.completionShell = findNewShell(beforeShells);
editor.getAction(ITextEditorActionConstants.DELETE_LINE).run();
SourceViewer sourceViewer = getSourceViewer();
ContentAssistant assist = (ContentAssistant) new Accessor(sourceViewer, SourceViewer.class).get("fContentAssistant");
new Accessor(assist, ContentAssistant.class).invoke("hide", new Object[0]);
}
use of org.eclipse.ui.texteditor.TextOperationAction in project eclipse.platform.text by eclipse.
the class ContextInfoTest method testContextInfo.
@Test
public void testContextInfo() throws Exception {
cleanFileAndEditor();
createAndOpenFile("foobar.txt", BarContentAssistProcessor.PROPOSAL);
final Set<Shell> beforeShells = Arrays.stream(editor.getSite().getShell().getDisplay().getShells()).filter(Shell::isVisible).collect(Collectors.toSet());
TextOperationAction action = (TextOperationAction) editor.getAction(ITextEditorActionConstants.CONTENT_ASSIST_CONTEXT_INFORMATION);
editor.selectAndReveal(4, 0);
action.update();
action.run();
waitAndDispatch(100);
this.completionShell = findNewShell(beforeShells);
assertEquals("idx= 0", getInfoText(this.completionShell));
editor.selectAndReveal(8, 0);
action.update();
action.run();
waitAndDispatch(100);
this.completionShell = findNewShell(beforeShells);
assertEquals("idx= 1", getInfoText(this.completionShell));
}
Aggregations