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); + } + } + } + /** *校验一下要设置的名称,不能为空,不能重名 *