|
|
|
@ -88,6 +88,7 @@ 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; |
|
|
|
@ -124,8 +125,8 @@ import java.util.Set;
|
|
|
|
|
public class FormulaPane extends BasicPane implements KeyListener, UIFormula { |
|
|
|
|
public static final int DEFUAL_FOMULA_LENGTH = 103; |
|
|
|
|
public static final String ELLIPSIS = "..."; |
|
|
|
|
public static final int KEY_CODE_A = 64; |
|
|
|
|
public static final int KEY_CODE_Z = 91; |
|
|
|
|
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"; |
|
|
|
@ -166,7 +167,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean inKeyCodeRange(KeyEvent e) { |
|
|
|
|
return (e.getExtendedKeyCode() > KEY_CODE_A && e.getExtendedKeyCode() < KEY_CODE_Z); |
|
|
|
|
return (e.getKeyChar() >= KEY_CODE_A && e.getKeyChar() <= KEY_CODE_Z); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -248,16 +249,25 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
|
|
|
|
|
private void 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); |
|
|
|
|
|
|
|
|
|
JPanel searchPane = new JPanel(new BorderLayout(4, 1)); |
|
|
|
|
this.add(searchPane, BorderLayout.NORTH); |
|
|
|
|
searchPane.add(keyWordTextField, BorderLayout.CENTER); |
|
|
|
|
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") + ":" |
|
|
|
|
+ " "); |
|
|
|
|
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); |
|
|
|
|
searchPane.add(formulaLabel, BorderLayout.WEST); |
|
|
|
|
|
|
|
|
|
containerSPane.add(labelPane, BorderLayout.WEST); |
|
|
|
|
containerSPane.add(searchPane, BorderLayout.EAST); |
|
|
|
|
|
|
|
|
|
initKeyWordTextFieldKeyListener(); |
|
|
|
|
tipsList = new JList(listModel); |
|
|
|
|
tipsList.addMouseListener(new DoubleClick()); |
|
|
|
@ -835,10 +845,12 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
if (checkResult.isValid()) { |
|
|
|
|
showMessageDialog(checkResult.getTips(), checkResult.isValid()); |
|
|
|
|
} else { |
|
|
|
|
String position = Toolkit.i18nText("Fine-Design_Basic_Formula_The") + (checkResult.getFormulaCoordinates().getColumns()) |
|
|
|
|
+ Toolkit.i18nText("Fine-Design_Basic_Formula_Error_Position") + " "; |
|
|
|
|
int confirmDialog = FineJOptionPane.showConfirmDialog( |
|
|
|
|
FormulaPane.this, |
|
|
|
|
checkResult.getTips() + ", " + Toolkit.i18nText("Fine-Design_Basic_Formula_Error_Position") + ":" + (checkResult.getFormulaCoordinates().getColumns()) + ".", |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Confirm"), |
|
|
|
|
position + checkResult.getTips(), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), |
|
|
|
|
JOptionPane.YES_NO_OPTION, |
|
|
|
|
JOptionPane.WARNING_MESSAGE, |
|
|
|
|
null, |
|
|
|
@ -1265,7 +1277,6 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
}; |
|
|
|
|
basicPane.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
UITextArea desArea = new UITextArea(); |
|
|
|
|
// desArea。setEnabled(false);
|
|
|
|
|
desArea.setText(this.getTextAreaText()); |
|
|
|
|
basicPane.add(new UIScrollPane(desArea), BorderLayout.CENTER); |
|
|
|
|
BasicDialog dialog = basicPane.showWindow(DesignerContext.getDesignerFrame()); |
|
|
|
@ -1339,6 +1350,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
public void refreshText(String line) { |
|
|
|
|
fixFunctionNameList(line); |
|
|
|
|
refreshDescriptionTextArea(line); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|