|
|
@ -646,7 +646,6 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class ResultSetSortConfigPane extends JPanel { |
|
|
|
public class ResultSetSortConfigPane extends JPanel { |
|
|
|
private static final String DEFAULT_VALUE = "="; |
|
|
|
private static final String DEFAULT_VALUE = "="; |
|
|
|
private final BaseFormula DEFAULT_FORMULA = BaseFormula.createFormulaBuilder().build(); |
|
|
|
|
|
|
|
private JPanel contentPane; |
|
|
|
private JPanel contentPane; |
|
|
|
private UIButtonGroup sortTypePane; |
|
|
|
private UIButtonGroup sortTypePane; |
|
|
|
private JFormulaField formulaField; |
|
|
|
private JFormulaField formulaField; |
|
|
@ -723,7 +722,8 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
} |
|
|
|
} |
|
|
|
BaseFormula baseFormula = dSColumn.getSortFormulaObject(); |
|
|
|
BaseFormula baseFormula = dSColumn.getSortFormulaObject(); |
|
|
|
if (baseFormula == null) { |
|
|
|
if (baseFormula == null) { |
|
|
|
this.formulaField.populateFormula(DEFAULT_FORMULA); |
|
|
|
BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(); |
|
|
|
|
|
|
|
this.formulaField.populateFormula(defaultFormula); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.formulaField.populateFormula(baseFormula); |
|
|
|
this.formulaField.populateFormula(baseFormula); |
|
|
|
} |
|
|
|
} |
|
|
@ -1064,11 +1064,12 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
public class JFormulaField extends JPanel { |
|
|
|
public class JFormulaField extends JPanel { |
|
|
|
private CellElement cellElement; |
|
|
|
private CellElement cellElement; |
|
|
|
private FormulaTextField formulaTextField; |
|
|
|
private FormulaTextField formulaTextField; |
|
|
|
private BaseFormula defaultFormula; |
|
|
|
private String defaultValue; |
|
|
|
|
|
|
|
|
|
|
|
public JFormulaField(String defaultValue) { |
|
|
|
public JFormulaField(String defaultValue) { |
|
|
|
|
|
|
|
|
|
|
|
this.defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); |
|
|
|
this.defaultValue = defaultValue; |
|
|
|
|
|
|
|
BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(this.defaultValue); |
|
|
|
formulaTextField = new FormulaTextField(); |
|
|
|
formulaTextField = new FormulaTextField(); |
|
|
|
formulaTextField.setValueAndText(defaultFormula, false); |
|
|
|
formulaTextField.setValueAndText(defaultFormula, false); |
|
|
|
|
|
|
|
|
|
|
@ -1145,6 +1146,7 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
public void doOk() { |
|
|
|
public void doOk() { |
|
|
|
BaseFormula valueFormula = formulaPane.update(); |
|
|
|
BaseFormula valueFormula = formulaPane.update(); |
|
|
|
if (valueFormula.getContent().length() <= 1) { |
|
|
|
if (valueFormula.getContent().length() <= 1) { |
|
|
|
|
|
|
|
BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(defaultValue); |
|
|
|
formulaTextField.setValueAndText(defaultFormula, false); |
|
|
|
formulaTextField.setValueAndText(defaultFormula, false); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
formulaTextField.setValueAndText(valueFormula, false); |
|
|
|
formulaTextField.setValueAndText(valueFormula, false); |
|
|
@ -1164,8 +1166,7 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class CustomValuePane extends JPanel { |
|
|
|
public class CustomValuePane extends JPanel { |
|
|
|
private static final String DEFAULT_VALUE = "=$$$"; |
|
|
|
private static final String DEFAULT_VALUE = "=$$$"; |
|
|
|
private final BaseFormula DEFAULT_FORMULA = BaseFormula.createFormulaBuilder().build(DEFAULT_VALUE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JFormulaField formulaField; |
|
|
|
private JFormulaField formulaField; |
|
|
|
|
|
|
|
|
|
|
|
public CustomValuePane() { |
|
|
|
public CustomValuePane() { |
|
|
@ -1188,7 +1189,8 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
if (valueFormula != null) { |
|
|
|
if (valueFormula != null) { |
|
|
|
formulaField.populateFormula(valueFormula); |
|
|
|
formulaField.populateFormula(valueFormula); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
formulaField.populateFormula(DEFAULT_FORMULA); |
|
|
|
BaseFormula defaultFormula = BaseFormula.createFormulaBuilder().build(DEFAULT_VALUE); |
|
|
|
|
|
|
|
formulaField.populateFormula(defaultFormula); |
|
|
|
} |
|
|
|
} |
|
|
|
formulaField.populateElement(cellElement); |
|
|
|
formulaField.populateElement(cellElement); |
|
|
|
|
|
|
|
|
|
|
@ -1201,7 +1203,7 @@ public class CellDSColumnEditor extends CellQuickEditor { |
|
|
|
Object value = cellElement.getValue(); |
|
|
|
Object value = cellElement.getValue(); |
|
|
|
if (value instanceof DSColumn) { |
|
|
|
if (value instanceof DSColumn) { |
|
|
|
DSColumn dSColumn = (DSColumn) (cellElement.getValue()); |
|
|
|
DSColumn dSColumn = (DSColumn) (cellElement.getValue()); |
|
|
|
dSColumn.setResultObject(this.formulaField.getFormula()); |
|
|
|
dSColumn.setResultObject(StringUtils.isEmpty(this.formulaField.getFormulaText()) ? null : this.formulaField.getFormula()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|