Scroll bar specific popup menu

Hi Beni,

I would like to be able to press the mouse right button on a dockable scroll bar to access its popup menu on a Windows system, similar to Windows Explorer. Also, the scroll bar in Eclipse pops up a popup menu similar to the one from Windows Explorer. I would be grateful if you could point me in the direction to enable or hook in, if possible, the Windows specific popup menu for a scroll bar within a dockable. Thank you.

Adi

I fail to see how your question is related to DockingFrames :wink:

Can’t you just add a MouseListener to the JScrollBars that are returned by JScrollPane.getHorizontal/VerticalScrollBar? As far as I know, you would need to create your own JPopupMenu, Java does not offer a default „Windows specific popup menu“.

Or you could use DockingFrames to create a global MouseListener, and do some filtering with the event.

CControl control = ...
control.getController().getGlobalMouseDispatcher().addMouseListener( yourListener );

...

yourListener = new MouseListener(){
  public void mousePressed( MouseEvent e ){
    if( e.getSource() instanceof JScrollBar && e.isPopupTrigger() ){
      // show whatever popup you would like to show
    }
  }
}

Hi Beni,

Thank you for the update. I had to ask the question just in case I was missing anything (as I have not done my research in this area). My intent is to maintain consistent behavior with Windows so when I noticed that the scroll bars on DockingFrames were missing the popup menus I wanted to ensure that I did not intentionally block them out somewhere in my DockingFrames code.

Yes, I have code to create (empty) popup menus for the scroll bars, but it will take additional time to put together the code behind the 7 vertical scroll bar menu items and 7 horizontal scroll bar menu items. It is another one for my to-do list. Regards.

/Adi