|
|
@ -399,6 +399,8 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript |
|
|
|
|
|
|
|
|
|
|
|
private static final long serialVersionUID = -6564079764032351372L; |
|
|
|
private static final long serialVersionUID = -6564079764032351372L; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private UIComboBox exportTypeComboBox; |
|
|
|
|
|
|
|
|
|
|
|
public 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} |
|
|
|
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); |
|
|
|
, EXPORT_TYPES_MAP); |
|
|
@ -449,6 +451,24 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript |
|
|
|
|
|
|
|
|
|
|
|
public FileNameCombobox() { |
|
|
|
public FileNameCombobox() { |
|
|
|
fileNameComboBox = getComboBoxWithModel(new String[]{DEFAULT, CUSTOM}, FILENAME_TYPE_MAP); |
|
|
|
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() { |
|
|
|
this.addCellEditorListener(new CellEditorListener() { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -458,15 +478,6 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void editingStopped(ChangeEvent e) { |
|
|
|
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(); |
|
|
|
fireTableDataChanged(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -514,7 +525,11 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { |
|
|
|
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { |
|
|
|
fileNameFormulaEditor.setValue(BaseFormula.createFormulaBuilder().build()); |
|
|
|
if (value != null) { |
|
|
|
|
|
|
|
fileNameFormulaEditor.setValue(BaseFormula.createFormulaBuilder().build(value)); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
fileNameFormulaEditor.setValue(BaseFormula.createFormulaBuilder().build()); |
|
|
|
|
|
|
|
} |
|
|
|
return fileNameFormulaEditor; |
|
|
|
return fileNameFormulaEditor; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|