|
|
@ -1,10 +1,8 @@ |
|
|
|
package com.fr.design.gui.icombobox; |
|
|
|
package com.fr.design.gui.icombobox; |
|
|
|
|
|
|
|
|
|
|
|
import com.fine.theme.light.ui.FineComboBoxUI; |
|
|
|
|
|
|
|
import com.fr.common.inputevent.InputEventBaseOnOS; |
|
|
|
import com.fr.common.inputevent.InputEventBaseOnOS; |
|
|
|
|
|
|
|
|
|
|
|
import java.awt.Component; |
|
|
|
import java.awt.Component; |
|
|
|
import java.awt.Dimension; |
|
|
|
|
|
|
|
import java.awt.Point; |
|
|
|
import java.awt.Point; |
|
|
|
import java.awt.Rectangle; |
|
|
|
import java.awt.Rectangle; |
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
import java.awt.event.MouseEvent; |
|
|
@ -12,12 +10,9 @@ import java.util.Vector; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.ComboBoxModel; |
|
|
|
import javax.swing.ComboBoxModel; |
|
|
|
import javax.swing.JComboBox; |
|
|
|
import javax.swing.JComboBox; |
|
|
|
import javax.swing.JComponent; |
|
|
|
|
|
|
|
import javax.swing.JList; |
|
|
|
import javax.swing.JList; |
|
|
|
import javax.swing.ListCellRenderer; |
|
|
|
import javax.swing.ListCellRenderer; |
|
|
|
import javax.swing.plaf.ComponentUI; |
|
|
|
|
|
|
|
import javax.swing.plaf.basic.BasicComboPopup; |
|
|
|
import javax.swing.plaf.basic.BasicComboPopup; |
|
|
|
import javax.swing.plaf.basic.ComboPopup; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; |
|
|
|
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; |
|
|
|
|
|
|
|
|
|
|
@ -40,29 +35,6 @@ public class ExtendedComboBox extends UIComboBox { |
|
|
|
super(items); |
|
|
|
super(items); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 更新UI |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public void updateUI() { |
|
|
|
|
|
|
|
setUI(new ExtendedComboBoxUI()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static class ExtendedComboBoxUI extends FineComboBoxUI { |
|
|
|
|
|
|
|
public static ComponentUI createUI(JComponent c) { |
|
|
|
|
|
|
|
return new ExtendedComboBoxUI(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected ComboPopup createPopup() { |
|
|
|
|
|
|
|
ExtendedComboPopup popup = new ExtendedComboPopup(comboBox); |
|
|
|
|
|
|
|
popup.getAccessibleContext().setAccessibleParent(comboBox); |
|
|
|
|
|
|
|
return popup; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ComboPopup getPopup() { |
|
|
|
|
|
|
|
return popup; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static class ExtendedComboPopup extends BasicComboPopup { |
|
|
|
static class ExtendedComboPopup extends BasicComboPopup { |
|
|
|
|
|
|
|
|
|
|
|
public ExtendedComboPopup(JComboBox combo) { |
|
|
|
public ExtendedComboPopup(JComboBox combo) { |
|
|
|