You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.2 KiB
73 lines
2.2 KiB
package com.fr.solution.plugin.design.formula.ui.type; |
|
|
|
import com.fr.base.BaseFormula; |
|
import com.fr.base.Parameter; |
|
import com.fr.design.beans.FurtherBasicBeanPane; |
|
import com.fr.design.gui.frpane.UIRadioPane; |
|
import com.fr.script.Calculator; |
|
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; |
|
|
|
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 Parameter[] analyze4Parameters(Calculator calculator) { |
|
return events.get(cardNamesPane.getSelectedIndex()).analyze4Parameters(calculator); |
|
} |
|
|
|
@Override |
|
protected String title4PopupWindow() { |
|
return "Formula"; |
|
} |
|
}
|
|
|