Browse Source

懒加载多sheet预览插件

master
richie 8 years ago
parent
commit
6c96e1b835
  1. 2
      build.xml
  2. 0
      lib/.gitkeep
  3. 9
      plugin.xml
  4. 10
      src/com/fr/plugin/lazy/sheet/LazyConstants.java
  5. 21
      src/com/fr/plugin/lazy/sheet/LazySheetActor.java

2
build.xml

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="jar" name="plugin">
<!-- JDK路径,根据自己机器上实际位置修改-->
<property name="jdk.home" value="/System/Library/Java/JavaVirtualMachines/1.6.1.jdk/Contents/Home"/>
<property name="jdk.home" value="/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home"/>
<property name="libs" value="${basedir}/lib"/>
<property name="publicLibs" value=""/>

0
lib/.gitkeep

9
plugin.xml

@ -3,13 +3,16 @@
<id>com.fr.plugin.report.lazysheet</id>
<name><![CDATA[多sheet懒加载]]></name>
<active>yes</active>
<version>2.0</version>
<version>2.1</version>
<env-version>8.0</env-version>
<jartime>2015-08-09</jartime>
<vendor>路人乙</vendor>
<vendor email="solution@finereport.com">solution.richie</vendor>
<description><![CDATA[多sheet报表仅仅只加载当前sheet(不支持sheet间运算)]]></description>
<change-notes><![CDATA[无]]></change-notes>
<change-notes><![CDATA[
[2016-04-11]增加插件API兼容性检测<br/>
]]></change-notes>
<extra-core>
<LocaleFinder class="com.fr.plugin.lazy.sheet.locale.LazyLocaleFinder"/>
</extra-core>
<extra-report>
<ActorProvider class="com.fr.plugin.lazy.sheet.LazySheetActorMark"/>

10
src/com/fr/plugin/lazy/sheet/LazyConstants.java

@ -0,0 +1,10 @@
package com.fr.plugin.lazy.sheet;
/**
* Created by richie on 16/4/11.
*/
public class LazyConstants {
static final String PLUGIN_ID= "com.fr.plugin.report.lazysheet";
}

21
src/com/fr/plugin/lazy/sheet/LazySheetActor.java

@ -1,8 +1,13 @@
package com.fr.plugin.lazy.sheet;
import com.fr.general.Inter;
import com.fr.main.impl.WorkBook;
import com.fr.main.workbook.ResultWorkBook;
import com.fr.plugin.ExtraClassManager;
import com.fr.stable.ViewActor;
import com.fr.stable.fun.FunctionHelper;
import com.fr.stable.fun.FunctionProcessor;
import com.fr.stable.fun.impl.AbstractFunctionProcessor;
import java.util.Map;
@ -11,9 +16,25 @@ import java.util.Map;
*/
public class LazySheetActor extends ViewActor {
private static final FunctionProcessor PPP = new AbstractFunctionProcessor() {
@Override
public int getId() {
return FunctionHelper.generateFunctionID(LazyConstants.PLUGIN_ID);
}
@Override
public String getLocaleKey() {
return Inter.getLocText("Plugin-Lazy_Load_Sheet");
}
};
@Override
public ResultWorkBook executeWorkBook(WorkBook workBook, Map parameterMap, int sheetIndex) {
if (parameterMap.containsKey("__lazy__")) {
FunctionProcessor processor = ExtraClassManager.getInstance().getFunctionProcessor();
if (processor != null) {
processor.recordFunction(PPP);
}
return new LazySheetWorkBookExecutor(workBook, parameterMap, sheetIndex).execute();
} else {
return super.executeWorkBook(workBook, parameterMap, sheetIndex);

Loading…
Cancel
Save