|
|
@ -18,63 +18,64 @@ public class ParameterJavaScriptPane extends AbstractHyperLinkPane<ParameterJava |
|
|
|
private UITextField itemNameTextField; |
|
|
|
private UITextField itemNameTextField; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ParameterJavaScriptPane(){ |
|
|
|
public ParameterJavaScriptPane() { |
|
|
|
this(null, false); |
|
|
|
this(null, false); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ParameterJavaScriptPane(HashMap hyperLinkEditorMap, boolean needRenamePane){ |
|
|
|
public ParameterJavaScriptPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { |
|
|
|
super(hyperLinkEditorMap, needRenamePane); |
|
|
|
super(hyperLinkEditorMap, needRenamePane); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); |
|
|
|
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); |
|
|
|
this.add(parameterViewPane, BorderLayout.CENTER); |
|
|
|
this.add(parameterViewPane, BorderLayout.CENTER); |
|
|
|
if(needRenamePane()){ |
|
|
|
if (needRenamePane()) { |
|
|
|
itemNameTextField = new UITextField(); |
|
|
|
itemNameTextField = new UITextField(); |
|
|
|
this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH); |
|
|
|
this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String title4PopupWindow() { |
|
|
|
public String title4PopupWindow() { |
|
|
|
return Inter.getLocText("JavaScript-Dynamic_Parameters"); |
|
|
|
return Inter.getLocText("JavaScript-Dynamic_Parameters"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void populateBean(ParameterJavaScript ob){ |
|
|
|
public void populateBean(ParameterJavaScript ob) { |
|
|
|
ParameterProvider[] parameters = ob.getParameters(); |
|
|
|
ParameterProvider[] parameters = ob.getParameters(); |
|
|
|
if (parameters.length == 0){ |
|
|
|
if (parameters.length == 0) { |
|
|
|
// TODO ALEX_SEP
|
|
|
|
// TODO ALEX_SEP
|
|
|
|
// parameters = DesignUtils.getEditingTemplateReport().getTemplateWorkBook().getParameters();
|
|
|
|
// parameters = DesignUtils.getEditingTemplateReport().getTemplateWorkBook().getParameters();
|
|
|
|
} |
|
|
|
} |
|
|
|
parameterViewPane.populate(parameters); |
|
|
|
parameterViewPane.populate(parameters); |
|
|
|
if(itemNameTextField != null){ |
|
|
|
if (itemNameTextField != null) { |
|
|
|
itemNameTextField.setText(ob.getItemName()); |
|
|
|
itemNameTextField.setText(ob.getItemName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public ParameterJavaScript updateBean(){ |
|
|
|
public ParameterJavaScript updateBean() { |
|
|
|
ParameterJavaScript js = new ParameterJavaScript(); |
|
|
|
ParameterJavaScript js = new ParameterJavaScript(); |
|
|
|
|
|
|
|
|
|
|
|
updateBean(js); |
|
|
|
updateBean(js); |
|
|
|
if(this.itemNameTextField != null){ |
|
|
|
if (this.itemNameTextField != null) { |
|
|
|
js.setItemName(itemNameTextField.getText()); |
|
|
|
js.setItemName(itemNameTextField.getText()); |
|
|
|
} |
|
|
|
} |
|
|
|
return js; |
|
|
|
return js; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void updateBean(ParameterJavaScript parameter) { |
|
|
|
public void updateBean(ParameterJavaScript parameter) { |
|
|
|
List<ParameterProvider> parameterList = parameterViewPane.update(); |
|
|
|
List<ParameterProvider> parameterList = parameterViewPane.update(); |
|
|
|
parameter.setParameters(parameterList.toArray(new Parameter[parameterList.size()])); |
|
|
|
parameter.setParameters(parameterList.toArray(new Parameter[parameterList.size()])); |
|
|
|
if(this.itemNameTextField != null){ |
|
|
|
if (this.itemNameTextField != null) { |
|
|
|
parameter.setItemName(itemNameTextField.getText()); |
|
|
|
parameter.setItemName(itemNameTextField.getText()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static class CHART_NO_RENAME extends ParameterJavaScriptPane{ |
|
|
|
public static class CHART_NO_RENAME extends ParameterJavaScriptPane { |
|
|
|
protected int getChartParaType() { |
|
|
|
protected int getChartParaType() { |
|
|
|
return ParameterTableModel.CHART_NORMAL_USE; |
|
|
|
return ParameterTableModel.CHART_NORMAL_USE; |
|
|
|
} |
|
|
|
} |
|
|
|
protected boolean needRenamePane(){ |
|
|
|
|
|
|
|
|
|
|
|
protected boolean needRenamePane() { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|