Browse Source

REPORT-64601 公式编辑器首次进入的时候光标位置不正确

1.放到swing执行队列队尾。
feature/x
Hoky 3 years ago
parent
commit
1977aa29d3
  1. 16
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

16
designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

@ -7,7 +7,6 @@ import com.fr.base.ParameterMapNameSpace;
import com.fr.base.TableDataNameSpace;
import com.fr.base.Utils;
import com.fr.base.io.IOFile;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.data.TableDataSource;
import com.fr.design.actions.UpdateAction;
import com.fr.design.border.UIRoundedBorder;
@ -116,8 +115,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* 公式编辑面板
@ -296,17 +293,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
refocusInWindow();
}
private void refocusInWindow() {
ExecutorService executorService = Executors.newCachedThreadPool(new NamedThreadFactory("formula-pane-refocus"));
executorService.execute(() -> {
try {
Thread.sleep(100);
formulaTextArea.requestFocusInWindow();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
});
executorService.shutdown();
public void refocusInWindow() {
SwingUtilities.invokeLater(() -> formulaTextArea.requestFocusInWindow());
}
private void initVariableTreeAndDescriptionArea() {

Loading…
Cancel
Save