diff --git a/designer-base/src/main/java/com/fr/design/beans/BasicStorePane.java b/designer-base/src/main/java/com/fr/design/beans/BasicStorePane.java new file mode 100644 index 0000000000..09a1378a87 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/beans/BasicStorePane.java @@ -0,0 +1,23 @@ +package com.fr.design.beans; + +import com.fr.common.annotations.Open; + +/** + * @author richie + * @version 10.0 + * Created by richie on 2019/9/24 + * 数据存取视图界面 + */ +@Open +public abstract class BasicStorePane extends BasicBeanPane { + + @Override + public T updateBean() { + return null; + } + + public abstract void populateBean(T t); + + @Override + public abstract void updateBean(T t); +} diff --git a/designer-base/src/main/java/com/fr/design/fun/ExportAttrTabProvider.java b/designer-base/src/main/java/com/fr/design/fun/ExportAttrTabProvider.java index 811d5e960b..d14726e7b7 100644 --- a/designer-base/src/main/java/com/fr/design/fun/ExportAttrTabProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/ExportAttrTabProvider.java @@ -1,14 +1,8 @@ package com.fr.design.fun; -import com.fr.design.report.AbstractExportPane; +import com.fr.design.beans.BasicStorePane; import com.fr.stable.fun.mark.Mutable; -import javax.swing.*; - -/** - * Created by vito on 16/5/5. - */ - /** * 导出属性Tab页的接口 */ @@ -18,31 +12,9 @@ public interface ExportAttrTabProvider extends Mutable { int CURRENT_LEVEL = 1; /** - * 转换成SwingComponent - * - * @return JComponent - */ - JComponent toSwingComponent(); - - /** - * 转换成AbstractExportPane - * - * @return AbstractExportPane - */ - AbstractExportPane toExportPane(); - - /** - * tab的标题 - * - * @return - */ - String title(); - - /** - * tag标签 + * 转换成业务视图界面 * - * @return tag名称 - * @deprecated 将来不使用tag作为区分 + * @return 业务视图界面 */ - String tag(); + BasicStorePane toServiceComponent(); } diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractExportAttrTabProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractExportAttrTabProvider.java index 2e526e6973..0d76c58309 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractExportAttrTabProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractExportAttrTabProvider.java @@ -1,19 +1,55 @@ package com.fr.design.fun.impl; +import com.fr.design.beans.BasicStorePane; import com.fr.design.fun.ExportAttrTabProvider; +import com.fr.design.report.AbstractExportPane; +import com.fr.stable.StringUtils; import com.fr.stable.fun.impl.AbstractProvider; import com.fr.stable.fun.mark.API; +import javax.swing.*; + /** * Created by vito on 16/5/5. */ @API(level = ExportAttrTabProvider.CURRENT_LEVEL) -public abstract class AbstractExportAttrTabProvider extends AbstractProvider implements ExportAttrTabProvider { +public abstract class AbstractExportAttrTabProvider extends AbstractProvider implements ExportAttrTabProvider { @Override public int currentAPILevel() { return CURRENT_LEVEL; } + /** + * @see ExportAttrTabProvider#toServiceComponent() + */ + @Deprecated + public AbstractExportPane toExportPane() { + return null; + } + + /** + * @see ExportAttrTabProvider#toServiceComponent() + */ + @Deprecated + public JComponent toSwingComponent() { + return toServiceComponent(); + } + + @Deprecated + public String title() { + return StringUtils.EMPTY; + } + + @Deprecated + public String tag() { + return StringUtils.EMPTY; + } + + @Override + public BasicStorePane toServiceComponent() { + return toExportPane(); + } + @Override public String mark4Provider() { return this.getClass().getName(); diff --git a/designer-base/src/main/java/com/fr/design/report/AbstractExportPane.java b/designer-base/src/main/java/com/fr/design/report/AbstractExportPane.java index efbde8d37d..ddf7e0c2de 100644 --- a/designer-base/src/main/java/com/fr/design/report/AbstractExportPane.java +++ b/designer-base/src/main/java/com/fr/design/report/AbstractExportPane.java @@ -1,11 +1,11 @@ package com.fr.design.report; -import com.fr.design.dialog.BasicPane; +import com.fr.design.beans.BasicStorePane; /** * Created by vito on 16/5/5. */ -public abstract class AbstractExportPane extends BasicPane { +public abstract class AbstractExportPane extends BasicStorePane { public abstract void populate(Object t); diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java b/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java index f2c180abd5..1ac27cc882 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java @@ -1,14 +1,13 @@ package com.fr.design.report; -import javax.swing.*; - import com.fr.design.ExtraDesignClassManager; +import com.fr.design.beans.BasicStorePane; import com.fr.design.dialog.BasicPane; import com.fr.design.fun.ExportAttrTabProvider; import com.fr.design.gui.frpane.UITabbedPane; - import com.fr.io.attr.ReportExportAttr; +import javax.swing.*; import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -18,7 +17,7 @@ public class ReportExportAttrPane extends BasicPane { private ExcelExportPane excelExportPane; private PDFExportPane pdfExportPane; private WordExportPane wordExportPane; - private List paneList; + private List> paneList; public ReportExportAttrPane() { UITabbedPane uiTabbedPane = new UITabbedPane(); @@ -33,8 +32,9 @@ public class ReportExportAttrPane extends BasicPane { Set providers = ExtraDesignClassManager.getInstance().getArray(ExportAttrTabProvider.XML_TAG); paneList = new ArrayList<>(); for (ExportAttrTabProvider provider : providers) { - uiTabbedPane.addTab(provider.title(), provider.toSwingComponent()); - paneList.add(provider.toExportPane()); + BasicStorePane storePane = provider.toServiceComponent(); + uiTabbedPane.addTab(storePane.getTitle(), storePane); + paneList.add(storePane); } this.add(uiTabbedPane); } @@ -61,8 +61,8 @@ public class ReportExportAttrPane extends BasicPane { this.wordExportPane.populate(reportExportAttr.getWordExportAttr()); } - for (AbstractExportPane exportpane : paneList) { - exportpane.populate(reportExportAttr); + for (BasicStorePane exportpane : paneList) { + exportpane.populateBean(reportExportAttr); } } @@ -81,8 +81,8 @@ public class ReportExportAttrPane extends BasicPane { reportExportAttr.setWordExportAttr(this.wordExportPane.update()); } - for (AbstractExportPane exportPane : paneList) { - exportPane.update(reportExportAttr); + for (BasicStorePane exportPane : paneList) { + exportPane.updateBean(reportExportAttr); } return reportExportAttr; }