use of org.eclipse.text.tests.Accessor in project eclipse.platform.text by eclipse.
the class FindReplaceDialogTest method openTextViewerAndFindReplaceDialog.
private void openTextViewerAndFindReplaceDialog() {
fTextViewer = new TextViewer(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
fTextViewer.setDocument(new Document("line\nline\nline"));
fTextViewer.getControl().setFocus();
Accessor fFindReplaceAction;
fFindReplaceAction = new Accessor("org.eclipse.ui.texteditor.FindReplaceAction", getClass().getClassLoader(), new Class[] { ResourceBundle.class, String.class, Shell.class, IFindReplaceTarget.class }, new Object[] { ResourceBundle.getBundle("org.eclipse.ui.texteditor.ConstructedEditorMessages"), "Editor.FindReplace.", fTextViewer.getControl().getShell(), fTextViewer.getFindReplaceTarget() });
fFindReplaceAction.invoke("run", null);
Object fFindReplaceDialogStub = fFindReplaceAction.get("fgFindReplaceDialogStub");
if (fFindReplaceDialogStub == null)
fFindReplaceDialogStub = fFindReplaceAction.get("fgFindReplaceDialogStubShell");
Accessor fFindReplaceDialogStubAccessor = new Accessor(fFindReplaceDialogStub, "org.eclipse.ui.texteditor.FindReplaceAction$FindReplaceDialogStub", getClass().getClassLoader());
fFindReplaceDialog = new Accessor(fFindReplaceDialogStubAccessor.invoke("getDialog", null), "org.eclipse.ui.texteditor.FindReplaceDialog", getClass().getClassLoader());
}
Aggregations