Browse Source

修复一下ToolKit的导包问题和HistoryTemplateListPane的过时方法问题

feature/big-screen
Yvan 4 years ago
parent
commit
b0cb486d8c
  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(GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), 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