Browse Source

REPORT-61105 & REPORT-61096 & REPORT-61012 控件联动及兼容老模板调整

bugfix/11.0
pengda 3 years ago
parent
commit
ae5cd80e9c
  1. 33
      designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java

33
designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java

@ -399,6 +399,8 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript
private static final long serialVersionUID = -6564079764032351372L;
private UIComboBox exportTypeComboBox;
public ExportTypeCombobox() {
exportTypeComboBox = getComboBoxWithModel(new String[]{ExportJavaScript.EXPORT_PDF, ExportJavaScript.EXPORT_EXCEL_PAGE, ExportJavaScript.EXPORT_EXCEL_SIMPLE, ExportJavaScript.EXPORT_EXCEL_SHEET, ExportJavaScript.EXPORT_WORD, ExportJavaScript.EXPORT_IMAGE}
, EXPORT_TYPES_MAP);
@ -449,6 +451,24 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript
public FileNameCombobox() {
fileNameComboBox = getComboBoxWithModel(new String[]{DEFAULT, CUSTOM}, FILENAME_TYPE_MAP);
fileNameComboBox.addItemListener(e -> {
if (e.getStateChange() == ItemEvent.SELECTED) {
final int row = table.getSelectedRow();
if (row == -1) {
return;
}
SingleJavaScript js = getList().get(row);
Object ob = fileNameComboBox.getSelectedItem();
if (ob != null) {
String value = ob.toString();
js.setDefaultFileName(StringUtils.equals(value, DEFAULT));
if (js.isDefaultFileName()) {
js.setFileName(StringUtils.EMPTY);
}
}
table.repaint();
}
});
this.addCellEditorListener(new CellEditorListener() {
@Override
@ -458,15 +478,6 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript
@Override
public void editingStopped(ChangeEvent e) {
if (table.getSelectedRow() == -1) {
return;
}
SingleJavaScript js = getList().get(table.getSelectedRow());
Object ob = fileNameComboBox.getSelectedItem();
if (ob != null) {
String value = ob.toString();
js.setDefaultFileName(StringUtils.equals(value, DEFAULT));
}
fireTableDataChanged();
}
});
@ -514,7 +525,11 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
if (value != null) {
fileNameFormulaEditor.setValue(BaseFormula.createFormulaBuilder().build(value));
} else {
fileNameFormulaEditor.setValue(BaseFormula.createFormulaBuilder().build());
}
return fileNameFormulaEditor;
}

Loading…
Cancel
Save