Search in sources :

Example 11 with Accessor

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());
}
Also used : Shell(org.eclipse.swt.widgets.Shell) ResourceBundle(java.util.ResourceBundle) Document(org.eclipse.jface.text.Document) Accessor(org.eclipse.text.tests.Accessor) IFindReplaceTarget(org.eclipse.jface.text.IFindReplaceTarget) TextViewer(org.eclipse.jface.text.TextViewer)

Aggregations

Accessor (org.eclipse.text.tests.Accessor)11 Test (org.junit.Test)5 Shell (org.eclipse.swt.widgets.Shell)4 IWorkbench (org.eclipse.ui.IWorkbench)4 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)4 PartInitException (org.eclipse.ui.PartInitException)4 CoreException (org.eclipse.core.runtime.CoreException)3 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)3 StyledText (org.eclipse.swt.custom.StyledText)3 DefaultEncodingSupport (org.eclipse.ui.editors.text.DefaultEncodingSupport)3 IEncodingSupport (org.eclipse.ui.editors.text.IEncodingSupport)3 TextEditor (org.eclipse.ui.editors.text.TextEditor)3 StatusTextEditor (org.eclipse.ui.texteditor.StatusTextEditor)3 ArrayList (java.util.ArrayList)2 AbstractInformationControl (org.eclipse.jface.text.AbstractInformationControl)2 IDocument (org.eclipse.jface.text.IDocument)2 DisplayHelper (org.eclipse.jface.text.tests.util.DisplayHelper)2 Control (org.eclipse.swt.widgets.Control)2 ResourceBundle (java.util.ResourceBundle)1 ITextFileBuffer (org.eclipse.core.filebuffers.ITextFileBuffer)1