Search in sources :

Example 16 with TextViewer

use of org.eclipse.jface.text.TextViewer 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)

Example 17 with TextViewer

use of org.eclipse.jface.text.TextViewer in project eclipse.platform.text by eclipse.

the class AbstractUndoManagerTest method setUp.

@Before
public void setUp() {
    fShell = new Shell();
    fUndoManager = createUndoManager(MAX_UNDO_LEVEL);
    fTextViewer = new TextViewer(fShell, SWT.NONE);
    fTextViewer.setUndoManager(fUndoManager);
    fUndoManager.connect(fTextViewer);
}
Also used : Shell(org.eclipse.swt.widgets.Shell) TextViewer(org.eclipse.jface.text.TextViewer) ITextViewer(org.eclipse.jface.text.ITextViewer) Before(org.junit.Before)

Aggregations

TextViewer (org.eclipse.jface.text.TextViewer)17 StyledText (org.eclipse.swt.custom.StyledText)6 Document (org.eclipse.jface.text.Document)3 Control (org.eclipse.swt.widgets.Control)3 Shell (org.eclipse.swt.widgets.Shell)3 FindReplaceOption (com.cubrid.tool.editor.dialog.FindReplaceOption)2 IAction (org.eclipse.jface.action.IAction)2 IFindReplaceTarget (org.eclipse.jface.text.IFindReplaceTarget)2 ResourceBundle (java.util.ResourceBundle)1 IFindReplaceTargetExtension (org.eclipse.jface.text.IFindReplaceTargetExtension)1 IFindReplaceTargetExtension3 (org.eclipse.jface.text.IFindReplaceTargetExtension3)1 ITextViewer (org.eclipse.jface.text.ITextViewer)1 IUndoManager (org.eclipse.jface.text.IUndoManager)1 Region (org.eclipse.jface.text.Region)1 GridData (org.eclipse.swt.layout.GridData)1 Accessor (org.eclipse.text.tests.Accessor)1 Before (org.junit.Before)1 Test (org.junit.Test)1