Browse Source

REPORT-4728 设计器单元格元素数据列过滤指定设置不能保存

master
yaoh.wu 7 years ago
parent
commit
7c216b6af6
  1. 67
      designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

67
designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -669,24 +669,12 @@ public class CellDSColumnEditor extends CellQuickEditor {
private JFormulaField topFormulaPane; private JFormulaField topFormulaPane;
private JFormulaField bottomFormulaPane; private JFormulaField bottomFormulaPane;
public ResultSetFilterConfigPane() { private ActionListener actionListener = new ActionListener() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel filterLabel = new UILabel(Inter.getLocText("BindColumn-Results_Filter"));
//结果集筛选下拉框
rsComboBox = new UIComboBox(new String[]{
Inter.getLocText("Undefined"),
Inter.getLocText("BindColumn-Top_N"),
Inter.getLocText("BindColumn-Bottom_N"),
Inter.getLocText("Odd"),
Inter.getLocText("Even"),
Inter.getLocText("Specify")
});
rsComboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
int selectIndex = rsComboBox.getSelectedIndex(); int selectIndex = rsComboBox.getSelectedIndex();
CardLayout setCardPaneLayout = (CardLayout) setCardPane.getLayout(); CardLayout setCardPaneLayout = (CardLayout) setCardPane.getLayout();
CardLayout tipCardPaneLayout = (CardLayout) tipCardPane.getLayout(); CardLayout tipCardPaneLayout = (CardLayout) tipCardPane.getLayout();
if (selectIndex == 1) { if (selectIndex == SelectCount.TOP) {
//前N个 //前N个
setCardPaneLayout.show(setCardPane, FilterType.TOP.name()); setCardPaneLayout.show(setCardPane, FilterType.TOP.name());
tipCardPaneLayout.show(tipCardPane, FilterType.TOP.name()); tipCardPaneLayout.show(tipCardPane, FilterType.TOP.name());
@ -695,7 +683,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(0, 0)); tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
} else if (selectIndex == 2) { } else if (selectIndex == SelectCount.BOTTOM) {
//后N个 //后N个
setCardPaneLayout.show(setCardPane, FilterType.BOTTOM.name()); setCardPaneLayout.show(setCardPane, FilterType.BOTTOM.name());
tipCardPaneLayout.show(tipCardPane, FilterType.BOTTOM.name()); tipCardPaneLayout.show(tipCardPane, FilterType.BOTTOM.name());
@ -704,7 +692,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(0, 0)); tipCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
} else if (selectIndex == 3) { } else if (selectIndex == SelectCount.ODD) {
//奇数 //奇数
setCardPaneLayout.show(setCardPane, FilterType.ODD.name()); setCardPaneLayout.show(setCardPane, FilterType.ODD.name());
tipCardPaneLayout.show(tipCardPane, FilterType.ODD.name()); tipCardPaneLayout.show(tipCardPane, FilterType.ODD.name());
@ -713,7 +701,8 @@ public class CellDSColumnEditor extends CellQuickEditor {
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
tipCardPane.setPreferredSize(new Dimension(224, 40)); tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
} else if (selectIndex == 4) { } else if (selectIndex == SelectCount.EVEN) {
//偶数
setCardPaneLayout.show(setCardPane, FilterType.EVEN.name()); setCardPaneLayout.show(setCardPane, FilterType.EVEN.name());
tipCardPaneLayout.show(tipCardPane, FilterType.EVEN.name()); tipCardPaneLayout.show(tipCardPane, FilterType.EVEN.name());
//隐藏set 显示tip //隐藏set 显示tip
@ -721,7 +710,8 @@ public class CellDSColumnEditor extends CellQuickEditor {
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
tipCardPane.setPreferredSize(new Dimension(224, 40)); tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
} else if (selectIndex == 5) { } else if (selectIndex == SelectCount.SPECIFY) {
//指定
setCardPaneLayout.show(setCardPane, FilterType.SPECIFY.name()); setCardPaneLayout.show(setCardPane, FilterType.SPECIFY.name());
tipCardPaneLayout.show(tipCardPane, FilterType.SPECIFY.name()); tipCardPaneLayout.show(tipCardPane, FilterType.SPECIFY.name());
//显示set和tip //显示set和tip
@ -730,6 +720,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
tipCardPane.setPreferredSize(new Dimension(224, 40)); tipCardPane.setPreferredSize(new Dimension(224, 40));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
} else { } else {
//未定义
setCardPaneLayout.show(setCardPane, FilterType.UNDEFINE.name()); setCardPaneLayout.show(setCardPane, FilterType.UNDEFINE.name());
tipCardPaneLayout.show(tipCardPane, FilterType.UNDEFINE.name()); tipCardPaneLayout.show(tipCardPane, FilterType.UNDEFINE.name());
//隐藏set和tip //隐藏set和tip
@ -739,7 +730,21 @@ public class CellDSColumnEditor extends CellQuickEditor {
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
} }
} }
};
public ResultSetFilterConfigPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel filterLabel = new UILabel(Inter.getLocText("BindColumn-Results_Filter"));
//结果集筛选下拉框
rsComboBox = new UIComboBox(new String[]{
Inter.getLocText("Undefined"),
Inter.getLocText("BindColumn-Top_N"),
Inter.getLocText("BindColumn-Bottom_N"),
Inter.getLocText("Odd"),
Inter.getLocText("Even"),
Inter.getLocText("Specify")
}); });
rsComboBox.addActionListener(actionListener);
//配置展示CardLayout //配置展示CardLayout
setCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); setCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
//提示信息展示CardLayout //提示信息展示CardLayout
@ -787,6 +792,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
} }
public void populate(CellElement cellElement) { public void populate(CellElement cellElement) {
rsComboBox.removeActionListener(actionListener);
if (cellElement != null) { if (cellElement != null) {
Object value = cellElement.getValue(); Object value = cellElement.getValue();
if (value != null && value instanceof DSColumn) { if (value != null && value instanceof DSColumn) {
@ -794,12 +800,17 @@ public class CellDSColumnEditor extends CellQuickEditor {
SelectCount selectCount = dSColumn.getSelectCount(); SelectCount selectCount = dSColumn.getSelectCount();
this.topFormulaPane.populateElement(cellElement); this.topFormulaPane.populateElement(cellElement);
this.bottomFormulaPane.populateElement(cellElement); this.bottomFormulaPane.populateElement(cellElement);
CardLayout setCardPaneLayout = (CardLayout) setCardPane.getLayout();
CardLayout tipCardPaneLayout = (CardLayout) tipCardPane.getLayout();
if (selectCount != null) { if (selectCount != null) {
int selectCountType = selectCount.getType(); int selectCountType = selectCount.getType();
this.rsComboBox.setSelectedIndex(selectCountType); this.rsComboBox.setSelectedIndex(selectCountType);
switch (selectCountType) { switch (selectCountType) {
case SelectCount.TOP: case SelectCount.TOP:
this.topFormulaPane.populate(selectCount.getFormulaCount()); this.topFormulaPane.populate(selectCount.getFormulaCount());
//前N个
setCardPaneLayout.show(setCardPane, FilterType.TOP.name());
tipCardPaneLayout.show(tipCardPane, FilterType.TOP.name());
//隐藏tip 显示set //隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(156, 20)); setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
@ -808,6 +819,9 @@ public class CellDSColumnEditor extends CellQuickEditor {
break; break;
case SelectCount.BOTTOM: case SelectCount.BOTTOM:
this.bottomFormulaPane.populate(selectCount.getFormulaCount()); this.bottomFormulaPane.populate(selectCount.getFormulaCount());
//后N个
setCardPaneLayout.show(setCardPane, FilterType.BOTTOM.name());
tipCardPaneLayout.show(tipCardPane, FilterType.BOTTOM.name());
//隐藏tip 显示set //隐藏tip 显示set
setCardPane.setPreferredSize(new Dimension(156, 20)); setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
@ -816,6 +830,9 @@ public class CellDSColumnEditor extends CellQuickEditor {
break; break;
case SelectCount.SPECIFY: case SelectCount.SPECIFY:
this.serialTextField.setText(selectCount.getSerial()); this.serialTextField.setText(selectCount.getSerial());
//指定
setCardPaneLayout.show(setCardPane, FilterType.SPECIFY.name());
tipCardPaneLayout.show(tipCardPane, FilterType.SPECIFY.name());
//显示set和tip //显示set和tip
setCardPane.setPreferredSize(new Dimension(156, 20)); setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
@ -823,6 +840,9 @@ public class CellDSColumnEditor extends CellQuickEditor {
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
break; break;
case SelectCount.EVEN: case SelectCount.EVEN:
//偶数
setCardPaneLayout.show(setCardPane, FilterType.EVEN.name());
tipCardPaneLayout.show(tipCardPane, FilterType.EVEN.name());
//隐藏set 显示tip //隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0)); setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
@ -830,6 +850,9 @@ public class CellDSColumnEditor extends CellQuickEditor {
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
break; break;
case SelectCount.ODD: case SelectCount.ODD:
//奇数
setCardPaneLayout.show(setCardPane, FilterType.ODD.name());
tipCardPaneLayout.show(tipCardPane, FilterType.ODD.name());
//隐藏set 显示tip //隐藏set 显示tip
setCardPane.setPreferredSize(new Dimension(0, 0)); setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
@ -837,6 +860,9 @@ public class CellDSColumnEditor extends CellQuickEditor {
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
break; break;
default: default:
//未定义
setCardPaneLayout.show(setCardPane, FilterType.UNDEFINE.name());
tipCardPaneLayout.show(tipCardPane, FilterType.UNDEFINE.name());
//隐藏set和tip //隐藏set和tip
setCardPane.setPreferredSize(new Dimension(0, 0)); setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
@ -844,6 +870,9 @@ public class CellDSColumnEditor extends CellQuickEditor {
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, 0);
} }
} else { } else {
//未定义
setCardPaneLayout.show(setCardPane, FilterType.UNDEFINE.name());
tipCardPaneLayout.show(tipCardPane, FilterType.UNDEFINE.name());
//隐藏set和tip //隐藏set和tip
setCardPane.setPreferredSize(new Dimension(0, 0)); setCardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
@ -852,6 +881,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
} }
} }
} }
rsComboBox.addActionListener(actionListener);
} }
public void update(CellElement cellElement) { public void update(CellElement cellElement) {
@ -887,6 +917,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
topFormulaPane.addListener(formulaListener); topFormulaPane.addListener(formulaListener);
bottomFormulaPane.addListener(formulaListener); bottomFormulaPane.addListener(formulaListener);
rsComboBox.registerChangeListener(formulaListener); rsComboBox.registerChangeListener(formulaListener);
serialTextField.registerChangeListener(formulaListener);
} }
} }

Loading…
Cancel
Save