Browse Source

无jira任务 代码质量

newui
vito 10 months ago
parent
commit
7352c53c48
  1. 2
      designer-realize/src/main/java/com/fr/design/mainframe/ReportFloatPane.java
  2. 8
      designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java

2
designer-realize/src/main/java/com/fr/design/mainframe/ReportFloatPane.java

@ -22,7 +22,7 @@ import static com.fine.swing.ui.layout.Layouts.row;
* *
* @author vito * @author vito
* @since 9.0 * @since 9.0
* Created 2017/7/27. * Created on 2017/7/27.
*/ */
public class ReportFloatPane extends Column { public class ReportFloatPane extends Column {

8
designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java

@ -21,6 +21,7 @@ import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.row;
public class FloatStringQuickEditor extends FloatQuickEditor { public class FloatStringQuickEditor extends FloatQuickEditor {
private static final char FORMULA_BEGINNING = '=';
private final UITextArea stringTextField; private final UITextArea stringTextField;
private final UIButton formulaButton; private final UIButton formulaButton;
@ -97,7 +98,7 @@ public class FloatStringQuickEditor extends FloatQuickEditor {
private void changeReportPaneCell(String tmpText) { private void changeReportPaneCell(String tmpText) {
if (tmpText != null && (!tmpText.isEmpty() && tmpText.charAt(0) == '=')) { if (isFormula(tmpText)) {
BaseFormula textFormula = BaseFormula.createFormulaBuilder().build(tmpText); BaseFormula textFormula = BaseFormula.createFormulaBuilder().build(tmpText);
textFormula.setReserveInResult(reserveInResult); textFormula.setReserveInResult(reserveInResult);
textFormula.setReserveOnWriteOrAnaly(reserveOnWriteOrAnaly); textFormula.setReserveOnWriteOrAnaly(reserveOnWriteOrAnaly);
@ -113,4 +114,9 @@ public class FloatStringQuickEditor extends FloatQuickEditor {
fireTargetModified(); fireTargetModified();
stringTextField.requestFocus(); stringTextField.requestFocus();
} }
private static boolean isFormula(String tmpText) {
return StringUtils.isNotEmpty(tmpText)
&& tmpText.charAt(0) == FORMULA_BEGINNING;
}
} }
Loading…
Cancel
Save