From 24b97d49a8752db95984227ebad41069c7957e9e Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 2 Aug 2016 09:26:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8jar?= =?UTF-8?q?=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/ui/FieldEditorDefinePane.java | 4 -- .../widget/ui/NumberEditorDefinePane.java | 3 -- .../widget/ui/TextFieldEditorDefinePane.java | 4 -- .../design/designer/creator/XFieldEditor.java | 38 +++++++++---------- .../design/designer/creator/XRadioGroup.java | 1 - .../design/designer/creator/XTextEditor.java | 2 - 6 files changed, 18 insertions(+), 34 deletions(-) diff --git a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java index eebd9c4f07..fb82682083 100644 --- a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java @@ -6,21 +6,17 @@ import java.awt.event.ItemListener; import javax.swing.BorderFactory; -import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.gui.ilable.UILabel; import javax.swing.JPanel; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.present.dict.DictionaryPane; import com.fr.form.ui.FieldEditor; import com.fr.general.Inter; -import com.fr.design.widget.DataModify; public abstract class FieldEditorDefinePane extends AbstractDataModify { private UICheckBox allowBlankCheckBox; diff --git a/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java index 26d34065c6..85f09bb5b0 100644 --- a/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java @@ -14,13 +14,10 @@ import javax.swing.JPanel; import javax.swing.SpinnerNumberModel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; import javax.swing.text.DefaultFormatter; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ispinner.UIBasicSpinner; -import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.form.ui.NumberEditor; import com.fr.general.Inter; diff --git a/designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java index 2399a90cec..6055de0831 100644 --- a/designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java @@ -3,18 +3,14 @@ package com.fr.design.widget.ui; import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.TextEditor; -import com.fr.form.ui.reg.NoneReg; import com.fr.form.ui.reg.RegExp; import com.fr.general.Inter; import com.fr.stable.StringUtils; import javax.swing.*; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; diff --git a/designer_form/src/com/fr/design/designer/creator/XFieldEditor.java b/designer_form/src/com/fr/design/designer/creator/XFieldEditor.java index 4b8a0db68c..4cd6b57f99 100644 --- a/designer_form/src/com/fr/design/designer/creator/XFieldEditor.java +++ b/designer_form/src/com/fr/design/designer/creator/XFieldEditor.java @@ -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}; + } } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/designer/creator/XRadioGroup.java b/designer_form/src/com/fr/design/designer/creator/XRadioGroup.java index daf2b25e4b..487e0c7305 100644 --- a/designer_form/src/com/fr/design/designer/creator/XRadioGroup.java +++ b/designer_form/src/com/fr/design/designer/creator/XRadioGroup.java @@ -19,7 +19,6 @@ import com.fr.design.mainframe.widget.editors.WidgetValueEditor; import com.fr.design.mainframe.widget.renderer.DictionaryRenderer; import com.fr.form.ui.RadioGroup; import com.fr.design.form.util.XCreatorConstants; -import com.fr.function.ARRAY; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; diff --git a/designer_form/src/com/fr/design/designer/creator/XTextEditor.java b/designer_form/src/com/fr/design/designer/creator/XTextEditor.java index 2d068ccb15..ee0f4d03c4 100644 --- a/designer_form/src/com/fr/design/designer/creator/XTextEditor.java +++ b/designer_form/src/com/fr/design/designer/creator/XTextEditor.java @@ -18,14 +18,12 @@ import com.fr.design.mainframe.widget.editors.RegexEditor; import com.fr.design.mainframe.widget.editors.WidgetValueEditor; import com.fr.design.mainframe.widget.renderer.RegexCellRencerer; import com.fr.form.ui.TextEditor; -import com.fr.form.ui.reg.NoneReg; import com.fr.form.ui.reg.RegExp; import com.fr.general.FRFont; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import com.fr.stable.Constants; import com.fr.stable.StringUtils; -import jdk.nashorn.internal.runtime.regexp.joni.Regex; /** * @author richer