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.

by mrs, 07 Aug, 2009 10:11 AM
693 1007  
6565   protected void beforePopup(JPopupMenu inPopup, MouseEvent e) {
6666     super.beforePopup(inPopup, e);
6767     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     }
6875     preparePopup(curIndex);
6976   }
7077