action toolbar popup - actions buttons didnt work in modal states

This commit is contained in:
Kirill Kalishev
2011-07-04 16:10:48 +04:00
parent 8a5e947617
commit 492a98f819
2 changed files with 14 additions and 1 deletions
@@ -1104,7 +1104,7 @@ public class AbstractPopup implements JBPopup {
public void eventDispatched(final AWTEvent event) {
if (event.getID() == WindowEvent.WINDOW_ACTIVATED) {
if (myCancelOnWindow) {
if (myCancelOnWindow && myPopup != null && !myPopup.isPopupWindow(((WindowEvent)event).getWindow())) {
cancel();
}
}
@@ -35,6 +35,8 @@ public interface PopupComponent {
void setRequestFocus(boolean requestFocus);
boolean isPopupWindow(Window window);
interface Factory {
PopupComponent getPopup(Component owner, Component content, int x, int y);
@@ -88,6 +90,11 @@ public interface PopupComponent {
myRequestFocus = requestFocus;
}
@Override
public boolean isPopupWindow(Window window) {
return myDialog != null && myDialog == window;
}
public DialogPopupWrapper(Component owner, Component content, int x, int y) {
if (!owner.isShowing()) {
throw new IllegalArgumentException("Popup owner must be showing");
@@ -145,6 +152,12 @@ public interface PopupComponent {
}
}
@Override
public boolean isPopupWindow(Window window) {
final Window wnd = getWindow();
return wnd != null && wnd == window;
}
public void hide(boolean dispose) {
myPopup.hide();