01: /*
02: * @(#)AquaJidePopupMenuUI.java 12/13/2006
03: *
04: * Copyright 2002 - 2006 JIDE Software Inc. All rights reserved.
05: */
06:
07: package com.jidesoft.plaf.aqua;
08:
09: import apple.laf.AquaPopupMenuUI;
10: import com.jidesoft.swing.SimpleScrollPane;
11:
12: import javax.swing.*;
13: import javax.swing.plaf.ComponentUI;
14:
15: public class AquaJidePopupMenuUI extends AquaPopupMenuUI {
16: public AquaJidePopupMenuUI() {
17: }
18:
19: public static ComponentUI createUI(JComponent c) {
20: return new AquaJidePopupMenuUI();
21: }
22:
23: @Override
24: public Popup getPopup(JPopupMenu popupMenu, int x, int y) {
25: PopupFactory popupFactory = PopupFactory.getSharedInstance();
26: SimpleScrollPane contents = new SimpleScrollPane(popupMenu,
27: SimpleScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
28: SimpleScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
29: contents.getScrollUpButton().setOpaque(true);
30: contents.getScrollDownButton().setOpaque(true);
31: contents.setBorder(BorderFactory.createEmptyBorder());
32: return popupFactory.getPopup(popupMenu.getInvoker(), contents,
33: x, y);
34: }
35: }
|