|
|
@ -1,11 +1,15 @@ |
|
|
|
package com.fr.design.actions.replace.action.content.formula.widget; |
|
|
|
package com.fr.design.actions.replace.action.content.formula.widget; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.data.Dictionary; |
|
|
|
|
|
|
|
import com.fr.data.impl.FormulaDictionary; |
|
|
|
import com.fr.data.impl.FormulaDisplayDictionary; |
|
|
|
import com.fr.data.impl.FormulaDisplayDictionary; |
|
|
|
|
|
|
|
import com.fr.data.impl.TableDataDictionary; |
|
|
|
import com.fr.data.impl.TreeNodeAttr; |
|
|
|
import com.fr.data.impl.TreeNodeAttr; |
|
|
|
import com.fr.data.impl.TreeNodeWrapper; |
|
|
|
import com.fr.data.impl.TreeNodeWrapper; |
|
|
|
import com.fr.design.actions.replace.info.FormulaInfo; |
|
|
|
import com.fr.design.actions.replace.info.FormulaInfo; |
|
|
|
import com.fr.design.actions.replace.info.base.ITContent; |
|
|
|
import com.fr.design.actions.replace.info.base.ITContent; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
|
|
|
import com.fr.form.ui.DictionaryContainer; |
|
|
|
import com.fr.form.ui.TreeEditor; |
|
|
|
import com.fr.form.ui.TreeEditor; |
|
|
|
import com.fr.form.ui.tree.LayerConfig; |
|
|
|
import com.fr.form.ui.tree.LayerConfig; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
@ -37,28 +41,38 @@ public class SearchTreeEditorFormulaAction extends AbstractSearchWidgetFormulaAc |
|
|
|
if (((TreeEditor) content.getReplaceObject()).getBuildModelConfig() != null) { |
|
|
|
if (((TreeEditor) content.getReplaceObject()).getBuildModelConfig() != null) { |
|
|
|
//LayerConfig[] 急速分层构建
|
|
|
|
//LayerConfig[] 急速分层构建
|
|
|
|
//TreeNodeWrapper 普通分层构建
|
|
|
|
//TreeNodeWrapper 普通分层构建
|
|
|
|
if (((TreeEditor) content.getReplaceObject()).getBuildModelConfig() instanceof LayerConfig[]) { |
|
|
|
//TableDataDictionary 自动构建
|
|
|
|
LayerConfig[] layerConfigs = (LayerConfig[]) ((TreeEditor) content.getReplaceObject()).getBuildModelConfig(); |
|
|
|
Object object = ((TreeEditor) content.getReplaceObject()).getBuildModelConfig(); |
|
|
|
|
|
|
|
if (object instanceof LayerConfig[]) { |
|
|
|
|
|
|
|
LayerConfig[] layerConfigs = (LayerConfig[]) object; |
|
|
|
dealWithLayerConfigs(layerConfigs, content, formulaInfos); |
|
|
|
dealWithLayerConfigs(layerConfigs, content, formulaInfos); |
|
|
|
} else if (((TreeEditor) content.getReplaceObject()).getBuildModelConfig() instanceof TreeNodeWrapper) { |
|
|
|
} else if (object instanceof TreeNodeWrapper) { |
|
|
|
TreeNodeWrapper wrapper = (TreeNodeWrapper) ((TreeEditor) content.getReplaceObject()).getBuildModelConfig(); |
|
|
|
TreeNodeWrapper wrapper = (TreeNodeWrapper) object; |
|
|
|
dealWithTreeNodeWrapper(wrapper, content, formulaInfos); |
|
|
|
dealWithTreeNodeWrapper(wrapper, content, formulaInfos); |
|
|
|
|
|
|
|
} else if (object instanceof TableDataDictionary) { |
|
|
|
|
|
|
|
TableDataDictionary tableDataDictionary = (TableDataDictionary) object; |
|
|
|
|
|
|
|
if (tableDataDictionary.getFormula() != null) { |
|
|
|
|
|
|
|
ITContent autoContent = ITContent.copy(content); |
|
|
|
|
|
|
|
autoContent.addOtherPos( |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Auto_Build"), |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Display_Value") |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
autoContent.setReplaceObject(tableDataDictionary.getFormula()); |
|
|
|
|
|
|
|
formulaInfos.add(new FormulaInfo(autoContent)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void dealWithTreeNodeWrapper(TreeNodeWrapper wrapper, ITContent content, List<FormulaInfo> formulaInfos) { |
|
|
|
private void dealWithTreeNodeWrapper(TreeNodeWrapper wrapper, ITContent content, List<FormulaInfo> formulaInfos) { |
|
|
|
for (TreeNodeAttr attr : wrapper.getTreeNodeAttrs()) { |
|
|
|
for (TreeNodeAttr attr : wrapper.getTreeNodeAttrs()) { |
|
|
|
if (((FormulaDisplayDictionary) attr.getDictionary()).getFormula() != null |
|
|
|
if (attr.getDictionary() != null) { |
|
|
|
&& StringUtils.isNotEmpty(((FormulaDisplayDictionary) attr.getDictionary()).getFormula().getContent())) { |
|
|
|
DictionaryType type = DictionaryType.match(attr.getDictionary().getClass().getSimpleName()); |
|
|
|
ITContent newContent = ITContent.copy(content); |
|
|
|
if (type != null) { |
|
|
|
newContent.setReplaceObject(((FormulaDisplayDictionary) attr.getDictionary()).getFormula()); |
|
|
|
type.searchFormulaFromDictionary(content, formulaInfos, attr.getDictionary()); |
|
|
|
newContent.addOtherPos( |
|
|
|
} |
|
|
|
Toolkit.i18nText("Fine-Design_Basic_DS_Dictionary"), |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Layer_Build") |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
formulaInfos.add(new FormulaInfo(newContent)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|