|
|
|
@ -1,17 +1,13 @@
|
|
|
|
|
package com.fr.design.widget.ui; |
|
|
|
|
|
|
|
|
|
import java.awt.*; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
|
|
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
|
import com.fr.design.dialog.DialogActionListener; |
|
|
|
|
import com.fr.design.dialog.UIDialog; |
|
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
|
|
|
|
|
import com.fr.design.gui.frpane.ReportletParameterViewPane; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.gui.itextfield.UITextField; |
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
@ -20,11 +16,24 @@ import com.fr.form.ui.IframeEditor;
|
|
|
|
|
import com.fr.general.Inter; |
|
|
|
|
import com.fr.stable.ParameterProvider; |
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
import java.awt.*; |
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> { |
|
|
|
|
|
|
|
|
|
private static final int P_W = 610; |
|
|
|
|
private static final int P_H = 580; |
|
|
|
|
private UITextField srcTextField; |
|
|
|
|
private ReportletParameterViewPane parameterViewPane; |
|
|
|
|
private UICheckBox horizontalCheck; |
|
|
|
|
private UICheckBox verticalCheck; |
|
|
|
|
private UIButton parameterViewPaneButton; |
|
|
|
|
private List<ParameterProvider> list; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IframeEditorDefinePane() { |
|
|
|
|
this.initComponents(); |
|
|
|
@ -41,25 +50,59 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
|
|
|
|
|
contentPane.add(attr); |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double[] rowSize = { p, p, p, p }; |
|
|
|
|
double[] columnSize = { p, f }; |
|
|
|
|
double[] rowSize = {p, p, p, p}; |
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
|
|
|
|
|
parameterViewPaneButton = new UIButton(Inter.getLocText("FR-Designer_Edit")); |
|
|
|
|
parameterViewPaneButton.addActionListener(parameterListener); |
|
|
|
|
parameterViewPane = new ReportletParameterViewPane(); |
|
|
|
|
|
|
|
|
|
java.awt.Component[][] coms = { |
|
|
|
|
{ horizontalCheck, null }, |
|
|
|
|
{ verticalCheck, null }, |
|
|
|
|
{ new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField() }, |
|
|
|
|
{ new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } }; |
|
|
|
|
int[][] rowCount = {{1, 1},{1, 1},{1, 1}, {1, 1}}; |
|
|
|
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5); |
|
|
|
|
{horizontalCheck, null}, |
|
|
|
|
{verticalCheck, null}, |
|
|
|
|
{new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UITextField()}, |
|
|
|
|
{new UILabel(Inter.getLocText("FR-Designer_Parameters")), parameterViewPaneButton}}; |
|
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, 45, LayoutConstants.VGAP_LARGE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contentPane.add(panel); |
|
|
|
|
|
|
|
|
|
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane); |
|
|
|
|
UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 24, contentPane); |
|
|
|
|
this.add(uiExpandablePane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ActionListener parameterListener = new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
List<ParameterProvider> paraList = parameterViewPane.update(); |
|
|
|
|
list = new ArrayList<ParameterProvider>(); |
|
|
|
|
ParameterProvider pr = null; |
|
|
|
|
for (ParameterProvider parameterProvider : paraList) { |
|
|
|
|
try { |
|
|
|
|
pr = (ParameterProvider) parameterProvider.clone(); |
|
|
|
|
} catch (CloneNotSupportedException e1) { |
|
|
|
|
e1.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
list.add(pr); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
UIDialog dialog = parameterViewPane.showUnsizedWindow(SwingUtilities.getWindowAncestor(new JPanel()), new DialogActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void doOk() { |
|
|
|
|
// list = parameterViewPane.update();
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void doCancel() { |
|
|
|
|
parameterViewPane.update(list); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
dialog.setSize(P_W, P_H); |
|
|
|
|
dialog.setVisible(true); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected String title4PopupWindow() { |
|
|
|
|