From 652c0d21aecd4c25e7914abf7bd6cab2a6910e7e Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 12 May 2016 12:52:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/design/widget/WidgetPane.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/designer/src/com/fr/design/widget/WidgetPane.java b/designer/src/com/fr/design/widget/WidgetPane.java index 2efdaebbb9..a29014c55d 100644 --- a/designer/src/com/fr/design/widget/WidgetPane.java +++ b/designer/src/com/fr/design/widget/WidgetPane.java @@ -75,18 +75,17 @@ public class WidgetPane extends BasicPane implements ItemListener { */ public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { + setOldWidget(update()); + Widget selectedItem = editorTypeComboBox.getCellWidget(); + WidgetDesignHandler handler = ExtraDesignClassManager.getInstance().getWidgetDesignHandler(); + if (handler != null) { + selectedItem = handler.dealWithWidget(getOldWidget(), selectedItem); + } if (e.getItem() instanceof Item && ((Item) e.getItem()).getValue() instanceof WidgetConfig) { - Widget newWidget = editorTypeComboBox.getCellWidget(); - - populate(editorTypeComboBox.getCellWidget()); + populate(selectedItem); return; } if (shouldFireSelectedEvent) { - Widget selectedItem = editorTypeComboBox.getCellWidget(); - WidgetDesignHandler handler = ExtraDesignClassManager.getInstance().getWidgetDesignHandler(); - if (handler != null) { - selectedItem = handler.dealWithWidget(getOldWidget(), selectedItem); - } populateWidgetConfig(selectedItem); } }