richie
9 years ago
33 changed files with 757 additions and 645 deletions
@ -0,0 +1,216 @@
|
||||
package com.fr.design.actions.core; |
||||
|
||||
import com.fr.base.FRContext; |
||||
import com.fr.base.Utils; |
||||
import com.fr.design.actions.UpdateAction; |
||||
import com.fr.design.file.HistoryTemplateListPane; |
||||
import com.fr.design.mainframe.JTemplate; |
||||
import com.fr.design.selection.QuickEditor; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.event.KeyEvent; |
||||
import java.lang.reflect.Constructor; |
||||
import java.util.*; |
||||
|
||||
/** |
||||
* 插入单元格元素和插入悬浮元素的一些集合方法 |
||||
*/ |
||||
public class ActionFactory { |
||||
private static LinkedHashSet<Class<?>> actionClasses = new LinkedHashSet<>(); |
||||
private static LinkedHashSet<Class<?>> floatActionClasses = new LinkedHashSet<>(); |
||||
|
||||
private ActionFactory() { |
||||
} |
||||
|
||||
private static Map<Class, QuickEditor> floatEditor = new HashMap<Class, QuickEditor>(); |
||||
|
||||
private static Class chartCollectionClass = null; |
||||
|
||||
private static Map<Class, QuickEditor> cellEditor = new HashMap<Class, QuickEditor>(); |
||||
|
||||
private static UpdateAction chartPreStyleAction = null; |
||||
|
||||
/** |
||||
* 待说明 |
||||
* |
||||
* @param clazz 待说明 |
||||
* @param editor 待说明 |
||||
*/ |
||||
public static void registerCellEditor(Class clazz, QuickEditor editor) { |
||||
cellEditor.put(clazz, editor); |
||||
} |
||||
|
||||
/** |
||||
* 待说明 |
||||
* |
||||
* @param clazz 待说明 |
||||
* @param editor 待说明 |
||||
*/ |
||||
public static void registerFloatEditor(Class clazz, QuickEditor editor) { |
||||
floatEditor.put(clazz, editor); |
||||
} |
||||
|
||||
/** |
||||
* 注册图表的 预定义样式. |
||||
* |
||||
* @param action 注册的图表预定义样式action |
||||
*/ |
||||
public static void registerChartPreStyleAction(UpdateAction action) { |
||||
chartPreStyleAction = action; |
||||
} |
||||
|
||||
/** |
||||
* 返回 图表预定义样式Action |
||||
*/ |
||||
public static UpdateAction getChartPreStyleAction() { |
||||
return chartPreStyleAction; |
||||
} |
||||
|
||||
/** |
||||
* kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. |
||||
* |
||||
* @param clazz 待说明 |
||||
*/ |
||||
public static void registerChartCollection(Class clazz) { |
||||
chartCollectionClass = clazz; |
||||
} |
||||
|
||||
public static Class getChartCollectionClass() { |
||||
return chartCollectionClass; |
||||
} |
||||
|
||||
/** |
||||
* kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. |
||||
* |
||||
* @param editor 待说明 |
||||
*/ |
||||
public static void registerChartFloatEditorInEditor(QuickEditor editor) { |
||||
if (chartCollectionClass != null) { |
||||
floatEditor.put(chartCollectionClass, editor); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. |
||||
* |
||||
* @param editor 待说明 |
||||
*/ |
||||
public static void registerChartCellEditorInEditor(QuickEditor editor) { |
||||
if (chartCollectionClass != null) { |
||||
cellEditor.put(chartCollectionClass, editor); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 返回 悬浮元素选中的Editor |
||||
*/ |
||||
public static QuickEditor getFloatEditor(Class clazz) { |
||||
return floatEditor.get(clazz); |
||||
} |
||||
|
||||
public static QuickEditor getCellEditor(Class clazz) { |
||||
return cellEditor.get(clazz); |
||||
} |
||||
|
||||
/** |
||||
* peter:从Action来产生ToolTipText. |
||||
* |
||||
* @param action 动作 |
||||
* @return 字符 |
||||
*/ |
||||
public static String createButtonToolTipText(Action action) { |
||||
StringBuffer buttonToolTipTextBuf = new StringBuffer(); |
||||
|
||||
//peter:把中文后面的(U),alt 快捷键的括号去掉,这个方法是临时的做法.
|
||||
String actionName = (String) action.getValue(Action.NAME); |
||||
if (actionName.lastIndexOf("(") != -1) { |
||||
buttonToolTipTextBuf.append(actionName.substring(0, actionName.lastIndexOf("("))); |
||||
} else { |
||||
buttonToolTipTextBuf.append(actionName); |
||||
} |
||||
|
||||
//peter:产生快捷键的ToolTip.
|
||||
KeyStroke keyStroke = (KeyStroke) action.getValue(Action.ACCELERATOR_KEY); |
||||
if (keyStroke != null) { |
||||
buttonToolTipTextBuf.append(" ("); |
||||
buttonToolTipTextBuf.append(KeyEvent.getKeyModifiersText(keyStroke.getModifiers())); |
||||
buttonToolTipTextBuf.append('+'); |
||||
buttonToolTipTextBuf.append(KeyEvent.getKeyText(keyStroke.getKeyCode())); |
||||
buttonToolTipTextBuf.append(')'); |
||||
} |
||||
|
||||
return Utils.objectToString(buttonToolTipTextBuf); |
||||
} |
||||
|
||||
/** |
||||
* 纪录插入元素的种类 |
||||
* |
||||
* @param cls 类型数组 |
||||
*/ |
||||
public static void registerCellInsertActionClass(Class<?>[] cls) { |
||||
if (cls != null) { |
||||
Collections.addAll(actionClasses, cls); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 生成单元格插入相关的Action |
||||
* 表单中报表块编辑需要屏蔽掉"插入子报表" |
||||
* |
||||
* @param cls 构造函数参数类型 |
||||
* @param obj 构造函数参数值 |
||||
* @return 相关Action组成的一个数组 |
||||
*/ |
||||
public static UpdateAction[] createCellInsertAction(Class cls, Object obj) { |
||||
List<UpdateAction> actions = new ArrayList<>(); |
||||
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); |
||||
for (Class<?> clazz : actionClasses) { |
||||
if (clazz == null) { |
||||
continue; |
||||
} |
||||
if (jTemplate.acceptToolbarItem(clazz)) { |
||||
try { |
||||
Constructor<? extends UpdateAction> c = (Constructor<? extends UpdateAction>)clazz.getConstructor(cls); |
||||
actions.add(c.newInstance(obj)); |
||||
} catch (Exception e) { |
||||
FRContext.getLogger().error(e.getMessage(), e); |
||||
} |
||||
} |
||||
} |
||||
return actions.toArray(new UpdateAction[actions.size()]); |
||||
} |
||||
|
||||
/** |
||||
* 登记悬浮元素插入类型 |
||||
* |
||||
* @param cls 插入类型数组 |
||||
*/ |
||||
public static void registerFloatInsertActionClass(Class<?>[] cls) { |
||||
if (cls != null) { |
||||
Collections.addAll(floatActionClasses, cls); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 生成悬浮元素插入相关的Action |
||||
* |
||||
* @param cls 构造函数参数类型 |
||||
* @param obj 构造函数参数值 |
||||
* @return 相关Action组成的一个数组 |
||||
*/ |
||||
public static UpdateAction[] createFloatInsertAction(Class cls, Object obj) { |
||||
List<UpdateAction> actions = new ArrayList<>(); |
||||
for (Class<?> clazz : floatActionClasses) { |
||||
if (clazz == null) { |
||||
continue; |
||||
} |
||||
try { |
||||
Constructor<? extends UpdateAction> c = (Constructor<? extends UpdateAction>)clazz.getConstructor(cls); |
||||
actions.add(c.newInstance(obj)); |
||||
} catch (Exception e) { |
||||
FRContext.getLogger().error(e.getMessage(), e); |
||||
} |
||||
} |
||||
return actions.toArray(new UpdateAction[actions.size()]); |
||||
} |
||||
} |
@ -1,202 +0,0 @@
|
||||
package com.fr.design.actions.core; |
||||
|
||||
import java.awt.event.KeyEvent; |
||||
import java.lang.reflect.Constructor; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
import javax.swing.Action; |
||||
import javax.swing.KeyStroke; |
||||
|
||||
import com.fr.base.FRContext; |
||||
import com.fr.base.Utils; |
||||
import com.fr.design.actions.UpdateAction; |
||||
import com.fr.design.file.HistoryTemplateListPane; |
||||
import com.fr.design.mainframe.JTemplate; |
||||
import com.fr.design.selection.QuickEditor; |
||||
|
||||
/** |
||||
* 一些ActionUtils |
||||
*/ |
||||
public class ActionUtils { |
||||
private static Class<UpdateAction>[] actionClasses; |
||||
private static Class<UpdateAction>[] floatActionClasses; |
||||
|
||||
private ActionUtils() { |
||||
} |
||||
|
||||
private static Map<Class, QuickEditor> floatEditor = new HashMap<Class, QuickEditor>(); |
||||
|
||||
private static Class chartCollectionClass = null; |
||||
|
||||
private static Map<Class, QuickEditor> cellEditor = new HashMap<Class, QuickEditor>(); |
||||
|
||||
private static UpdateAction chartPreStyleAction = null; |
||||
|
||||
/** |
||||
* 待说明 |
||||
* @param clzz 待说明 |
||||
* @param editor 待说明 |
||||
*/ |
||||
public static void registerCellEditor(Class clzz, QuickEditor editor) { |
||||
cellEditor.put(clzz, editor); |
||||
} |
||||
|
||||
/** |
||||
* 待说明 |
||||
* @param clzz 待说明 |
||||
* @param editor 待说明 |
||||
*/ |
||||
public static void registerFloatEditor(Class clzz, QuickEditor editor) { |
||||
floatEditor.put(clzz, editor); |
||||
} |
||||
|
||||
/** |
||||
* 注册图表的 预定义样式. |
||||
* @param action 注册的图表预定义样式action |
||||
*/ |
||||
public static void registerChartPreStyleAction(UpdateAction action) { |
||||
chartPreStyleAction = action; |
||||
} |
||||
|
||||
/** |
||||
* 返回 图表预定义样式Action |
||||
*/ |
||||
public static UpdateAction getChartPreStyleAction() { |
||||
return chartPreStyleAction; |
||||
} |
||||
|
||||
/** |
||||
* kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. |
||||
* @param clzz 待说明 |
||||
*/ |
||||
public static void registerChartCollection(Class clzz) { |
||||
chartCollectionClass = clzz; |
||||
} |
||||
|
||||
public static Class getChartCollectionClass() { |
||||
return chartCollectionClass; |
||||
} |
||||
|
||||
/** |
||||
* kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. |
||||
* @param editor 待说明 |
||||
*/ |
||||
public static void registerChartFloatEditorInEditor(QuickEditor editor) { |
||||
if(chartCollectionClass != null) { |
||||
floatEditor.put(chartCollectionClass, editor); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. |
||||
* @param editor 待说明 |
||||
*/ |
||||
public static void registerChartCellEditorInEditor(QuickEditor editor) { |
||||
if(chartCollectionClass != null) { |
||||
cellEditor.put(chartCollectionClass, editor); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 返回 悬浮元素选中的Editor |
||||
*/ |
||||
public static QuickEditor getFloatEditor(Class clazz) { |
||||
return floatEditor.get(clazz); |
||||
} |
||||
|
||||
public static QuickEditor getCellEditor(Class clazz) { |
||||
return cellEditor.get(clazz); |
||||
} |
||||
|
||||
/** |
||||
* peter:从Action来产生ToolTipText. |
||||
* @param action 动作 |
||||
* @return 字符 |
||||
*/ |
||||
public static String createButtonToolTipText(Action action) { |
||||
StringBuffer buttonToolTipTextBuf = new StringBuffer(); |
||||
|
||||
//peter:把中文后面的(U),alt 快捷键的括号去掉,这个方法是临时的做法.
|
||||
String actionName = (String) action.getValue(Action.NAME); |
||||
if (actionName.lastIndexOf("(") != -1) { |
||||
buttonToolTipTextBuf.append(actionName.substring(0, actionName.lastIndexOf("("))); |
||||
} else { |
||||
buttonToolTipTextBuf.append(actionName); |
||||
} |
||||
|
||||
//peter:产生快捷键的ToolTip.
|
||||
KeyStroke keyStroke = (KeyStroke) action.getValue(Action.ACCELERATOR_KEY); |
||||
if (keyStroke != null) { |
||||
buttonToolTipTextBuf.append(" ("); |
||||
buttonToolTipTextBuf.append(KeyEvent.getKeyModifiersText(keyStroke.getModifiers())); |
||||
buttonToolTipTextBuf.append('+'); |
||||
buttonToolTipTextBuf.append(KeyEvent.getKeyText(keyStroke.getKeyCode())); |
||||
buttonToolTipTextBuf.append(')'); |
||||
} |
||||
|
||||
return Utils.objectToString(buttonToolTipTextBuf); |
||||
} |
||||
|
||||
/** |
||||
* 纪录插入元素的种类 |
||||
* |
||||
* @param cls 类型数组 |
||||
*/ |
||||
public static void registerCellInsertActionClass(Class<UpdateAction>[] cls) { |
||||
actionClasses = cls; |
||||
} |
||||
|
||||
/** |
||||
* 生成单元格插入相关的Action |
||||
* |
||||
* @param cls 构造函数参数类型 |
||||
* @param obj 构造函数参数值 |
||||
* @return 相关Action组成的一个数组 |
||||
*/ |
||||
public static UpdateAction[] createCellInsertAction(Class cls, Object obj) { |
||||
int length = 0; |
||||
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); |
||||
//表单中报表块编辑屏蔽掉 插入子报表
|
||||
length = jTemplate.isJWorkBook()? actionClasses.length : actionClasses.length - 1; |
||||
UpdateAction[] actions = new UpdateAction[length]; |
||||
for (int i = 0; i < length; i++) { |
||||
try { |
||||
Constructor<UpdateAction> c = actionClasses[i].getConstructor(cls); |
||||
actions[i] = c.newInstance(obj); |
||||
} catch (Exception e) { |
||||
FRContext.getLogger().error(e.getMessage(), e); |
||||
} |
||||
} |
||||
return actions; |
||||
} |
||||
|
||||
/** |
||||
* 登记悬浮元素插入类型 |
||||
* |
||||
* @param cls 插入类型数组 |
||||
*/ |
||||
public static void registerFloatInsertActionClass(Class<UpdateAction>[] cls) { |
||||
floatActionClasses = cls; |
||||
} |
||||
|
||||
/** |
||||
* 生成悬浮元素插入相关的Action |
||||
* |
||||
* @param cls 构造函数参数类型 |
||||
* @param obj 构造函数参数值 |
||||
* @return 相关Action组成的一个数组 |
||||
*/ |
||||
public static UpdateAction[] createFloatInsertAction(Class cls, Object obj) { |
||||
UpdateAction[] actions = new UpdateAction[floatActionClasses.length]; |
||||
for (int i = 0; i < floatActionClasses.length; i++) { |
||||
try { |
||||
Constructor<UpdateAction> c = floatActionClasses[i].getConstructor(cls); |
||||
actions[i] = c.newInstance(obj); |
||||
} catch (Exception e) { |
||||
FRContext.getLogger().error(e.getMessage(), e); |
||||
} |
||||
} |
||||
return actions; |
||||
} |
||||
} |
@ -0,0 +1,7 @@
|
||||
package com.fr.design.actions.core; |
||||
|
||||
/** |
||||
* Created by richie on 16/4/25. |
||||
*/ |
||||
public interface WorkBookSupportable { |
||||
} |
@ -0,0 +1,26 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.actions.UpdateAction; |
||||
import com.fr.design.selection.QuickEditor; |
||||
import com.fr.stable.fun.Level; |
||||
|
||||
|
||||
/** |
||||
* Created by richie on 16/4/25. |
||||
*/ |
||||
public interface ElementUIProvider extends Level { |
||||
|
||||
String MARK_STRING = "ElementUIProvider"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
Class<?> targetCellEditorClass(); |
||||
|
||||
Class<?> targetObjectClass(); |
||||
|
||||
QuickEditor<?> quickEditor(); |
||||
|
||||
Class<? extends UpdateAction> actionForInsertCellElement(); |
||||
|
||||
Class<? extends UpdateAction> actionForInsertFloatElement(); |
||||
} |
@ -0,0 +1,20 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.ElementUIProvider; |
||||
import com.fr.stable.fun.impl.AbstractProvider; |
||||
|
||||
/** |
||||
* Created by richie on 16/4/25. |
||||
*/ |
||||
public abstract class AbstractElementUIProvider extends AbstractProvider implements ElementUIProvider { |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return this.getClass().getName(); |
||||
} |
||||
} |
@ -1 +1 @@
|
||||
package com.fr.design.module;
import com.fr.chart.base.ChartInternationalNameContentBean;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.actions.core.ActionUtils;
import com.fr.design.chart.ChartDialog;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.ChartWidgetOption;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.mainframe.App;
import com.fr.design.mainframe.ChartAndWidgetPropertyPane;
import com.fr.design.mainframe.ChartPropertyPane;
import com.fr.form.ui.ChartEditor;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import com.fr.stable.plugin.PluginReadListener;
import javax.swing.*;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 7.0.3
* Date: 13-7-8
* Time: 上午9:13
*/
public class ChartDesignerModule extends DesignModule {
public void start() {
super.start();
dealBeforeRegister();
register();
registerFloatEditor();
}
protected void dealBeforeRegister(){
StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class);
}
private void register(){
DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup());
GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override
public void success() {
DesignModuleFactory.registerExtraWidgetOptions(options4Show());
}
});
DesignModuleFactory.registerChartEditorClass(ChartEditor.class);
DesignModuleFactory.registerChartComponentClass(ChartComponent.class);
DesignModuleFactory.registerChartDialogClass(ChartDialog.class);
DesignModuleFactory.registerChartAndWidgetPropertyPane(ChartAndWidgetPropertyPane.class);
DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class);
ActionUtils.registerChartPreStyleAction(new ChartPreStyleAction());
}
protected void registerFloatEditor() {
ActionUtils.registerChartCollection(ChartCollection.class);
}
/**
* 返回设计器能打开的模板类型的一个数组列表
*
* @return 可以打开的模板类型的数组
*/
public App<?>[] apps4TemplateOpener() {
return new App[0];
}
protected WidgetOption[] options4Show() {
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames();
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length];
for (int i = 0; i < typeName.length; i++) {
String plotID = typeName[i].getPlotID();
Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID);
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID);
Icon icon = IOUtils.readIcon(iconPath);
child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]);
}
return child;
}
public String getInterNationalName() {
return Inter.getLocText("FR-Chart-Design_ChartModule");
}
} |
||||
package com.fr.design.module;
import com.fr.chart.base.ChartInternationalNameContentBean;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.chart.ChartDialog;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.ChartWidgetOption;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.mainframe.App;
import com.fr.design.mainframe.ChartAndWidgetPropertyPane;
import com.fr.design.mainframe.ChartPropertyPane;
import com.fr.form.ui.ChartEditor;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import com.fr.stable.plugin.PluginReadListener;
import javax.swing.*;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 7.0.3
* Date: 13-7-8
* Time: 上午9:13
*/
public class ChartDesignerModule extends DesignModule {
public void start() {
super.start();
dealBeforeRegister();
register();
registerFloatEditor();
}
protected void dealBeforeRegister(){
StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class);
}
private void register(){
DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup());
GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override
public void success() {
DesignModuleFactory.registerExtraWidgetOptions(options4Show());
}
});
DesignModuleFactory.registerChartEditorClass(ChartEditor.class);
DesignModuleFactory.registerChartComponentClass(ChartComponent.class);
DesignModuleFactory.registerChartDialogClass(ChartDialog.class);
DesignModuleFactory.registerChartAndWidgetPropertyPane(ChartAndWidgetPropertyPane.class);
DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class);
ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction());
}
protected void registerFloatEditor() {
ActionFactory.registerChartCollection(ChartCollection.class);
}
/**
* 返回设计器能打开的模板类型的一个数组列表
*
* @return 可以打开的模板类型的数组
*/
public App<?>[] apps4TemplateOpener() {
return new App[0];
}
protected WidgetOption[] options4Show() {
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames();
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length];
for (int i = 0; i < typeName.length; i++) {
String plotID = typeName[i].getPlotID();
Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID);
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID);
Icon icon = IOUtils.readIcon(iconPath);
child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]);
}
return child;
}
public String getInterNationalName() {
return Inter.getLocText("FR-Chart-Design_ChartModule");
}
} |
Loading…
Reference in new issue