|
|
|
@ -6,8 +6,6 @@ package com.fr.design.designer.creator;
|
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.Dimension; |
|
|
|
|
import java.beans.IntrospectionException; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.border.Border; |
|
|
|
@ -24,8 +22,8 @@ import com.fr.stable.ArrayUtils;
|
|
|
|
|
*/ |
|
|
|
|
public abstract class XFieldEditor extends XWidgetCreator { |
|
|
|
|
|
|
|
|
|
protected static final Border FIELDBORDER = BorderFactory.createLineBorder(new Color(128, 152, 186), 1); |
|
|
|
|
|
|
|
|
|
protected static final Border FIELDBORDER = BorderFactory.createLineBorder(new Color(128, 152, 186), 1); |
|
|
|
|
|
|
|
|
|
public XFieldEditor(FieldEditor widget, Dimension initSize) { |
|
|
|
|
super(widget, initSize); |
|
|
|
|
} |
|
|
|
@ -33,22 +31,22 @@ public abstract class XFieldEditor extends XWidgetCreator {
|
|
|
|
|
@Override |
|
|
|
|
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { |
|
|
|
|
return (CRPropertyDescriptor[]) ArrayUtils.addAll( |
|
|
|
|
super.supportedDescriptor(),getCRPropertyDescriptor() |
|
|
|
|
); |
|
|
|
|
super.supportedDescriptor(), getCRPropertyDescriptor() |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private CRPropertyDescriptor[] getCRPropertyDescriptor() throws IntrospectionException { |
|
|
|
|
CRPropertyDescriptor allowBlank = new CRPropertyDescriptor("allowBlank", this.data.getClass()).setI18NName( |
|
|
|
|
Inter.getLocText("Allow_Blank")).setEditorClass(InChangeBooleanEditor.class).putKeyValue( |
|
|
|
|
XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"); |
|
|
|
|
CRPropertyDescriptor blankErrorMsg = new CRPropertyDescriptor("errorMessage", this.data.getClass()).setI18NName( |
|
|
|
|
Inter.getLocText("Verify-Message")) |
|
|
|
|
.putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"); |
|
|
|
|
CRPropertyDescriptor fontSize = new CRPropertyDescriptor("fontSize", this.data.getClass(), "getFontSize", "setFontSize") |
|
|
|
|
.setI18NName(Inter.getLocText(new String[]{"FRFont", "FRFont-Size"})) |
|
|
|
|
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"); |
|
|
|
|
return !((FieldEditor) toData()).isAllowBlank() ? |
|
|
|
|
new CRPropertyDescriptor[] {allowBlank, blankErrorMsg, fontSize} |
|
|
|
|
: new CRPropertyDescriptor[] {allowBlank, fontSize}; |
|
|
|
|
} |
|
|
|
|
private CRPropertyDescriptor[] getCRPropertyDescriptor() throws IntrospectionException { |
|
|
|
|
CRPropertyDescriptor allowBlank = new CRPropertyDescriptor("allowBlank", this.data.getClass()).setI18NName( |
|
|
|
|
Inter.getLocText("Allow_Blank")).setEditorClass(InChangeBooleanEditor.class).putKeyValue( |
|
|
|
|
XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"); |
|
|
|
|
CRPropertyDescriptor blankErrorMsg = new CRPropertyDescriptor("errorMessage", this.data.getClass()).setI18NName( |
|
|
|
|
Inter.getLocText("Verify-Message")) |
|
|
|
|
.putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"); |
|
|
|
|
CRPropertyDescriptor fontSize = new CRPropertyDescriptor("fontSize", this.data.getClass(), "getFontSize", "setFontSize") |
|
|
|
|
.setI18NName(Inter.getLocText(new String[]{"FRFont", "FRFont-Size"})) |
|
|
|
|
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"); |
|
|
|
|
return !((FieldEditor) toData()).isAllowBlank() ? |
|
|
|
|
new CRPropertyDescriptor[]{allowBlank, blankErrorMsg, fontSize} |
|
|
|
|
: new CRPropertyDescriptor[]{allowBlank, fontSize}; |
|
|
|
|
} |
|
|
|
|
} |