use of com.android.tools.idea.run.AvdComboBox in project android by JetBrains.
the class EmulatorTargetConfigurable method createUIComponents.
private void createUIComponents() {
myAvdCombo = new AvdComboBox(myProject, true, false) {
@Override
public Module getModule() {
return myContext.getModule();
}
};
myAvdCombo.startUpdatingAvds(ModalityState.current());
JComboBox avdComboBox = myAvdCombo.getComboBox();
avdComboBox.setRenderer(new ListCellRendererWrapper() {
@Override
public void customize(JList list, Object value, int index, boolean selected, boolean hasFocus) {
if (value instanceof IdDisplay) {
setText(((IdDisplay) value).getDisplay());
} else {
setText(String.format("<html><font color='red'>Unknown AVD %1$s</font></html>", value == null ? "" : value.toString()));
}
}
});
avdComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
resetAvdCompatibilityWarningLabel();
}
});
myAvdComboWithButton = new ComboboxWithBrowseButton(avdComboBox);
Disposer.register(myParentDisposable, myAvdCombo);
}
Aggregations