forked from fanruan/design
Browse Source
Merge in DESIGN/design from ~YUAN.WANG/design:release/10.0 to release/10.0 * commit '81bf9616db12bd64fcff3b2ca10001de3eb60f2c': REPORT-59475 控件校验错误提示支持公式 REPORT-59475 控件校验错误提示支持公式 REPORT-59476 && REPORT-59475 1、文本控件校验规则支持国际化 2、控件校验错误提示支持公式zheng-1641779399395
Yuan.Wang
3 years ago
11 changed files with 242 additions and 91 deletions
@ -0,0 +1,11 @@
|
||||
package com.fr.design.beans; |
||||
|
||||
import javax.swing.JComponent; |
||||
|
||||
public interface ErrorMsgTextFieldAdapter { |
||||
void setText(String str); |
||||
|
||||
String getText(); |
||||
|
||||
JComponent getErrorMsgTextField(); |
||||
} |
@ -0,0 +1,46 @@
|
||||
package com.fr.design.beans; |
||||
|
||||
import com.fr.design.gui.itextfield.UITextField; |
||||
|
||||
import javax.swing.JComponent; |
||||
import javax.swing.event.DocumentEvent; |
||||
import javax.swing.event.DocumentListener; |
||||
|
||||
public class UITextFieldAdapter implements ErrorMsgTextFieldAdapter { |
||||
private final UITextField uiTextField = new UITextField(); |
||||
|
||||
public UITextFieldAdapter(){ |
||||
addDocumentListener(); |
||||
} |
||||
@Override |
||||
public void setText(String str) { |
||||
uiTextField.setText(str); |
||||
} |
||||
|
||||
@Override |
||||
public String getText() { |
||||
return uiTextField.getText(); |
||||
} |
||||
|
||||
public void addDocumentListener() { |
||||
uiTextField.getDocument().addDocumentListener(new DocumentListener() { |
||||
|
||||
public void changedUpdate(DocumentEvent e) { |
||||
uiTextField.setToolTipText(uiTextField.getText()); |
||||
} |
||||
|
||||
public void insertUpdate(DocumentEvent e) { |
||||
uiTextField.setToolTipText(uiTextField.getText()); |
||||
} |
||||
|
||||
public void removeUpdate(DocumentEvent e) { |
||||
uiTextField.setToolTipText(uiTextField.getText()); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
@Override |
||||
public JComponent getErrorMsgTextField() { |
||||
return uiTextField; |
||||
} |
||||
} |
@ -0,0 +1,11 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.gui.frpane.RegFieldPane; |
||||
import com.fr.stable.fun.mark.Immutable; |
||||
|
||||
public interface RegPaneProvider extends Immutable { |
||||
int CURRENT_LEVEL = 1; |
||||
String XML_TAG = "RegPaneProvider"; |
||||
|
||||
RegFieldPane createRegPane(); |
||||
} |
@ -0,0 +1,11 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.design.beans.ErrorMsgTextFieldAdapter; |
||||
import com.fr.stable.fun.mark.Immutable; |
||||
|
||||
public interface TextFieldAdapterProvider extends Immutable { |
||||
String XML_TAG = "ErrorMesPaneWrapperProvider"; |
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
ErrorMsgTextFieldAdapter createTextFieldAdapter(); |
||||
} |
@ -0,0 +1,22 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.RegPaneProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author Joe |
||||
* 2021/10/8 15:19 |
||||
*/ |
||||
@API(level = RegPaneProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractRegPaneProvider implements RegPaneProvider { |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public int layerIndex() { |
||||
return DEFAULT_LAYER_INDEX; |
||||
} |
||||
} |
@ -0,0 +1,22 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.TextFieldAdapterProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
/** |
||||
* @author Joe |
||||
* 2021/10/8 15:17 |
||||
*/ |
||||
@API(level = TextFieldAdapterProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractTextFieldAdapterProvider implements TextFieldAdapterProvider { |
||||
|
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public int layerIndex() { |
||||
return DEFAULT_LAYER_INDEX; |
||||
} |
||||
} |
Loading…
Reference in new issue