|
|
@ -14,7 +14,11 @@ import com.fr.design.mainframe.App; |
|
|
|
import com.fr.design.mainframe.DesignerFrame; |
|
|
|
import com.fr.design.mainframe.DesignerFrame; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.Inter; |
|
|
|
import com.fr.general.ModuleContext; |
|
|
|
import com.fr.general.ModuleContext; |
|
|
|
import com.fr.js.*; |
|
|
|
import com.fr.js.EmailJavaScript; |
|
|
|
|
|
|
|
import com.fr.js.JavaScriptImpl; |
|
|
|
|
|
|
|
import com.fr.js.ParameterJavaScript; |
|
|
|
|
|
|
|
import com.fr.js.ReportletHyperlink; |
|
|
|
|
|
|
|
import com.fr.js.WebHyperlink; |
|
|
|
import com.fr.module.TopModule; |
|
|
|
import com.fr.module.TopModule; |
|
|
|
import com.fr.stable.bridge.StableFactory; |
|
|
|
import com.fr.stable.bridge.StableFactory; |
|
|
|
import com.fr.stable.plugin.ExtraDesignClassManagerProvider; |
|
|
|
import com.fr.stable.plugin.ExtraDesignClassManagerProvider; |
|
|
@ -32,65 +36,67 @@ import java.util.Set; |
|
|
|
* 所有设计器模块的父类 |
|
|
|
* 所有设计器模块的父类 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract class DesignModule extends TopModule { |
|
|
|
public abstract class DesignModule extends TopModule { |
|
|
|
public static final String LOCALE_FILE_PATH = "com/fr/design/locale/designer"; |
|
|
|
public static final String LOCALE_FILE_PATH = "com/fr/design/locale/designer"; |
|
|
|
public void start() { |
|
|
|
|
|
|
|
super.start(); |
|
|
|
public void start() { |
|
|
|
App<?>[] apps = apps4TemplateOpener(); |
|
|
|
super.start(); |
|
|
|
for (App<?> app : apps) { |
|
|
|
App<?>[] apps = apps4TemplateOpener(); |
|
|
|
DesignerFrame.registApp(app); |
|
|
|
for (App<?> app : apps) { |
|
|
|
} |
|
|
|
DesignerFrame.registApp(app); |
|
|
|
|
|
|
|
} |
|
|
|
ModuleContext.registerStartedModule(DesignModule.class.getName(), this); |
|
|
|
ModuleContext.registerStartedModule(DesignModule.class.getName(), this); |
|
|
|
StableFactory.registerMarkedClass(ExtraDesignClassManagerProvider.XML_TAG, ExtraDesignClassManager.class); |
|
|
|
StableFactory.registerMarkedClass(ExtraDesignClassManagerProvider.XML_TAG, ExtraDesignClassManager.class); |
|
|
|
ActionFactory.registerCellInsertActionClass(actionsForInsertCellElement()); |
|
|
|
ActionFactory.registerCellInsertActionClass(actionsForInsertCellElement()); |
|
|
|
ActionFactory.registerFloatInsertActionClass(actionsForInsertFloatElement()); |
|
|
|
ActionFactory.registerFloatInsertActionClass(actionsForInsertFloatElement()); |
|
|
|
DesignModuleFactory.registerCreators4Hyperlink(hyperlinkTypes()); |
|
|
|
DesignModuleFactory.registerCreators4Hyperlink(hyperlinkTypes()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isStarted() { |
|
|
|
public boolean isStarted() { |
|
|
|
return ModuleContext.isModuleStarted(DesignModule.class.getName()); |
|
|
|
return ModuleContext.isModuleStarted(DesignModule.class.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回设计器能打开的模板类型的一个数组列表 |
|
|
|
* 返回设计器能打开的模板类型的一个数组列表 |
|
|
|
* |
|
|
|
* |
|
|
|
* @return 可以打开的模板类型的数组 |
|
|
|
* @return 可以打开的模板类型的数组 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public abstract App<?>[] apps4TemplateOpener(); |
|
|
|
public abstract App<?>[] apps4TemplateOpener(); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 国际化文件路径 |
|
|
|
* 国际化文件路径 |
|
|
|
* @return 国际化文件路径 |
|
|
|
* |
|
|
|
*/ |
|
|
|
* @return 国际化文件路径 |
|
|
|
public String[] getLocaleFile() { |
|
|
|
*/ |
|
|
|
return new String[]{LOCALE_FILE_PATH}; |
|
|
|
public String[] getLocaleFile() { |
|
|
|
} |
|
|
|
return new String[]{LOCALE_FILE_PATH}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Class<?>[] actionsForInsertCellElement() { |
|
|
|
public Class<?>[] actionsForInsertCellElement() { |
|
|
|
List<Class<?>> classes = new ArrayList<>(); |
|
|
|
List<Class<?>> classes = new ArrayList<>(); |
|
|
|
Set<ElementUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); |
|
|
|
Set<ElementUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); |
|
|
|
for (ElementUIProvider provider : providers) { |
|
|
|
for (ElementUIProvider provider : providers) { |
|
|
|
classes.add(provider.actionForInsertCellElement()); |
|
|
|
classes.add(provider.actionForInsertCellElement()); |
|
|
|
} |
|
|
|
} |
|
|
|
return classes.toArray(new Class<?>[classes.size()]); |
|
|
|
return classes.toArray(new Class<?>[classes.size()]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Class<?>[] actionsForInsertFloatElement() { |
|
|
|
public Class<?>[] actionsForInsertFloatElement() { |
|
|
|
List<Class<?>> classes = new ArrayList<>(); |
|
|
|
List<Class<?>> classes = new ArrayList<>(); |
|
|
|
Set<ElementUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); |
|
|
|
Set<ElementUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING); |
|
|
|
for (ElementUIProvider provider : providers) { |
|
|
|
for (ElementUIProvider provider : providers) { |
|
|
|
classes.add(provider.actionForInsertFloatElement()); |
|
|
|
classes.add(provider.actionForInsertFloatElement()); |
|
|
|
} |
|
|
|
} |
|
|
|
return classes.toArray(new Class<?>[classes.size()]); |
|
|
|
return classes.toArray(new Class<?>[classes.size()]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public NameableCreator[] hyperlinkTypes() { |
|
|
|
public NameableCreator[] hyperlinkTypes() { |
|
|
|
return new NameableCreator[]{ |
|
|
|
return new NameableCreator[]{ |
|
|
|
new NameObjectCreator(Inter.getLocText("FR-Hyperlink_Reportlet"), ReportletHyperlink.class, ReportletHyperlinkPane.CHART_NO_RENAME.class), |
|
|
|
new NameObjectCreator(Inter.getLocText("FR-Hyperlink_Reportlet"), ReportletHyperlink.class, ReportletHyperlinkPane.chartNoRename.class), |
|
|
|
new NameObjectCreator(Inter.getLocText("FR-Designer_Email"), EmailJavaScript.class, EmailPane.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("Hyperlink-Web_link"), WebHyperlink.class, WebHyperlinkPane.chartNoRename.class), |
|
|
|
new NameObjectCreator(Inter.getLocText("JavaScript-Dynamic_Parameters"), ParameterJavaScript.class, ParameterJavaScriptPane.CHART_NO_RENAME.class), |
|
|
|
new NameObjectCreator(Inter.getLocText("JavaScript-Dynamic_Parameters"), ParameterJavaScript.class, ParameterJavaScriptPane.chartNoRename.class), |
|
|
|
new NameObjectCreator("JavaScript", JavaScriptImpl.class, JavaScriptImplPane.CHART_NO_RENAME.class) |
|
|
|
new NameObjectCreator("FR-Designer_JavaScript", JavaScriptImpl.class, JavaScriptImplPane.chartNoRename.class) |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |