Browse Source
* commit 'd941231d760c72ad4861bd9146b884d88788b301': 去掉无用返回值 private 改成循环存取 邮件图片导出设置part5 in 5master
superman
9 years ago
8 changed files with 160 additions and 63 deletions
@ -1,67 +1,89 @@ |
|||||||
package com.fr.design.report; |
package com.fr.design.report; |
||||||
|
|
||||||
import javax.swing.BorderFactory; |
import javax.swing.*; |
||||||
import javax.swing.BoxLayout; |
|
||||||
|
|
||||||
|
import com.fr.design.ExtraDesignClassManager; |
||||||
import com.fr.design.dialog.BasicPane; |
import com.fr.design.dialog.BasicPane; |
||||||
|
import com.fr.design.fun.AbstractExportPane; |
||||||
|
import com.fr.design.fun.ExportAttrTabProvider; |
||||||
|
import com.fr.design.gui.frpane.UITabbedPane; |
||||||
import com.fr.general.Inter; |
import com.fr.general.Inter; |
||||||
import com.fr.io.attr.ReportExportAttr; |
import com.fr.io.attr.ReportExportAttr; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
|
||||||
public class ReportExportAttrPane extends BasicPane { |
public class ReportExportAttrPane extends BasicPane { |
||||||
private ExcelExportPane excelExportPane; |
private ExcelExportPane excelExportPane; |
||||||
private PDFExportPane pdfExportPane; |
private PDFExportPane pdfExportPane; |
||||||
private WordExportPane wordExportPane; |
private WordExportPane wordExportPane; |
||||||
|
private List<AbstractExportPane> paneList; |
||||||
public ReportExportAttrPane() { |
|
||||||
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); |
public ReportExportAttrPane() { |
||||||
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); |
UITabbedPane uiTabbedPane = new UITabbedPane(); |
||||||
excelExportPane = new ExcelExportPane(); |
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); |
||||||
this.add(excelExportPane); |
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); |
||||||
pdfExportPane = new PDFExportPane(); |
excelExportPane = new ExcelExportPane(); |
||||||
this.add(pdfExportPane); |
uiTabbedPane.addTab("Excel", excelExportPane); |
||||||
wordExportPane = new WordExportPane(); |
pdfExportPane = new PDFExportPane(); |
||||||
this.add(wordExportPane); |
uiTabbedPane.addTab("PDF", pdfExportPane); |
||||||
} |
wordExportPane = new WordExportPane(); |
||||||
|
uiTabbedPane.addTab("Word", wordExportPane); |
||||||
@Override |
ExportAttrTabProvider[] providers = ExtraDesignClassManager.getInstance().getExportAttrTabProviders(); |
||||||
protected String title4PopupWindow() { |
paneList = new ArrayList<AbstractExportPane>(); |
||||||
return Inter.getLocText("ReportD-Excel_Export"); |
for (ExportAttrTabProvider provider : providers) { |
||||||
} |
uiTabbedPane.addTab(provider.title(), provider.toSwingComponent()); |
||||||
|
paneList.add(provider.toExportPane()); |
||||||
public void populate(ReportExportAttr reportExportAttr) { |
} |
||||||
if (reportExportAttr == null) { |
this.add(uiTabbedPane); |
||||||
reportExportAttr = new ReportExportAttr(); |
} |
||||||
} |
|
||||||
|
@Override |
||||||
if (this.excelExportPane != null) { |
protected String title4PopupWindow() { |
||||||
this.excelExportPane.populate(reportExportAttr.getExcelExportAttr()); |
return Inter.getLocText("ReportD-Excel_Export"); |
||||||
} |
} |
||||||
|
|
||||||
if (this.pdfExportPane != null) { |
public void populate(ReportExportAttr reportExportAttr) { |
||||||
this.pdfExportPane.populate(reportExportAttr.getPDFExportAttr()); |
if (reportExportAttr == null) { |
||||||
} |
reportExportAttr = new ReportExportAttr(); |
||||||
|
} |
||||||
if (this.wordExportPane != null) { |
|
||||||
this.wordExportPane.populate(reportExportAttr.getWordExportAttr()); |
if (this.excelExportPane != null) { |
||||||
} |
this.excelExportPane.populate(reportExportAttr.getExcelExportAttr()); |
||||||
} |
} |
||||||
|
|
||||||
public ReportExportAttr update() { |
if (this.pdfExportPane != null) { |
||||||
|
this.pdfExportPane.populate(reportExportAttr.getPDFExportAttr()); |
||||||
ReportExportAttr reportExportAttr = new ReportExportAttr(); |
} |
||||||
if (this.excelExportPane != null) { |
|
||||||
reportExportAttr.setExcelExportAttr(this.excelExportPane.update()); |
if (this.wordExportPane != null) { |
||||||
} |
this.wordExportPane.populate(reportExportAttr.getWordExportAttr()); |
||||||
|
} |
||||||
if (this.pdfExportPane != null) { |
|
||||||
reportExportAttr.setPDFExportAttr(this.pdfExportPane.update()); |
for (AbstractExportPane exportpane : paneList) { |
||||||
} |
exportpane.populate(reportExportAttr); |
||||||
|
} |
||||||
if (this.wordExportPane != null) { |
} |
||||||
reportExportAttr.setWordExportAttr(this.wordExportPane.update()); |
|
||||||
} |
public ReportExportAttr update() { |
||||||
|
|
||||||
return reportExportAttr; |
ReportExportAttr reportExportAttr = new ReportExportAttr(); |
||||||
} |
if (this.excelExportPane != null) { |
||||||
|
reportExportAttr.setExcelExportAttr(this.excelExportPane.update()); |
||||||
|
} |
||||||
|
|
||||||
|
if (this.pdfExportPane != null) { |
||||||
|
reportExportAttr.setPDFExportAttr(this.pdfExportPane.update()); |
||||||
|
} |
||||||
|
|
||||||
|
if (this.wordExportPane != null) { |
||||||
|
reportExportAttr.setWordExportAttr(this.wordExportPane.update()); |
||||||
|
} |
||||||
|
|
||||||
|
for (AbstractExportPane exportPane : paneList) { |
||||||
|
exportPane.update(reportExportAttr); |
||||||
|
} |
||||||
|
return reportExportAttr; |
||||||
|
} |
||||||
} |
} |
@ -0,0 +1,13 @@ |
|||||||
|
package com.fr.design.fun; |
||||||
|
|
||||||
|
import com.fr.design.dialog.BasicPane; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by vito on 16/5/5. |
||||||
|
*/ |
||||||
|
public abstract class AbstractExportPane extends BasicPane { |
||||||
|
|
||||||
|
public abstract void populate(Object t); |
||||||
|
|
||||||
|
public abstract void update(Object t); |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
package com.fr.design.fun; |
||||||
|
|
||||||
|
import com.fr.stable.fun.Level; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by vito on 16/5/5. |
||||||
|
*/ |
||||||
|
public interface ExportAttrTabProvider extends Level{ |
||||||
|
String XML_TAG = "ExportAttrTabProvider"; |
||||||
|
|
||||||
|
int CURRENT_LEVEL = 1; |
||||||
|
|
||||||
|
JComponent toSwingComponent(); |
||||||
|
|
||||||
|
AbstractExportPane toExportPane(); |
||||||
|
|
||||||
|
String title(); |
||||||
|
|
||||||
|
String tag(); |
||||||
|
} |
@ -0,0 +1,19 @@ |
|||||||
|
package com.fr.design.fun.impl; |
||||||
|
|
||||||
|
import com.fr.design.fun.ExportAttrTabProvider; |
||||||
|
import com.fr.stable.fun.impl.AbstractProvider; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by vito on 16/5/5. |
||||||
|
*/ |
||||||
|
public abstract class AbstractExportAttrTabProvider extends AbstractProvider implements ExportAttrTabProvider { |
||||||
|
@Override |
||||||
|
public int currentAPILevel() { |
||||||
|
return CURRENT_LEVEL; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String mark4Provider() { |
||||||
|
return this.getClass().getName(); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue