|
|
|
package com.fr.solution.plugin.design.formula.ui.type;
|
|
|
|
|
|
|
|
import com.fanruan.api.design.ui.component.UIRadioPane;
|
|
|
|
import com.fr.stable.ParameterProvider;
|
|
|
|
import com.fr.stable.script.CalculatorProvider;
|
|
|
|
import com.fr.solution.plugin.design.formula.ui.evt.OperateListener;
|
|
|
|
|
|
|
|
import com.fr.solution.plugin.design.formula.ui.type.impl.BasicFormulaPane;
|
|
|
|
import com.fr.solution.plugin.design.formula.ui.type.impl.ScriptFormulaPane;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 有问题,子类无法重写abstract方法的参数无法修改
|
|
|
|
*/
|
|
|
|
import com.fr.design.beans.FurtherBasicBeanPane;
|
|
|
|
import com.fr.base.BaseFormula;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
public class CategoryFormulaPane extends UIRadioPane<BaseFormula> {
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 6102846618673364636L;
|
|
|
|
private List<CommonEvent> events;
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected List<FurtherBasicBeanPane<? extends BaseFormula>> initPaneList() {
|
|
|
|
List<FurtherBasicBeanPane<? extends BaseFormula>> list = new ArrayList<FurtherBasicBeanPane<? extends BaseFormula>>();
|
|
|
|
|
|
|
|
BasicFormulaPane normal = new BasicFormulaPane();
|
|
|
|
ScriptFormulaPane script = new ScriptFormulaPane();
|
|
|
|
|
|
|
|
list.add(normal);
|
|
|
|
list.add(script);
|
|
|
|
|
|
|
|
if (events == null) {
|
|
|
|
events = new ArrayList<CommonEvent>();
|
|
|
|
}
|
|
|
|
events.add(normal);
|
|
|
|
events.add(script);
|
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onDoubleClick(String currentLineContent) {
|
|
|
|
events.get(cardNamesPane.getSelectedIndex()).onDoubleClick(currentLineContent);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onSingleClick() {
|
|
|
|
events.get(cardNamesPane.getSelectedIndex()).onSingleClick();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void applyText(String text) {
|
|
|
|
events.get(cardNamesPane.getSelectedIndex()).applyText(text);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void checkContentValid() {
|
|
|
|
events.get(cardNamesPane.getSelectedIndex()).checkContentValid();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onSearch() {
|
|
|
|
events.get(cardNamesPane.getSelectedIndex()).onSearch();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setOperateListener(OperateListener listener) {
|
|
|
|
for (CommonEvent event : events) {
|
|
|
|
event.setOperateListener(listener);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public ParameterProvider[] analyze4Parameters(CalculatorProvider calculator) {
|
|
|
|
return events.get(cardNamesPane.getSelectedIndex()).analyze4Parameters(calculator);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected String title4PopupWindow() {
|
|
|
|
return "Formula";
|
|
|
|
}
|
|
|
|
}
|