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.

95 lines
3.3 KiB

3 years ago
package com.fr.plugin.xx.jsd9663.hyperlink;
import com.fr.base.Parameter;
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.ilable.UILabel;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.ParameterProvider;
import javax.swing.*;
import java.awt.*;
import java.util.HashMap;
import java.util.List;
public class PostMessageHyperlinkPane extends BasicBeanPane<PostMessageHyperlink> {
private UINumberField parentNode;
protected ReportletParameterViewPane parameterViewPane;
private HashMap hyperLinkEditorMap;
public PostMessageHyperlinkPane() {
this.initComponents();
}
@Override
protected String title4PopupWindow() {
return "title4PopupWindow";
}
protected void initComponents() {
parentNode = new UINumberField();
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel pane = TableLayoutHelper.createTableLayoutPane(
new Component[][]{
{new UILabel("\u7236\u7a97\u53e3\u6240\u5c5e\u5c42\u6570:"), parentNode}
},
new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED},
new double[]{ TableLayout.PREFERRED,TableLayout.FILL}
);
this.add( pane, BorderLayout.NORTH );
this.parameterViewPane = new ReportletParameterViewPane( this.getChartParaType(), this.getValueEditorPane(), this.getValueEditorPane());
this.add(this.parameterViewPane, "Center");
this.parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Toolkit.i18nText("Fine-Design_Basic_Parameter"), (Color)null));
}
protected int getChartParaType() {
return this.hyperLinkEditorMap != null ? 1 : 0;
}
protected ValueEditorPane getValueEditorPane() {
return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(this.getChartParaType(), this.hyperLinkEditorMap);
}
@Override
public void populateBean(PostMessageHyperlink demoHyperlink) {
List var2 = this.parameterViewPane.update();
var2.clear();
ParameterProvider[] var3 = demoHyperlink.getParameters();
this.parameterViewPane.populate(var3);
parentNode.setValue(demoHyperlink.getParentNode());
}
@Override
public PostMessageHyperlink updateBean() {
PostMessageHyperlink demoHyperlink = new PostMessageHyperlink();
this.updateBean(demoHyperlink);
demoHyperlink.setParentNode((int)parentNode.getValue());
return demoHyperlink;
}
public void updateBean(PostMessageHyperlink var1) {
List var2 = this.parameterViewPane.update();
if (!var2.isEmpty()) {
Parameter[] var3 = new Parameter[var2.size()];
var2.toArray(var3);
var1.setParameters(var3);
var1.setParentNode((int)parentNode.getValue());
} else {
var1.setParameters((ParameterProvider[])null);
}
}
}