|
|
|
@ -1,14 +1,16 @@
|
|
|
|
|
package com.fr.design.mainframe.cell.settingpane; |
|
|
|
|
|
|
|
|
|
import com.fine.theme.utils.FineUIScale; |
|
|
|
|
import com.fine.swing.ui.layout.Layouts; |
|
|
|
|
import com.fine.theme.utils.FineUIUtils; |
|
|
|
|
import com.formdev.flatlaf.util.ScaledEmptyBorder; |
|
|
|
|
import com.fr.base.Style; |
|
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
|
import com.fr.design.dialog.link.MessageWithLink; |
|
|
|
|
import com.fr.design.editor.ValueEditorPane; |
|
|
|
|
import com.fr.design.editor.ValueEditorPaneFactory; |
|
|
|
|
import com.fr.design.file.HistoryTemplateListPane; |
|
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
|
import com.fr.design.gui.core.ReactiveCardPane; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
|
import com.fr.design.gui.ibutton.UIRadioButton; |
|
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
@ -17,10 +19,6 @@ import com.fr.design.gui.ilable.UILabel;
|
|
|
|
|
import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
|
import com.fr.design.gui.itextfield.UITextField; |
|
|
|
|
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.layout.VerticalFlowLayout; |
|
|
|
|
import com.fr.design.locale.impl.DataMaskMark; |
|
|
|
|
import com.fr.design.mainframe.EastRegionContainerPane; |
|
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
@ -46,19 +44,18 @@ import javax.swing.ButtonGroup;
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.SwingConstants; |
|
|
|
|
import javax.swing.UIManager; |
|
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.CardLayout; |
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.awt.Insets; |
|
|
|
|
import java.awt.Rectangle; |
|
|
|
|
import java.awt.event.ItemEvent; |
|
|
|
|
import java.awt.event.ItemListener; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.fix; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.row; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.column; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.flex; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author zhou |
|
|
|
|
* @since 2012-5-11下午5:24:31 |
|
|
|
@ -67,12 +64,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
|
|
|
|
|
private static final int HEAD_WDITH = 290; |
|
|
|
|
private static final int HEAD_HEIGTH = 24; |
|
|
|
|
private static final int COMBO_WIDTH = 154; |
|
|
|
|
private static final int BUTTON_GROUP_WIDTH = 140; |
|
|
|
|
private static final double f = TableLayout.FILL; |
|
|
|
|
private static final double p = TableLayout.PREFERRED; |
|
|
|
|
// normal
|
|
|
|
|
private UIButtonGroup autoshrik; |
|
|
|
|
private static final int DOWNLOAD_INDEX = 3; |
|
|
|
|
|
|
|
|
|
private UICheckBox previewCellContent; |
|
|
|
|
private UICheckBox printAndExportContent; |
|
|
|
@ -81,22 +73,20 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
private UIComboBox showContent; |
|
|
|
|
|
|
|
|
|
//内容提示
|
|
|
|
|
private ReactiveCardPane showContentPane; |
|
|
|
|
private UIButtonGroup tooltipButtonGroup; |
|
|
|
|
private CardLayout tooltipLayout; |
|
|
|
|
private JPanel tooltipPane; |
|
|
|
|
private ReactiveCardPane tooltipPane; |
|
|
|
|
private UITextField tooltipTextField; |
|
|
|
|
private UITextField fileNameTextField; |
|
|
|
|
|
|
|
|
|
//文本超出时隐藏
|
|
|
|
|
private ReactiveCardPane overflowPane; |
|
|
|
|
private UICheckBox textOverflowCheckBox; |
|
|
|
|
private int curSelectedIndex; |
|
|
|
|
private UIComboBox showPartComboBox; |
|
|
|
|
private CardLayout showPartLayout; |
|
|
|
|
private JPanel showPartPane; |
|
|
|
|
private UISpinner showCharNums; |
|
|
|
|
private UIComboBox textOverflowTypeComboBox; |
|
|
|
|
|
|
|
|
|
private UITextField fileNameTextField; |
|
|
|
|
|
|
|
|
|
// 分页
|
|
|
|
|
private UICheckBox pageBeforeRowCheckBox; |
|
|
|
|
private UICheckBox pageAfterRowCheckBox; |
|
|
|
@ -121,21 +111,22 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
// 插入行策略
|
|
|
|
|
private UIButtonGroup insertRowPolicyButtonGroup; |
|
|
|
|
private ValueEditorPane valueEditor; |
|
|
|
|
private CardLayout insertRowLayout; |
|
|
|
|
private JPanel insertRowPane; |
|
|
|
|
private JPanel insertRowPolicyPane; |
|
|
|
|
private JPanel defaultValuePane; |
|
|
|
|
private ReactiveCardPane insertRowPolicyPane; |
|
|
|
|
private UILabel insertRowPolicyLabel; |
|
|
|
|
|
|
|
|
|
// 数据脱敏
|
|
|
|
|
private UILabel scopeLabel; |
|
|
|
|
private UIRadioButton exportButton; |
|
|
|
|
private UIRadioButton previewAndExportButton; |
|
|
|
|
private UIRadioButton[] desensitizationButtons; |
|
|
|
|
private CellDesensitizationGroupsPane groupsPane; |
|
|
|
|
private final int EXPORT_SCOPE = CellDesensitizationAttr.EXPORT_SCOPE; |
|
|
|
|
private final int PREVIEW_AND_EXPORT_SCOPE = CellDesensitizationAttr.PREVIEW_AND_EXPORT_SCOPE; |
|
|
|
|
|
|
|
|
|
private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92); |
|
|
|
|
private static Color TIPS_FONT_COLOR = FineUIUtils.getUIColor("Label.tipColor", "inactiveCaption"); |
|
|
|
|
|
|
|
|
|
protected void initContentPane() { |
|
|
|
|
leftContentPane = createContentPane(); |
|
|
|
|
if (leftContentPane != null) { |
|
|
|
|
this.add(leftContentPane, BorderLayout.CENTER); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 初始化 |
|
|
|
@ -143,18 +134,17 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
* @return 面板 |
|
|
|
|
*/ |
|
|
|
|
public JPanel createContentPane() { |
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Basic"), HEAD_WDITH, HEAD_HEIGTH, basicPane())}, |
|
|
|
|
new Component[]{new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Advaced"), HEAD_WDITH, HEAD_HEIGTH, seniorPane())}, |
|
|
|
|
new Component[]{new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Pagination"), HEAD_WDITH, HEAD_HEIGTH, pagePane())}, |
|
|
|
|
new Component[]{new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Desensitization"), HEAD_WDITH, HEAD_HEIGTH, desensitizePane())} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
JPanel tableLayoutPane = TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p, p, p}, new double[]{f}); |
|
|
|
|
|
|
|
|
|
JPanel pane = Layouts.column( |
|
|
|
|
cell(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Basic"), HEAD_WDITH, HEAD_HEIGTH, basicPane())), |
|
|
|
|
fix(1).with(it -> it.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")))), |
|
|
|
|
cell(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Advaced"), HEAD_WDITH, HEAD_HEIGTH, seniorPane())), |
|
|
|
|
fix(1).with(it -> it.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")))), |
|
|
|
|
cell(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Pagination"), HEAD_WDITH, HEAD_HEIGTH, pagePane())), |
|
|
|
|
fix(1).with(it -> it.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")))), |
|
|
|
|
cell(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Desensitization"), HEAD_WDITH, HEAD_HEIGTH, desensitizePane())) |
|
|
|
|
).getComponent(); |
|
|
|
|
initAllNames(); |
|
|
|
|
return tableLayoutPane; |
|
|
|
|
return pane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel desensitizePane() { |
|
|
|
@ -174,24 +164,22 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
groupsPane = new CellDesensitizationGroupsPane(this); |
|
|
|
|
|
|
|
|
|
JPanel contentPane = FRGUIPaneFactory.createVerticalFlowLayout_F_Pane(true, VerticalFlowLayout.TOP, 0, 10, true); |
|
|
|
|
contentPane.add(scopePane); |
|
|
|
|
contentPane.add(hyperlink); |
|
|
|
|
contentPane.add(groupsPane); |
|
|
|
|
|
|
|
|
|
return contentPane; |
|
|
|
|
return Layouts.column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
cell(scopePane), |
|
|
|
|
cell(hyperlink), |
|
|
|
|
cell(groupsPane) |
|
|
|
|
).getComponent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 脱敏设置应用范围panel |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private JPanel initScopePane() { |
|
|
|
|
scopeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Scope")); |
|
|
|
|
// 数据脱敏
|
|
|
|
|
UILabel scopeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Scope")); |
|
|
|
|
exportButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Desensitization_Export")); |
|
|
|
|
previewAndExportButton = new UIRadioButton(Toolkit.i18nText("Fine-Design_Report_Desensitization_Preview_Export")); |
|
|
|
|
desensitizationButtons = new UIRadioButton[]{ |
|
|
|
|
UIRadioButton[] desensitizationButtons = new UIRadioButton[]{ |
|
|
|
|
exportButton, previewAndExportButton |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -199,13 +187,9 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
for (UIRadioButton radioButton : desensitizationButtons) { |
|
|
|
|
buttonGroup.add(radioButton); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
JPanel head = new JPanel(); |
|
|
|
|
head.setLayout(new BorderLayout()); |
|
|
|
|
head.add(scopeLabel, BorderLayout.NORTH); |
|
|
|
|
head.add(exportButton, BorderLayout.CENTER); |
|
|
|
|
head.add(previewAndExportButton, BorderLayout.SOUTH); |
|
|
|
|
return head; |
|
|
|
|
return row( |
|
|
|
|
cell(scopeLabel).weight(1.2), cell(exportButton).weight(1.2), cell(previewAndExportButton).weight(1.8) |
|
|
|
|
).getComponent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel basicPane() { |
|
|
|
@ -216,228 +200,211 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
adjustRadioButtons = new UIRadioButton[]{ |
|
|
|
|
defaultAutoRadioButton, noAutoRadioButton, autoHeightRadioButton, autoWidthRadioButton |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 指定分组
|
|
|
|
|
ButtonGroup autoBG = new ButtonGroup(); |
|
|
|
|
for (UIRadioButton radioButton : adjustRadioButtons) { |
|
|
|
|
autoBG.add(radioButton); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
JPanel basicPane = new JPanel() { |
|
|
|
|
@Override |
|
|
|
|
public Insets getInsets() { |
|
|
|
|
return new Insets(LayoutConstants.VGAP_MEDIUM, 0, LayoutConstants.VGAP_MEDIUM, 0); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
VerticalFlowLayout verticalFlowLayout = new VerticalFlowLayout(VerticalFlowLayout.CENTER, 0, 0); |
|
|
|
|
verticalFlowLayout.setAlignLeft(true); |
|
|
|
|
basicPane.setLayout(verticalFlowLayout); |
|
|
|
|
basicPane.add(defaultAutoRadioButton); |
|
|
|
|
basicPane.add(noAutoRadioButton); |
|
|
|
|
basicPane.add(autoHeightRadioButton); |
|
|
|
|
basicPane.add(autoWidthRadioButton); |
|
|
|
|
|
|
|
|
|
return basicPane; |
|
|
|
|
return Layouts.column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
cell(defaultAutoRadioButton), |
|
|
|
|
cell(noAutoRadioButton), |
|
|
|
|
cell(autoHeightRadioButton), |
|
|
|
|
cell(autoWidthRadioButton) |
|
|
|
|
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, LayoutConstants.VERTICAL_GAP, 0)) |
|
|
|
|
).getComponent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel seniorPane() { |
|
|
|
|
initInsertRowPolicyPane(); |
|
|
|
|
JPanel seniorPane = new JPanel(new BorderLayout()); |
|
|
|
|
seniorPane.add(seniorUpPane(), BorderLayout.NORTH); |
|
|
|
|
seniorPane.add(insertRowPolicyPane, BorderLayout.CENTER); |
|
|
|
|
insertRowPolicyPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); |
|
|
|
|
return seniorPane; |
|
|
|
|
return Layouts.column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
cell(seniorUpPane()), |
|
|
|
|
cell(insertRowPolicyPane) |
|
|
|
|
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, LayoutConstants.VERTICAL_GAP, 0)) |
|
|
|
|
).getComponent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initInsertRowPolicyPane() { |
|
|
|
|
// 插入行策略
|
|
|
|
|
insertRowPolicyButtonGroup = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_NULL"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Estate_Default_Text"), |
|
|
|
|
insertRowPolicyButtonGroup = new UIButtonGroup(new String[]{ |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_NULL"), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Estate_Default_Text"), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_COPY")}); |
|
|
|
|
defaultValuePane = new JPanel(new BorderLayout(4, 0)); |
|
|
|
|
valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane(); |
|
|
|
|
defaultValuePane.add(valueEditor, BorderLayout.CENTER); |
|
|
|
|
insertRowLayout = new CardLayout(); |
|
|
|
|
insertRowPane = new JPanel(insertRowLayout); |
|
|
|
|
insertRowPane.add(new JPanel(), "none"); |
|
|
|
|
insertRowPane.add(defaultValuePane, "content"); |
|
|
|
|
insertRowPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
insertRowPolicyButtonGroup.addChangeListener(new ChangeListener() { |
|
|
|
|
@Override |
|
|
|
|
public void stateChanged(ChangeEvent e) { |
|
|
|
|
if (insertRowPolicyButtonGroup.getSelectedIndex() == 1) { |
|
|
|
|
insertRowPane.setPreferredSize(new Dimension(100, FineUIScale.scale(UIManager.getInt("CellOtherSetPane.height")))); |
|
|
|
|
insertRowLayout.show(insertRowPane, "content"); |
|
|
|
|
} else { |
|
|
|
|
insertRowLayout.show(insertRowPane, "none"); |
|
|
|
|
insertRowPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
UILabel insertRowPolicyLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy", SwingConstants.LEFT)); |
|
|
|
|
insertRowPolicyLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy", SwingConstants.LEFT)); |
|
|
|
|
UIComponentUtils.setLineWrap(insertRowPolicyLabel); |
|
|
|
|
|
|
|
|
|
// 如果右侧需要很宽的空间,就用3行1列的布局
|
|
|
|
|
if (insertRowPolicyButtonGroup.getPreferredSize().getWidth() > BUTTON_GROUP_WIDTH) { |
|
|
|
|
double[] rowSize = {p, p, p}; |
|
|
|
|
double[] columnSize = {f}; |
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{insertRowPolicyLabel}, |
|
|
|
|
new Component[]{insertRowPolicyButtonGroup}, |
|
|
|
|
new Component[]{insertRowPane}, |
|
|
|
|
}; |
|
|
|
|
insertRowPolicyPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM); |
|
|
|
|
} else { |
|
|
|
|
double[] rowSize = {p, p}; |
|
|
|
|
double[] columnSize = {f, BUTTON_GROUP_WIDTH}; |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{insertRowPolicyLabel, insertRowPolicyButtonGroup}, |
|
|
|
|
new Component[]{null, insertRowPane}, |
|
|
|
|
}; |
|
|
|
|
insertRowPolicyPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM); |
|
|
|
|
} |
|
|
|
|
insertRowPolicyPane = ReactiveCardPane.create() |
|
|
|
|
.addSupplier("empty", () -> Layouts.column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
row( |
|
|
|
|
cell(insertRowPolicyLabel).weight(1.2), |
|
|
|
|
cell(insertRowPolicyButtonGroup).weight(3) |
|
|
|
|
) |
|
|
|
|
).getComponent()) |
|
|
|
|
.addSupplier("default", () -> Layouts.column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
row( |
|
|
|
|
cell(insertRowPolicyLabel).weight(1.2), |
|
|
|
|
cell(insertRowPolicyButtonGroup).weight(3) |
|
|
|
|
), |
|
|
|
|
row( |
|
|
|
|
flex(1.2), |
|
|
|
|
cell(valueEditor).weight(3) |
|
|
|
|
) |
|
|
|
|
).getComponent() |
|
|
|
|
); |
|
|
|
|
insertRowPolicyPane.select("empty").populate(); |
|
|
|
|
|
|
|
|
|
insertRowPolicyButtonGroup.addChangeListener(e -> { |
|
|
|
|
String key = insertRowPolicyButtonGroup.getSelectedIndex() == 1 ? "default" : "empty"; |
|
|
|
|
insertRowPolicyPane.select(key).populate(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel seniorUpPane() { |
|
|
|
|
JPanel pane = new JPanel(new BorderLayout()); |
|
|
|
|
// TODO: 方法之间的耦合还比较严重。现在必须先执行 createShowContentPane,再执行 createSeniorCheckPane。否则出现 npe。
|
|
|
|
|
pane.add(createTextOverflowPane(), BorderLayout.SOUTH); |
|
|
|
|
pane.add(createShowContentPane(), BorderLayout.CENTER); |
|
|
|
|
pane.add(createSeniorCheckPane(), BorderLayout.NORTH); |
|
|
|
|
return pane; |
|
|
|
|
initTextOverflowPane(); |
|
|
|
|
initShowContentPane(); |
|
|
|
|
return Layouts.column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
cell(createSeniorCheckPane()), |
|
|
|
|
cell(showContentPane), |
|
|
|
|
cell(overflowPane) |
|
|
|
|
).getComponent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createShowContentPane() { |
|
|
|
|
double[] rowSize = {p, p, p, p}; |
|
|
|
|
double[] colSize = {f, COMBO_WIDTH}; |
|
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
|
|
|
|
|
|
JPanel fileNamePane = createNormal(); |
|
|
|
|
fileNamePane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); |
|
|
|
|
private void initShowContentPane() { |
|
|
|
|
showContent = new UIComboBox(new String[]{ |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Show_As_Image"), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Show_As_HTML"), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_As_Download")}); |
|
|
|
|
UILabel downloadLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_File_Name_For_Download")); |
|
|
|
|
fileNameTextField = new UITextField(); |
|
|
|
|
|
|
|
|
|
UILabel showContentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Content"), SwingConstants.LEFT); |
|
|
|
|
UIComponentUtils.setLineWrap(showContentLabel); |
|
|
|
|
UILabel toolTipLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip")); |
|
|
|
|
|
|
|
|
|
tooltipLayout = new CardLayout(); |
|
|
|
|
tooltipPane = new JPanel(tooltipLayout); |
|
|
|
|
tooltipPane.add(new JPanel(), "none"); |
|
|
|
|
tooltipPane.add(tooltipTextField, "content"); |
|
|
|
|
tooltipPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
tooltipButtonGroup = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip_Custom"), Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip_CellValue")}); |
|
|
|
|
tooltipButtonGroup.addChangeListener(new ChangeListener() { |
|
|
|
|
@Override |
|
|
|
|
public void stateChanged(ChangeEvent e) { |
|
|
|
|
if (tooltipButtonGroup.getSelectedIndex() == 0) { |
|
|
|
|
tooltipPane.setPreferredSize(new Dimension(154, FineUIScale.scale(UIManager.getInt("CellOtherSetPane.height")))); |
|
|
|
|
tooltipLayout.show(tooltipPane, "content"); |
|
|
|
|
initTooltipPane(); |
|
|
|
|
showContentPane = ReactiveCardPane.create() |
|
|
|
|
.addSupplier("default", () -> column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
row( |
|
|
|
|
cell(showContentLabel).weight(1.2), cell(showContent).weight(3.0) |
|
|
|
|
), |
|
|
|
|
cell(tooltipPane) |
|
|
|
|
).getComponent()) |
|
|
|
|
.addSupplier("download", () -> column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
row( |
|
|
|
|
cell(showContentLabel).weight(1.2), cell(showContent).weight(3.0) |
|
|
|
|
), |
|
|
|
|
row( |
|
|
|
|
cell(downloadLabel).weight(1.2), cell(fileNameTextField).weight(3.0) |
|
|
|
|
), |
|
|
|
|
cell(tooltipPane) |
|
|
|
|
).getComponent()); |
|
|
|
|
showContentPane.select("default").populate(); |
|
|
|
|
|
|
|
|
|
showContent.addItemListener(e -> { |
|
|
|
|
if (e.getStateChange() == ItemEvent.SELECTED) { |
|
|
|
|
if (showContent.getSelectedIndex() == DOWNLOAD_INDEX) { |
|
|
|
|
showContentPane.select("download").populate(); |
|
|
|
|
} else { |
|
|
|
|
tooltipLayout.show(tooltipPane, "none"); |
|
|
|
|
tooltipPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
showContentPane.select("default").populate(); |
|
|
|
|
} |
|
|
|
|
handleCellShowStyleChange(e); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{showContentLabel, UIComponentUtils.wrapWithBorderLayoutPane(showContent)}, |
|
|
|
|
new Component[]{fileNamePane, null}, // 选择"用下载连接显示二进制内容"时,会显示这一行的面板
|
|
|
|
|
new Component[]{toolTipLabel, tooltipButtonGroup}, // “自定义”or"单元格值"
|
|
|
|
|
new Component[]{null, tooltipPane} // 选择“自定义”时显示这一行
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
JPanel showContentPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, colSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM); |
|
|
|
|
showContentPane.setBorder(BorderFactory.createEmptyBorder(6, 0, 6, 0)); |
|
|
|
|
|
|
|
|
|
return showContentPane; |
|
|
|
|
private void initTooltipPane() { |
|
|
|
|
UILabel toolTipLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip")); |
|
|
|
|
tooltipButtonGroup = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip_Custom"), |
|
|
|
|
Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip_CellValue")}); |
|
|
|
|
tooltipTextField = new UITextField(); |
|
|
|
|
tooltipPane = ReactiveCardPane.create() |
|
|
|
|
.addSupplier("define", () -> column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
row( |
|
|
|
|
cell(toolTipLabel).weight(1.2), cell(tooltipButtonGroup).weight(3.0) |
|
|
|
|
), |
|
|
|
|
row( |
|
|
|
|
flex(1.2), cell(tooltipTextField).weight(3.0) |
|
|
|
|
) |
|
|
|
|
).getComponent()) |
|
|
|
|
.addSupplier("cellValue", () -> column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
row( |
|
|
|
|
cell(toolTipLabel).weight(1.2), cell(tooltipButtonGroup).weight(3.0) |
|
|
|
|
) |
|
|
|
|
).getComponent()); |
|
|
|
|
tooltipPane.select("define").populate(); |
|
|
|
|
|
|
|
|
|
tooltipButtonGroup.addChangeListener(e -> { |
|
|
|
|
if (tooltipButtonGroup.getSelectedIndex() == 0) { |
|
|
|
|
tooltipPane.select("define").populate(); |
|
|
|
|
} else { |
|
|
|
|
tooltipPane.select("cellValue").populate(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createTextOverflowPane() { |
|
|
|
|
showPartLayout = new CardLayout(); |
|
|
|
|
showPartPane = new JPanel(showPartLayout); |
|
|
|
|
private void initTextOverflowPane() { |
|
|
|
|
showCharNums = new UISpinner(0, Integer.MAX_VALUE, 1, 10); |
|
|
|
|
JPanel showPartNumPane = new JPanel(new BorderLayout(4, 0)); |
|
|
|
|
showPartNumPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_Nums")), BorderLayout.WEST); |
|
|
|
|
showPartNumPane.add(showCharNums, BorderLayout.CENTER); |
|
|
|
|
showPartPane.add(new JPanel(), "none"); |
|
|
|
|
showPartPane.add(showPartNumPane, "content"); |
|
|
|
|
UILabel numberLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_Nums")); |
|
|
|
|
showPartComboBox = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_CharNum"), Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_CellWidth")}); |
|
|
|
|
showPartComboBox.addItemListener(new ItemListener() { |
|
|
|
|
@Override |
|
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
textOverflowTypeComboBox = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_Ellipsis"), Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_NoneSymbol")}); |
|
|
|
|
UILabel showPartLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_ShowPart")); |
|
|
|
|
UILabel hideTypeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_HideType")); |
|
|
|
|
textOverflowCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_HideWhenOverflow")); |
|
|
|
|
|
|
|
|
|
overflowPane = ReactiveCardPane.create() |
|
|
|
|
.addSupplier("empty", () -> column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
cell(textOverflowCheckBox) |
|
|
|
|
).getComponent()) |
|
|
|
|
.addSupplier("showChar", () -> column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
cell(textOverflowCheckBox), |
|
|
|
|
row(cell(showPartLabel).weight(1.2), cell(showPartComboBox).weight(1.6), flex(0.1), cell(numberLabel).weight(0.5), cell(showCharNums).weight(0.8)), |
|
|
|
|
row(cell(hideTypeLabel).weight(1.2), cell(textOverflowTypeComboBox).weight(3.0)) |
|
|
|
|
).getComponent()) |
|
|
|
|
.addSupplier("showCell", () -> column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
cell(textOverflowCheckBox), |
|
|
|
|
row(cell(showPartLabel).weight(1.2), cell(showPartComboBox).weight(3.0)), |
|
|
|
|
row(cell(hideTypeLabel).weight(1.2), cell(textOverflowTypeComboBox).weight(3.0)) |
|
|
|
|
).getComponent()); |
|
|
|
|
overflowPane.select("empty").populate(); |
|
|
|
|
showPartComboBox.addItemListener(e -> { |
|
|
|
|
if (showPartComboBox.getSelectedIndex() == 0) { |
|
|
|
|
overflowPane.select("showChar").populate(); |
|
|
|
|
} else { |
|
|
|
|
overflowPane.select("showCell").populate(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
textOverflowCheckBox.addItemListener(e -> { |
|
|
|
|
if (e.getStateChange() == ItemEvent.SELECTED) { |
|
|
|
|
if (showPartComboBox.getSelectedIndex() == 0) { |
|
|
|
|
showPartPane.setPreferredSize(new Dimension(70, FineUIScale.scale(UIManager.getInt("CellOtherSetPane.height")))); |
|
|
|
|
showPartLayout.show(showPartPane, "content"); |
|
|
|
|
overflowPane.select("showChar").populate(); |
|
|
|
|
} else { |
|
|
|
|
showPartLayout.show(showPartPane, "none"); |
|
|
|
|
showPartPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
overflowPane.select("showCell").populate(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
textOverflowTypeComboBox = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_Ellipsis"), Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_NoneSymbol")}); |
|
|
|
|
UILabel showPartLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_ShowPart") + ":"); |
|
|
|
|
UILabel hideTypeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_HideType") + ":"); |
|
|
|
|
Component[][] textOverflowComponents = new Component[][]{ |
|
|
|
|
new Component[]{showPartLabel, showPartComboBox, showPartPane}, |
|
|
|
|
new Component[]{hideTypeLabel, textOverflowTypeComboBox, null} |
|
|
|
|
}; |
|
|
|
|
JPanel textOverflowComPane = TableLayoutHelper.createTableLayoutPane(textOverflowComponents, new double[]{p, p}, new double[]{p, f, p}); |
|
|
|
|
textOverflowComPane.setVisible(false); |
|
|
|
|
textOverflowCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_HideWhenOverflow")); |
|
|
|
|
textOverflowCheckBox.addItemListener(new ItemListener() { |
|
|
|
|
@Override |
|
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
textOverflowComPane.setVisible(e.getStateChange() == ItemEvent.SELECTED); |
|
|
|
|
if (e.getStateChange() == ItemEvent.SELECTED) { |
|
|
|
|
if (showPartComboBox.getSelectedIndex() == 0) { |
|
|
|
|
showPartPane.setPreferredSize(new Dimension(70, FineUIScale.scale(UIManager.getInt("CellOtherSetPane.height")))); |
|
|
|
|
showPartLayout.show(showPartPane, "content"); |
|
|
|
|
} else { |
|
|
|
|
showPartLayout.show(showPartPane, "none"); |
|
|
|
|
showPartPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
} |
|
|
|
|
// 记录目前自动调整哪个被选中
|
|
|
|
|
for (int i = 0; i < adjustRadioButtons.length; i++) { |
|
|
|
|
if (adjustRadioButtons[i].isSelected()) { |
|
|
|
|
curSelectedIndex = i; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
// 记录目前自动调整哪个被选中
|
|
|
|
|
for (int i = 0; i < adjustRadioButtons.length; i++) { |
|
|
|
|
if (adjustRadioButtons[i].isSelected()) { |
|
|
|
|
curSelectedIndex = i; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
noAutoRadioButton.setSelected(true); |
|
|
|
|
} else { |
|
|
|
|
adjustRadioButtons[curSelectedIndex].setSelected(true); |
|
|
|
|
} |
|
|
|
|
noAutoRadioButton.setSelected(true); |
|
|
|
|
} else { |
|
|
|
|
overflowPane.select("empty").populate(); |
|
|
|
|
adjustRadioButtons[curSelectedIndex].setSelected(true); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
JPanel dynamicPaneWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
dynamicPaneWrapper.add(textOverflowComPane); |
|
|
|
|
JPanel textOverflowPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
|
textOverflowPane.add(textOverflowCheckBox, BorderLayout.NORTH); |
|
|
|
|
textOverflowPane.add(dynamicPaneWrapper, BorderLayout.CENTER); |
|
|
|
|
textOverflowPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); |
|
|
|
|
return textOverflowPane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel createSeniorCheckPane() { |
|
|
|
|
previewCellContent.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); |
|
|
|
|
printAndExportContent.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); |
|
|
|
|
printAndExportBackground.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); |
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double[] rowSize = {p, p, p, p}; |
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{null, null}, |
|
|
|
|
new Component[]{previewCellContent, null}, |
|
|
|
|
new Component[]{printAndExportContent, null}, |
|
|
|
|
new Component[]{printAndExportBackground, null}, |
|
|
|
|
}; |
|
|
|
|
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_LARGE); |
|
|
|
|
previewCellContent = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Preview_Cell_Content")); |
|
|
|
|
printAndExportContent = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Print_Content")); |
|
|
|
|
printAndExportBackground = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Print_Background")); |
|
|
|
|
return Layouts.column(LayoutConstants.VERTICAL_GAP, |
|
|
|
|
cell(previewCellContent), |
|
|
|
|
cell(printAndExportContent), |
|
|
|
|
cell(printAndExportBackground) |
|
|
|
|
).getComponent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private JPanel pagePane() { |
|
|
|
@ -451,73 +418,31 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
canBreakOnPaginateCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_CellPage_Can_Break_On_Paginate")); |
|
|
|
|
repeatCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_CellPage_Repeat_Content_When_Paging")); |
|
|
|
|
pageFixedRowDataCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_CellWrite_Page_Fixed_Row_Cell")); |
|
|
|
|
currentPageFixedRowDataTipLabel = new UILabel(" (" + Toolkit.i18nText("Fine-Design_Report_CellWrite_No_Page_Fixed_Row_Cell") +")"); |
|
|
|
|
|
|
|
|
|
pageBeforeRowCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); |
|
|
|
|
pageAfterRowCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); |
|
|
|
|
pageBeforeColumnCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); |
|
|
|
|
pageAfterColumnCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); |
|
|
|
|
canBreakOnPaginateCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); |
|
|
|
|
repeatCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); |
|
|
|
|
pageFixedRowDataCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); |
|
|
|
|
currentPageFixedRowDataTipLabel.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); |
|
|
|
|
currentPageFixedRowDataTipLabel.setForeground(TIPS_FONT_COLOR); |
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p, p}; |
|
|
|
|
double[] columnSize = {p}; |
|
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
new Component[]{null}, |
|
|
|
|
new Component[]{pageBeforeRowCheckBox}, |
|
|
|
|
new Component[]{pageAfterRowCheckBox}, |
|
|
|
|
new Component[]{null}, |
|
|
|
|
new Component[]{pageBeforeColumnCheckBox}, |
|
|
|
|
new Component[]{pageAfterColumnCheckBox}, |
|
|
|
|
new Component[]{null}, |
|
|
|
|
new Component[]{canBreakOnPaginateCheckBox}, |
|
|
|
|
new Component[]{repeatCheckBox}, |
|
|
|
|
new Component[]{null}, |
|
|
|
|
new Component[]{pageFixedRowDataCheckBox}, |
|
|
|
|
new Component[]{currentPageFixedRowDataTipLabel} |
|
|
|
|
}; |
|
|
|
|
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_LARGE); |
|
|
|
|
currentPageFixedRowDataTipLabel = new UILabel(" (" + Toolkit.i18nText("Fine-Design_Report_CellWrite_No_Page_Fixed_Row_Cell") +")", SwingConstants.LEFT); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
currentPageFixedRowDataTipLabel.setForeground(TIPS_FONT_COLOR); |
|
|
|
|
return Layouts.column( |
|
|
|
|
cell(pageBeforeRowCheckBox), |
|
|
|
|
fix(LayoutConstants.VERTICAL_GAP), |
|
|
|
|
cell(pageAfterRowCheckBox), |
|
|
|
|
fix(LayoutConstants.VGAP_SMALL + LayoutConstants.VERTICAL_GAP), |
|
|
|
|
|
|
|
|
|
cell(pageBeforeColumnCheckBox), |
|
|
|
|
fix(LayoutConstants.VERTICAL_GAP), |
|
|
|
|
cell(pageAfterColumnCheckBox), |
|
|
|
|
fix(LayoutConstants.VGAP_SMALL + LayoutConstants.VERTICAL_GAP), |
|
|
|
|
|
|
|
|
|
cell(canBreakOnPaginateCheckBox), |
|
|
|
|
fix(LayoutConstants.VERTICAL_GAP), |
|
|
|
|
cell(repeatCheckBox), |
|
|
|
|
fix(LayoutConstants.VGAP_SMALL + LayoutConstants.VERTICAL_GAP), |
|
|
|
|
|
|
|
|
|
cell(pageFixedRowDataCheckBox), |
|
|
|
|
fix(LayoutConstants.VERTICAL_GAP), |
|
|
|
|
cell(currentPageFixedRowDataTipLabel) |
|
|
|
|
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, LayoutConstants.VERTICAL_GAP, 0)) |
|
|
|
|
).getComponent(); |
|
|
|
|
|
|
|
|
|
private JPanel createNormal() { |
|
|
|
|
previewCellContent = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Preview_Cell_Content")); |
|
|
|
|
printAndExportContent = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Print_Content")); |
|
|
|
|
printAndExportBackground = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Print_Background")); |
|
|
|
|
showContent = new UIComboBox(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Show_As_Image"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_Show_As_HTML"), |
|
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_As_Download")}); |
|
|
|
|
final CardLayout fileNameLayout = new CardLayout(); |
|
|
|
|
final JPanel fileNamePane = new JPanel(fileNameLayout); |
|
|
|
|
JPanel fileNameCCPane = new JPanel(new BorderLayout(4, 0)); |
|
|
|
|
fileNameCCPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_File_Name_For_Download")), BorderLayout.WEST); |
|
|
|
|
fileNameTextField = new UITextField(); |
|
|
|
|
tooltipTextField = new UITextField(); |
|
|
|
|
tooltipTextField.getUI(); |
|
|
|
|
fileNamePane.add(new JPanel(), "none"); |
|
|
|
|
fileNamePane.add(fileNameCCPane, "content"); |
|
|
|
|
fileNamePane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
fileNameCCPane.add(fileNameTextField, BorderLayout.CENTER); |
|
|
|
|
showContent.addItemListener(new ItemListener() { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
if (e.getStateChange() == ItemEvent.SELECTED) { |
|
|
|
|
if (showContent.getSelectedIndex() == 3) { |
|
|
|
|
fileNamePane.setPreferredSize(new Dimension(100, FineUIScale.scale(UIManager.getInt("CellOtherSetPane.height")))); |
|
|
|
|
fileNameLayout.show(fileNamePane, "content"); |
|
|
|
|
} else { |
|
|
|
|
fileNameLayout.show(fileNamePane, "none"); |
|
|
|
|
fileNamePane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
} |
|
|
|
|
handleCellShowStyleChange(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return fileNamePane; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void handleCellShowStyleChange(ItemEvent itemEvent) { |
|
|
|
@ -567,7 +492,6 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String getIconPath() { |
|
|
|
|
// return "com/fr/design/images/m_format/cellstyle/otherset.png";
|
|
|
|
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -632,11 +556,9 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
tooltipButtonGroup.setSelectedIndex(1); |
|
|
|
|
} |
|
|
|
|
if (tooltipButtonGroup.getSelectedIndex() == 0) { |
|
|
|
|
tooltipPane.setPreferredSize(new Dimension(100, FineUIScale.scale(UIManager.getInt("CellOtherSetPane.height")))); |
|
|
|
|
tooltipLayout.show(tooltipPane, "content"); |
|
|
|
|
tooltipPane.select("define").populate(); |
|
|
|
|
} else { |
|
|
|
|
tooltipLayout.show(tooltipPane, "none"); |
|
|
|
|
tooltipPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
tooltipPane.select("cellValue").populate(); |
|
|
|
|
} |
|
|
|
|
tooltipPane.setVisible(true); |
|
|
|
|
if (cellGUIAttr.isHideTextWhenOverflow()) { |
|
|
|
@ -647,7 +569,6 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
} else { |
|
|
|
|
showPartComboBox.setSelectedIndex(1); |
|
|
|
|
} |
|
|
|
|
showPartPane.setVisible(true); |
|
|
|
|
if (cellGUIAttr.isTextOverflowEllipsis()) { |
|
|
|
|
textOverflowTypeComboBox.setSelectedItem(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_Ellipsis")); |
|
|
|
|
} else { |
|
|
|
@ -684,19 +605,13 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
insertRowPolicyButtonGroup.setSelectedIndex(0); |
|
|
|
|
this.valueEditor.populate(StringUtils.EMPTY); |
|
|
|
|
} |
|
|
|
|
if (insertRowPolicyButtonGroup.getSelectedIndex() == 1) { |
|
|
|
|
insertRowPane.setPreferredSize(new Dimension(100, FineUIScale.scale(UIManager.getInt("CellOtherSetPane.height")))); |
|
|
|
|
insertRowLayout.show(insertRowPane, "content"); |
|
|
|
|
} else { |
|
|
|
|
insertRowLayout.show(insertRowPane, "none"); |
|
|
|
|
insertRowPane.setPreferredSize(new Dimension(0, 0)); |
|
|
|
|
} |
|
|
|
|
String key = insertRowPolicyButtonGroup.getSelectedIndex() == 1 ? "default" : "empty"; |
|
|
|
|
insertRowPolicyPane.select(key).populate(); |
|
|
|
|
insertRowPolicyPane.setVisible(true); |
|
|
|
|
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); |
|
|
|
|
if (!jTemplate.isJWorkBook()) { //表单中报表块编辑屏蔽掉 插入行策略
|
|
|
|
|
insertRowPolicyPane.setVisible(false); |
|
|
|
|
insertRowPolicyPane.select("empty").populate(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
populateDesensitizationBean(cellElement); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -816,7 +731,8 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
|
|
|
|
|
if (cellDesensitizationAttr == null) { |
|
|
|
|
cellDesensitizationAttr = new CellDesensitizationAttr(); |
|
|
|
|
} |
|
|
|
|
cellDesensitizationAttr.setScope(exportButton.isSelected() ? EXPORT_SCOPE : PREVIEW_AND_EXPORT_SCOPE); |
|
|
|
|
int previewAndExportScope = CellDesensitizationAttr.PREVIEW_AND_EXPORT_SCOPE; |
|
|
|
|
cellDesensitizationAttr.setScope(exportButton.isSelected() ? EXPORT_SCOPE : previewAndExportScope); |
|
|
|
|
cellDesensitizationAttr.setDesensitizationBeans(new ArrayList<>(groupsPane.update())); |
|
|
|
|
cellElement.addCellAttr(cellDesensitizationAttr); |
|
|
|
|
} |
|
|
|
|