Methods Summary |
---|
protected javax.swing.JButton | createArrowButton()Creates an button which will be used as the control to show or hide
the popup portion of the combo box.
if (XPStyle.getXP() != null) {
return new XPComboBoxButton();
} else {
return super.createArrowButton();
}
|
protected javax.swing.ComboBoxEditor | createEditor()Creates the default editor that will be used in editable combo boxes.
A default editor will be used only if an editor has not been
explicitly set with setEditor .
return new WindowsComboBoxEditor();
|
protected java.awt.LayoutManager | createLayoutManager()Creates a layout manager for managing the components which make up the
combo box.
return new BasicComboBoxUI.ComboBoxLayoutManager() {
public void layoutContainer(Container parent) {
super.layoutContainer(parent);
if (XPStyle.getXP() != null && arrowButton != null) {
Dimension d = parent.getSize();
Insets insets = getInsets();
int buttonWidth = arrowButton.getPreferredSize().width;
arrowButton.setBounds(WindowsUtils.isLeftToRight((JComboBox)parent)
? (d.width - insets.right - buttonWidth)
: insets.left,
insets.top,
buttonWidth, d.height - insets.top - insets.bottom);
}
}
};
|
protected javax.swing.plaf.basic.ComboPopup | createPopup()
return super.createPopup();
|
public static javax.swing.plaf.ComponentUI | createUI(javax.swing.JComponent c)
return new WindowsComboBoxUI();
|
public java.awt.Dimension | getPreferredSize(javax.swing.JComponent c)
Dimension d = super.getPreferredSize(c);
d.width += 4;
d.height += 2;
if (XPStyle.getXP() != null) {
d.height += 2;
}
return d;
|
protected void | installKeyboardActions()
super.installKeyboardActions();
|
public void | installUI(javax.swing.JComponent c)
super.installUI( c );
comboBox.setRequestFocusEnabled( true );
if (XPStyle.getXP() != null && arrowButton != null) {
rolloverListener = new RolloverListener();
comboBox.addMouseListener(rolloverListener);
}
|
public void | paintCurrentValue(java.awt.Graphics g, java.awt.Rectangle bounds, boolean hasFocus)If necessary paints the currently selected item.
if (XPStyle.getXP() != null) {
bounds.x += 2;
bounds.y += 2;
bounds.width -= 3;
bounds.height -= 4;
} else {
bounds.x += 1;
bounds.y += 1;
bounds.width -= 2;
bounds.height -= 2;
}
super.paintCurrentValue(g, bounds, hasFocus);
|
public void | uninstallUI(javax.swing.JComponent c)
if (XPStyle.getXP() != null) {
comboBox.removeMouseListener(rolloverListener);
}
super.uninstallUI( c );
|