This fixes the Custom Column menu entry in the context menu from disappearing.
Quaqua (Mac OS X UI improvement library) breaks JTabbedPane.indexAtLocation(x, y), so I have to write my own workaround.
| 693 | 1007 | |
|---|---|---|
| 65 | 65 | protected void beforePopup(JPopupMenu inPopup, MouseEvent e) { |
| 66 | 66 | super.beforePopup(inPopup, e); |
| 67 | 67 | int curIndex = mTabs.indexAtLocation(e.getX(), e.getY()); |
| 68 | if(curIndex == -1) { | |
| 69 | int tabCount = mTabs.getTabCount(); | |
| 70 | for(int i=0; i<tabCount; i++) { | |
| 71 | Rectangle tabBounds = mTabs.getBoundsAt(i); | |
| 72 | if(tabBounds != null && tabBounds.contains(e.getPoint())) curIndex = i; | |
| 73 | } | |
| 74 | } | |
| 68 | 75 | preparePopup(curIndex); |
| 69 | 76 | } |
| 70 | 77 | |
