private void appendSymfonyVersions() { comboVersions.setModel(new ListComboBoxModel<>(new ArrayList<>())); ApplicationManager.getApplication().executeOnPooledThread(() -> { final List<SymfonyInstallerVersion> symfonyInstallerVersions1 = getVersions(); if (symfonyInstallerVersions1 != null) { UIUtil.invokeLaterIfNeeded(() -> comboVersions.setModel(new ListComboBoxModel<>(symfonyInstallerVersions1))); } }); }
/** * {@inheritDoc} */ public void actionPerformed(ActionEvent evt) { if(evt.getActionCommand().equals(UPDATE)) { this.fireContentsChanged(this, 0, getSize()); } } }
/** * Set the selected item. The implementation of this method should notify * all registered {@code ListDataListener}s that the contents have changed. * * @param item * the list object to select or {@code null} to clear the * selection * @throws ClassCastException * if {@code item} is not of type {@code E} */ @Override @SuppressWarnings("unchecked") public void setSelectedItem(Object item) { if ((selected != null && !selected.equals(item)) || selected == null && item != null) { selected = (E) item; fireContentsChanged(this, -1, -1); } }
/** * Set single selection content. When one shape is selected the id and name * are shown * * @param id the id to show * @param name the name to show */ private void setSingle(Shape shape) { if (!Arrays.asList(this.getComponents()).contains(idLabel)) { this.removeAll(); add(idLabel); add(idText); add(nameLabel); add(nameText); add(typeLabel); add(typeBox); this.repaint(); } idText.setText(new Long(shape.getId()).toString()); nameText.setText(shape.getName()); typeModel.setSelectedItem(shape.getImportType()); }
BuildPanel(Map<Action, JCheckBox> checkboxes, List<String> quickLists) { quickListElements = new ArrayList<>(); quickListModel = new ListComboBoxModel<>(quickListElements); quickListModel.addListDataListener(getListDataListener(quickLists)); panel = new JPanel(); panel.setBorder(IdeBorderFactory.createTitledBorder(TEXT_TITLE_ACTIONS)); panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); if (SaveActionManager.getInstance().isCompilingAvailable()) { panel.add(wrap(checkboxes.get(compile), null)); panel.add(wrap(checkboxes.get(reload), null)); } // @SuppressWarnings("unchecked") // JComboBox<QuickListWrapper> comboBox = new ComboBox<QuickListWrapper>(quickListModel); // panel.add(wrap(checkboxes.get(executeAction), comboBox)); panel.add(Box.createHorizontalGlue()); panel.setMinimumSize(new Dimension(MAX_VALUE, 0)); }
@Override public void contentsChanged(ListDataEvent e) { QuickListWrapper selectedItem = (QuickListWrapper) ((ListComboBoxModel) e.getSource()) .getSelectedItem(); if (selectedItem == null) { return; } quickLists.clear(); quickLists.add(selectedItem.getId()); }
/** * {@inheritDoc} */ @Override public void actionPerformed(ActionEvent evt) { if(evt.getActionCommand().equals(UPDATE)) { this.fireContentsChanged(this, 0, getSize() - 1); } } }
/** * Set the selected item. The implementation of this method should notify * all registered {@code ListDataListener}s that the contents have changed. * * @param item * the list object to select or {@code null} to clear the * selection * @throws ClassCastException * if {@code item} is not of type {@code E} */ @SuppressWarnings("unchecked") public void setSelectedItem(Object item) { if ((selected != null && !selected.equals(item)) || selected == null && item != null) { selected = (E) item; fireContentsChanged(this, -1, -1); } }
String valueString = shape.getValue() != null ? shape.getValue().toString() : "Unknown"; valueText.setText(valueString); typeModel.setSelectedItem(shape.getImportType()); shapeTypeModel.setSelectedItem(shape.getType());
/** * {@inheritDoc} */ @Override public void actionPerformed(ActionEvent evt) { if(evt.getActionCommand().equals(UPDATE)) { this.fireContentsChanged(this, 0, getSize() - 1); } } }
/** * Set the selected item. The implementation of this method should notify * all registered {@code ListDataListener}s that the contents have changed. * * @param item * the list object to select or {@code null} to clear the * selection * @throws ClassCastException * if {@code item} is not of type {@code E} */ @Override @SuppressWarnings("unchecked") public void setSelectedItem(Object item) { if ((selected != null && !selected.equals(item)) || selected == null && item != null) { selected = (E) item; fireContentsChanged(this, -1, -1); } }
public void updateLanguagesList(Collection<Language> languages) { Language selectedLanguage = getSelectedLanguage(); myLanguagesComboBox.removeItemListener(myLanguagesComboBoxListener); //noinspection Since15 myLanguagesComboBox.setModel(new ListComboBoxModel<Language>(new ArrayList<Language>(languages))); if (selectedLanguage != null && languages.contains(selectedLanguage)) { myLanguagesComboBox.setSelectedItem(selectedLanguage); } if (languages.size() < 2) { myLanguagesComboBox.setVisible(false); } else { myLanguagesComboBox.setVisible(true); } myLanguagesComboBox.addItemListener(myLanguagesComboBoxListener); } }
/** * {@inheritDoc} */ @Override public void actionPerformed(ActionEvent evt) { if(evt.getActionCommand().equals(UPDATE)) { this.fireContentsChanged(this, 0, getSize() - 1); } } }
/** * Set the selected item. The implementation of this method should notify * all registered {@code ListDataListener}s that the contents have changed. * * @param item * the list object to select or {@code null} to clear the * selection * @throws ClassCastException * if {@code item} is not of type {@code E} */ @Override @SuppressWarnings("unchecked") public void setSelectedItem(Object item) { if ((selected != null && !selected.equals(item)) || selected == null && item != null) { selected = (E) item; fireContentsChanged(this, -1, -1); } }
/** * {@inheritDoc} */ @Override public void actionPerformed(ActionEvent evt) { if(evt.getActionCommand().equals(UPDATE)) { this.fireContentsChanged(this, 0, getSize() - 1); } } }
/** * Set the selected item. The implementation of this method should notify * all registered {@code ListDataListener}s that the contents have changed. * * @param item * the list object to select or {@code null} to clear the * selection * @throws ClassCastException * if {@code item} is not of type {@code E} */ @Override @SuppressWarnings("unchecked") public void setSelectedItem(Object item) { if ((selected != null && !selected.equals(item)) || selected == null && item != null) { selected = (E) item; fireContentsChanged(this, -1, -1); } }