|
|
|
@ -7,6 +7,7 @@ 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; |
|
|
|
@ -115,6 +116,8 @@ 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; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 公式编辑面板 |
|
|
|
@ -151,6 +154,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
private FormulaPaneAutoCompletion autoCompletion; |
|
|
|
|
private DefaultCompletionProvider completionProvider; |
|
|
|
|
private static final Map<String, String> PARAM_PREFIX_MAP = new HashMap<>(); |
|
|
|
|
private ExecutorService executorService = Executors.newCachedThreadPool(new NamedThreadFactory("formula-pane-refocus")); |
|
|
|
|
|
|
|
|
|
public FormulaPane() { |
|
|
|
|
initComponents(); |
|
|
|
@ -290,6 +294,19 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
initTextPane(); |
|
|
|
|
initTipsPane(); |
|
|
|
|
initVariableTreeAndDescriptionArea(); |
|
|
|
|
refocusInWindow(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void refocusInWindow() { |
|
|
|
|
executorService.execute(() -> { |
|
|
|
|
try { |
|
|
|
|
Thread.sleep(100); |
|
|
|
|
formulaTextArea.requestFocusInWindow(); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
executorService.shutdown(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initVariableTreeAndDescriptionArea() { |
|
|
|
|