Browse Source

Merge pull request #1139 in DESIGN/design from ~RICHIE/design:feature/10.0 to feature/10.0

* commit '355d5ebfd119a5a9506ff37015471e26d2f8f561':
  无JIRA任务 比如恶心的插件接口,稍微改下
research/11.0
richie 5 years ago
parent
commit
a5cac50e94
  1. 23
      designer-base/src/main/java/com/fr/design/beans/BasicStorePane.java
  2. 36
      designer-base/src/main/java/com/fr/design/fun/ExportAttrTabProvider.java
  3. 38
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractExportAttrTabProvider.java
  4. 4
      designer-base/src/main/java/com/fr/design/report/AbstractExportPane.java
  5. 20
      designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java

23
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<T> extends BasicBeanPane<T> {
@Override
public T updateBean() {
return null;
}
public abstract void populateBean(T t);
@Override
public abstract void updateBean(T t);
}

36
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();
}

38
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();

4
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<Object> {
public abstract void populate(Object t);

20
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<AbstractExportPane> paneList;
private List<BasicStorePane<?>> paneList;
public ReportExportAttrPane() {
UITabbedPane uiTabbedPane = new UITabbedPane();
@ -33,8 +32,9 @@ public class ReportExportAttrPane extends BasicPane {
Set<ExportAttrTabProvider> 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;
}

Loading…
Cancel
Save