Browse Source

Pull request #7386: REPORT-65125 & REPORT-65124

Merge in DESIGN/design from ~STARRYI/design:release/11.0 to release/11.0

* commit 'e1beb6c99d37059e39feef82776141255958cb70':
  REPORT-65124 【模板主题】单元格样式编辑的效果有问题
  REPORT-65125 【模板主题】双击数据列设置格式,没有保存成功
bugfix/11.0
starryi 3 years ago
parent
commit
8c439731e2
  1. 15
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java
  2. 58
      designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java

15
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java

@ -30,9 +30,11 @@ import com.fr.stable.Nameable;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.DefaultListModel;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.ListModel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
@ -101,7 +103,7 @@ public class CellStyleListEditPane extends JListControlPane {
@Override @Override
protected JNameEdList createJNameList() { protected JNameEdList createJNameList() {
JNameEdList nameEdList = super.createJNameList(); JNameEdList nameEdList = new NoIconNamedList(new DefaultListModel());
nameEdList.setCellEditor(new UnEditableListCellEditor(new UITextField())); nameEdList.setCellEditor(new UnEditableListCellEditor(new UITextField()));
nameEdList.setCellRenderer(new NoIconNameableListCellRenderer()); nameEdList.setCellRenderer(new NoIconNameableListCellRenderer());
return nameEdList; return nameEdList;
@ -294,6 +296,17 @@ public class CellStyleListEditPane extends JListControlPane {
return component; return component;
} }
} }
private class NoIconNamedList extends JNameEdList {
public NoIconNamedList(ListModel dataModel) {
super(dataModel);
}
@Override
public int getIconWidth() {
return 0;
}
}
private class UnEditableListCellEditor extends DefaultListCellEditor { private class UnEditableListCellEditor extends DefaultListCellEditor {
public UnEditableListCellEditor(UITextField textField) { public UnEditableListCellEditor(UITextField textField) {

58
designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java

@ -3,7 +3,6 @@ package com.fr.design.dscolumn;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.data.util.SortOrder; import com.fr.data.util.SortOrder;
import com.fr.design.border.UITitledBorder; import com.fr.design.border.UITitledBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
@ -11,10 +10,10 @@ import com.fr.design.formula.CustomVariableResolver;
import com.fr.design.formula.FormulaFactory; import com.fr.design.formula.FormulaFactory;
import com.fr.design.formula.SortFormulaPane; import com.fr.design.formula.SortFormulaPane;
import com.fr.design.formula.UIFormula; import com.fr.design.formula.UIFormula;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
@ -29,11 +28,19 @@ import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.cell.cellattr.core.group.SelectCount; import com.fr.report.cell.cellattr.core.group.SelectCount;
import javax.swing.*; import javax.swing.BorderFactory;
import java.awt.*; import javax.swing.Box;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.Arrays;
import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.BOTTOM; import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.BOTTOM;
import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.SPECIFY; import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.SPECIFY;
@ -541,7 +548,7 @@ public class DSColumnAdvancedPane extends BasicPane {
} }
} }
public static class FormatAttrPane extends TextFormatPane { public static class ReLayoutTextFormatPane extends TextFormatPane {
protected void initLayout() { protected void initLayout() {
JComponent[][] components = new JComponent[][] { {typeComboBox, textField, roundingBox} }; JComponent[][] components = new JComponent[][] { {typeComboBox, textField, roundingBox} };
@ -571,6 +578,45 @@ public class DSColumnAdvancedPane extends BasicPane {
} }
} }
public static class FormatAttrPane extends AbstractAttrNoScrollPane {
private TextFormatPane formatPane;
@Override
protected JPanel createContentPane() {
this.formatPane = new ReLayoutTextFormatPane();
return this.formatPane;
}
@Override
public Dimension getPreferredSize() {
if (formatPane == null) {
return super.getPreferredSize();
}
return formatPane.getPreferredSize();
}
protected void initContentPane() {
leftContentPane = createContentPane();
if (leftContentPane != null) {
leftContentPane.setBorder(BorderFactory.createEmptyBorder());
this.add(leftContentPane, BorderLayout.CENTER);
}
}
public void populate(CellElement cellElement) {
if (cellElement != null && formatPane != null) {
formatPane.populateBean(cellElement.getStyle());
}
}
public void update(CellElement cellElement) {
if (cellElement != null && formatPane != null) {
cellElement.setStyle(formatPane.update(cellElement.getStyle()));
}
}
}
private void checkButtonEnabled() { private void checkButtonEnabled() {
if (useMultiplyNumCheckBox.isSelected()) { if (useMultiplyNumCheckBox.isSelected()) {
multiNumSpinner.setEnabled(true); multiNumSpinner.setEnabled(true);

Loading…
Cancel
Save