|
|
@ -1,31 +1,19 @@ |
|
|
|
package com.fr.design.module; |
|
|
|
package com.fr.design.module; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
import com.fr.base.*; |
|
|
|
import com.fr.base.ConfigManager; |
|
|
|
|
|
|
|
import com.fr.base.FRContext; |
|
|
|
|
|
|
|
import com.fr.base.Formula; |
|
|
|
|
|
|
|
import com.fr.base.MultiFieldParameter; |
|
|
|
|
|
|
|
import com.fr.base.Style; |
|
|
|
|
|
|
|
import com.fr.base.TempNameStyle; |
|
|
|
|
|
|
|
import com.fr.base.io.XMLEncryptUtils; |
|
|
|
import com.fr.base.io.XMLEncryptUtils; |
|
|
|
import com.fr.base.process.ProcessOperator; |
|
|
|
import com.fr.base.process.ProcessOperator; |
|
|
|
import com.fr.base.remote.RemoteDeziConstants; |
|
|
|
import com.fr.base.remote.RemoteDeziConstants; |
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
import com.fr.design.actions.core.ActionUtils; |
|
|
|
import com.fr.design.actions.core.ActionFactory; |
|
|
|
import com.fr.design.actions.insert.cell.BiasCellAction; |
|
|
|
import com.fr.design.actions.insert.cell.*; |
|
|
|
import com.fr.design.actions.insert.cell.ChartCellAction; |
|
|
|
|
|
|
|
import com.fr.design.actions.insert.cell.DSColumnCellAction; |
|
|
|
|
|
|
|
import com.fr.design.actions.insert.cell.FormulaCellAction; |
|
|
|
|
|
|
|
import com.fr.design.actions.insert.cell.GeneralCellAction; |
|
|
|
|
|
|
|
import com.fr.design.actions.insert.cell.ImageCellAction; |
|
|
|
|
|
|
|
import com.fr.design.actions.insert.cell.RichTextCellAction; |
|
|
|
|
|
|
|
import com.fr.design.actions.insert.cell.SubReportCellAction; |
|
|
|
|
|
|
|
import com.fr.design.actions.insert.flot.ChartFloatAction; |
|
|
|
import com.fr.design.actions.insert.flot.ChartFloatAction; |
|
|
|
import com.fr.design.actions.insert.flot.FormulaFloatAction; |
|
|
|
import com.fr.design.actions.insert.flot.FormulaFloatAction; |
|
|
|
import com.fr.design.actions.insert.flot.ImageFloatAction; |
|
|
|
import com.fr.design.actions.insert.flot.ImageFloatAction; |
|
|
|
import com.fr.design.actions.insert.flot.TextBoxFloatAction; |
|
|
|
import com.fr.design.actions.insert.flot.TextBoxFloatAction; |
|
|
|
import com.fr.design.actions.server.StyleListAction; |
|
|
|
import com.fr.design.actions.server.StyleListAction; |
|
|
|
|
|
|
|
import com.fr.design.fun.ElementUIProvider; |
|
|
|
import com.fr.design.gui.controlpane.NameObjectCreator; |
|
|
|
import com.fr.design.gui.controlpane.NameObjectCreator; |
|
|
|
import com.fr.design.gui.controlpane.NameableCreator; |
|
|
|
import com.fr.design.gui.controlpane.NameableCreator; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
@ -36,11 +24,7 @@ import com.fr.design.javascript.EmailPane; |
|
|
|
import com.fr.design.javascript.JavaScriptImplPane; |
|
|
|
import com.fr.design.javascript.JavaScriptImplPane; |
|
|
|
import com.fr.design.javascript.ParameterJavaScriptPane; |
|
|
|
import com.fr.design.javascript.ParameterJavaScriptPane; |
|
|
|
import com.fr.design.javascript.ProcessTransitionAdapter; |
|
|
|
import com.fr.design.javascript.ProcessTransitionAdapter; |
|
|
|
import com.fr.design.mainframe.App; |
|
|
|
import com.fr.design.mainframe.*; |
|
|
|
import com.fr.design.mainframe.DecodeDialog; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.InformationCollector; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.JWorkBook; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.bbs.BBSGuestPane; |
|
|
|
import com.fr.design.mainframe.bbs.BBSGuestPane; |
|
|
|
import com.fr.design.mainframe.form.FormECCompositeProvider; |
|
|
|
import com.fr.design.mainframe.form.FormECCompositeProvider; |
|
|
|
import com.fr.design.mainframe.form.FormECDesignerProvider; |
|
|
|
import com.fr.design.mainframe.form.FormECDesignerProvider; |
|
|
@ -50,28 +34,15 @@ import com.fr.design.mainframe.loghandler.DesignerLogImpl; |
|
|
|
import com.fr.design.parameter.WorkBookParameterReader; |
|
|
|
import com.fr.design.parameter.WorkBookParameterReader; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.file.FILE; |
|
|
|
import com.fr.file.FILE; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.*; |
|
|
|
import com.fr.general.FRLogger; |
|
|
|
|
|
|
|
import com.fr.general.IOUtils; |
|
|
|
|
|
|
|
import com.fr.general.Inter; |
|
|
|
|
|
|
|
import com.fr.general.ModuleContext; |
|
|
|
|
|
|
|
import com.fr.general.xml.GeneralXMLTools; |
|
|
|
import com.fr.general.xml.GeneralXMLTools; |
|
|
|
import com.fr.io.importer.Excel2007ReportImporter; |
|
|
|
import com.fr.io.importer.Excel2007ReportImporter; |
|
|
|
import com.fr.io.importer.ExcelReportImporter; |
|
|
|
import com.fr.io.importer.ExcelReportImporter; |
|
|
|
import com.fr.js.EmailJavaScript; |
|
|
|
import com.fr.js.*; |
|
|
|
import com.fr.js.JavaScriptImpl; |
|
|
|
|
|
|
|
import com.fr.js.ParameterJavaScript; |
|
|
|
|
|
|
|
import com.fr.js.ReportletHyperlink; |
|
|
|
|
|
|
|
import com.fr.js.WebHyperlink; |
|
|
|
|
|
|
|
import com.fr.main.impl.WorkBook; |
|
|
|
import com.fr.main.impl.WorkBook; |
|
|
|
import com.fr.plugin.ExtraClassManager; |
|
|
|
import com.fr.plugin.ExtraClassManager; |
|
|
|
import com.fr.quickeditor.ChartQuickEditor; |
|
|
|
import com.fr.quickeditor.ChartQuickEditor; |
|
|
|
import com.fr.quickeditor.cellquick.CellBiasTextPainterEditor; |
|
|
|
import com.fr.quickeditor.cellquick.*; |
|
|
|
import com.fr.quickeditor.cellquick.CellDScolumnEditor; |
|
|
|
|
|
|
|
import com.fr.quickeditor.cellquick.CellImageQuickEditor; |
|
|
|
|
|
|
|
import com.fr.quickeditor.cellquick.CellRichTextEditor; |
|
|
|
|
|
|
|
import com.fr.quickeditor.cellquick.CellStringQuickEditor; |
|
|
|
|
|
|
|
import com.fr.quickeditor.cellquick.CellSubReportEditor; |
|
|
|
|
|
|
|
import com.fr.quickeditor.floatquick.FloatImageQuickEditor; |
|
|
|
import com.fr.quickeditor.floatquick.FloatImageQuickEditor; |
|
|
|
import com.fr.quickeditor.floatquick.FloatStringQuickEditor; |
|
|
|
import com.fr.quickeditor.floatquick.FloatStringQuickEditor; |
|
|
|
import com.fr.report.cell.CellElementValueConverter; |
|
|
|
import com.fr.report.cell.CellElementValueConverter; |
|
|
@ -79,6 +50,7 @@ import com.fr.report.cell.cellattr.core.RichText; |
|
|
|
import com.fr.report.cell.cellattr.core.SubReport; |
|
|
|
import com.fr.report.cell.cellattr.core.SubReport; |
|
|
|
import com.fr.report.cell.cellattr.core.group.DSColumn; |
|
|
|
import com.fr.report.cell.cellattr.core.group.DSColumn; |
|
|
|
import com.fr.report.cell.painter.BiasTextPainter; |
|
|
|
import com.fr.report.cell.painter.BiasTextPainter; |
|
|
|
|
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.ParameterProvider; |
|
|
|
import com.fr.stable.ParameterProvider; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.bridge.StableFactory; |
|
|
|
import com.fr.stable.bridge.StableFactory; |
|
|
@ -113,9 +85,7 @@ public class DesignerModule extends DesignModule { |
|
|
|
GeneralXMLTools.Object_Tokenizer = startXMLReadObjectTokenizer(); |
|
|
|
GeneralXMLTools.Object_Tokenizer = startXMLReadObjectTokenizer(); |
|
|
|
GeneralXMLTools.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); |
|
|
|
GeneralXMLTools.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); |
|
|
|
addAdapterForPlate(); |
|
|
|
addAdapterForPlate(); |
|
|
|
generateInsertActionClasses(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
registerHyperlink(); |
|
|
|
|
|
|
|
registerCellEditor(); |
|
|
|
registerCellEditor(); |
|
|
|
registerFloatEditor(); |
|
|
|
registerFloatEditor(); |
|
|
|
registerData4Form(); |
|
|
|
registerData4Form(); |
|
|
@ -136,18 +106,21 @@ public class DesignerModule extends DesignModule { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
private void registerCellEditor() { |
|
|
|
private void registerCellEditor() { |
|
|
|
ActionUtils.registerCellEditor(String.class, CellStringQuickEditor.getInstance()); |
|
|
|
ActionFactory.registerCellEditor(String.class, CellStringQuickEditor.getInstance()); |
|
|
|
ActionUtils.registerCellEditor(Number.class, CellStringQuickEditor.getInstance()); |
|
|
|
ActionFactory.registerCellEditor(Number.class, CellStringQuickEditor.getInstance()); |
|
|
|
ActionUtils.registerCellEditor(Formula.class, CellStringQuickEditor.getInstance()); |
|
|
|
ActionFactory.registerCellEditor(Formula.class, CellStringQuickEditor.getInstance()); |
|
|
|
ActionUtils.registerCellEditor(SubReport.class, CellSubReportEditor.getInstance()); |
|
|
|
ActionFactory.registerCellEditor(SubReport.class, CellSubReportEditor.getInstance()); |
|
|
|
ActionUtils.registerCellEditor(RichText.class, CellRichTextEditor.getInstance()); |
|
|
|
ActionFactory.registerCellEditor(RichText.class, CellRichTextEditor.getInstance()); |
|
|
|
ActionUtils.registerCellEditor(DSColumn.class, CellDScolumnEditor.getInstance()); |
|
|
|
ActionFactory.registerCellEditor(DSColumn.class, CellDScolumnEditor.getInstance()); |
|
|
|
ActionUtils.registerCellEditor(Image.class, CellImageQuickEditor.getInstance()); |
|
|
|
ActionFactory.registerCellEditor(Image.class, CellImageQuickEditor.getInstance()); |
|
|
|
ActionUtils.registerCellEditor(BiasTextPainter.class, new CellBiasTextPainterEditor()); |
|
|
|
ActionFactory.registerCellEditor(BiasTextPainter.class, new CellBiasTextPainterEditor()); |
|
|
|
ActionUtils.registerCellEditor(BufferedImage.class, CellImageQuickEditor.getInstance()); |
|
|
|
ActionFactory.registerCellEditor(BufferedImage.class, CellImageQuickEditor.getInstance()); |
|
|
|
|
|
|
|
|
|
|
|
if (ModuleContext.isModuleStarted(Module.CHART_MODULE)) { |
|
|
|
ActionFactory.registerChartCellEditorInEditor(ChartQuickEditor.getInstance()); |
|
|
|
ActionUtils.registerChartCellEditorInEditor(ChartQuickEditor.getInstance()); |
|
|
|
|
|
|
|
|
|
|
|
ElementUIProvider[] providers = ExtraDesignClassManager.getInstance().getElementUIProviders(); |
|
|
|
|
|
|
|
for (ElementUIProvider provider : providers) { |
|
|
|
|
|
|
|
ActionFactory.registerCellEditor(provider.targetObjectClass(), provider.quickEditor()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -162,15 +135,13 @@ public class DesignerModule extends DesignModule { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void registerFloatEditor() { |
|
|
|
private void registerFloatEditor() { |
|
|
|
FloatStringQuickEditor floatStringQuickEditor = new FloatStringQuickEditor(); |
|
|
|
FloatStringQuickEditor floatStringQuickEditor = new FloatStringQuickEditor(); |
|
|
|
ActionUtils.registerFloatEditor(String.class, floatStringQuickEditor); |
|
|
|
ActionFactory.registerFloatEditor(String.class, floatStringQuickEditor); |
|
|
|
ActionUtils.registerFloatEditor(Formula.class, floatStringQuickEditor); |
|
|
|
ActionFactory.registerFloatEditor(Formula.class, floatStringQuickEditor); |
|
|
|
|
|
|
|
|
|
|
|
FloatImageQuickEditor floatImageQuickEditor = new FloatImageQuickEditor(); |
|
|
|
FloatImageQuickEditor floatImageQuickEditor = new FloatImageQuickEditor(); |
|
|
|
ActionUtils.registerFloatEditor(Image.class, floatImageQuickEditor); |
|
|
|
ActionFactory.registerFloatEditor(Image.class, floatImageQuickEditor); |
|
|
|
ActionUtils.registerFloatEditor(BufferedImage.class, floatImageQuickEditor); |
|
|
|
ActionFactory.registerFloatEditor(BufferedImage.class, floatImageQuickEditor); |
|
|
|
if (ModuleContext.isModuleStarted(Module.CHART_MODULE)) { |
|
|
|
ActionFactory.registerChartFloatEditorInEditor(ChartQuickEditor.getInstance()); |
|
|
|
ActionUtils.registerChartFloatEditorInEditor(ChartQuickEditor.getInstance()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -268,6 +239,7 @@ public class DesignerModule extends DesignModule { |
|
|
|
public String[] defaultExtentions() { |
|
|
|
public String[] defaultExtentions() { |
|
|
|
return new String[]{"xlsx"}; |
|
|
|
return new String[]{"xlsx"}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public WorkBook asIOFile(FILE tplFile) { |
|
|
|
public WorkBook asIOFile(FILE tplFile) { |
|
|
|
WorkBook workbook = null; |
|
|
|
WorkBook workbook = null; |
|
|
@ -287,6 +259,7 @@ public class DesignerModule extends DesignModule { |
|
|
|
public String[] defaultExtentions() { |
|
|
|
public String[] defaultExtentions() { |
|
|
|
return new String[]{"xls"}; |
|
|
|
return new String[]{"xls"}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public WorkBook asIOFile(FILE tplFile) { |
|
|
|
public WorkBook asIOFile(FILE tplFile) { |
|
|
|
WorkBook workbook = null; |
|
|
|
WorkBook workbook = null; |
|
|
@ -305,6 +278,7 @@ public class DesignerModule extends DesignModule { |
|
|
|
public String[] defaultExtentions() { |
|
|
|
public String[] defaultExtentions() { |
|
|
|
return new String[]{"cpt"}; |
|
|
|
return new String[]{"cpt"}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public WorkBook asIOFile(FILE file) { |
|
|
|
public WorkBook asIOFile(FILE file) { |
|
|
|
if (XMLEncryptUtils.isCptEncoded() && |
|
|
|
if (XMLEncryptUtils.isCptEncoded() && |
|
|
|
!XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) { |
|
|
|
!XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) { |
|
|
@ -393,9 +367,8 @@ public class DesignerModule extends DesignModule { |
|
|
|
jd.setVisible(true); |
|
|
|
jd.setVisible(true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void generateInsertActionClasses() { |
|
|
|
public Class<?>[] actionsForInsertCellElement() { |
|
|
|
if (ModuleContext.isModuleStarted(CHART_MODULE)) { |
|
|
|
return (Class<?>[])ArrayUtils.addAll(new Class<?>[]{ |
|
|
|
ActionUtils.registerCellInsertActionClass(new Class[]{ |
|
|
|
|
|
|
|
DSColumnCellAction.class, |
|
|
|
DSColumnCellAction.class, |
|
|
|
GeneralCellAction.class, |
|
|
|
GeneralCellAction.class, |
|
|
|
RichTextCellAction.class, |
|
|
|
RichTextCellAction.class, |
|
|
@ -404,49 +377,18 @@ public class DesignerModule extends DesignModule { |
|
|
|
ImageCellAction.class, |
|
|
|
ImageCellAction.class, |
|
|
|
BiasCellAction.class, |
|
|
|
BiasCellAction.class, |
|
|
|
SubReportCellAction.class |
|
|
|
SubReportCellAction.class |
|
|
|
}); |
|
|
|
}, super.actionsForInsertCellElement()); |
|
|
|
ActionUtils.registerFloatInsertActionClass(new Class[]{ |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Class<?>[] actionsForInsertFloatElement() { |
|
|
|
|
|
|
|
return (Class<?>[]) ArrayUtils.addAll(new Class<?>[]{ |
|
|
|
TextBoxFloatAction.class, |
|
|
|
TextBoxFloatAction.class, |
|
|
|
FormulaFloatAction.class, |
|
|
|
FormulaFloatAction.class, |
|
|
|
ChartFloatAction.class, |
|
|
|
ChartFloatAction.class, |
|
|
|
ImageFloatAction.class |
|
|
|
ImageFloatAction.class |
|
|
|
}); |
|
|
|
}, super.actionsForInsertFloatElement()); |
|
|
|
} else { |
|
|
|
|
|
|
|
ActionUtils.registerCellInsertActionClass(new Class[]{ |
|
|
|
|
|
|
|
DSColumnCellAction.class, |
|
|
|
|
|
|
|
GeneralCellAction.class, |
|
|
|
|
|
|
|
FormulaCellAction.class, |
|
|
|
|
|
|
|
ImageCellAction.class, |
|
|
|
|
|
|
|
BiasCellAction.class, |
|
|
|
|
|
|
|
SubReportCellAction.class |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
ActionUtils.registerFloatInsertActionClass(new Class[]{ |
|
|
|
|
|
|
|
TextBoxFloatAction.class, |
|
|
|
|
|
|
|
FormulaFloatAction.class, |
|
|
|
|
|
|
|
ImageFloatAction.class |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void registerHyperlink() { |
|
|
|
|
|
|
|
if (ModuleContext.isModuleStarted(Module.CHART_MODULE)) { |
|
|
|
|
|
|
|
DesignModuleFactory.registerCreators4Hyperlink(new NameableCreator[]{ |
|
|
|
|
|
|
|
new NameObjectCreator(Inter.getLocText("FR-Hyperlink_Reportlet"), ReportletHyperlink.class, ReportletHyperlinkPane.CHART_NO_RENAME.class), |
|
|
|
|
|
|
|
new NameObjectCreator(Inter.getLocText("FR-Designer_Email"), EmailJavaScript.class, EmailPane.class), |
|
|
|
|
|
|
|
new NameObjectCreator(Inter.getLocText("Hyperlink-Web_link"), WebHyperlink.class, WebHyperlinkPane.CHART_NO_RENAME.class), |
|
|
|
|
|
|
|
new NameObjectCreator(Inter.getLocText("JavaScript-Dynamic_Parameters"), ParameterJavaScript.class, ParameterJavaScriptPane.CHART_NO_RENAME.class), |
|
|
|
|
|
|
|
new NameObjectCreator("JavaScript", JavaScriptImpl.class, JavaScriptImplPane.CHART_NO_RENAME.class) |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
DesignModuleFactory.registerCreators4Hyperlink(new NameableCreator[]{ |
|
|
|
|
|
|
|
new NameObjectCreator(Inter.getLocText("FR-Hyperlink_Reportlet"), ReportletHyperlink.class, ReportletHyperlinkPane.class), |
|
|
|
|
|
|
|
new NameObjectCreator(Inter.getLocText("FR-Designer_Email"), EmailJavaScript.class, EmailPane.class), |
|
|
|
|
|
|
|
new NameObjectCreator(Inter.getLocText("Hyperlink-Web_link"), WebHyperlink.class, WebHyperlinkPane.class), |
|
|
|
|
|
|
|
new NameObjectCreator(Inter.getLocText("JavaScript-Dynamic_Parameters"), ParameterJavaScript.class, ParameterJavaScriptPane.class), |
|
|
|
|
|
|
|
new NameObjectCreator("JavaScript", JavaScriptImpl.class, JavaScriptImplPane.class) |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void registerData4Form() { |
|
|
|
private void registerData4Form() { |
|
|
|
StableFactory.registerMarkedClass(FormECDesignerProvider.XML_TAG, FormElementCaseDesigner.class); |
|
|
|
StableFactory.registerMarkedClass(FormECDesignerProvider.XML_TAG, FormElementCaseDesigner.class); |
|
|
|