From b793303df7778641b2cc95916efd15c5f3e9dc1c Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 11 Oct 2016 17:17:56 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-465=20=E6=97=A5=E6=9C=9F=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E7=9A=84format=E5=92=8C=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E7=9B=B8=E4=BA=92=E7=8B=AC=E7=AB=8B,=20?= =?UTF-8?q?=E4=B8=8D=E8=A6=81=E8=81=94=E5=8A=A8=E8=AE=BE=E7=BD=AE,=20?= =?UTF-8?q?=E9=80=A0=E6=88=90=E5=9B=B0=E6=89=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/present/CellWriteAttrPane.java | 39 ++----------------- 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/designer/src/com/fr/design/present/CellWriteAttrPane.java b/designer/src/com/fr/design/present/CellWriteAttrPane.java index 5f4d6a8eac..4158dbd6c6 100644 --- a/designer/src/com/fr/design/present/CellWriteAttrPane.java +++ b/designer/src/com/fr/design/present/CellWriteAttrPane.java @@ -1,15 +1,13 @@ package com.fr.design.present; import com.fr.base.FRContext; -import com.fr.base.Style; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.widget.WidgetPane; -import com.fr.design.dialog.BasicDialog; -import com.fr.design.dialog.BasicPane; -import com.fr.design.dialog.DialogActionAdapter; -import com.fr.form.ui.DateEditor; import com.fr.form.ui.NoneWidget; import com.fr.form.ui.Widget; import com.fr.general.FRLogger; @@ -22,8 +20,6 @@ import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; import java.awt.*; -import java.text.Format; -import java.text.SimpleDateFormat; public class CellWriteAttrPane extends BasicPane { @@ -78,22 +74,6 @@ public class CellWriteAttrPane extends BasicPane { Widget cellWidget = cellElement.getWidget(); - if (cellWidget != null && cellWidget instanceof DateEditor) { - // p:日期的格式需要设置到单元格子里面. - DateEditor dateCellEditorDef = (DateEditor) cellWidget; - - // p:需要把下拉的编辑器,日期格式,都放到CellElement的Style里面 - // 这个地方很方便用户,是alex提出的. - // p:日期的格式需要设置到单元格子里面. - Style style = cellElement.getStyle(); - if (style != null) { - Format format = style.getFormat(); - if (format != null && format instanceof SimpleDateFormat) { - SimpleDateFormat simpleDateFormat = (SimpleDateFormat) format; - dateCellEditorDef.setFormatText(simpleDateFormat.toPattern()); - } - } - } // 这里进行克隆的原因是为了保留原始的Widget以便和新的Widget做比较来判断是否发生了改变 if (cellWidget != null) { try { @@ -111,19 +91,6 @@ public class CellWriteAttrPane extends BasicPane { } Widget cellWidget = this.cellEditorDefPane.update(); - // p:需要把下拉的编辑器,日期格式,都放到CellElement的Style里面 - if (cellWidget instanceof DateEditor) { - // p:日期的格式需要设置到单元格子里面. - DateEditor dateCellEditorDef = (DateEditor) cellWidget; - String formatText = dateCellEditorDef.getFormatText(); - if (formatText != null) { - Style style = cellElement.getStyle(); - if (style != null) { - cellElement.setStyle(style.deriveFormat(new SimpleDateFormat(formatText))); - } - } - } - // p:最后把这个cellEditorDef设置到CellGUIAttr. if (cellWidget instanceof NoneWidget) { cellElement.setWidget(null);