diff --git a/README.md b/README.md index 70c034a..d6a21f2 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,19 @@ -# 自定义条件属性 +# 条件属性扩展-单元对齐 -当前已有的条件属性包含下图中的几种类型 +该插件提供了扩展的条件属性,可以根据单元格设置的条件属性有不同的对齐方式。 -![0](screenshots/e0.png) +模板设置如下图所示: -在特殊情况下,已有的几种类型并不能完全满足需求,典型的就是,根据不同的条件把单元格内的内容做不同的对齐。 -这个时候,就可以使用条件属性接口```com.fr.design.fun.HighlightProvider```以及其抽象类```com.fr.design.fun.impl.AbstractHighlightProvider```了。 -通过这个接口可以制作出如下如所示的插件效果 +![1](screenshots/1.png) -![1](screenshots/e1.png) +添加三个条件属性,分别设置了值为1的时候居中对齐、值为2的时候左对齐、值为3的时候右对齐 -可以看到多出了一个"我的条件属性"的项,当然这个名字是可以根据实际情况修改的。 -选择了以后,就可以设置单元格的对齐方式了 +![2](screenshots/2.png) -![2](screenshots/e2.png) +下图中仅列了第一个条件属性 + +![3](screenshots/3.png) + +模板预览结果如下图所示: + +![4](screenshots/4.png) \ No newline at end of file diff --git a/screenshots/1.png b/screenshots/1.png new file mode 100644 index 0000000..21c9385 Binary files /dev/null and b/screenshots/1.png differ diff --git a/screenshots/2.png b/screenshots/2.png new file mode 100644 index 0000000..f9855da Binary files /dev/null and b/screenshots/2.png differ diff --git a/screenshots/3.png b/screenshots/3.png new file mode 100644 index 0000000..e85ddef Binary files /dev/null and b/screenshots/3.png differ diff --git a/screenshots/4.png b/screenshots/4.png new file mode 100644 index 0000000..dc0fd77 Binary files /dev/null and b/screenshots/4.png differ diff --git a/screenshots/e0.png b/screenshots/e0.png deleted file mode 100644 index 9dc4920..0000000 Binary files a/screenshots/e0.png and /dev/null differ diff --git a/screenshots/e1.png b/screenshots/e1.png deleted file mode 100644 index 1e8c9c7..0000000 Binary files a/screenshots/e1.png and /dev/null differ diff --git a/screenshots/e2.png b/screenshots/e2.png deleted file mode 100644 index 089ccb9..0000000 Binary files a/screenshots/e2.png and /dev/null differ diff --git a/src/main/java/com/fr/plugin/cell/highlight/fun/AlignHighlightAction.java b/src/main/java/com/fr/plugin/cell/highlight/fun/AlignHighlightAction.java index b2c592a..5b61bd4 100644 --- a/src/main/java/com/fr/plugin/cell/highlight/fun/AlignHighlightAction.java +++ b/src/main/java/com/fr/plugin/cell/highlight/fun/AlignHighlightAction.java @@ -6,7 +6,9 @@ import com.fr.intelli.record.Original; import com.fr.plugin.PluginLicense; import com.fr.plugin.PluginLicenseManager; import com.fr.record.analyzer.EnableMetrics; +import com.fr.report.cell.CellElement; import com.fr.report.cell.cellattr.highlight.AbstractStyleHighlightAction; +import com.fr.script.Calculator; import com.fr.stable.AssistUtils; import com.fr.stable.Constants; import com.fr.stable.xml.XMLPrintWriter; @@ -35,6 +37,11 @@ public class AlignHighlightAction extends AbstractStyleHighlightAction { return align; } + @Override + public void action(CellElement cellElement, Calculator calculator) { + super.action(cellElement, calculator); + } + @Override @Focus(id = AlignHighlightConstants.PLUGIN_ID, text = "Plugin-Highlight_Align", source = Original.PLUGIN) protected Style modStyle(Style style) { diff --git a/src/main/resources/com/fr/plugin/cell/highlight/locale/align.properties b/src/main/resources/com/fr/plugin/cell/highlight/locale/align.properties index 63722f9..3d4b503 100644 --- a/src/main/resources/com/fr/plugin/cell/highlight/locale/align.properties +++ b/src/main/resources/com/fr/plugin/cell/highlight/locale/align.properties @@ -4,4 +4,4 @@ Plugin-Highlight_Align_Center=Center Plugin-Highlight_Align_Right=Right Plugin-Highlight_Align_Current_Row=Current row Plugin-Highlight_Align_Current_Column=Current column -Plugin-Highlight_Align_Current_Cell Current cell \ No newline at end of file +Plugin-Highlight_Align_Current_Cell=Current cell \ No newline at end of file