Browse Source

Merge branch 'master' of Mars.Ma/demo-highlight-align into master

master
richie 5 years ago committed by Gogs
parent
commit
cf715a19bb
  1. 10
      pom.xml
  2. 2
      src/main/java/com/fr/plugin/cell/highlight/AlignCellHighlightBridge.java
  3. 12
      src/main/java/com/fr/plugin/cell/highlight/fun/AlignHighlightAction.java
  4. 24
      src/main/java/com/fr/plugin/cell/highlight/ui/AlignHighlightPane.java

10
pom.xml

@ -14,5 +14,15 @@
<build> <build>
<!---如果要更改调试插件,改这里的配置就可以了--> <!---如果要更改调试插件,改这里的配置就可以了-->
<outputDirectory>${project.basedir}/../webroot/WEB-INF/plugins/plugin-com.fr.plugin.cell.highlight.align.v10-1.0/classes</outputDirectory> <outputDirectory>${project.basedir}/../webroot/WEB-INF/plugins/plugin-com.fr.plugin.cell.highlight.align.v10-1.0/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build> </build>
</project> </project>

2
src/main/java/com/fr/plugin/cell/highlight/AlignCellHighlightBridge.java

@ -1,6 +1,6 @@
package com.fr.plugin.cell.highlight; package com.fr.plugin.cell.highlight;
import com.fr.design.condition.ConditionAttrSingleConditionPane; import com.fanruan.api.design.ui.condition.ConditionAttrSingleConditionPane;
import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.fun.impl.AbstractHighlightProvider; import com.fr.design.fun.impl.AbstractHighlightProvider;
import com.fr.plugin.cell.highlight.fun.AlignHighlightAction; import com.fr.plugin.cell.highlight.fun.AlignHighlightAction;

12
src/main/java/com/fr/plugin/cell/highlight/fun/AlignHighlightAction.java

@ -1,19 +1,18 @@
package com.fr.plugin.cell.highlight.fun; package com.fr.plugin.cell.highlight.fun;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.intelli.record.Focus; import com.fr.intelli.record.Focus;
import com.fr.intelli.record.Original; 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.record.analyzer.EnableMetrics;
import com.fanruan.api.report.cell.AbstractStyleHighlightAction;
import com.fanruan.api.macro.Constants;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
import com.fr.report.cell.cellattr.highlight.AbstractStyleHighlightAction;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.AssistUtils;
import com.fr.stable.Constants;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
import com.fanruan.api.util.AssistKit; import com.fanruan.api.util.AssistKit;
import com.fanruan.api.runtime.PluginKit;
/** /**
* @author richie * @author richie
* @date 2015-03-26 * @date 2015-03-26
@ -45,8 +44,7 @@ public class AlignHighlightAction extends AbstractStyleHighlightAction {
@Override @Override
@Focus(id = AlignHighlightConstants.PLUGIN_ID, text = "Plugin-Highlight_Align", source = Original.PLUGIN) @Focus(id = AlignHighlightConstants.PLUGIN_ID, text = "Plugin-Highlight_Align", source = Original.PLUGIN)
protected Style modStyle(Style style) { protected Style modStyle(Style style) {
PluginLicense pluginLicense = PluginLicenseManager.getInstance().getPluginLicenseByID(AlignHighlightConstants.PLUGIN_ID); if (PluginKit.isCurrentPluginAvailable()) {
if (pluginLicense != null && pluginLicense.isAvailable()) {
return style.deriveHorizontalAlignment(align); return style.deriveHorizontalAlignment(align);
} }
return style; return style;

24
src/main/java/com/fr/plugin/cell/highlight/ui/AlignHighlightPane.java

@ -1,13 +1,13 @@
package com.fr.plugin.cell.highlight.ui; package com.fr.plugin.cell.highlight.ui;
import com.fr.design.condition.ConditionAttrSingleConditionPane;
import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fanruan.api.design.ui.condition.ConditionAttrSingleConditionPane;
import com.fr.design.gui.icombobox.UIDictionaryComboBox; import com.fanruan.api.design.ui.component.UIComboBox;
import com.fr.general.Inter; import com.fanruan.api.design.ui.component.UIDictionaryComboBox;
import com.fr.plugin.cell.highlight.fun.AlignHighlightAction; import com.fr.plugin.cell.highlight.fun.AlignHighlightAction;
import com.fr.report.cell.cellattr.highlight.HighlightAction; import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.stable.Constants; import com.fanruan.api.macro.Constants;
import com.fanruan.api.design.DesignKit;
import javax.swing.*; import javax.swing.*;
@ -25,22 +25,22 @@ public class AlignHighlightPane extends ConditionAttrSingleConditionPane<Highlig
this.alignComboBox = new UIDictionaryComboBox<Integer>( this.alignComboBox = new UIDictionaryComboBox<Integer>(
new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT}, new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT},
new String[]{ new String[]{
Inter.getLocText("Plugin-Highlight_Align_Left"), DesignKit.i18nText("Plugin-Highlight_Align_Left"),
Inter.getLocText("Plugin-Highlight_Align_Center"), DesignKit.i18nText("Plugin-Highlight_Align_Center"),
Inter.getLocText("Plugin-Highlight_Align_Right")} DesignKit.i18nText("Plugin-Highlight_Align_Right")}
); );
add(alignComboBox); add(alignComboBox);
this.scopeComboBox = new UIComboBox(new String[]{ this.scopeComboBox = new UIComboBox(new String[]{
Inter.getLocText("Plugin-Highlight_Align_Current_Cell"), DesignKit.i18nText("Plugin-Highlight_Align_Current_Cell"),
Inter.getLocText("Plugin-Highlight_Align_Current_Row"), DesignKit.i18nText("Plugin-Highlight_Align_Current_Row"),
Inter.getLocText("Plugin-Highlight_Align_Current_Column")}); DesignKit.i18nText("Plugin-Highlight_Align_Current_Column")});
this.add(this.scopeComboBox); this.add(this.scopeComboBox);
} }
@Override @Override
public String nameForPopupMenuItem() { public String nameForPopupMenuItem() {
return Inter.getLocText("Plugin-Highlight_Align"); return DesignKit.i18nText("Plugin-Highlight_Align");
} }
@Override @Override

Loading…
Cancel
Save