|
|
|
@ -1,5 +1,10 @@
|
|
|
|
|
package com.fr.design.formula; |
|
|
|
|
|
|
|
|
|
import com.fine.swing.ui.layout.Layouts; |
|
|
|
|
import com.fine.theme.icon.LazyIcon; |
|
|
|
|
import com.fine.theme.light.ui.FineRoundBorder; |
|
|
|
|
import com.fine.theme.utils.FineUIScale; |
|
|
|
|
import com.formdev.flatlaf.ui.FlatUIUtils; |
|
|
|
|
import com.fr.base.BaseFormula; |
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
|
import com.fr.base.Parameter; |
|
|
|
@ -10,6 +15,7 @@ import com.fr.base.io.IOFile;
|
|
|
|
|
import com.fr.data.TableDataSource; |
|
|
|
|
import com.fr.design.actions.UpdateAction; |
|
|
|
|
import com.fr.design.border.UIRoundedBorder; |
|
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
|
import com.fr.design.dialog.BasicDialog; |
|
|
|
|
import com.fr.design.dialog.BasicPane; |
|
|
|
@ -66,7 +72,7 @@ import com.fr.stable.script.Tiny;
|
|
|
|
|
import com.fr.stable.script.TinyHunter; |
|
|
|
|
|
|
|
|
|
import java.awt.Window; |
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.SwingConstants; |
|
|
|
|
import javax.swing.DefaultListCellRenderer; |
|
|
|
|
import javax.swing.DefaultListModel; |
|
|
|
|
import javax.swing.Icon; |
|
|
|
@ -92,7 +98,6 @@ import java.awt.BorderLayout;
|
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.awt.FlowLayout; |
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
import java.awt.event.FocusEvent; |
|
|
|
@ -120,6 +125,10 @@ import java.util.List;
|
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.row; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.flex; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 公式编辑面板 |
|
|
|
|
* |
|
|
|
@ -128,13 +137,11 @@ import java.util.Set;
|
|
|
|
|
*/ |
|
|
|
|
@EnableMetrics |
|
|
|
|
public class FormulaPane extends BasicPane implements KeyListener, UIFormula { |
|
|
|
|
public static final int DEFUAL_FOMULA_LENGTH = 103; |
|
|
|
|
public static final int DEFUAL_FOMULA_LENGTH = FineUIScale.scale(103); |
|
|
|
|
public static final String ELLIPSIS = "..."; |
|
|
|
|
public static final char KEY_CODE_A = 'A'; |
|
|
|
|
public static final char KEY_CODE_Z = 'z'; |
|
|
|
|
public static final String NEWLINE = "\n"; |
|
|
|
|
public static final String FORMULA_ICON = "/com/fr/design/images/m_file/formula.png"; |
|
|
|
|
public static final String PARAM_ICON = "/com/fr/design/images/m_file/param.png"; |
|
|
|
|
private VariableTreeAndDescriptionArea variableTreeAndDescriptionArea; |
|
|
|
|
private RSyntaxTextArea formulaTextArea; |
|
|
|
|
private UITextField keyWordTextField = new UITextField(18); |
|
|
|
@ -156,8 +163,6 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
private DefaultCompletionProvider completionProvider; |
|
|
|
|
private static final Map<String, String> PARAM_PREFIX_MAP = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
public static final int DESCRIPTION_TEXT_AREA_ROW = 16, DESCRIPTION_TEXT_AREA_COLUMN = 27; |
|
|
|
|
|
|
|
|
|
public FormulaPane() { |
|
|
|
|
initComponents(); |
|
|
|
|
} |
|
|
|
@ -255,26 +260,17 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initTipsPane() { |
|
|
|
|
private JPanel initTipsPane() { |
|
|
|
|
// tipsPane
|
|
|
|
|
JPanel containerSPane = new JPanel(new BorderLayout(4, 1)); |
|
|
|
|
JPanel labelPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0), true); |
|
|
|
|
JPanel searchPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0), true); |
|
|
|
|
containerSPane.setPreferredSize(new Dimension(892, 23)); |
|
|
|
|
this.add(containerSPane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
UIButton searchButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaPane_Search")); |
|
|
|
|
UILabel formulaLabel = new UILabel( |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaD_Input_Formula_In_The_Text_Area_Below") + ":"); |
|
|
|
|
formulaLabel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); |
|
|
|
|
|
|
|
|
|
labelPane.add(formulaLabel, BorderLayout.WEST); |
|
|
|
|
keyWordTextField.setPreferredSize(new Dimension(240, 23)); |
|
|
|
|
searchPane.add(keyWordTextField, BorderLayout.EAST); |
|
|
|
|
searchPane.add(searchButton, BorderLayout.EAST); |
|
|
|
|
|
|
|
|
|
containerSPane.add(labelPane, BorderLayout.WEST); |
|
|
|
|
containerSPane.add(searchPane, BorderLayout.EAST); |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaD_Input_Formula_In_The_Text_Area_Below") + ":", SwingConstants.LEFT); |
|
|
|
|
JPanel containerSPane = row( |
|
|
|
|
cell(formulaLabel), |
|
|
|
|
flex(), |
|
|
|
|
cell(keyWordTextField), |
|
|
|
|
cell(searchButton) |
|
|
|
|
).getComponent(); |
|
|
|
|
|
|
|
|
|
initKeyWordTextFieldKeyListener(); |
|
|
|
|
tipsList = new JList(listModel); |
|
|
|
@ -288,14 +284,22 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
fixFunctionNameList(tipsList.getSelectedValue().toString()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return containerSPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void initComponents() { |
|
|
|
|
this.setLayout(new BorderLayout(4, 4)); |
|
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
|
|
|
|
|
|
initTextPane(); |
|
|
|
|
initTipsPane(); |
|
|
|
|
initVariableTreeAndDescriptionArea(); |
|
|
|
|
JPanel textPane = initTextPane(); |
|
|
|
|
JPanel tipsPane = initTipsPane(); |
|
|
|
|
JPanel variablePane = initVariableTreeAndDescriptionArea(); |
|
|
|
|
|
|
|
|
|
this.add(Layouts.column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
cell(tipsPane), |
|
|
|
|
cell(textPane).weight(1), |
|
|
|
|
cell(variablePane).weight(2) |
|
|
|
|
).getComponent()); |
|
|
|
|
refocusInWindow(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -303,37 +307,31 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
SwingUtilities.invokeLater(() -> formulaTextArea.requestFocusInWindow()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initVariableTreeAndDescriptionArea() { |
|
|
|
|
private JPanel initVariableTreeAndDescriptionArea() { |
|
|
|
|
variableTreeAndDescriptionArea = new VariableTreeAndDescriptionArea(); |
|
|
|
|
this.add(variableTreeAndDescriptionArea, BorderLayout.SOUTH); |
|
|
|
|
return variableTreeAndDescriptionArea; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initTextPane() { |
|
|
|
|
private JPanel initTextPane() { |
|
|
|
|
JPanel textPane = new JPanel(new BorderLayout(0, LayoutConstants.VERTICAL_GAP)); |
|
|
|
|
JPanel checkBoxAndButtonPane = new JPanel(new BorderLayout()); |
|
|
|
|
|
|
|
|
|
// text
|
|
|
|
|
JPanel textPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
this.add(textPane, BorderLayout.CENTER); |
|
|
|
|
JPanel checkBoxandbuttonPane = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane(); |
|
|
|
|
initFormulaTextArea(); |
|
|
|
|
|
|
|
|
|
UIScrollPane formulaTextAreaScrollPane = new UIScrollPane(formulaTextArea); |
|
|
|
|
formulaTextAreaScrollPane.setBorder(null); |
|
|
|
|
textPane.add(formulaTextAreaScrollPane, BorderLayout.CENTER); |
|
|
|
|
textPane.add(checkBoxandbuttonPane, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
|
|
formulaTextAreaScrollPane.setBorder(new FineRoundBorder()); |
|
|
|
|
|
|
|
|
|
// buttonPane
|
|
|
|
|
JPanel buttonPane = row(8).getComponent(); |
|
|
|
|
UIButton checkValidButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaD_Check_Valid")); |
|
|
|
|
UIButton calButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Formula_Cal_Button")); |
|
|
|
|
checkValidButton.addActionListener(checkValidActionListener); |
|
|
|
|
calButton.addActionListener(calculateActionListener); |
|
|
|
|
buttonPane.add(checkValidButton); |
|
|
|
|
buttonPane.add(calButton); |
|
|
|
|
|
|
|
|
|
//靠左流式布局
|
|
|
|
|
JPanel checkBoxPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
|
checkBoxandbuttonPane.add(checkBoxPane, BorderLayout.WEST); |
|
|
|
|
//靠右流式布局
|
|
|
|
|
JPanel buttonPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); |
|
|
|
|
buttonPane.add(checkValidButton, BorderLayout.EAST); |
|
|
|
|
buttonPane.add(calButton, BorderLayout.EAST); |
|
|
|
|
checkBoxandbuttonPane.add(buttonPane, BorderLayout.EAST); |
|
|
|
|
// checkBoxPane
|
|
|
|
|
JPanel checkBoxPane = row(8).getComponent(); |
|
|
|
|
if (autoCompletionCheck == null) { |
|
|
|
|
autoCompletionCheck = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula_AutoCompletion")); |
|
|
|
|
autoCompletionCheck.setSelected(true); |
|
|
|
@ -342,10 +340,16 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
checkBeforeColse = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Formula_Check_Before_Closed")); |
|
|
|
|
checkBeforeColse.setSelected(true); |
|
|
|
|
} |
|
|
|
|
checkBoxPane.add(autoCompletionCheck, BorderLayout.WEST); |
|
|
|
|
checkBoxPane.add(checkBeforeColse, BorderLayout.WEST); |
|
|
|
|
checkBoxPane.add(autoCompletionCheck); |
|
|
|
|
checkBoxPane.add(checkBeforeColse); |
|
|
|
|
extendCheckBoxPane(checkBoxPane); |
|
|
|
|
|
|
|
|
|
// layout
|
|
|
|
|
checkBoxAndButtonPane.add(checkBoxPane, BorderLayout.WEST); |
|
|
|
|
checkBoxAndButtonPane.add(buttonPane, BorderLayout.EAST); |
|
|
|
|
textPane.add(formulaTextAreaScrollPane, BorderLayout.CENTER); |
|
|
|
|
textPane.add(checkBoxAndButtonPane, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
|
|
ParameterTableModel model = new ParameterTableModel(0); |
|
|
|
|
editor4CalPane = new UITableEditorPane<>(model); |
|
|
|
|
formulaTextArea.addFocusListener(new FocusListener() { |
|
|
|
@ -363,6 +367,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
uninstallAutoCompletion(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return textPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private CompletionProvider createCompletionProvider() { |
|
|
|
@ -370,7 +375,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
completionProvider = new DefaultCompletionProvider(); |
|
|
|
|
NameAndDescription[] nameAndDescriptions = FunctionConstants.ALL.getDescriptions(); |
|
|
|
|
for (NameAndDescription nameAndDescription : nameAndDescriptions) { |
|
|
|
|
completionProvider.addCompletion(new FormulaCompletion(completionProvider, nameAndDescription.getName(), BaseUtils.readIcon(FORMULA_ICON))); |
|
|
|
|
completionProvider.addCompletion(new FormulaCompletion(completionProvider, nameAndDescription.getName(), new LazyIcon("formula"))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
VariableResolver variableResolver = VariableResolver.DEFAULT; |
|
|
|
@ -394,7 +399,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
paramWithoutPre = parameter; |
|
|
|
|
PARAM_PREFIX_MAP.put(paramWithoutPre, StringUtils.EMPTY); |
|
|
|
|
} |
|
|
|
|
completionProvider.addCompletion(new FormulaCompletion(completionProvider, paramWithoutPre, BaseUtils.readIcon(PARAM_ICON))); |
|
|
|
|
completionProvider.addCompletion(new FormulaCompletion(completionProvider, paramWithoutPre, new LazyIcon("param"))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return completionProvider; |
|
|
|
@ -645,7 +650,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
popupMenu = new JPopupMenu(); |
|
|
|
|
JScrollPane tipsScrollPane = new JScrollPane(tipsList); |
|
|
|
|
popupMenu.add(tipsScrollPane); |
|
|
|
|
tipsScrollPane.setPreferredSize(new Dimension(240, 146)); |
|
|
|
|
tipsScrollPane.setPreferredSize(new Dimension(FineUIScale.scale(240), FineUIScale.scale(146))); |
|
|
|
|
tipsScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC)); |
|
|
|
|
popupMenu.show(keyWordTextField, 0, 23); |
|
|
|
|
} |
|
|
|
@ -742,8 +747,10 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public BasicDialog showLargeWindow(Window window, DialogActionListener l) { |
|
|
|
|
BasicDialog basicDialog = super.showWindowWithCustomSize(window, l, new Dimension(900, 600)); |
|
|
|
|
basicDialog.setMinimumSize(new Dimension(900, 600)); |
|
|
|
|
int width = FineUIScale.scale(900); |
|
|
|
|
int height = FineUIScale.scale(600); |
|
|
|
|
BasicDialog basicDialog = super.showWindowWithCustomSize(window, l, new Dimension(width, height)); |
|
|
|
|
basicDialog.setMinimumSize(new Dimension(width, height)); |
|
|
|
|
basicDialog.setResizable(true); |
|
|
|
|
return basicDialog; |
|
|
|
|
} |
|
|
|
@ -1066,15 +1073,15 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
this.initComponents(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initFunctionTypeList(JPanel functionPane) { |
|
|
|
|
private JPanel initFunctionTypeList() { |
|
|
|
|
functionTypeList = new QuickList(functionTypeListModel); |
|
|
|
|
UIScrollPane functionTypeScrollPane = new UIScrollPane(functionTypeList); |
|
|
|
|
functionTypeScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC)); |
|
|
|
|
functionTypeScrollPane.setPreferredSize(new Dimension(140, 200)); |
|
|
|
|
functionPane.add(this.createNamePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaD_Function_Category") + ":", functionTypeScrollPane), BorderLayout.WEST); |
|
|
|
|
functionTypeScrollPane.setBorder(new FineRoundBorder()); |
|
|
|
|
functionTypeList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); |
|
|
|
|
initTypeListCellRenderer(); |
|
|
|
|
initGroupTypeModel(); |
|
|
|
|
initTypeListSelectionListener(); |
|
|
|
|
return this.createNamePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaD_Function_Category"), functionTypeScrollPane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initTypeListCellRenderer() { |
|
|
|
@ -1181,23 +1188,21 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initFunctionNameList(JPanel functionPane) { |
|
|
|
|
private JPanel initFunctionNameList() { |
|
|
|
|
functionNameList = new JList(new DefaultListModel()); |
|
|
|
|
UIScrollPane functionNameScrollPane = new UIScrollPane(functionNameList); |
|
|
|
|
functionNameScrollPane.setPreferredSize(new Dimension(140, 200)); |
|
|
|
|
functionPane.add( |
|
|
|
|
this.createNamePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaD_Function_Name") + ":", functionNameScrollPane), |
|
|
|
|
BorderLayout.CENTER); |
|
|
|
|
functionNameScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC)); |
|
|
|
|
functionNameScrollPane.setBorder(new FineRoundBorder()); |
|
|
|
|
functionNameList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); |
|
|
|
|
initFunctionNameListCellRenderer(); |
|
|
|
|
initFunctionNameListSelectionListener(); |
|
|
|
|
initFunctionNameListMouseListener(); |
|
|
|
|
return this.createNamePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaD_Function_Name"), functionNameScrollPane); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initDescriptionTextArea() { |
|
|
|
|
// Description
|
|
|
|
|
descriptionTextArea = new UITextArea(DESCRIPTION_TEXT_AREA_ROW,DESCRIPTION_TEXT_AREA_COLUMN); |
|
|
|
|
descriptionTextArea.setBackground(Color.white); |
|
|
|
|
descriptionTextArea = new UITextArea(); |
|
|
|
|
descriptionTextArea.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); |
|
|
|
|
descriptionTextArea.setLineWrap(true); |
|
|
|
|
descriptionTextArea.setWrapStyleWord(true); |
|
|
|
|
descriptionTextArea.setEditable(false); |
|
|
|
@ -1263,14 +1268,12 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initVariablesTree() { |
|
|
|
|
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
// vairable.
|
|
|
|
|
private JPanel initVariablesTree() { |
|
|
|
|
// variable
|
|
|
|
|
variablesTree = new JTree(); |
|
|
|
|
UIScrollPane variablesTreePane = new UIScrollPane(variablesTree); |
|
|
|
|
variablesTreePane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC)); |
|
|
|
|
panel.add(this.createNamePane( |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaPane_Variables") + ":", variablesTreePane), BorderLayout.WEST); |
|
|
|
|
variablesTreePane.setBorder(new FineRoundBorder()); |
|
|
|
|
variablesTree.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); |
|
|
|
|
variablesTree.setRootVisible(false); |
|
|
|
|
variablesTree.setShowsRootHandles(true); |
|
|
|
|
variablesTree.addMouseListener(applyTextMouseListener); |
|
|
|
@ -1280,23 +1283,34 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
|
|
|
|
|
UIScrollPane desScrollPane = new UIScrollPane(descriptionTextArea); |
|
|
|
|
desScrollPane.setBorder(null); |
|
|
|
|
panel.add(this.createNamePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaPane_Formula_Description") + ":", desScrollPane), BorderLayout.CENTER); |
|
|
|
|
initVariablesTreeSelectionListener(); |
|
|
|
|
this.add(panel,BorderLayout.CENTER); |
|
|
|
|
return Layouts.row(LayoutConstants.HORIZONTAL_GAP, |
|
|
|
|
cell(this.createNamePane( |
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_FormulaPane_Variables"), variablesTreePane) |
|
|
|
|
).weight(1), |
|
|
|
|
cell(this.createNamePane( |
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_FormulaPane_Formula_Description"), desScrollPane) |
|
|
|
|
).weight(1) |
|
|
|
|
).getComponent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initComponents() { |
|
|
|
|
this.setLayout(new BorderLayout(4, 4)); |
|
|
|
|
initVariablesTree(); |
|
|
|
|
initFunctionPane(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initFunctionPane() { |
|
|
|
|
JPanel functionPane = new JPanel(new BorderLayout(4, 4)); |
|
|
|
|
this.add(functionPane, BorderLayout.WEST); |
|
|
|
|
initFunctionTypeList(functionPane); |
|
|
|
|
initFunctionNameList(functionPane); |
|
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
|
JPanel variablesTreePane = initVariablesTree(); |
|
|
|
|
JPanel functionPane = initFunctionPane(); |
|
|
|
|
this.add(Layouts.row(LayoutConstants.HORIZONTAL_GAP, |
|
|
|
|
cell(functionPane).weight(1), |
|
|
|
|
cell(variablesTreePane).weight(2) |
|
|
|
|
).getComponent()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel initFunctionPane() { |
|
|
|
|
JPanel functionTypePane = initFunctionTypeList(); |
|
|
|
|
JPanel functionNamePane = initFunctionNameList(); |
|
|
|
|
functionTypeList.setSelectedIndex(0); |
|
|
|
|
return Layouts.row(LayoutConstants.HORIZONTAL_GAP, |
|
|
|
|
cell(functionTypePane).weight(1), cell(functionNamePane).weight(1) |
|
|
|
|
).getComponent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -1312,7 +1326,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
public LookDetailAction() { |
|
|
|
|
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaPane_Function_Detail")); |
|
|
|
|
this.setMnemonic('L'); |
|
|
|
|
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/preview.png")); |
|
|
|
|
this.setSmallIcon(new LazyIcon("preview")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 弹出的窗口中显示函数的用法明细
|
|
|
|
@ -1345,7 +1359,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createNamePane(String name, JComponent comp) { |
|
|
|
|
JPanel namePane = new JPanel(new BorderLayout(4, 4)); |
|
|
|
|
JPanel namePane = new JPanel(new BorderLayout(0, 4)); |
|
|
|
|
namePane.add(new UILabel(name), BorderLayout.NORTH); |
|
|
|
|
namePane.add(comp, BorderLayout.CENTER); |
|
|
|
|
return namePane; |
|
|
|
@ -1419,7 +1433,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
DefaultMutableTreeNode bindCellNode = new DefaultMutableTreeNode(new TextUserObject("$$$")); |
|
|
|
|
rootNode.add(bindCellNode); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// todo: 缺一些icon
|
|
|
|
|
rootNode.add(new TextFolderUserObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FormulaD_Data_Fields"), |
|
|
|
|
BaseUtils.readIcon("/com/fr/design/images/dialog/table.png"), |
|
|
|
|
variableResolver.resolveColumnNames()).createMutableTreeNode()); |
|
|
|
@ -1434,7 +1448,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
variableResolver.resolveTableDataParameterVariables()).createMutableTreeNode()); |
|
|
|
|
|
|
|
|
|
rootNode.add(new TextFolderUserObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ParameterD_Report_Parameter"), |
|
|
|
|
BaseUtils.readIcon("/com/fr/design/images/m_report/p.gif"), |
|
|
|
|
new LazyIcon("param"), |
|
|
|
|
variableResolver.resolveReportParameterVariables()).createMutableTreeNode()); |
|
|
|
|
|
|
|
|
|
rootNode.add(new TextFolderUserObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Global_Parameters"), |
|
|
|
|