Search in sources :

Example 1 with BrowserFamily

use of com.intellij.ide.browsers.BrowserFamily in project kotlin by JetBrains.

the class K2JSRunConfigurationEditor method setUpBrowserCombobox.

private void setUpBrowserCombobox() {
    for (WebBrowser browser : WebBrowserManager.getInstance().getActiveBrowsers()) {
        browserComboBox.addItem(browser.getFamily());
    }
    browserComboBox.setRenderer(new ListCellRendererWrapper<BrowserFamily>() {

        @Override
        public void customize(JList list, BrowserFamily family, int index, boolean selected, boolean hasFocus) {
            if (family != null) {
                setText(family.getName());
                setIcon(family.getIcon());
            }
        }
    });
    if (browserComboBox.getItemCount() < 2) {
        browserComboBox.setVisible(false);
        browserComboBox.setVisible(false);
    } else {
        browserComboBox.setSelectedItem(0);
    }
}
Also used : WebBrowser(com.intellij.ide.browsers.WebBrowser) BrowserFamily(com.intellij.ide.browsers.BrowserFamily)

Aggregations

BrowserFamily (com.intellij.ide.browsers.BrowserFamily)1 WebBrowser (com.intellij.ide.browsers.WebBrowser)1