|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package com.fr.van.chart.designer.component; |
|
|
|
|
|
|
|
|
|
import com.fr.concurrent.NamedThreadFactory; |
|
|
|
|
import com.fr.design.ui.ModernUIPane; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.plugin.chart.base.AttrTooltipRichText; |
|
|
|
|
import com.fr.plugin.chart.type.TextAlign; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
@ -10,6 +12,8 @@ import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter;
|
|
|
|
|
import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; |
|
|
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.concurrent.ExecutorService; |
|
|
|
|
import java.util.concurrent.Executors; |
|
|
|
|
|
|
|
|
|
public class VanChartRichEditorPane { |
|
|
|
|
|
|
|
|
@ -21,6 +25,25 @@ public class VanChartRichEditorPane {
|
|
|
|
|
private static ModernUIPane<RichEditorModel> richEditorPane; |
|
|
|
|
private static Browser browser; |
|
|
|
|
|
|
|
|
|
public static void initRichEditorPane() { |
|
|
|
|
ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor(new NamedThreadFactory("VanChartRichEditor")); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
singleThreadExecutor.submit(new Runnable() { |
|
|
|
|
@Override |
|
|
|
|
public void run() { |
|
|
|
|
try { |
|
|
|
|
richEditorPane = initPane(new RichEditorModel()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} finally { |
|
|
|
|
singleThreadExecutor.shutdown(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static ModernUIPane<RichEditorModel> createRichEditorPane(AttrTooltipRichText richEditor) { |
|
|
|
|
RichEditorModel model = getRichEditorModel(richEditor); |
|
|
|
|
|
|
|
|
@ -88,11 +111,14 @@ public class VanChartRichEditorPane {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static class RichEditorModel { |
|
|
|
|
private String content; |
|
|
|
|
private boolean auto; |
|
|
|
|
private String params; |
|
|
|
|
private String initParams; |
|
|
|
|
private String align; |
|
|
|
|
private String content = StringUtils.EMPTY; |
|
|
|
|
private boolean auto = true; |
|
|
|
|
private String params = StringUtils.EMPTY; |
|
|
|
|
private String initParams = StringUtils.EMPTY; |
|
|
|
|
private String align = TextAlign.LEFT.getAlign(); |
|
|
|
|
|
|
|
|
|
public RichEditorModel() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public RichEditorModel(String content, boolean auto, String params, String initParams, String align) { |
|
|
|
|
this.content = content; |
|
|
|
|