Browse Source

REPORT-62808 公式编辑器优化,辅助框内选择函数后,函数名没有正确跳转

1.修复单击实现偶然失效的bug;
2.修复上下键不生效的bug。
feature/x
Hoky 3 years ago
parent
commit
68a18ce3a2
  1. 33
      designer-base/src/main/java/com/fr/design/gui/autocomplete/FormulaAutoCompletePopupWindow.java

33
designer-base/src/main/java/com/fr/design/gui/autocomplete/FormulaAutoCompletePopupWindow.java

@ -152,7 +152,32 @@ class FormulaAutoCompletePopupWindow extends JWindow implements CaretListener,
list.setCellRenderer(new DelegatingCellRenderer()); list.setCellRenderer(new DelegatingCellRenderer());
list.addListSelectionListener(this); list.addListSelectionListener(this);
list.addMouseListener(this); list.addMouseListener(new MouseListener() {
@Override
public void mouseClicked(MouseEvent e) {
}
@Override
public void mousePressed(MouseEvent e) {
}
@Override
public void mouseReleased(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent e) {
}
@Override
public void mouseExited(MouseEvent e) {
}
});
JPanel contentPane = new JPanel(new BorderLayout()); JPanel contentPane = new JPanel(new BorderLayout());
JScrollPane sp = new JScrollPane(list, JScrollPane sp = new JScrollPane(list,
@ -373,9 +398,6 @@ class FormulaAutoCompletePopupWindow extends JWindow implements CaretListener,
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2 && e.getButton() == 1) { if (e.getClickCount() == 2 && e.getButton() == 1) {
insertSelectedCompletion(); insertSelectedCompletion();
refreshInstallComp();
} else if (e.getClickCount() == 1) {
refreshInstallComp();
} }
} }
@ -389,6 +411,7 @@ class FormulaAutoCompletePopupWindow extends JWindow implements CaretListener,
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
refreshInstallComp();
} }
@ -818,6 +841,7 @@ class FormulaAutoCompletePopupWindow extends JWindow implements CaretListener,
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (isVisible()) { if (isVisible()) {
selectNextItem(); selectNextItem();
refreshInstallComp();
} }
} }
@ -994,6 +1018,7 @@ class FormulaAutoCompletePopupWindow extends JWindow implements CaretListener,
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (isVisible()) { if (isVisible()) {
selectPreviousItem(); selectPreviousItem();
refreshInstallComp();
} }
} }

Loading…
Cancel
Save