mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Ignore mouse clicks outside of editor bounds in ExpandableTextFields
This commit is contained in:
+11
@@ -24,6 +24,7 @@ import javax.swing.plaf.basic.BasicTextFieldUI;
|
||||
import javax.swing.text.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -419,6 +420,16 @@ public abstract class TextFieldWithPopupHandlerUI extends BasicTextFieldUI imple
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int viewToModel(JTextComponent tc, Point pt, Position.Bias[] biasReturn) {
|
||||
return getVisibleEditorRect().contains(pt) ? super.viewToModel(tc, pt, biasReturn) : -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int viewToModel2D(JTextComponent tc, Point2D pt, Position.Bias[] biasReturn) {
|
||||
return getVisibleEditorRect().contains(pt) ? super.viewToModel2D(tc, pt, biasReturn): -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Notifies a repaint manager to repaint the current text component later.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user