|
|
|
@ -3,6 +3,7 @@ package com.fr.design.hyperlink.popup;
|
|
|
|
|
import com.fr.base.BaseFormula; |
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
|
import com.fr.base.Parameter; |
|
|
|
|
import com.fr.design.base.mode.DesignModeContext; |
|
|
|
|
import com.fr.design.dialog.BasicDialog; |
|
|
|
|
import com.fr.design.dialog.DialogActionAdapter; |
|
|
|
|
import com.fr.design.formula.TinyFormulaPane; |
|
|
|
@ -10,6 +11,7 @@ import com.fr.design.gui.frpane.ReportletParameterViewPane;
|
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
import com.fr.design.gui.ibutton.UIRadioButton; |
|
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
|
import com.fr.design.gui.itableeditorpane.UITableEditAction; |
|
|
|
|
import com.fr.design.gui.itextfield.UITextField; |
|
|
|
|
import com.fr.design.gui.itree.filetree.ReportletPane; |
|
|
|
@ -25,8 +27,14 @@ import com.fr.stable.FormulaProvider;
|
|
|
|
|
import com.fr.stable.ParameterProvider; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
import java.awt.*; |
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.ButtonGroup; |
|
|
|
|
import javax.swing.JOptionPane; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.awt.FlowLayout; |
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
import java.util.List; |
|
|
|
@ -44,6 +52,7 @@ public class ContentSettingPane extends AbstractHyperLinkPane<MobilePopupHyperli
|
|
|
|
|
private JPanel textSettingPanel; |
|
|
|
|
private TinyFormulaPane textContentPane; |
|
|
|
|
private CustomFontPane fontPane; |
|
|
|
|
private UIComboBox postComboBox; |
|
|
|
|
|
|
|
|
|
public ContentSettingPane() { |
|
|
|
|
super(); |
|
|
|
@ -112,7 +121,15 @@ public class ContentSettingPane extends AbstractHyperLinkPane<MobilePopupHyperli
|
|
|
|
|
JPanel templateContentPane = new JPanel(); |
|
|
|
|
templateContentPane.setLayout(new BorderLayout(0,8)); |
|
|
|
|
|
|
|
|
|
templateContentPane.add(this.createTemplateSelectPanel(), BorderLayout.NORTH); |
|
|
|
|
if (DesignModeContext.isDuchampMode()) { |
|
|
|
|
JPanel jPanel = new JPanel(new BorderLayout(0, 5)); |
|
|
|
|
jPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
jPanel.add(this.createTemplateSelectPanel(), BorderLayout.NORTH); |
|
|
|
|
jPanel.add(this.createPostComboPanel(), BorderLayout.SOUTH); |
|
|
|
|
templateContentPane.add(jPanel, BorderLayout.NORTH); |
|
|
|
|
} else { |
|
|
|
|
templateContentPane.add(this.createTemplateSelectPanel(), BorderLayout.NORTH); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
parameterViewPane = this.createReportletParameterViewPane(); |
|
|
|
|
templateContentPane.add(parameterViewPane, BorderLayout.CENTER); |
|
|
|
@ -152,6 +169,15 @@ public class ContentSettingPane extends AbstractHyperLinkPane<MobilePopupHyperli
|
|
|
|
|
return MobilePopupUIUtils.createLeftTileRightContentPanel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Template"), templatePanel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createPostComboPanel() { |
|
|
|
|
JPanel postComboPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
postComboBox = new UIComboBox(new String[]{"GET", "POST"}); |
|
|
|
|
postComboBox.setPreferredSize(new Dimension(60, 20)); |
|
|
|
|
postComboBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
|
postComboPanel.add(postComboBox, BorderLayout.WEST); |
|
|
|
|
return MobilePopupUIUtils.createLeftTileRightContentPanel(Toolkit.i18nText("Fine-Design_Basic_Reportlet_Parameter_Type"), postComboPanel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private ReportletParameterViewPane createReportletParameterViewPane() { |
|
|
|
|
ReportletParameterViewPane templateParameterViewPane = new ReportletParameterViewPane( |
|
|
|
|
new UITableEditAction[]{ |
|
|
|
@ -285,6 +311,10 @@ public class ContentSettingPane extends AbstractHyperLinkPane<MobilePopupHyperli
|
|
|
|
|
ParameterProvider[] parameters =link.getParameters(); |
|
|
|
|
parameterViewPane.populate(parameters); |
|
|
|
|
|
|
|
|
|
if (DesignModeContext.isDuchampMode()) { |
|
|
|
|
this.postComboBox.setSelectedIndex(link.isByPost() ? 1 : 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 继承参数
|
|
|
|
|
extendParametersCheckBox.setSelected(link.isExtendParameters()); |
|
|
|
|
} |
|
|
|
@ -292,6 +322,10 @@ public class ContentSettingPane extends AbstractHyperLinkPane<MobilePopupHyperli
|
|
|
|
|
private void updateTemplateContentBean(MobilePopupHyperlink link) { |
|
|
|
|
link.setReportletPath(templatePathTextField.getText()); |
|
|
|
|
|
|
|
|
|
if (DesignModeContext.isDuchampMode()) { |
|
|
|
|
link.setByPost(postComboBox.getSelectedIndex() == 1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<ParameterProvider> parameterList = this.parameterViewPane.update(); |
|
|
|
|
if (!parameterList.isEmpty()) { |
|
|
|
|
Parameter[] parameters = new Parameter[parameterList.size()]; |
|
|
|
|