mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Check for modification after choosing value in a popup
This commit is contained in:
+17
-1
@@ -33,6 +33,7 @@ import com.intellij.openapi.util.ActionCallback;
|
||||
import com.intellij.ui.JBColor;
|
||||
import com.intellij.ui.RelativeFont;
|
||||
import com.intellij.ui.components.labels.LinkLabel;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.util.ui.update.MergingUpdateQueue;
|
||||
import com.intellij.util.ui.update.Update;
|
||||
|
||||
@@ -149,7 +150,7 @@ class ConfigurableEditor extends AbstractEditor implements AnActionListener, AWT
|
||||
case MouseEvent.MOUSE_RELEASED:
|
||||
case MouseEvent.MOUSE_DRAGGED:
|
||||
MouseEvent me = (MouseEvent)event;
|
||||
if (isDescendingFrom(me.getComponent(), this)) {
|
||||
if (isDescendingFrom(me.getComponent(), this) || isPopupOverEditor(me.getComponent())) {
|
||||
requestUpdate();
|
||||
}
|
||||
break;
|
||||
@@ -178,6 +179,21 @@ class ConfigurableEditor extends AbstractEditor implements AnActionListener, AWT
|
||||
});
|
||||
}
|
||||
|
||||
private boolean isPopupOverEditor(Component component) {
|
||||
Window editor = UIUtil.getWindow(this);
|
||||
if (editor != null) {
|
||||
Window popup = UIUtil.getWindow(component);
|
||||
if (popup != null && editor == popup.getParent()) {
|
||||
if (popup instanceof JDialog) {
|
||||
JDialog dialog = (JDialog)popup;
|
||||
return Dialog.ModalityType.MODELESS == dialog.getModalityType();
|
||||
}
|
||||
return popup instanceof JWindow;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void updateCurrent(Configurable configurable, boolean reset) {
|
||||
boolean modified = configurable != null && configurable.isModified();
|
||||
myApplyAction.setEnabled(modified);
|
||||
|
||||
Reference in New Issue
Block a user