From 033940a959387ee1c2649bc8f772f1d276f195c8 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Fri, 1 Sep 2017 17:37:56 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-4267=20=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E9=A2=84=E5=AE=9A=E4=B9=89=E6=8E=A7=E4=BB=B6=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/CellWidgetPropertyPane.java | 19 +++++-------- .../src/com/fr/design/widget/WidgetPane.java | 27 +++++++++---------- 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java b/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java index 920116b2c..e0a2cf441 100644 --- a/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java +++ b/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java @@ -2,18 +2,14 @@ package com.fr.design.mainframe; import com.fr.base.FRContext; import com.fr.design.actions.utils.ReportActionUtils; -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.present.CellWriteAttrPane; import com.fr.design.widget.WidgetPane; import com.fr.form.ui.NoneWidget; import com.fr.form.ui.Widget; import com.fr.general.FRLogger; import com.fr.general.Inter; import com.fr.grid.selection.CellSelection; -import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.privilege.finegrain.WidgetPrivilegeControl; import com.fr.report.cell.CellElement; @@ -34,7 +30,7 @@ public class CellWidgetPropertyPane extends BasicPane { private WidgetPane cellEditorDefPane; private ElementCasePane ePane; - public static CellWidgetPropertyPane getInstance(){ + public static CellWidgetPropertyPane getInstance() { if (singleton == null) { singleton = new CellWidgetPropertyPane(); } @@ -43,11 +39,9 @@ public class CellWidgetPropertyPane extends BasicPane { public CellWidgetPropertyPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); -// this.addAttributeChangeListener(listener); -// cellEditorDefPane = new WidgetPane(elementCasePane); } - public void clear (){ + public void clear() { singleton = null; } @@ -86,7 +80,7 @@ public class CellWidgetPropertyPane extends BasicPane { } - public void reInit(ElementCasePane ePane){ + public void reInit(ElementCasePane ePane) { this.ePane = ePane; cellEditorDefPane = new WidgetPane(ePane); this.removeAll(); @@ -144,14 +138,15 @@ public class CellWidgetPropertyPane extends BasicPane { return newWidget; } - @Override /** - *检测是否有效 + * 检测是否有效 + * + * @throws Exception e */ + @Override public void checkValid() throws Exception { this.cellEditorDefPane.checkValid(); } - } \ No newline at end of file diff --git a/designer/src/com/fr/design/widget/WidgetPane.java b/designer/src/com/fr/design/widget/WidgetPane.java index 10ebf66a5..593bf2197 100644 --- a/designer/src/com/fr/design/widget/WidgetPane.java +++ b/designer/src/com/fr/design/widget/WidgetPane.java @@ -65,7 +65,7 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener this.addAttributeChangeListener(listener); } - public JPanel initNorthPane(){ + public JPanel initNorthPane() { UILabel emptyLabel = new UILabel(); emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); @@ -80,7 +80,7 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener return jPanel; } - protected CellWidgetCardPane initWidgetCardPane(ElementCasePane pane){ + protected CellWidgetCardPane initWidgetCardPane(ElementCasePane pane) { return new CellWidgetCardPane(pane); } @@ -129,30 +129,29 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener editorTypeComboBox.setSelectedIndex(-1); return; } - + // 预定义组件 if (widget instanceof NameWidget) { String name = ((NameWidget) widget).getName(); shouldFireSelectedEvent = false; editorTypeComboBox.setSelectedItem(new Item(name, name)); shouldFireSelectedEvent = true; cellEditorCardPane.populate(widget); - return; } + // 内置组件 + else { + Class clazz = widget.getClass(); + if (ArrayUtils.contains(ButtonConstants.CLASSES4BUTTON, clazz)) { + clazz = Button.class; + } + cellEditorCardPane.populate(widget); - Class clazz = widget.getClass(); - if (ArrayUtils.contains(ButtonConstants.CLASSES4BUTTON, clazz)) { - clazz = Button.class; + shouldFireSelectedEvent = false; + editorTypeComboBox.setSelectedItemByWidgetClass(clazz); + shouldFireSelectedEvent = true; } - cellEditorCardPane.populate(widget); - - shouldFireSelectedEvent = false; - editorTypeComboBox.setSelectedItemByWidgetClass(clazz); - shouldFireSelectedEvent = true; - removeAttributeChangeListener(); initAllListeners(); this.addAttributeChangeListener(listener); - } public Widget update() {