forked from fanruan/design
Browse Source
* commit '91a1c17f85f1f762a7aa3bc0bb38aead0cf8b533': 修改代码质量 修改代码质量 修改代码质量 修改代码质量 修改代码质量 修改代码质量 修改代码格式 修改代码格式 增加参数 去掉多余import 添加参数 抽象出抽象类 抽象出抽象类 抽象出抽象类 修改方法名称master
superman
7 years ago
21 changed files with 1247 additions and 1362 deletions
@ -0,0 +1,56 @@ |
|||||||
|
package com.fr.design.hyperlink; |
||||||
|
|
||||||
|
import com.fr.design.beans.FurtherBasicBeanPane; |
||||||
|
import com.fr.design.editor.ValueEditorPane; |
||||||
|
import com.fr.design.editor.ValueEditorPaneFactory; |
||||||
|
import com.fr.design.gui.frpane.ReportletParameterViewPane; |
||||||
|
import com.fr.design.gui.itableeditorpane.ParameterTableModel; |
||||||
|
import com.fr.js.JavaScript; |
||||||
|
|
||||||
|
import java.util.HashMap; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by mengao on 2017/10/12. |
||||||
|
*/ |
||||||
|
public abstract class AbstractHyperLinkPane<T> extends FurtherBasicBeanPane<T> { |
||||||
|
private HashMap hyperLinkEditorMap; |
||||||
|
private boolean needRenamePane = false; |
||||||
|
protected ReportletParameterViewPane parameterViewPane; |
||||||
|
|
||||||
|
|
||||||
|
public AbstractHyperLinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { |
||||||
|
this.hyperLinkEditorMap = hyperLinkEditorMap; |
||||||
|
this.needRenamePane = needRenamePane; |
||||||
|
} |
||||||
|
|
||||||
|
public AbstractHyperLinkPane() { |
||||||
|
} |
||||||
|
|
||||||
|
public ReportletParameterViewPane getParameterViewPane() { |
||||||
|
return parameterViewPane; |
||||||
|
} |
||||||
|
|
||||||
|
public void setParameterViewPane(ReportletParameterViewPane parameterViewPane) { |
||||||
|
this.parameterViewPane = parameterViewPane; |
||||||
|
} |
||||||
|
|
||||||
|
public boolean accept(Object ob) { |
||||||
|
return ob instanceof JavaScript; |
||||||
|
} |
||||||
|
|
||||||
|
public void reset() { |
||||||
|
} |
||||||
|
|
||||||
|
protected int getChartParaType() { |
||||||
|
return hyperLinkEditorMap != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; |
||||||
|
} |
||||||
|
|
||||||
|
protected ValueEditorPane getValueEditorPane() { |
||||||
|
return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), hyperLinkEditorMap); |
||||||
|
} |
||||||
|
|
||||||
|
protected boolean needRenamePane() { |
||||||
|
return needRenamePane; |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,145 @@ |
|||||||
|
package com.fr.design.hyperlink; |
||||||
|
|
||||||
|
import com.fr.base.Utils; |
||||||
|
import com.fr.design.beans.BasicBeanPane; |
||||||
|
import com.fr.design.gui.icombobox.UIComboBox; |
||||||
|
import com.fr.design.gui.ilable.UILabel; |
||||||
|
import com.fr.design.gui.itextfield.UINumberField; |
||||||
|
import com.fr.design.layout.FRGUIPaneFactory; |
||||||
|
import com.fr.general.Inter; |
||||||
|
import com.fr.js.Hyperlink; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
import java.awt.*; |
||||||
|
import java.awt.event.ActionEvent; |
||||||
|
import java.awt.event.ActionListener; |
||||||
|
|
||||||
|
public abstract class AbstractHyperNorthPane<T extends Hyperlink> extends BasicBeanPane<T> { |
||||||
|
public static final int NEW_WINDOW = 0; |
||||||
|
public static final int DIALOG = 1; |
||||||
|
public static final int SELF = 2; |
||||||
|
public static final int DEFAULT_H_VALUE = 400; |
||||||
|
public static final int DEFAULT_V_VALUE = 600; |
||||||
|
|
||||||
|
private JPanel headerPane; |
||||||
|
private UIComboBox targetFrameComboBox; |
||||||
|
|
||||||
|
private UINumberField heightTextFiled; |
||||||
|
private UINumberField widthTextFiled; |
||||||
|
|
||||||
|
|
||||||
|
public AbstractHyperNorthPane() { |
||||||
|
this.initComponents(); |
||||||
|
} |
||||||
|
|
||||||
|
protected void initComponents() { |
||||||
|
this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); |
||||||
|
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
||||||
|
headerPane = this.setHeaderPanel(); |
||||||
|
this.add(headerPane, BorderLayout.NORTH); |
||||||
|
this.add(centerPane, BorderLayout.CENTER); |
||||||
|
targetFrameComboBox = new UIComboBox(getTargetFrames()); |
||||||
|
targetFrameComboBox.setRenderer(new DefaultListCellRenderer() { |
||||||
|
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
||||||
|
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
||||||
|
return this; |
||||||
|
} |
||||||
|
}); |
||||||
|
JPanel targetFramePanel = new JPanel(); |
||||||
|
targetFramePanel.add(new UILabel(Inter.getLocText("Hyperlink-Link_Opened_in"))); |
||||||
|
targetFramePanel.add(targetFrameComboBox); |
||||||
|
targetFrameComboBox.setEditable(true); |
||||||
|
targetFrameComboBox.setPreferredSize(new Dimension(100, 20)); |
||||||
|
|
||||||
|
final JPanel newWindowConfPane = new JPanel(); |
||||||
|
newWindowConfPane.add(new UILabel(Inter.getLocText("FR-Designer_Height") + ": ")); |
||||||
|
heightTextFiled = new UINumberField(); |
||||||
|
heightTextFiled.setText(String.valueOf(DEFAULT_H_VALUE)); |
||||||
|
heightTextFiled.setPreferredSize(new Dimension(40, 20)); |
||||||
|
newWindowConfPane.add(heightTextFiled); |
||||||
|
newWindowConfPane.add(new UILabel(" " + Inter.getLocText("FR-Designer_Width") + ": ")); |
||||||
|
widthTextFiled = new UINumberField(); |
||||||
|
widthTextFiled.setText(String.valueOf(DEFAULT_V_VALUE)); |
||||||
|
widthTextFiled.setPreferredSize(new Dimension(40, 20)); |
||||||
|
newWindowConfPane.add(widthTextFiled); |
||||||
|
|
||||||
|
JPanel centerPanel = new JPanel(new BorderLayout()); |
||||||
|
centerPanel.add(targetFramePanel, BorderLayout.WEST); |
||||||
|
centerPanel.add(newWindowConfPane, BorderLayout.EAST); |
||||||
|
newWindowConfPane.setVisible(false); |
||||||
|
|
||||||
|
centerPane.add(centerPanel); |
||||||
|
targetFrameComboBox.addActionListener(new ActionListener() { |
||||||
|
@Override |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
newWindowConfPane.setVisible(DIALOG == targetFrameComboBox.getSelectedIndex()); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
this.add(this.setFootPanel(), BorderLayout.SOUTH); |
||||||
|
} |
||||||
|
|
||||||
|
protected String[] getTargetFrames() { |
||||||
|
return new String[]{Inter.getLocText("Hyperlink-New_Window"), Inter.getLocText("FR-Hyperlink_Dialog"), Inter.getLocText("Hyperlink-Self_Window")}; |
||||||
|
} |
||||||
|
|
||||||
|
protected abstract JPanel setHeaderPanel(); |
||||||
|
|
||||||
|
protected abstract JPanel setFootPanel(); |
||||||
|
|
||||||
|
protected abstract void populateSubHyperlinkBean(T link); |
||||||
|
|
||||||
|
public UIComboBox getTargetFrameComboBox() { |
||||||
|
return targetFrameComboBox; |
||||||
|
} |
||||||
|
|
||||||
|
public void setTargetFrameComboBox(UIComboBox targetFrameComboBox) { |
||||||
|
this.targetFrameComboBox = targetFrameComboBox; |
||||||
|
} |
||||||
|
|
||||||
|
public UINumberField getHeightTextFiled() { |
||||||
|
return heightTextFiled; |
||||||
|
} |
||||||
|
|
||||||
|
public void setHeightTextFiled(UINumberField heightTextFiled) { |
||||||
|
this.heightTextFiled = heightTextFiled; |
||||||
|
} |
||||||
|
|
||||||
|
public UINumberField getWidthTextFiled() { |
||||||
|
return widthTextFiled; |
||||||
|
} |
||||||
|
|
||||||
|
public void setWidthTextFiled(UINumberField widthTextFiled) { |
||||||
|
this.widthTextFiled = widthTextFiled; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void populateBean(T link) { |
||||||
|
String name = link.getTargetFrame(); |
||||||
|
targetFrameComboBox.setSelectedIndex(HyperlinkTargetFrame.convert(name)); |
||||||
|
heightTextFiled.setText(String.valueOf(link.getHeight() == 0 ? DEFAULT_H_VALUE : link.getHeight())); |
||||||
|
widthTextFiled.setText(String.valueOf(link.getWidth() == 0 ? DEFAULT_V_VALUE : link.getWidth())); |
||||||
|
populateSubHyperlinkBean(link); |
||||||
|
} |
||||||
|
|
||||||
|
protected abstract T updateSubHyperlinkBean(); |
||||||
|
|
||||||
|
protected abstract void updateSubHyperlinkBean(T t); |
||||||
|
|
||||||
|
@Override |
||||||
|
public T updateBean() { |
||||||
|
T link = updateSubHyperlinkBean(); |
||||||
|
|
||||||
|
updateBean(link); |
||||||
|
|
||||||
|
return link; |
||||||
|
} |
||||||
|
|
||||||
|
public void updateBean(T link) { |
||||||
|
updateSubHyperlinkBean(link); |
||||||
|
link.setTargetFrame(HyperlinkTargetFrame.parse(targetFrameComboBox.getSelectedIndex()).getName()); |
||||||
|
link.setHeight(Utils.objectToNumber(heightTextFiled.getText(), false).intValue()); |
||||||
|
link.setWidth(Utils.objectToNumber(widthTextFiled.getText(), false).intValue()); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -1,144 +0,0 @@ |
|||||||
package com.fr.design.hyperlink; |
|
||||||
|
|
||||||
import com.fr.base.Utils; |
|
||||||
import com.fr.design.beans.BasicBeanPane; |
|
||||||
import com.fr.design.gui.icombobox.UIComboBox; |
|
||||||
import com.fr.design.gui.ilable.UILabel; |
|
||||||
import com.fr.design.gui.itextfield.UINumberField; |
|
||||||
import com.fr.design.layout.FRGUIPaneFactory; |
|
||||||
import com.fr.general.Inter; |
|
||||||
import com.fr.js.Hyperlink; |
|
||||||
|
|
||||||
import javax.swing.*; |
|
||||||
import java.awt.*; |
|
||||||
import java.awt.event.ActionEvent; |
|
||||||
import java.awt.event.ActionListener; |
|
||||||
|
|
||||||
public abstract class AbstractHyperlinkPane<T extends Hyperlink> extends BasicBeanPane<T> { |
|
||||||
public static final int NEW_WINDOW = 0; |
|
||||||
public static final int DIALOG = 1; |
|
||||||
public static final int SELF = 2; |
|
||||||
public static final int DEFAULT_H_VALUE = 400; |
|
||||||
public static final int DEFAULT_V_VALUE = 600; |
|
||||||
|
|
||||||
private JPanel headerPane; |
|
||||||
private UIComboBox targetFrameComboBox; |
|
||||||
|
|
||||||
private UINumberField heightTextFiled; |
|
||||||
private UINumberField widthTextFiled; |
|
||||||
|
|
||||||
|
|
||||||
public AbstractHyperlinkPane() { |
|
||||||
this.initComponents(); |
|
||||||
} |
|
||||||
|
|
||||||
protected void initComponents() { |
|
||||||
this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); |
|
||||||
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
||||||
headerPane = this.setHeaderPanel(); |
|
||||||
this.add(headerPane, BorderLayout.NORTH); |
|
||||||
this.add(centerPane, BorderLayout.CENTER); |
|
||||||
targetFrameComboBox = new UIComboBox(getTargetFrames()); |
|
||||||
targetFrameComboBox.setRenderer(new DefaultListCellRenderer() { |
|
||||||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
|
||||||
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
|
||||||
return this; |
|
||||||
} |
|
||||||
}); |
|
||||||
JPanel targetFramePanel = new JPanel(); |
|
||||||
targetFramePanel.add(new UILabel(Inter.getLocText("Hyperlink-Link_Opened_in"))); |
|
||||||
targetFramePanel.add(targetFrameComboBox); |
|
||||||
targetFrameComboBox.setEditable(true); |
|
||||||
targetFrameComboBox.setPreferredSize(new Dimension(100, 20)); |
|
||||||
|
|
||||||
final JPanel newWindowConfPane = new JPanel(); |
|
||||||
newWindowConfPane.add(new UILabel(Inter.getLocText("FR-Designer_Height") + ": ")); |
|
||||||
heightTextFiled = new UINumberField(); |
|
||||||
heightTextFiled.setText(String.valueOf(DEFAULT_H_VALUE)); |
|
||||||
heightTextFiled.setPreferredSize(new Dimension(40, 20)); |
|
||||||
newWindowConfPane.add(heightTextFiled); |
|
||||||
newWindowConfPane.add(new UILabel(" " + Inter.getLocText("FR-Designer_Width") + ": ")); |
|
||||||
widthTextFiled = new UINumberField(); |
|
||||||
widthTextFiled.setText(String.valueOf(DEFAULT_V_VALUE)); |
|
||||||
widthTextFiled.setPreferredSize(new Dimension(40, 20)); |
|
||||||
newWindowConfPane.add(widthTextFiled); |
|
||||||
|
|
||||||
JPanel centerPanel = new JPanel(new BorderLayout()); |
|
||||||
centerPanel.add(targetFramePanel, BorderLayout.WEST); |
|
||||||
centerPanel.add(newWindowConfPane, BorderLayout.EAST); |
|
||||||
newWindowConfPane.setVisible(false); |
|
||||||
|
|
||||||
centerPane.add(centerPanel); |
|
||||||
targetFrameComboBox.addActionListener(new ActionListener() { |
|
||||||
@Override |
|
||||||
public void actionPerformed(ActionEvent e) { |
|
||||||
newWindowConfPane.setVisible(DIALOG == targetFrameComboBox.getSelectedIndex()); |
|
||||||
} |
|
||||||
}); |
|
||||||
|
|
||||||
this.add(this.setFootPanel(), BorderLayout.SOUTH); |
|
||||||
} |
|
||||||
protected String[] getTargetFrames(){ |
|
||||||
return new String[]{Inter.getLocText("Hyperlink-New_Window"), Inter.getLocText("FR-Hyperlink_Dialog"), Inter.getLocText("Hyperlink-Self_Window")}; |
|
||||||
} |
|
||||||
|
|
||||||
protected abstract JPanel setHeaderPanel(); |
|
||||||
|
|
||||||
protected abstract JPanel setFootPanel(); |
|
||||||
|
|
||||||
protected abstract void populateSubHyperlinkBean(T link); |
|
||||||
|
|
||||||
public UIComboBox getTargetFrameComboBox() { |
|
||||||
return targetFrameComboBox; |
|
||||||
} |
|
||||||
|
|
||||||
public void setTargetFrameComboBox(UIComboBox targetFrameComboBox) { |
|
||||||
this.targetFrameComboBox = targetFrameComboBox; |
|
||||||
} |
|
||||||
|
|
||||||
public UINumberField getHeightTextFiled() { |
|
||||||
return heightTextFiled; |
|
||||||
} |
|
||||||
|
|
||||||
public void setHeightTextFiled(UINumberField heightTextFiled) { |
|
||||||
this.heightTextFiled = heightTextFiled; |
|
||||||
} |
|
||||||
|
|
||||||
public UINumberField getWidthTextFiled() { |
|
||||||
return widthTextFiled; |
|
||||||
} |
|
||||||
|
|
||||||
public void setWidthTextFiled(UINumberField widthTextFiled) { |
|
||||||
this.widthTextFiled = widthTextFiled; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public void populateBean(T link) { |
|
||||||
String name = link.getTargetFrame(); |
|
||||||
targetFrameComboBox.setSelectedIndex(HyperlinkTargetFrame.convert(name)); |
|
||||||
heightTextFiled.setText(String.valueOf(link.getHeight() == 0 ? DEFAULT_H_VALUE : link.getHeight())); |
|
||||||
widthTextFiled.setText(String.valueOf(link.getWidth() == 0 ? DEFAULT_V_VALUE : link.getWidth())); |
|
||||||
populateSubHyperlinkBean(link); |
|
||||||
} |
|
||||||
|
|
||||||
protected abstract T updateSubHyperlinkBean(); |
|
||||||
|
|
||||||
protected abstract void updateSubHyperlinkBean(T t); |
|
||||||
|
|
||||||
@Override |
|
||||||
public T updateBean() { |
|
||||||
T link = updateSubHyperlinkBean(); |
|
||||||
|
|
||||||
updateBean(link); |
|
||||||
|
|
||||||
return link; |
|
||||||
} |
|
||||||
|
|
||||||
public void updateBean(T link) { |
|
||||||
updateSubHyperlinkBean(link); |
|
||||||
link.setTargetFrame(HyperlinkTargetFrame.parse(targetFrameComboBox.getSelectedIndex()).getName()); |
|
||||||
link.setHeight(Utils.objectToNumber(heightTextFiled.getText(), false).intValue()); |
|
||||||
link.setWidth(Utils.objectToNumber(widthTextFiled.getText(), false).intValue()); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -1,99 +1,81 @@ |
|||||||
package com.fr.design.javascript; |
package com.fr.design.javascript; |
||||||
|
|
||||||
import com.fr.base.Parameter; |
import com.fr.base.Parameter; |
||||||
import com.fr.base.chart.BasePlot; |
|
||||||
import com.fr.design.beans.BasicBeanPane; |
|
||||||
import com.fr.design.editor.ValueEditorPane; |
|
||||||
import com.fr.design.editor.ValueEditorPaneFactory; |
|
||||||
import com.fr.design.gui.frpane.ReportletParameterViewPane; |
import com.fr.design.gui.frpane.ReportletParameterViewPane; |
||||||
import com.fr.design.gui.itableeditorpane.ParameterTableModel; |
import com.fr.design.gui.itableeditorpane.ParameterTableModel; |
||||||
import com.fr.design.gui.itextfield.UITextField; |
import com.fr.design.gui.itextfield.UITextField; |
||||||
|
import com.fr.design.hyperlink.AbstractHyperLinkPane; |
||||||
import com.fr.design.utils.gui.GUICoreUtils; |
import com.fr.design.utils.gui.GUICoreUtils; |
||||||
import com.fr.general.Inter; |
import com.fr.general.Inter; |
||||||
import com.fr.js.ParameterJavaScript; |
import com.fr.js.ParameterJavaScript; |
||||||
import com.fr.stable.ParameterProvider; |
import com.fr.stable.ParameterProvider; |
||||||
|
|
||||||
import java.awt.*; |
import java.awt.*; |
||||||
|
import java.util.HashMap; |
||||||
import java.util.List; |
import java.util.List; |
||||||
|
|
||||||
public class ParameterJavaScriptPane extends BasicBeanPane<ParameterJavaScript> { |
public class ParameterJavaScriptPane extends AbstractHyperLinkPane<ParameterJavaScript> { |
||||||
private BasePlot plot; |
|
||||||
private UITextField itemNameTextField; |
private UITextField itemNameTextField; |
||||||
private ReportletParameterViewPane parameterViewPane; |
|
||||||
|
|
||||||
protected BasePlot getPlot() { |
|
||||||
return plot; |
|
||||||
} |
|
||||||
|
|
||||||
public ParameterJavaScriptPane(){ |
public ParameterJavaScriptPane() { |
||||||
this(null); |
this(null, false); |
||||||
} |
} |
||||||
|
|
||||||
public ParameterJavaScriptPane(BasePlot plot){ |
public ParameterJavaScriptPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { |
||||||
this.plot = plot; |
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("FR-Designer-Hyperlink_Name") + ":"), BorderLayout.NORTH); |
||||||
} |
} |
||||||
} |
|
||||||
|
|
||||||
protected int getChartParaType() { |
|
||||||
return plot != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; |
|
||||||
} |
|
||||||
|
|
||||||
protected ValueEditorPane getValueEditorPane() { |
|
||||||
return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), plot); |
|
||||||
} |
} |
||||||
|
|
||||||
protected boolean needRenamePane(){ |
@Override |
||||||
return plot != null && plot.isNeedRenameHyperLinkPane(); |
public String title4PopupWindow() { |
||||||
|
return Inter.getLocText("JavaScript-Dynamic_Parameters"); |
||||||
} |
} |
||||||
|
|
||||||
@Override |
|
||||||
protected String title4PopupWindow() { |
|
||||||
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 ChartNoRename 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; |
||||||
} |
} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue