Browse Source

无JIRA任务 比如恶心的插件接口,稍微改下

research/11.0
richie 5 years ago
parent
commit
355d5ebfd1
  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; 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 com.fr.stable.fun.mark.Mutable;
import javax.swing.*;
/**
* Created by vito on 16/5/5.
*/
/** /**
* 导出属性Tab页的接口 * 导出属性Tab页的接口
*/ */
@ -18,31 +12,9 @@ public interface ExportAttrTabProvider extends Mutable {
int CURRENT_LEVEL = 1; int CURRENT_LEVEL = 1;
/** /**
* 转换成SwingComponent * 转换成业务视图界面
*
* @return JComponent
*/
JComponent toSwingComponent();
/**
* 转换成AbstractExportPane
*
* @return AbstractExportPane
*/
AbstractExportPane toExportPane();
/**
* tab的标题
*
* @return
*/
String title();
/**
* tag标签
* *
* @return tag名称 * @return 业务视图界面
* @deprecated 将来不使用tag作为区分
*/ */
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; package com.fr.design.fun.impl;
import com.fr.design.beans.BasicStorePane;
import com.fr.design.fun.ExportAttrTabProvider; 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.impl.AbstractProvider;
import com.fr.stable.fun.mark.API; import com.fr.stable.fun.mark.API;
import javax.swing.*;
/** /**
* Created by vito on 16/5/5. * Created by vito on 16/5/5.
*/ */
@API(level = ExportAttrTabProvider.CURRENT_LEVEL) @API(level = ExportAttrTabProvider.CURRENT_LEVEL)
public abstract class AbstractExportAttrTabProvider extends AbstractProvider implements ExportAttrTabProvider { public abstract class AbstractExportAttrTabProvider extends AbstractProvider implements ExportAttrTabProvider {
@Override @Override
public int currentAPILevel() { public int currentAPILevel() {
return CURRENT_LEVEL; 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 @Override
public String mark4Provider() { public String mark4Provider() {
return this.getClass().getName(); 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; package com.fr.design.report;
import com.fr.design.dialog.BasicPane; import com.fr.design.beans.BasicStorePane;
/** /**
* Created by vito on 16/5/5. * 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); 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; package com.fr.design.report;
import javax.swing.*;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicStorePane;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.ExportAttrTabProvider; import com.fr.design.fun.ExportAttrTabProvider;
import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.io.attr.ReportExportAttr; import com.fr.io.attr.ReportExportAttr;
import javax.swing.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@ -18,7 +17,7 @@ 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; private List<BasicStorePane<?>> paneList;
public ReportExportAttrPane() { public ReportExportAttrPane() {
UITabbedPane uiTabbedPane = new UITabbedPane(); UITabbedPane uiTabbedPane = new UITabbedPane();
@ -33,8 +32,9 @@ public class ReportExportAttrPane extends BasicPane {
Set<ExportAttrTabProvider> providers = ExtraDesignClassManager.getInstance().getArray(ExportAttrTabProvider.XML_TAG); Set<ExportAttrTabProvider> providers = ExtraDesignClassManager.getInstance().getArray(ExportAttrTabProvider.XML_TAG);
paneList = new ArrayList<>(); paneList = new ArrayList<>();
for (ExportAttrTabProvider provider : providers) { for (ExportAttrTabProvider provider : providers) {
uiTabbedPane.addTab(provider.title(), provider.toSwingComponent()); BasicStorePane<?> storePane = provider.toServiceComponent();
paneList.add(provider.toExportPane()); uiTabbedPane.addTab(storePane.getTitle(), storePane);
paneList.add(storePane);
} }
this.add(uiTabbedPane); this.add(uiTabbedPane);
} }
@ -61,8 +61,8 @@ public class ReportExportAttrPane extends BasicPane {
this.wordExportPane.populate(reportExportAttr.getWordExportAttr()); this.wordExportPane.populate(reportExportAttr.getWordExportAttr());
} }
for (AbstractExportPane exportpane : paneList) { for (BasicStorePane exportpane : paneList) {
exportpane.populate(reportExportAttr); exportpane.populateBean(reportExportAttr);
} }
} }
@ -81,8 +81,8 @@ public class ReportExportAttrPane extends BasicPane {
reportExportAttr.setWordExportAttr(this.wordExportPane.update()); reportExportAttr.setWordExportAttr(this.wordExportPane.update());
} }
for (AbstractExportPane exportPane : paneList) { for (BasicStorePane exportPane : paneList) {
exportPane.update(reportExportAttr); exportPane.updateBean(reportExportAttr);
} }
return reportExportAttr; return reportExportAttr;
} }

Loading…
Cancel
Save