mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
junit/testng configuration ui: ensure correct document is updated (IDEA-143334)
This commit is contained in:
+6
-5
@@ -398,27 +398,28 @@ public class JUnitConfigurable<T extends JUnitConfiguration> extends SettingsEdi
|
||||
final LabeledComponent testLocation = getTestLocation(i);
|
||||
final JComponent component = testLocation.getComponent();
|
||||
final ComponentWithBrowseButton field;
|
||||
final Object document;
|
||||
Object document;
|
||||
if (component instanceof TextFieldWithBrowseButton) {
|
||||
field = (TextFieldWithBrowseButton)component;
|
||||
document = new PlainDocument();
|
||||
((TextFieldWithBrowseButton)field).getTextField().setDocument((Document)document);
|
||||
myModel.setJUnitDocument(i, document);
|
||||
} else if (component instanceof EditorTextFieldWithBrowseButton) {
|
||||
field = (ComponentWithBrowseButton)component;
|
||||
document = ((EditorTextField)field.getChildComponent()).getDocument();
|
||||
myModel.setJUnitDocument(i, document);
|
||||
}
|
||||
else {
|
||||
field = myPatternTextField;
|
||||
document = new PlainDocument();
|
||||
((TextFieldWithBrowseButton)field).getTextField().setDocument((Document)document);
|
||||
myModel.setJUnitDocument(i, document);
|
||||
|
||||
}
|
||||
myBrowsers[i].setField(field);
|
||||
if (myBrowsers[i] instanceof MethodBrowser) {
|
||||
((MethodBrowser)myBrowsers[i]).installCompletion((EditorTextField)field.getChildComponent());
|
||||
final EditorTextField childComponent = (EditorTextField)field.getChildComponent();
|
||||
((MethodBrowser)myBrowsers[i]).installCompletion(childComponent);
|
||||
document = childComponent.getDocument();
|
||||
}
|
||||
myModel.setJUnitDocument(i, document);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-6
@@ -197,22 +197,21 @@ public class TestNGConfigurationEditor extends SettingsEditor<TestNGConfiguratio
|
||||
((TextFieldWithBrowseButton)field).getTextField().setDocument((PlainDocument)document);
|
||||
}
|
||||
else if (field instanceof EditorTextFieldWithBrowseButton) {
|
||||
final com.intellij.openapi.editor.Document componentDocument =
|
||||
((EditorTextFieldWithBrowseButton)field).getChildComponent().getDocument();
|
||||
|
||||
model.setDocument(i, componentDocument);
|
||||
document = ((EditorTextFieldWithBrowseButton)field).getChildComponent().getDocument();
|
||||
}
|
||||
else {
|
||||
field = myPatternTextField;
|
||||
document = new PlainDocument();
|
||||
((TextFieldWithBrowseButton)field).getTextField().setDocument((Document)document);
|
||||
model.setDocument(i, document);
|
||||
}
|
||||
|
||||
browseListeners[i].setField((ComponentWithBrowseButton)field);
|
||||
if (browseListeners[i] instanceof MethodBrowser) {
|
||||
((MethodBrowser)browseListeners[i]).installCompletion((EditorTextField)((ComponentWithBrowseButton)field).getChildComponent());
|
||||
final EditorTextField childComponent = (EditorTextField)((ComponentWithBrowseButton)field).getChildComponent();
|
||||
((MethodBrowser)browseListeners[i]).installCompletion(childComponent);
|
||||
document = childComponent.getDocument();
|
||||
}
|
||||
model.setDocument(i, document);
|
||||
}
|
||||
model.setType(TestType.CLASS);
|
||||
propertiesFile.getComponent().getTextField().setDocument(model.getPropertiesFileDocument());
|
||||
|
||||
Reference in New Issue
Block a user