Search in sources :

Example 1 with MethodBrowser

use of com.intellij.execution.MethodBrowser in project intellij-community by JetBrains.

the class JUnitConfigurable method installDocuments.

private void installDocuments() {
    for (int i = 0; i < myTestLocations.length; i++) {
        final LabeledComponent testLocation = getTestLocation(i);
        final JComponent component = testLocation.getComponent();
        final ComponentWithBrowseButton field;
        Object document;
        if (component instanceof TextFieldWithBrowseButton) {
            field = (TextFieldWithBrowseButton) component;
            document = new PlainDocument();
            ((TextFieldWithBrowseButton) field).getTextField().setDocument((Document) document);
        } else if (component instanceof EditorTextFieldWithBrowseButton) {
            field = (ComponentWithBrowseButton) component;
            document = ((EditorTextField) field.getChildComponent()).getDocument();
        } else {
            field = myPatternTextField;
            document = new PlainDocument();
            ((TextFieldWithBrowseButton) field).getTextField().setDocument((Document) document);
        }
        myBrowsers[i].setField(field);
        if (myBrowsers[i] instanceof MethodBrowser) {
            final EditorTextField childComponent = (EditorTextField) field.getChildComponent();
            ((MethodBrowser) myBrowsers[i]).installCompletion(childComponent);
            document = childComponent.getDocument();
        }
        myModel.setJUnitDocument(i, document);
    }
}
Also used : MethodBrowser(com.intellij.execution.MethodBrowser) PlainDocument(javax.swing.text.PlainDocument) PlainDocument(javax.swing.text.PlainDocument) Document(javax.swing.text.Document)

Aggregations

MethodBrowser (com.intellij.execution.MethodBrowser)1 Document (javax.swing.text.Document)1 PlainDocument (javax.swing.text.PlainDocument)1