use of com.android.tools.idea.ui.SearchField in project android by JetBrains.
the class IconPickerDialog method createUIComponents.
private void createUIComponents() {
mySearchField = new SearchField(false);
mySearchField.addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
updateFilter();
}
});
}
use of com.android.tools.idea.ui.SearchField in project android by JetBrains.
the class ChooseResourceDialog method createSearchField.
@NotNull
private SearchField createSearchField() {
SearchField searchField = new // no history: interferes with arrow down to jump into the list
SearchField(// no history: interferes with arrow down to jump into the list
false) {
@Override
protected void showPopup() {
// Turn off search popup; we're overriding the Down key to jump into the list instead
}
};
searchField.getTextEditor().addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
// Allow arrow down to jump directly into the list
if (e.getKeyCode() == KeyEvent.VK_DOWN) {
e.consume();
getSelectedPanel().selectFirst();
}
}
});
searchField.setMaximumSize(new Dimension(JBUI.scale(300), searchField.getMaximumSize().height));
searchField.addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
updateFilter();
}
});
return searchField;
}
Aggregations