|
From: SVN by r. <sv...@ca...> - 2008-10-16 21:16:49
|
Author: roy
Date: 2008-10-16 23:16:38 +0200 (Thu, 16 Oct 2008)
New Revision: 325
Modified:
src/main/java/nl/improved/sqlclient/charva/CharvaSQLShellWindow.java
Log:
fix hide with using backspace
escape still works.. but hiding is really slow
Modified: src/main/java/nl/improved/sqlclient/charva/CharvaSQLShellWindow.java
===================================================================
--- src/main/java/nl/improved/sqlclient/charva/CharvaSQLShellWindow.java 2008-10-15 15:06:52 UTC (rev 324)
+++ src/main/java/nl/improved/sqlclient/charva/CharvaSQLShellWindow.java 2008-10-16 21:16:38 UTC (rev 325)
@@ -251,27 +251,17 @@
}
@Override
- public void processKeyEvent(KeyEvent evt) {
- super.processKeyEvent(evt);
-
- /*
- * SR: Ok, so I am aware that all this logic should have been placed in a KeyListener instead...
- * For some dark reason though it seems that if I add a keyListener to either this popup or the
- * menuitems individually, the listener never gets the desired key events.
- */
- if (evt.isConsumed()) {
- return;
+ public void hide() {
+ if (wasCancelled()) {
+ super.hide();
}
- if (evt.getKeyCode() == KeyEvent.VK_ESCAPE) {
- MyPopupMenu.super.hide();
- evt.consume();
- }
}
- @Override
- public void hide() {}
-
- private String select() {
+ /**
+ * Use this method to block the user interface and return the selected value.
+ * @return the selected value
+ */
+ public String select() {
show();
return selectedValue;
}
|