From 19767ee33b43f500e31a1d5e226f567746690fca Mon Sep 17 00:00:00 2001 From: pengda Date: Thu, 28 Jan 2021 11:26:01 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-47606=20=E8=81=9A=E5=90=88=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E6=8B=96=E6=8B=BD=E6=97=B6=E5=81=9C=E6=AD=A2=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E4=BC=9A=E5=9B=9E=E9=80=80=E5=88=B0=E5=8E=9F=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/poly/PolyBlockProperPane.java | 2 +- .../com/fr/poly/PolyBlockProperTable.java | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java index 316e86c28a..24a9272abe 100644 --- a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java +++ b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java @@ -41,7 +41,7 @@ public class PolyBlockProperPane extends DockingView { } public void update(){ - polyBlockProperTable.update(); + polyBlockProperTable.setBlockName(this.designer.getEditingTarget()); } @Override diff --git a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java index cd98e66225..fa786dc1e3 100644 --- a/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java +++ b/designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java @@ -111,12 +111,7 @@ public class PolyBlockProperTable extends JPanel { if (isPopulating || block == null) { return; } - if (blockPropertyPane.getWidgetNameField() != null) { - String toSetWidgetName = blockPropertyPane.getWidgetNameField().getText(); - if (isBlockNameValid(toSetWidgetName, block.getBlockName())) { - block.setBlockName(toSetWidgetName); - } - } + setBlockName(block); PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget()); boundsgroup.setValue(x.getValue(), 0, 1); boundsgroup.setValue(y.getValue(), 1, 1); @@ -125,6 +120,18 @@ public class PolyBlockProperTable extends JPanel { firePropertyEdit(); } + public void setBlockName(TemplateBlock block){ + if (isPopulating || block == null || blockPropertyPane == null) { + return; + } + if (blockPropertyPane.getWidgetNameField() != null) { + String toSetWidgetName = blockPropertyPane.getWidgetNameField().getText(); + if (isBlockNameValid(toSetWidgetName, block.getBlockName())) { + block.setBlockName(toSetWidgetName); + } + } + } + /** *校验一下要设置的名称,不能为空,不能重名 *