use of com.intellij.ui.SearchTextField in project android by JetBrains.
the class ChooseDeviceDefinitionStepFixture method enterSearchTerm.
@NotNull
public ChooseDeviceDefinitionStepFixture enterSearchTerm(@NotNull String searchTerm) {
SearchTextField searchField = robot().finder().findByType(target(), SearchTextField.class);
replaceText(searchField.getTextEditor(), searchTerm);
return this;
}
use of com.intellij.ui.SearchTextField in project android by JetBrains.
the class AttachedToolWindowTest method testSearchButtonInHeader.
@Test
public void testSearchButtonInHeader() {
JLabel header = findHeaderLabel(myToolWindow.getComponent());
assertThat(header.isVisible()).isTrue();
SearchTextField searchField = findHeaderSearchField(myToolWindow.getComponent());
assertThat(searchField.isVisible()).isFalse();
ActionButton button = findButtonByName(myToolWindow.getComponent(), "Search");
assertThat(button).isNotNull();
button.click();
assertThat(header.isVisible()).isFalse();
assertThat(searchField.isVisible()).isTrue();
fireFocusLost(searchField.getTextEditor());
assertThat(header.isVisible()).isTrue();
assertThat(searchField.isVisible()).isFalse();
}
use of com.intellij.ui.SearchTextField in project android by JetBrains.
the class TraceViewPanel method createSearchField.
private SearchTextField createSearchField() {
SearchTextField stf = new SearchTextField(true);
stf.setOpaque(false);
stf.setEnabled(true);
Utils.setSmallerFont(stf);
stf.addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
searchTextChanged(getText(e));
}
private String getText(DocumentEvent e) {
try {
return e.getDocument().getText(0, e.getDocument().getLength());
} catch (BadLocationException e1) {
return "";
}
}
});
JTextField editorTextField = stf.getTextEditor();
editorTextField.setMinimumSize(new Dimension(JBUI.scale(200), -1));
editorTextField.registerKeyboardAction(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
closeSearchComponent();
}
}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
return stf;
}
Aggregations