richie
5 years ago
19 changed files with 185 additions and 109 deletions
@ -0,0 +1,6 @@ |
|||||||
|
*.iml |
||||||
|
.idea/ |
||||||
|
.DS_Store |
||||||
|
.classpath |
||||||
|
target/ |
||||||
|
lib/report/*.jar |
Binary file not shown.
@ -0,0 +1,61 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
|
||||||
|
<parent> |
||||||
|
<groupId>com.fr.plugin</groupId> |
||||||
|
<artifactId>starter</artifactId> |
||||||
|
<version>10.0</version> |
||||||
|
</parent> |
||||||
|
<packaging>jar</packaging> |
||||||
|
<artifactId>plugin-lazysheet</artifactId> |
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>com.fanruan.api</groupId> |
||||||
|
<artifactId>finekit</artifactId> |
||||||
|
<version>10.0</version> |
||||||
|
<scope>system</scope> |
||||||
|
<systemPath>${project.basedir}/lib/finekit-10.0.jar</systemPath> |
||||||
|
</dependency> |
||||||
|
</dependencies> |
||||||
|
<build> |
||||||
|
<!---如果要更改调试插件,改这里的配置就可以了--> |
||||||
|
<outputDirectory>${project.basedir}/../webroot/WEB-INF/plugins/plugin-com.fr.plugin.report.lazysheet-1.0/classes</outputDirectory> |
||||||
|
<plugins> |
||||||
|
<plugin> |
||||||
|
<groupId>org.apache.maven.plugins</groupId> |
||||||
|
<artifactId>maven-compiler-plugin</artifactId> |
||||||
|
<configuration> |
||||||
|
<source>6</source> |
||||||
|
<target>6</target> |
||||||
|
</configuration> |
||||||
|
</plugin> |
||||||
|
</plugins> |
||||||
|
</build> |
||||||
|
<repositories> |
||||||
|
<repository> |
||||||
|
<id>fanruan</id> |
||||||
|
<name>fanruan</name> |
||||||
|
<url>http://mvn.finedevelop.com/repository/maven-public/</url> |
||||||
|
<snapshots> |
||||||
|
<enabled>true</enabled> |
||||||
|
<updatePolicy>always</updatePolicy> |
||||||
|
<checksumPolicy>warn</checksumPolicy> |
||||||
|
</snapshots> |
||||||
|
</repository> |
||||||
|
</repositories> |
||||||
|
<pluginRepositories> |
||||||
|
<pluginRepository> |
||||||
|
<id>fanruan</id> |
||||||
|
<name>fanruan</name> |
||||||
|
<url>http://mvn.finedevelop.com/repository/maven-public/</url> |
||||||
|
<snapshots> |
||||||
|
<enabled>true</enabled> |
||||||
|
<updatePolicy>always</updatePolicy> |
||||||
|
<checksumPolicy>warn</checksumPolicy> |
||||||
|
</snapshots> |
||||||
|
</pluginRepository> |
||||||
|
</pluginRepositories> |
||||||
|
</project> |
@ -1,43 +0,0 @@ |
|||||||
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; |
|
||||||
|
|
||||||
/** |
|
||||||
* Created by richie on 15/7/17. |
|
||||||
*/ |
|
||||||
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); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -1,34 +0,0 @@ |
|||||||
package com.fr.plugin.lazy.sheet; |
|
||||||
|
|
||||||
import com.fr.design.preview.ViewPreview; |
|
||||||
|
|
||||||
import java.util.HashMap; |
|
||||||
import java.util.Map; |
|
||||||
|
|
||||||
/** |
|
||||||
* Created by richie on 15/7/17. |
|
||||||
*/ |
|
||||||
public class LazySheetPreview extends ViewPreview { |
|
||||||
|
|
||||||
@Override |
|
||||||
public int currentAPILevel() { |
|
||||||
return CURRENT_LEVEL; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public String nameForPopupItem() { |
|
||||||
return "懒加载多sheet"; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public int previewTypeCode() { |
|
||||||
return 18; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public Map<String, Object> parametersForPreview() { |
|
||||||
Map<String, Object> map = super.parametersForPreview(); |
|
||||||
map.put("__lazy__", true); |
|
||||||
return map; |
|
||||||
} |
|
||||||
} |
|
@ -1 +0,0 @@ |
|||||||
Plugin-Lazy_Load_Sheet=Lazy Load Sheet |
|
@ -1 +0,0 @@ |
|||||||
Plugin-Lazy_Load_Sheet=Lazy Load Sheet |
|
@ -1 +0,0 @@ |
|||||||
Plugin-Lazy_Load_Sheet=\u61D2\u52A0\u8F7D\u591Asheet |
|
@ -1,15 +1,15 @@ |
|||||||
package com.fr.plugin.lazy.sheet.locale; |
package com.fr.plugin.lazy.sheet; |
||||||
|
|
||||||
import com.fr.stable.fun.impl.AbstractLocaleFinder; |
import com.fr.stable.fun.impl.AbstractLocaleFinder; |
||||||
|
|
||||||
/** |
/** |
||||||
* Created by richie on 16/4/11. |
* Created by richie on 16/4/11. |
||||||
*/ |
*/ |
||||||
public class LazyLocaleFinder extends AbstractLocaleFinder { |
public class LazyLocaleBridge extends AbstractLocaleFinder { |
||||||
|
|
||||||
@Override |
@Override |
||||||
public int currentAPILevel() { |
public int currentAPILevel() { |
||||||
return 1; |
return CURRENT_LEVEL; |
||||||
} |
} |
||||||
|
|
||||||
@Override |
@Override |
@ -1,12 +1,13 @@ |
|||||||
package com.fr.plugin.lazy.sheet; |
package com.fr.plugin.lazy.sheet; |
||||||
|
|
||||||
|
import com.fr.plugin.lazy.sheet.fun.LazySheetActor; |
||||||
import com.fr.report.fun.impl.AbstractActorProvider; |
import com.fr.report.fun.impl.AbstractActorProvider; |
||||||
import com.fr.report.stable.fun.Actor; |
import com.fr.report.stable.fun.Actor; |
||||||
|
|
||||||
/** |
/** |
||||||
* Created by richie on 15/7/17. |
* Created by richie on 15/7/17. |
||||||
*/ |
*/ |
||||||
public class LazySheetActorMark extends AbstractActorProvider { |
public class LazySheetActorBridge extends AbstractActorProvider { |
||||||
|
|
||||||
@Override |
@Override |
||||||
public int currentAPILevel() { |
public int currentAPILevel() { |
@ -0,0 +1,44 @@ |
|||||||
|
package com.fr.plugin.lazy.sheet; |
||||||
|
|
||||||
|
import com.fanruan.api.i18n.I18nKit; |
||||||
|
import com.fr.design.fun.impl.AbstractPreviewProvider; |
||||||
|
|
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by richie on 15/7/17. |
||||||
|
*/ |
||||||
|
public class LazySheetPreviewBridge extends AbstractPreviewProvider { |
||||||
|
|
||||||
|
@Override |
||||||
|
public int currentAPILevel() { |
||||||
|
return CURRENT_LEVEL; |
||||||
|
} |
||||||
|
|
||||||
|
public String iconPathForPopupItem() { |
||||||
|
return "com/fr/design/images/buttonicon/anas.png"; |
||||||
|
} |
||||||
|
|
||||||
|
public String iconPathForLarge() { |
||||||
|
return "com/fr/design/images/buttonicon/anab24.png"; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String nameForPopupItem() { |
||||||
|
return I18nKit.getLocText("Plugin-Lazy_Load_Preview"); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public int previewTypeCode() { |
||||||
|
return 18; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public Map<String, Object> parametersForPreview() { |
||||||
|
Map<String, Object> map = new HashMap<String, Object>(); |
||||||
|
map.put("op", "view"); |
||||||
|
map.put("__lazy__", true); |
||||||
|
return map; |
||||||
|
} |
||||||
|
} |
@ -1,4 +1,4 @@ |
|||||||
package com.fr.plugin.lazy.sheet; |
package com.fr.plugin.lazy.sheet.fun; |
||||||
|
|
||||||
/** |
/** |
||||||
* Created by richie on 16/4/11. |
* Created by richie on 16/4/11. |
@ -0,0 +1,30 @@ |
|||||||
|
package com.fr.plugin.lazy.sheet.fun; |
||||||
|
|
||||||
|
import com.fanruan.api.report.view.BaseViewActor; |
||||||
|
import com.fr.intelli.record.Focus; |
||||||
|
import com.fr.main.TemplateWorkBook; |
||||||
|
import com.fr.main.workbook.ResultWorkBook; |
||||||
|
import com.fr.record.analyzer.EnableMetrics; |
||||||
|
|
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by richie on 15/7/17. |
||||||
|
*/ |
||||||
|
@EnableMetrics |
||||||
|
public class LazySheetActor extends BaseViewActor { |
||||||
|
|
||||||
|
@Override |
||||||
|
@Focus(id = LazyConstants.PLUGIN_ID, text = "Plugin-Lazy_Load_Sheet") |
||||||
|
public ResultWorkBook run(TemplateWorkBook workBook, Map parameterMap, int sheetIndex) { |
||||||
|
if (parameterMap.containsKey("__lazy__")) { |
||||||
|
return lazyExecute(workBook, parameterMap, sheetIndex); |
||||||
|
} else { |
||||||
|
return super.executeWorkBook(workBook, parameterMap, sheetIndex); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
private ResultWorkBook lazyExecute(TemplateWorkBook workBook, Map parameterMap, int sheetIndex) { |
||||||
|
return new LazySheetWorkBookExecutor(workBook, parameterMap, sheetIndex).execute(); |
||||||
|
} |
||||||
|
} |
@ -1,37 +1,30 @@ |
|||||||
package com.fr.plugin.lazy.sheet; |
package com.fr.plugin.lazy.sheet.fun; |
||||||
|
|
||||||
import com.fr.main.impl.WorkBook; |
import com.fanruan.api.report.executor.ViewWorkBookExecutor; |
||||||
import com.fr.main.workbook.AnalyRWorkBook; |
import com.fr.main.TemplateWorkBook; |
||||||
import com.fr.main.workbook.ResultWorkBook; |
|
||||||
import com.fr.report.report.ResultReport; |
import com.fr.report.report.ResultReport; |
||||||
import com.fr.report.report.TemplateReport; |
import com.fr.report.report.TemplateReport; |
||||||
import com.fr.report.stable.fun.Actor; |
import com.fr.report.stable.fun.Actor; |
||||||
import com.fr.view.cal.sheet.AnalyWorkBookExecutor; |
|
||||||
|
|
||||||
import java.util.Map; |
import java.util.Map; |
||||||
|
|
||||||
/** |
/** |
||||||
* Created by richie on 15/7/17. |
* Created by richie on 15/7/17. |
||||||
*/ |
*/ |
||||||
public class LazySheetWorkBookExecutor extends AnalyWorkBookExecutor { |
public class LazySheetWorkBookExecutor extends ViewWorkBookExecutor { |
||||||
private int sheetIndex; |
private int sheetIndex; |
||||||
|
|
||||||
public LazySheetWorkBookExecutor(WorkBook workBook, Map<String, Object> parameterMap, int sheetIndex) { |
public LazySheetWorkBookExecutor(TemplateWorkBook workBook, Map<String, Object> parameterMap, int sheetIndex) { |
||||||
super(workBook, parameterMap); |
super(workBook, parameterMap); |
||||||
this.sheetIndex = sheetIndex; |
this.sheetIndex = sheetIndex; |
||||||
} |
} |
||||||
|
|
||||||
@Override |
|
||||||
public ResultWorkBook initResultBook(Map<String, Object> parameterMap) { |
|
||||||
return new AnalyRWorkBook(parameterMap); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
@Override |
||||||
public Actor getExeType() { |
public Actor getExeType() { |
||||||
return new LazySheetActor(); |
return new LazySheetActor(); |
||||||
} |
} |
||||||
|
|
||||||
protected void _execute(){ |
protected void _execute() { |
||||||
// 先按顺序来,其实这里就一个个塞进去,然后在这里面开始统一分步计算
|
// 先按顺序来,其实这里就一个个塞进去,然后在这里面开始统一分步计算
|
||||||
TemplateReport report; |
TemplateReport report; |
||||||
for (int i = 0, len = this.nameListMap.size(); i < len; i++) { |
for (int i = 0, len = this.nameListMap.size(); i < len; i++) { |
@ -0,0 +1,2 @@ |
|||||||
|
Plugin-Lazy_Load_Sheet=Lazy Load Sheet |
||||||
|
Plugin-Lazy_Load_Preview=Lazy Preview |
@ -0,0 +1,2 @@ |
|||||||
|
Plugin-Lazy_Load_Sheet=Lazy Load Sheet |
||||||
|
Plugin-Lazy_Load_Preview=Lazy Preview |
Loading…
Reference in new issue