Package javax.swing.plaf.basic

Examples of javax.swing.plaf.basic.ComboPopup


                .createLayoutManager());
    }

    public void testGetMinimumSize() throws Exception {
        ui.setComboBox(comboBox);
        ComboPopup popup = new BasicComboPopup(comboBox);
        ui.setPopup(popup);
        ui.setListBox(popup.getList());
        ui.installListeners();
        comboBox.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
        Dimension listPart = new BasicComboBoxRenderer().getListCellRendererComponent(
                popup.getList(), "", -1, false, false).getPreferredSize();
        Dimension expectedSize = new Dimension(listPart.width + listPart.height + 8,
                listPart.height + 8);
        assertEquals(expectedSize, ui.getMinimumSize(null));
        assertEquals(expectedSize, ui.getCachedMinimumSize());
        ui.setCachedMinimumSize(new Dimension(100, 100));
        assertEquals(ui.getCachedMinimumSize(), ui.getMinimumSize(null));
        comboBox.addItem("aaa");
        listPart = new BasicComboBoxRenderer().getListCellRendererComponent(popup.getList(),
                "aaa", -1, false, false).getPreferredSize();
        expectedSize = new Dimension(listPart.width + listPart.height + 8, listPart.height + 8);
        assertEquals(expectedSize, ui.getMinimumSize(null));
    }
View Full Code Here


    private JList accessPopupList(boolean showPopup) {
        AccessibleContext accessibleContext = (AccessibleContext) eventQueueRunner.invoke(getComboBox(), "getAccessibleContext");
        if (accessibleContext == null)
            throw new ComponentException("Unable to access accessible context from combo" + this, finder.getScriptModel(),
                    windowMonitor);
        ComboPopup popup = (ComboPopup) accessibleContext.getAccessibleChild(0 /* popup */);
        JList list = popup.getList();
        if (showPopup) {
            eventQueueRunner.invoke(getComboBox(), "requestFocus");
            eventQueueRunner.invoke(getComboBox(), "showPopup");
            eventQueueRunner.invoke(list, "requestFocus");
        }
View Full Code Here

                .createLayoutManager());
    }

    public void testGetMinimumSize() throws Exception {
        ui.setComboBox(comboBox);
        ComboPopup popup = new BasicComboPopup(comboBox);
        ui.setPopup(popup);
        ui.setListBox(popup.getList());
        ui.installListeners();
        comboBox.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
        Dimension listPart = new BasicComboBoxRenderer().getListCellRendererComponent(
                popup.getList(), "", -1, false, false).getPreferredSize();
        Dimension expectedSize = new Dimension(listPart.width + listPart.height + 8,
                listPart.height + 8);
        assertEquals(expectedSize, ui.getMinimumSize(null));
        assertEquals(expectedSize, ui.getCachedMinimumSize());
        ui.setCachedMinimumSize(new Dimension(100, 100));
        assertEquals(ui.getCachedMinimumSize(), ui.getMinimumSize(null));
        comboBox.addItem("aaa");
        listPart = new BasicComboBoxRenderer().getListCellRendererComponent(popup.getList(),
                "aaa", -1, false, false).getPreferredSize();
        expectedSize = new Dimension(listPart.width + listPart.height + 8, listPart.height + 8);
        assertEquals(expectedSize, ui.getMinimumSize(null));
    }
View Full Code Here

   *
   * @see javax.swing.plaf.basic.BasicComboBoxUI#createPopup()
   */
  @Override
  protected ComboPopup createPopup() {
    final ComboPopup sPopup = new SubstanceComboPopup(this.comboBox);

    final ComponentOrientation currOrientation = this.comboBox
        .getComponentOrientation();

    SwingUtilities.invokeLater(new Runnable() {
View Full Code Here

   *
   * @see javax.swing.plaf.basic.BasicComboBoxUI#createPopup()
   */
  @Override
  protected ComboPopup createPopup() {
    final ComboPopup sPopup = new SubstanceComboPopup(this.comboBox);

    final ComponentOrientation currOrientation = this.comboBox
        .getComponentOrientation();

    SwingUtilities.invokeLater(new Runnable() {
View Full Code Here

TOP

Related Classes of javax.swing.plaf.basic.ComboPopup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.