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