Browse Source

REPORT-59475 控件校验错误提示支持公式

zheng-1641779399395
Yuan.Wang 3 years ago
parent
commit
1bc70a94f3
  1. 2
      designer-base/src/main/java/com/fr/design/beans/UITextFieldAdapter.java
  2. 26
      designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java
  3. 12
      designer-form/src/main/java/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java
  4. 10
      designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java
  5. 11
      designer-realize/src/main/java/com/fr/design/widget/ui/TextFieldEditorDefinePane.java

2
designer-base/src/main/java/com/fr/design/beans/UITextFieldAdapter.java

@ -7,7 +7,7 @@ import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
public class UITextFieldAdapter implements ErrorMsgTextFieldAdapter { public class UITextFieldAdapter implements ErrorMsgTextFieldAdapter {
UITextField uiTextField = new UITextField(); private final UITextField uiTextField = new UITextField();
public UITextFieldAdapter(){ public UITextFieldAdapter(){
addDocumentListener(); addDocumentListener();

26
designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java

@ -5,7 +5,11 @@ import com.fr.design.beans.ErrorMsgTextFieldAdapter;
import com.fr.design.beans.UITextFieldAdapter; 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.XCreator;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.fun.TextFieldAdapterProvider; import com.fr.design.fun.TextFieldAdapterProvider;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
@ -15,12 +19,12 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.ui.designer.component.FontSizeComboPane; import com.fr.design.widget.ui.designer.component.FontSizeComboPane;
import com.fr.form.ui.FieldEditor; import com.fr.form.ui.FieldEditor;
import com.fr.log.FineLoggerFactory;
import javax.swing.BorderFactory;
import javax.swing.*; import javax.swing.JPanel;
import javax.swing.event.DocumentEvent; import java.awt.BorderLayout;
import javax.swing.event.DocumentListener; import java.awt.Component;
import java.awt.*;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
@ -80,12 +84,18 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initErrorMsgPane() { protected void initErrorMsgPane() {
// 错误信息 // 错误信息
TextFieldAdapterProvider provider = ExtraDesignClassManager.getInstance().getSingle(TextFieldAdapterProvider.XML_TAG); TextFieldAdapterProvider provider = ExtraDesignClassManager.getInstance().getSingle(TextFieldAdapterProvider.XML_TAG);
if (provider != null) { if (provider == null) {
errorMsgTextField= provider.createTextFieldAdapter(); errorMsgTextField = new UITextFieldAdapter();
return; return;
} }
try {
errorMsgTextField = provider.createTextFieldAdapter();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
errorMsgTextField = new UITextFieldAdapter(); errorMsgTextField = new UITextFieldAdapter();
} }
}
protected abstract T updateSubFieldEditorBean(); protected abstract T updateSubFieldEditorBean();

12
designer-form/src/main/java/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java

@ -13,6 +13,7 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -86,14 +87,19 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
} }
protected RegFieldPane createRegPane() { protected RegFieldPane createRegPane() {
RegPaneProvider provider = ExtraDesignClassManager.getInstance().getSingle(RegPaneProvider.XML_TAG); RegPaneProvider provider = ExtraDesignClassManager.getInstance().getSingle(RegPaneProvider.XML_TAG);
if (provider != null) { if (provider == null) {
return provider.createRegPane(); return new RegFieldPane();
} }
try {
return provider.createRegPane();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return new RegFieldPane(); return new RegFieldPane();
} }
}
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {

10
designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java

@ -12,6 +12,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.FieldEditor; import com.fr.form.ui.FieldEditor;
import com.fr.log.FineLoggerFactory;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -47,12 +48,17 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initErrorMsgPane() { protected void initErrorMsgPane() {
// 错误信息 // 错误信息
TextFieldAdapterProvider provider = ExtraDesignClassManager.getInstance().getSingle(TextFieldAdapterProvider.XML_TAG); TextFieldAdapterProvider provider = ExtraDesignClassManager.getInstance().getSingle(TextFieldAdapterProvider.XML_TAG);
if (provider != null) { if (provider == null) {
errorMsgTextField= provider.createTextFieldAdapter(); errorMsgTextField = new UITextFieldAdapter();
return; return;
} }
try {
errorMsgTextField = provider.createTextFieldAdapter();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
errorMsgTextField = new UITextFieldAdapter(); errorMsgTextField = new UITextFieldAdapter();
} }
}
@Override @Override
public void populateBean(T ob) { public void populateBean(T ob) {

11
designer-realize/src/main/java/com/fr/design/widget/ui/TextFieldEditorDefinePane.java

@ -6,6 +6,7 @@ import com.fr.design.gui.frpane.RegFieldPane;
import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.frpane.RegPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -62,11 +63,17 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
protected RegFieldPane createRegPane() { protected RegFieldPane createRegPane() {
RegPaneProvider provider = ExtraDesignClassManager.getInstance().getSingle(RegPaneProvider.XML_TAG); RegPaneProvider provider = ExtraDesignClassManager.getInstance().getSingle(RegPaneProvider.XML_TAG);
if (provider != null) { if (provider == null) {
return provider.createRegPane(); return new RegFieldPane();
} }
try {
return provider.createRegPane();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return new RegFieldPane(); return new RegFieldPane();
} }
}
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {

Loading…
Cancel
Save