Browse Source

Pull request #2412: REPORT-40459 【回归】右侧属性面板富文本编辑按钮变短

Merge in DESIGN/design from ~YVAN/design:release/10.0 to release/10.0

* commit 'b0cb486d8cbdb3e2157af082814eefc89eb8aa5f':
  修复一下ToolKit的导包问题和HistoryTemplateListPane的过时方法问题
  REPORT-40459 【回归】右侧属性面板富文本编辑按钮变短 【问题原因】实际上不是编辑按钮变短了,而是上面的两个Label变短了,在使用TableLayout.FILL的情况下,后面跟着的输入框还有UICombox变长了,而编辑按钮前面的占位空白Label是写死size的,没有保持一致,所以空白Label不变的情况下,编辑按钮显得短了 【改动方案】将占位Label的宽度修改为与前面自动计算宽度的两个Label一致,这样后面跟的东西宽度就都是一致的
feature/big-screen
Yvan 4 years ago
parent
commit
78d2db74fd
  1. 19
      designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java

19
designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java

@ -3,11 +3,12 @@ package com.fr.quickeditor;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.iscrollbar.UIScrollBar; import com.fr.design.gui.iscrollbar.UIScrollBar;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
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.CellElementPropertyPane; import com.fr.design.mainframe.CellElementPropertyPane;
@ -48,7 +49,7 @@ import java.util.ArrayList;
*/ */
public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> { public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
protected static final Dimension LABEL_DIMENSION = new Dimension(60, 20); protected static final Dimension LABEL_DIMENSION = new Dimension(GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), 20);
protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3;
/** /**
@ -165,7 +166,7 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
columnRowTextField.setText(columnRow.toString()); columnRowTextField.setText(columnRow.toString());
cellElement = tc.getEditingElementCase().getTemplateCellElement(cs.getColumn(), cs.getRow()); cellElement = tc.getEditingElementCase().getTemplateCellElement(cs.getColumn(), cs.getRow());
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jTemplate != null) { if (jTemplate != null) {
comboBox.removeActionListener(comboBoxActionListener); comboBox.removeActionListener(comboBoxActionListener);
comboBox.removeAllItems(); comboBox.removeAllItems();
@ -208,10 +209,10 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
private JPanel initTopContent() { private JPanel initTopContent() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), f}; double[] columnSize = {GraphHelper.getWidth(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), f};
double[] rowSize = {p, p}; double[] rowSize = {p, p};
UILabel cellLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell")); UILabel cellLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Cell"));
UILabel insertContentLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")); UILabel insertContentLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element"));
initCellElementEditComboBox(); initCellElementEditComboBox();
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()}, new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()},
@ -263,7 +264,7 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
* 初始化添加按钮 * 初始化添加按钮
*/ */
private void initCellElementEditComboBox() { private void initCellElementEditComboBox() {
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jTemplate == null) { if (jTemplate == null) {
comboBox = new UIComboBox(); comboBox = new UIComboBox();
return; return;
@ -304,8 +305,8 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
ColumnRow columnRowEdit = ColumnRow.valueOf(columnRowTextField.getText()); ColumnRow columnRowEdit = ColumnRow.valueOf(columnRowTextField.getText());
// barry:检查输入是否正确 // barry:检查输入是否正确
if (!ColumnRow.validate(columnRowEdit)) { if (!ColumnRow.validate(columnRowEdit)) {
Object[] options = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")}; Object[] options = {Toolkit.i18nText("Fine-Design_Report_OK")};
JOptionPane.showOptionDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Please_Input_Letters+Numbers(A1,AA1,A11....)"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Warning"), JOptionPane.showOptionDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Please_Input_Letters+Numbers(A1,AA1,A11....)"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Warning"),
JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]); JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]);
// 重新选中当前的selection,把columnRowTextField // 重新选中当前的selection,把columnRowTextField
tc.setSelection(tc.getSelection()); tc.setSelection(tc.getSelection());

Loading…
Cancel
Save