Package javax.swing.plaf

Examples of javax.swing.plaf.ComboBoxUI


    }
  }

  public void updateUI() {
    dateFormat  = new SimpleDateFormat(ApplicationContext.getUserPreferences().getDateDisplayFormat());
    ComboBoxUI cui = (ComboBoxUI) UIManager.getUI(this);
    if (cui instanceof MetalComboBoxUI) {
      cui = new MetalDateComboBoxUI();
    } else if (cui instanceof MotifComboBoxUI) {
      cui = new MotifDateComboBoxUI();
    } else if (cui instanceof WindowsComboBoxUI) {
View Full Code Here


        final JComboBox combo = new JComboBox();
        final EventList<Object> items = new BasicEventList<Object>();
        items.add("First");
        items.add("Second");

        final ComboBoxUI originalUI = combo.getUI();
        final ComboBoxModel originalModel = combo.getModel();
        final boolean originalEditable = combo.isEditable();
        final ComboBoxEditor originalEditor = combo.getEditor();
        final int originalEditorKeyListenerCount = originalEditor.getEditorComponent().getKeyListeners().length;
        final AbstractDocument originalEditorDocument = (AbstractDocument) ((JTextField) combo.getEditor().getEditorComponent()).getDocument();
View Full Code Here

        assertFalse(propertyChangeController.isChanged());
    }

    public void testSetUI() throws Exception {
        assertNotNull(comboBox.getUI());
        ComboBoxUI newUI = new ComboBoxUI() {
            @Override
            public boolean isFocusTraversable(final JComboBox arg0) {
                return false;
            }
View Full Code Here

        assertFalse(propertyChangeController.isChanged());
    }

    public void testSetUI() throws Exception {
        assertNotNull(comboBox.getUI());
        ComboBoxUI newUI = new ComboBoxUI() {
            @Override
            public boolean isFocusTraversable(final JComboBox arg0) {
                return false;
            }
View Full Code Here

    JComponent result = (JComponent) super.getListCellRendererComponent(
        list, value, index, isSelected, cellHasFocus);

    ListUI baseListUI = list.getUI();
    ComboBoxUI baseComboUI = combo.getUI();
    if ((baseListUI instanceof SubstanceListUI)
        && (baseComboUI instanceof SubstanceComboBoxUI)) {
      SubstanceListUI listUI = (SubstanceListUI) baseListUI;
      SubstanceComboBoxUI comboUI = (SubstanceComboBoxUI) baseComboUI;
View Full Code Here

     * Overridden to take into account any popup insets specified in
     * SynthComboBoxUI
     */
    @Override
    protected Rectangle computePopupBounds(int px,int py,int pw,int ph) {
        ComboBoxUI ui = comboBox.getUI();
        if (ui instanceof SynthComboBoxUI) {
            SynthComboBoxUI sui = (SynthComboBoxUI)ui;
            if (sui.popupInsets != null) {
                Insets i = sui.popupInsets;
                return super.computePopupBounds(
View Full Code Here

        assertFalse(propertyChangeController.isChanged());
    }

    public void testSetUI() throws Exception {
        assertNotNull(comboBox.getUI());
        ComboBoxUI newUI = new ComboBoxUI() {
            @Override
            public boolean isFocusTraversable(final JComboBox arg0) {
                return false;
            }
View Full Code Here

     * Overridden to take into account any popup insets specified in
     * SynthComboBoxUI
     */
    @Override
    protected Rectangle computePopupBounds(int px, int py, int pw, int ph) {
        ComboBoxUI ui = comboBox.getUI();
        if (ui instanceof SynthComboBoxUI) {
            SynthComboBoxUI sui = (SynthComboBoxUI) ui;
            if (sui.popupInsets != null) {
                Insets i = sui.popupInsets;
                return super.computePopupBounds(
View Full Code Here

        View switcherView = SwitcherView.VIEW_INFO.createView(mockComponent);
       
        // Find combo box so we can test its UI object
        @SuppressWarnings("rawtypes")
        JComboBox comboBox = findComponent(switcherView, JComboBox.class);       
        ComboBoxUI ui = comboBox.getUI();
       
               
        // Verify that ui paints a rounded rect (per spec)
        Graphics mockGraphics = Mockito.mock(Graphics.class, Mockito.RETURNS_MOCKS);
        ui.paint(mockGraphics, comboBox);
        Mockito.verify(mockGraphics).fillRoundRect(
                Mockito.anyInt(), Mockito.anyInt(), Mockito.anyInt(),Mockito.anyInt(),Mockito.anyInt(),Mockito.anyInt());
       
    }
View Full Code Here

    });
  }

  @Nullable
  public static ComboPopup getComboBoxPopup(JComboBox comboBox) {
    final ComboBoxUI ui = comboBox.getUI();
    if (ui instanceof BasicComboBoxUI) {
      try {
        final Field popup = BasicComboBoxUI.class.getDeclaredField("popup");
        popup.setAccessible(true);
        return (ComboPopup) popup.get(ui);
View Full Code Here

TOP

Related Classes of javax.swing.plaf.ComboBoxUI

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.