|
|
@ -218,6 +218,10 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript |
|
|
|
this.add(editorPane, BorderLayout.CENTER); |
|
|
|
this.add(editorPane, BorderLayout.CENTER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void reset() { |
|
|
|
|
|
|
|
editorPane.populate(new SingleJavaScript[0]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected String title4PopupWindow() { |
|
|
|
protected String title4PopupWindow() { |
|
|
|
return Toolkit.i18nText("Fine-Design_Basic_Export_JS_Setting"); |
|
|
|
return Toolkit.i18nText("Fine-Design_Basic_Export_JS_Setting"); |
|
|
@ -399,6 +403,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 +455,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 +482,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 +529,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) { |
|
|
|
|
|
|
|
if (value != null) { |
|
|
|
|
|
|
|
fileNameFormulaEditor.setValue(BaseFormula.createFormulaBuilder().build(value)); |
|
|
|
|
|
|
|
} else { |
|
|
|
fileNameFormulaEditor.setValue(BaseFormula.createFormulaBuilder().build()); |
|
|
|
fileNameFormulaEditor.setValue(BaseFormula.createFormulaBuilder().build()); |
|
|
|
|
|
|
|
} |
|
|
|
return fileNameFormulaEditor; |
|
|
|
return fileNameFormulaEditor; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -633,7 +652,7 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript |
|
|
|
} |
|
|
|
} |
|
|
|
ParameterProvider[] providers = (ParameterProvider[]) value; |
|
|
|
ParameterProvider[] providers = (ParameterProvider[]) value; |
|
|
|
if (providers != null) { |
|
|
|
if (providers != null) { |
|
|
|
paraSettingPane.refresh(Arrays.asList(providers)); |
|
|
|
paraSettingPane.refresh(new ArrayList<>(Arrays.asList(providers))); |
|
|
|
} |
|
|
|
} |
|
|
|
return paraButton; |
|
|
|
return paraButton; |
|
|
|
} |
|
|
|
} |
|
|
@ -758,6 +777,7 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript |
|
|
|
public void populateBean(ExportJavaScript ob) { |
|
|
|
public void populateBean(ExportJavaScript ob) { |
|
|
|
if (ob == null) { |
|
|
|
if (ob == null) { |
|
|
|
ob = new ExportJavaScript(); |
|
|
|
ob = new ExportJavaScript(); |
|
|
|
|
|
|
|
otherTemplatePane.reset(); |
|
|
|
} |
|
|
|
} |
|
|
|
this.templateRadioGroup.selectIndexButton(ob.isCurrentTemplate() ? 0 : 1); |
|
|
|
this.templateRadioGroup.selectIndexButton(ob.isCurrentTemplate() ? 0 : 1); |
|
|
|
if (ob.isCurrentTemplate()) { |
|
|
|
if (ob.isCurrentTemplate()) { |
|
|
|