diff --git a/designer/src/com/fr/design/report/ReportExportAttrPane.java b/designer/src/com/fr/design/report/ReportExportAttrPane.java index a3f114022f..7e3f157e84 100644 --- a/designer/src/com/fr/design/report/ReportExportAttrPane.java +++ b/designer/src/com/fr/design/report/ReportExportAttrPane.java @@ -8,18 +8,17 @@ 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.io.attr.ImageExportAttr; import com.fr.io.attr.ReportExportAttr; -import java.util.HashMap; -import java.util.Map; +import java.util.ArrayList; +import java.util.List; public class ReportExportAttrPane extends BasicPane { private ExcelExportPane excelExportPane; private PDFExportPane pdfExportPane; private WordExportPane wordExportPane; - Map paneMap; + List paneList; public ReportExportAttrPane() { UITabbedPane uiTabbedPane = new UITabbedPane(); @@ -32,10 +31,10 @@ public class ReportExportAttrPane extends BasicPane { wordExportPane = new WordExportPane(); uiTabbedPane.addTab("Word", wordExportPane); ExportAttrTabProvider[] providers = ExtraDesignClassManager.getInstance().getExportAttrTabProviders(); - paneMap = new HashMap(); + paneList = new ArrayList(); for (ExportAttrTabProvider provider : providers) { uiTabbedPane.addTab(provider.title(), provider.toSwingComponent()); - paneMap.put(provider.tag(), provider.toExportPane()); + paneList.add(provider.toExportPane()); } this.add(uiTabbedPane); } @@ -62,9 +61,8 @@ public class ReportExportAttrPane extends BasicPane { this.wordExportPane.populate(reportExportAttr.getWordExportAttr()); } - AbstractExportPane exportPane = paneMap.get("Image"); - if(exportPane != null){ - exportPane.populate(reportExportAttr.getImageExportAttr()); + for (AbstractExportPane exportpane : paneList) { + exportpane.populate(reportExportAttr); } } @@ -83,9 +81,11 @@ public class ReportExportAttrPane extends BasicPane { reportExportAttr.setWordExportAttr(this.wordExportPane.update()); } - AbstractExportPane exportPane = paneMap.get("Image"); - if(exportPane != null){ - reportExportAttr.setImageExportAttr(exportPane.update(ImageExportAttr.class)); + for (AbstractExportPane exportPane : paneList) { + ReportExportAttr exportAttr = exportPane.update(reportExportAttr, ReportExportAttr.class); + if (exportAttr != null) { + reportExportAttr = exportAttr; + } } return reportExportAttr; } diff --git a/designer_base/src/com/fr/design/fun/AbstractExportPane.java b/designer_base/src/com/fr/design/fun/AbstractExportPane.java index 22d6ada018..2986a7f7d4 100644 --- a/designer_base/src/com/fr/design/fun/AbstractExportPane.java +++ b/designer_base/src/com/fr/design/fun/AbstractExportPane.java @@ -9,16 +9,10 @@ public abstract class AbstractExportPane extends BasicPane { public abstract void populate(Object t); - public abstract Object update(); + public abstract Object update(Object t); -// public void populate(Object object,Class clazz){ -// if(object.getClass().isAssignableFrom(clazz)){ -// this.populate(clazz.cast(object)); -// } -// } - - public T update(Class clazz){ - Object object = this.update(); + public T update(Object t,Class clazz){ + Object object = this.update(t); if(object == null){ return null; }