|
|
@ -1,9 +1,13 @@ |
|
|
|
package com.fr.design.widget.ui.designer; |
|
|
|
package com.fr.design.widget.ui.designer; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
|
|
|
|
import com.fr.design.beans.ErrorMsgTextFieldAdapter; |
|
|
|
|
|
|
|
import com.fr.design.beans.UITextFieldAdapter; |
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
import com.fr.design.constants.LayoutConstants; |
|
|
|
import com.fr.design.designer.IntervalConstants; |
|
|
|
import com.fr.design.designer.IntervalConstants; |
|
|
|
import com.fr.design.designer.creator.*; |
|
|
|
import com.fr.design.designer.creator.*; |
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
|
|
|
|
import com.fr.design.fun.TextFieldAdapterProvider; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.itextfield.UITextField; |
|
|
|
import com.fr.design.gui.itextfield.UITextField; |
|
|
@ -23,7 +27,7 @@ import java.awt.event.ItemListener; |
|
|
|
public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> { |
|
|
|
public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> { |
|
|
|
protected UICheckBox allowBlankCheckBox; |
|
|
|
protected UICheckBox allowBlankCheckBox; |
|
|
|
// richer:错误信息,是所有控件共有的属性,所以放到这里来
|
|
|
|
// richer:错误信息,是所有控件共有的属性,所以放到这里来
|
|
|
|
protected UITextField errorMsgTextField; |
|
|
|
protected ErrorMsgTextFieldAdapter errorMsgTextField; |
|
|
|
protected JPanel validatePane; |
|
|
|
protected JPanel validatePane; |
|
|
|
protected FontSizeComboPane fontSizePane; |
|
|
|
protected FontSizeComboPane fontSizePane; |
|
|
|
protected UITextField labelNameTextField; |
|
|
|
protected UITextField labelNameTextField; |
|
|
@ -40,7 +44,6 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr |
|
|
|
allowBlankCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Null")); |
|
|
|
allowBlankCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Null")); |
|
|
|
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); |
|
|
|
fontSizePane = new FontSizeComboPane(); |
|
|
|
fontSizePane = new FontSizeComboPane(); |
|
|
|
errorMsgTextField = new UITextField(); |
|
|
|
|
|
|
|
JPanel contentPane = this.setFirstContentPane(); |
|
|
|
JPanel contentPane = this.setFirstContentPane(); |
|
|
|
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
jPanel.add(contentPane, BorderLayout.CENTER); |
|
|
|
jPanel.add(contentPane, BorderLayout.CENTER); |
|
|
@ -76,26 +79,14 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr |
|
|
|
|
|
|
|
|
|
|
|
protected void initErrorMsgPane() { |
|
|
|
protected void initErrorMsgPane() { |
|
|
|
// 错误信息
|
|
|
|
// 错误信息
|
|
|
|
errorMsgTextField = new UITextField(); |
|
|
|
TextFieldAdapterProvider provider = ExtraDesignClassManager.getInstance().getSingle(TextFieldAdapterProvider.XML_TAG); |
|
|
|
// // richer:主要为了方便查看比较长的错误信息
|
|
|
|
if (provider != null) { |
|
|
|
errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { |
|
|
|
errorMsgTextField= provider.createTextFieldAdapter(); |
|
|
|
|
|
|
|
return; |
|
|
|
public void changedUpdate(DocumentEvent e) { |
|
|
|
|
|
|
|
errorMsgTextField.setToolTipText(errorMsgTextField.getText()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void insertUpdate(DocumentEvent e) { |
|
|
|
|
|
|
|
errorMsgTextField.setToolTipText(errorMsgTextField.getText()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void removeUpdate(DocumentEvent e) { |
|
|
|
|
|
|
|
errorMsgTextField.setToolTipText(errorMsgTextField.getText()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
errorMsgTextField = new UITextFieldAdapter(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected abstract T updateSubFieldEditorBean(); |
|
|
|
protected abstract T updateSubFieldEditorBean(); |
|
|
|
|
|
|
|
|
|
|
|
protected abstract JPanel setFirstContentPane(); |
|
|
|
protected abstract JPanel setFirstContentPane(); |
|
|
@ -111,7 +102,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr |
|
|
|
validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
final UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip")); |
|
|
|
final UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip")); |
|
|
|
JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
final JPanel errorTipPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{uiLabel, errorMsgTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); |
|
|
|
final JPanel errorTipPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{uiLabel, errorMsgTextField.getErrorMsgTextField()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); |
|
|
|
errorTipPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0)); |
|
|
|
errorTipPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0)); |
|
|
|
borderPane.add(errorTipPane, BorderLayout.CENTER); |
|
|
|
borderPane.add(errorTipPane, BorderLayout.CENTER); |
|
|
|
allowBlankCheckBox.addItemListener(new ItemListener() { |
|
|
|
allowBlankCheckBox.addItemListener(new ItemListener() { |
|
|
|