Lines Matching refs:comboBox

69     protected JComboBox<Object> comboBox;  field in BasicComboBoxUI
292 comboBox = tmp; in installUI()
303 if ( comboBox.getRenderer() == null || comboBox.getRenderer() instanceof UIResource ) { in installUI()
304 comboBox.setRenderer( createRenderer() ); in installUI()
307 if ( comboBox.getEditor() == null || comboBox.getEditor() instanceof UIResource ) { in installUI()
308 comboBox.setEditor( createEditor() ); in installUI()
314 comboBox.setLayout( createLayoutManager() ); in installUI()
316 comboBox.setRequestFocusEnabled( true ); in installUI()
320 comboBox.putClientProperty("doNotCancelPopup", HIDE_POPUP_KEY); in installUI()
325 comboBox.setKeySelectionManager(keySelectionManager); in installUI()
330 setPopupVisible( comboBox, false); in uninstallUI()
335 comboBox.setLayout( null ); in uninstallUI()
341 if ( comboBox.getRenderer() == null || comboBox.getRenderer() instanceof UIResource ) { in uninstallUI()
342 comboBox.setRenderer( null ); in uninstallUI()
345 ComboBoxEditor comboBoxEditor = comboBox.getEditor(); in uninstallUI()
349 comboBox.requestFocusInWindow(); in uninstallUI()
351 comboBox.setEditor( null ); in uninstallUI()
355 comboBox.setKeySelectionManager(null); in uninstallUI()
365 comboBox = null; in uninstallUI()
373 LookAndFeel.installColorsAndFont( comboBox, in installDefaults()
377 LookAndFeel.installBorder( comboBox, "ComboBox.border" ); in installDefaults()
378 LookAndFeel.installProperty( comboBox, "opaque", Boolean.TRUE); in installDefaults()
396 comboBox.addItemListener( itemListener ); in installListeners()
399 comboBox.addPropertyChangeListener( propertyChangeListener ); in installListeners()
402 comboBox.addKeyListener( keyListener ); in installListeners()
405 comboBox.addFocusListener( focusListener ); in installListeners()
408 comboBox.addMouseListener( popupMouseListener ); in installListeners()
411 comboBox.addMouseMotionListener( popupMouseMotionListener ); in installListeners()
414 comboBox.addKeyListener(popupKeyListener); in installListeners()
417 if ( comboBox.getModel() != null ) { in installListeners()
419 comboBox.getModel().addListDataListener( listDataListener ); in installListeners()
429 LookAndFeel.installColorsAndFont( comboBox, in uninstallDefaults()
433 LookAndFeel.uninstallBorder( comboBox ); in uninstallDefaults()
443 comboBox.removeKeyListener( keyListener ); in uninstallListeners()
446 comboBox.removeItemListener( itemListener ); in uninstallListeners()
449 comboBox.removePropertyChangeListener( propertyChangeListener ); in uninstallListeners()
452 comboBox.removeFocusListener( focusListener ); in uninstallListeners()
455 comboBox.removeMouseListener( popupMouseListener ); in uninstallListeners()
458 comboBox.removeMouseMotionListener( popupMouseMotionListener ); in uninstallListeners()
461 comboBox.removeKeyListener(popupKeyListener); in uninstallListeners()
463 if ( comboBox.getModel() != null ) { in uninstallListeners()
465 comboBox.getModel().removeListDataListener( listDataListener ); in uninstallListeners()
477 return new BasicComboPopup( comboBox ); in createPopup()
712 Component[] children = comboBox.getComponents(); in updateToolTipTextForChildren()
715 ((JComponent)children[i]).setToolTipText( comboBox.getToolTipText() ); in updateToolTipTextForChildren()
770 comboBox.add(arrowButton); in installComponents()
774 if ( comboBox.isEditable() ) { in installComponents()
778 comboBox.add( currentValuePane ); in installComponents()
793 comboBox.removeAll(); // Just to be safe. in uninstallComponents()
808 editor = comboBox.getEditor().getEditorComponent(); in addEditor()
811 comboBox.add(editor); in addEditor()
812 if(comboBox.isFocusOwner()) { in addEditor()
828 comboBox.remove( editor ); in removeEditor()
841 editor.setEnabled(comboBox.isEnabled()); in configureEditor()
843 editor.setFocusable(comboBox.isFocusable()); in configureEditor()
845 editor.setFont( comboBox.getFont() ); in configureEditor()
853 comboBox.getEditor().addActionListener(getHandler()); in configureEditor()
861 comboBox.configureEditor(comboBox.getEditor(),comboBox.getSelectedItem()); in configureEditor()
879 comboBox.getEditor().removeActionListener(getHandler()); in unconfigureEditor()
890 arrowButton.setEnabled( comboBox.isEnabled() ); in configureArrowButton()
891 arrowButton.setFocusable(comboBox.isFocusable()); in configureArrowButton()
964 return !comboBox.isEditable(); in isFocusTraversable()
976 hasFocus = comboBox.hasFocus(); in paint()
977 if ( !comboBox.isEditable() ) { in paint()
1036 if (!comboBox.isEditable()) { in getBaseline()
1037 ListCellRenderer<Object> renderer = comboBox.getRenderer(); in getBaseline()
1042 Object prototypeValue = comboBox.getPrototypeDisplayValue(); in getBaseline()
1046 else if (comboBox.getModel().getSize() > 0) { in getBaseline()
1049 value = comboBox.getModel().getElementAt(0); in getBaseline()
1062 component.setFont(comboBox.getFont()); in getBaseline()
1090 if (comboBox.isEditable()) { in getBaselineResizeBehavior()
1094 ListCellRenderer<Object> renderer = comboBox.getRenderer(); in getBaselineResizeBehavior()
1099 Object prototypeValue = comboBox.getPrototypeDisplayValue(); in getBaselineResizeBehavior()
1103 else if (comboBox.getModel().getSize() > 0) { in getBaselineResizeBehavior()
1106 value = comboBox.getModel().getElementAt(0); in getBaselineResizeBehavior()
1121 if ( comboBox.isEditable() ) { in getAccessibleChildrenCount()
1138 ac.setAccessibleParent(comboBox); in getAccessibleChild()
1143 if ( comboBox.isEditable() in getAccessibleChild()
1146 ac.setAccessibleParent(comboBox); in getAccessibleChild()
1178 InputMap inputMap = comboBox.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); in isNavigationKey()
1194 if ( comboBox.isPopupVisible() ) { in selectNextPossibleValue()
1198 si = comboBox.getSelectedIndex(); in selectNextPossibleValue()
1201 if ( si < comboBox.getModel().getSize() - 1 ) { in selectNextPossibleValue()
1205 … if (!(UIManager.getBoolean("ComboBox.noActionOnKeyNavigation") && comboBox.isPopupVisible())) { in selectNextPossibleValue()
1206 comboBox.setSelectedIndex(si+1); in selectNextPossibleValue()
1209 comboBox.repaint(); in selectNextPossibleValue()
1220 if ( comboBox.isPopupVisible() ) { in selectPreviousPossibleValue()
1224 si = comboBox.getSelectedIndex(); in selectPreviousPossibleValue()
1231 … if (!(UIManager.getBoolean("ComboBox.noActionOnKeyNavigation") && comboBox.isPopupVisible())) { in selectPreviousPossibleValue()
1232 comboBox.setSelectedIndex(si-1); in selectPreviousPossibleValue()
1235 comboBox.repaint(); in selectPreviousPossibleValue()
1243 setPopupVisible(comboBox, !isPopupVisible(comboBox)); in toggleOpenClose()
1252 int width = comboBox.getWidth(); in rectangleForCurrentValue()
1253 int height = comboBox.getHeight(); in rectangleForCurrentValue()
1259 if(BasicGraphicsUtils.isLeftToRight(comboBox)) { in rectangleForCurrentValue()
1277 return comboBox.getInsets(); in getInsets()
1297 ListCellRenderer<Object> renderer = comboBox.getRenderer(); in paintCurrentValue()
1300 if ( hasFocus && !isPopupVisible(comboBox) ) { in paintCurrentValue()
1302 comboBox.getSelectedItem(), in paintCurrentValue()
1309 comboBox.getSelectedItem(), in paintCurrentValue()
1315 c.setFont(comboBox.getFont()); in paintCurrentValue()
1316 if ( hasFocus && !isPopupVisible(comboBox) ) { in paintCurrentValue()
1321 if ( comboBox.isEnabled() ) { in paintCurrentValue()
1322 c.setForeground(comboBox.getForeground()); in paintCurrentValue()
1323 c.setBackground(comboBox.getBackground()); in paintCurrentValue()
1327 comboBox, this, "ComboBox.disabledForeground", null)); in paintCurrentValue()
1329 comboBox, this, "ComboBox.disabledBackground", null)); in paintCurrentValue()
1347 currentValuePane.paintComponent(g,c,comboBox,x,y,w,h,shouldValidate); in paintCurrentValue()
1359 if ( comboBox.isEnabled() ) in paintCurrentValueBackground()
1360 g.setColor(DefaultLookup.getColor(comboBox, this, in paintCurrentValueBackground()
1363 g.setColor(DefaultLookup.getColor(comboBox, this, in paintCurrentValueBackground()
1374 comboBox.repaint(r.x,r.y,r.width,r.height); in repaintCurrentValue()
1418 ListCellRenderer<Object> renderer = comboBox.getRenderer(); in getDisplaySize()
1425 Object prototypeValue = comboBox.getPrototypeDisplayValue(); in getDisplaySize()
1434 ComboBoxModel<Object> model = comboBox.getModel(); in getDisplaySize()
1467 if (comboBox.isEditable()) { in getDisplaySize()
1473 if ( comboBox.isEditable() ) { in getDisplaySize()
1505 comp.setFont(comboBox.getFont()); in getSizeForComponent()
1527 SwingUtilities.replaceUIInputMap(comboBox, JComponent. in installKeyboardActions()
1531 LazyActionMap.installLazyActionMap(comboBox, BasicComboBoxUI.class, in installKeyboardActions()
1537 return (InputMap)DefaultLookup.get(comboBox, this, in getInputMap()
1551 SwingUtilities.replaceUIInputMap(comboBox, JComponent. in uninstallKeyboardActions()
1553 SwingUtilities.replaceUIActionMap(comboBox, null); in uninstallKeyboardActions()
1581 JComboBox<Object> comboBox = (JComboBox)e.getSource(); in actionPerformed() local
1583 comboBox.getUI(), BasicComboBoxUI.class); in actionPerformed()
1585 comboBox.firePopupMenuCanceled(); in actionPerformed()
1586 comboBox.setPopupVisible(false); in actionPerformed()
1590 int index = getNextIndex(comboBox, key); in actionPerformed()
1591 if (index >= 0 && index < comboBox.getItemCount()) { in actionPerformed()
1592 … if (UIManager.getBoolean("ComboBox.noActionOnKeyNavigation") && comboBox.isPopupVisible()) { in actionPerformed()
1595 comboBox.repaint(); in actionPerformed()
1597 comboBox.setSelectedIndex(index); in actionPerformed()
1602 if (comboBox.isShowing() ) { in actionPerformed()
1603 if ( comboBox.isPopupVisible() ) { in actionPerformed()
1608 comboBox.setPopupVisible(true); in actionPerformed()
1616 if (comboBox.isShowing() ) { in actionPerformed()
1617 if ( (comboBox.isEditable() || in actionPerformed()
1619 && !comboBox.isPopupVisible() ) { in actionPerformed()
1620 comboBox.setPopupVisible(true); in actionPerformed()
1629 if (ui != null && (key == TOGGLE || !comboBox.isEditable())) { in actionPerformed()
1633 comboBox.setSelectedIndex(ui.popup.getList(). in actionPerformed()
1637 comboBox.setPopupVisible(!comboBox.isPopupVisible()); in actionPerformed()
1643 if (ui.isPopupVisible(comboBox)) { in actionPerformed()
1646 else if (DefaultLookup.getBoolean(comboBox, ui, in actionPerformed()
1648 ui.setPopupVisible(comboBox, true); in actionPerformed()
1655 if (comboBox.isShowing() && ui != null) { in actionPerformed()
1656 if ( comboBox.isEditable() && !comboBox.isPopupVisible()) { in actionPerformed()
1657 comboBox.setPopupVisible(true); in actionPerformed()
1665 if (comboBox.isPopupVisible()) { in actionPerformed()
1671 comboBox.getEditor().setItem(listItem); in actionPerformed()
1672 comboBox.setSelectedItem(listItem); in actionPerformed()
1674 comboBox.setPopupVisible(false); in actionPerformed()
1679 if (!comboBox.isEditable() || isEnterSelectablePopup in actionPerformed()
1687 comboBox.getEditor().setItem(listItem); in actionPerformed()
1688 comboBox.setSelectedItem(listItem); in actionPerformed()
1691 comboBox.setPopupVisible(false); in actionPerformed()
1696 if (ui.isTableCellEditor && !comboBox.isEditable()) { in actionPerformed()
1697 comboBox.setSelectedItem(comboBox.getSelectedItem()); in actionPerformed()
1702 JRootPane root = SwingUtilities.getRootPane(comboBox); in actionPerformed()
1722 private int getNextIndex(JComboBox<?> comboBox, String key) { in getNextIndex() argument
1723 int listHeight = comboBox.getMaximumRowCount(); in getNextIndex()
1725 int selectedIndex = comboBox.getSelectedIndex(); in getNextIndex()
1727 && (comboBox.getUI() instanceof BasicComboBoxUI)) { in getNextIndex()
1728 selectedIndex = ((BasicComboBoxUI) comboBox.getUI()).listBox.getSelectedIndex(); in getNextIndex()
1737 int max = comboBox.getItemCount(); in getNextIndex()
1744 return comboBox.getItemCount() - 1; in getNextIndex()
1746 return comboBox.getSelectedIndex(); in getNextIndex()
1792 comboBox.revalidate(); in propertyChange()
1796 JComboBox<?> comboBox = (JComboBox)e.getSource(); in propertyChange() local
1812comboBox.configureEditor( comboBox.getEditor(), comboBox.getSelectedItem() ); in propertyChange()
1816 comboBox.revalidate(); in propertyChange()
1817 comboBox.repaint(); in propertyChange()
1819 else if ( propertyName == "editor" && comboBox.isEditable() ) { in propertyChange()
1821 comboBox.revalidate(); in propertyChange()
1824 if ( comboBox.isEditable() ) { in propertyChange()
1825 comboBox.setRequestFocusEnabled( false ); in propertyChange()
1828 comboBox.setRequestFocusEnabled( true ); in propertyChange()
1832 comboBox.revalidate(); in propertyChange()
1835 boolean enabled = comboBox.isEnabled(); in propertyChange()
1840 comboBox.repaint(); in propertyChange()
1843 boolean focusable = comboBox.isFocusable(); in propertyChange()
1848 comboBox.repaint(); in propertyChange()
1851 if ( isPopupVisible( comboBox ) ) { in propertyChange()
1852 setPopupVisible(comboBox, false); in propertyChange()
1853 setPopupVisible(comboBox, true); in propertyChange()
1857 listBox.setFont( comboBox.getFont() ); in propertyChange()
1859 editor.setFont( comboBox.getFont() ); in propertyChange()
1863 comboBox.validate(); in propertyChange()
1867 comboBox.validate(); in propertyChange()
1879 comboBox.revalidate(); in propertyChange()
1884 comboBox.revalidate(); in propertyChange()
1902 } else if ( comboBox.isEnabled() && comboBox.getModel().getSize()!=0 && in keyPressed()
1905 if ( comboBox.selectWithKeyChar(e.getKeyChar()) ) { in keyPressed()
1929 ComboBoxEditor comboBoxEditor = comboBox.getEditor(); in focusGained()
1936 comboBox.repaint(); in focusGained()
1938 if (comboBox.isEditable() && editor != null) { in focusGained()
1944 ComboBoxEditor editor = comboBox.getEditor(); in focusLost()
1949 Object selectedItem = comboBox.getSelectedItem(); in focusLost()
1952 comboBox.actionPerformed in focusLost()
1960 setPopupVisible(comboBox, false); in focusLost()
1962 comboBox.repaint(); in focusLost()
1973 comboBox.revalidate(); in contentsChanged()
1978 if (comboBox.isEditable() && editor != null) { in contentsChanged()
1979 comboBox.configureEditor( comboBox.getEditor(), in contentsChanged()
1980 comboBox.getSelectedItem() ); in contentsChanged()
1984 comboBox.repaint(); in contentsChanged()
2056 Object item = comboBox.getEditor().getItem(); in actionPerformed()
2058 if (!comboBox.isPopupVisible() && !item.equals(comboBox.getSelectedItem())) { in actionPerformed()
2059 comboBox.setSelectedItem(comboBox.getEditor().getItem()); in actionPerformed()
2061 ActionMap am = comboBox.getActionMap(); in actionPerformed()
2065 action.actionPerformed(new ActionEvent(comboBox, evt.getID(), in actionPerformed()
2085 int startIndex = comboBox.getSelectedIndex(); in selectionForKey()