Browse Source

Merge pull request #1183 in BA/design from ~YAOH.WU/a_design_0811:release/9.0 to release/9.0

* commit '88b8591d034f3f4191a56c44b058be2f4b079e12':
  REPORT-4361 单元格元素 数据列 数据设置 分组 高级 自定义按钮问题
master
superman 7 years ago
parent
commit
d681ee5aa9
  1. 31
      designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java
  2. 2
      designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

31
designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java

@ -7,7 +7,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
@ -41,12 +40,12 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
private ItemListener listener; private ItemListener listener;
public ResultSetGroupDockingPane(ElementCasePane ePane) { public ResultSetGroupDockingPane() {
super(); super();
this.initComponents(ePane); this.initComponents();
} }
public void initComponents(ElementCasePane ePane) { public void initComponents() {
goBox = new UIComboBox(new String[]{Inter.getLocText("BindColumn-Group"), Inter.getLocText("BindColumn-Select"), Inter.getLocText("BindColumn-Summary")}); goBox = new UIComboBox(new String[]{Inter.getLocText("BindColumn-Group"), Inter.getLocText("BindColumn-Select"), Inter.getLocText("BindColumn-Summary")});
initCardPane(); initCardPane();
contentPane = layoutPane(); contentPane = layoutPane();
@ -66,22 +65,23 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
}; };
goBox.addItemListener(new ItemListener() { goBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent ee) { public void itemStateChanged(ItemEvent ee) {
checkButtonEnabled();
int i = goBox.getSelectedIndex(); int i = goBox.getSelectedIndex();
if (i == BIND_GROUP) { if (i == BIND_GROUP) {
cardLayout.show(cardPane, "groupPane"); cardLayout.show(cardPane, "groupPane");
cardPane.setPreferredSize(new Dimension(156, 20)); cardPane.setPreferredSize(new Dimension(158, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 10); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 10);
checkButtonEnabled();
} else if (i == BIND_SELECTED) { } else if (i == BIND_SELECTED) {
cardLayout.show(cardPane, "listPane"); cardLayout.show(cardPane, "listPane");
cardPane.setPreferredSize(new Dimension(0, 0)); cardPane.setPreferredSize(new Dimension(0, 0));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 0);
} else if (i == BIND_SUMMARY) { } else if (i == BIND_SUMMARY) {
cardLayout.show(cardPane, "summaryPane"); cardLayout.show(cardPane, "summaryPane");
cardPane.setPreferredSize(new Dimension(156, 20)); cardPane.setPreferredSize(new Dimension(158, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 10); TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, 10);
CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr(); CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr();
cellExpandAttr.setDirection(Constants.NONE); cellExpandAttr.setDirection(Constants.NONE);
checkButtonEnabled();
} }
} }
}); });
@ -96,7 +96,6 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
cardLayout = new CardLayout(); cardLayout = new CardLayout();
cardPane.setLayout(cardLayout); cardPane.setLayout(cardLayout);
JPanel pane = new JPanel(new BorderLayout(3, 0));
groupComboBox.addItemListener(new ItemListener() { groupComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
checkButtonEnabled(); checkButtonEnabled();
@ -104,7 +103,9 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
}); });
advancedButton = new UIButton(Inter.getLocText("Custom")); advancedButton = new UIButton(Inter.getLocText("Custom"));
advancedButton.addActionListener(groupAdvancedListener); advancedButton.addActionListener(groupAdvancedListener);
pane.add(groupComboBox, BorderLayout.WEST);
JPanel pane = new JPanel(new BorderLayout(0, 10));
pane.add(groupComboBox, BorderLayout.NORTH);
pane.add(advancedButton, BorderLayout.CENTER); pane.add(advancedButton, BorderLayout.CENTER);
cardPane.add(pane, "groupPane"); cardPane.add(pane, "groupPane");
@ -124,7 +125,7 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
// RecordGrouper // RecordGrouper
recordGrouper = dSColumn.getGrouper(); recordGrouper = dSColumn.getGrouper();
if (recordGrouper instanceof FunctionGrouper && !((FunctionGrouper) recordGrouper).isCustom()) { if (recordGrouper instanceof FunctionGrouper && !((FunctionGrouper) recordGrouper).isCustom()) {
int mode = ((FunctionGrouper) recordGrouper).getDivideMode(); int mode = recordGrouper.getDivideMode();
if (mode == FunctionGrouper.GROUPING_MODE) { if (mode == FunctionGrouper.GROUPING_MODE) {
cardLayout.show(cardPane, "groupPane"); cardLayout.show(cardPane, "groupPane");
this.goBox.setSelectedIndex(BIND_GROUP); this.goBox.setSelectedIndex(BIND_GROUP);
@ -152,7 +153,6 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
this.goBox.setSelectedIndex(BIND_GROUP); this.goBox.setSelectedIndex(BIND_GROUP);
this.groupComboBox.setSelectedIndex(ADVANCED); this.groupComboBox.setSelectedIndex(ADVANCED);
} }
checkButtonEnabled(); checkButtonEnabled();
} }
@ -190,6 +190,15 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
advancedButton.setEnabled(true); advancedButton.setEnabled(true);
} }
} }
if (advancedButton.isEnabled()) {
cardPane.setPreferredSize(new Dimension(158, 50));
cardPane.revalidate();
cardPane.repaint();
} else {
cardPane.setPreferredSize(new Dimension(158, 20));
cardPane.revalidate();
cardPane.repaint();
}
} }
public void addListener(ItemListener listener) { public void addListener(ItemListener listener) {

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

@ -217,7 +217,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
DSColumnBasicEditorPane() { DSColumnBasicEditorPane() {
dataPane = new SelectedDataColumnPane(true, true, tc, cellElement); dataPane = new SelectedDataColumnPane(true, true, tc, cellElement);
groupPane = new ResultSetGroupDockingPane(tc); groupPane = new ResultSetGroupDockingPane();
dataPane.addListener(dataListener); dataPane.addListener(dataListener);
groupPane.addListener(groupListener); groupPane.addListener(groupListener);

Loading…
Cancel
Save