Skip to content

Commit

Permalink
MONDRIAN: fix for bug #2208312, Mouse right click doesn’t work on MAC…
Browse files Browse the repository at this point in the history
… OS X or Linux

[git-p4: depot-paths = "//open/mondrian/": change = 11852]
  • Loading branch information
Will Gorman committed Oct 30, 2008
1 parent 1f94aa8 commit 5b55cb3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main/mondrian/gui/QueryPanel.java
Expand Up @@ -183,7 +183,24 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
queryTextPane.setFont(new java.awt.Font("Courier New", 0, 12));
queryTextPane.setText("");
queryTextPane.addMouseListener(new MouseAdapter() {

// From MouseAdapter javadoc:
//
// Popup menus are triggered differently
// on different systems. Therefore, isPopupTrigger
// should be checked in both mousePressed
// and mouseReleased
// for proper cross-platform functionality.

public void mousePressed(MouseEvent e) {
checkPopupTrigger(e);
}

public void mouseReleased(MouseEvent e) {
checkPopupTrigger(e);
}

public void checkPopupTrigger(MouseEvent e) {
if (e.isPopupTrigger()) {
int x = e.getX();
int y = e.getY();
Expand Down
16 changes: 16 additions & 0 deletions src/main/mondrian/gui/SchemaExplorer.java
Expand Up @@ -2956,7 +2956,23 @@ public void editingStopped(ChangeEvent e) {

class PopupTrigger extends MouseAdapter {

// From MouseAdapter javadoc:
//
// Popup menus are triggered differently
// on different systems. Therefore, isPopupTrigger
// should be checked in both mousePressed
// and mouseReleased
// for proper cross-platform functionality.

public void mousePressed(MouseEvent e) {
showMenu(e);
}

public void mouseReleased(MouseEvent e) {
showMenu(e);
}

public void showMenu(MouseEvent e) {
if (e.isPopupTrigger()) {
int x = e.getX();
int y = e.getY();
Expand Down

0 comments on commit 5b55cb3

Please sign in to comment.