Browse Source

update

bugfix/10.0
Hades 6 years ago
parent
commit
b0e562dc50
  1. 14
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

14
designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

@ -216,15 +216,23 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
Widget widget = currentEditorDefinePane.updateBean(); Widget widget = currentEditorDefinePane.updateBean();
if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic")) && widgetPropertyPane != null) { if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic")) && widgetPropertyPane != null) {
UITextField widgetNameField = widgetPropertyPane.getWidgetNameField(); UITextField widgetNameField = widgetPropertyPane.getWidgetNameField();
String toSetWidgetName = widgetNameField.getText();
String currentWidgetName = widget.getWidgetName();
// 设置的组件名和当前组件名相同 直接返回
if (ComparatorUtils.equals(toSetWidgetName, currentWidgetName)) {
return;
}
String containerName = designer.getTarget().getContainer().getWidgetName();
Widget existWidget = FormWidgetHelper.findWidgetByName(widget, widgetNameField.getText()); Widget existWidget = FormWidgetHelper.findWidgetByName(widget, widgetNameField.getText());
boolean exist = ComparatorUtils.equals(designer.getTarget().getContainer().getWidgetName(), widgetNameField.getText()) || (existWidget != null && !ComparatorUtils.equals(widget.getWidgetName(), widgetNameField.getText())); // 判断设置的组件名是否和容器同名以及组件是否在容器在存在 满足任何之一 抛出提示
boolean exist = ComparatorUtils.equals(containerName, toSetWidgetName) || existWidget != null;
if (exist) { if (exist) {
widgetNameField.setText(widget.getWidgetName()); widgetNameField.setText(currentWidgetName);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"), JOptionPane.ERROR_MESSAGE, BaseUtils.readIcon("com/fr/design/form/images/joption_failure.png")); JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"), JOptionPane.ERROR_MESSAGE, BaseUtils.readIcon("com/fr/design/form/images/joption_failure.png"));
return; return;
} }
widgetPropertyPane.update(widget); widgetPropertyPane.update(widget);
xCreator.resetCreatorName(widget.getWidgetName()); xCreator.resetCreatorName(toSetWidgetName);
xCreator.resetVisible(widget.isVisible()); xCreator.resetVisible(widget.isVisible());
designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED); designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED);
return; return;

Loading…
Cancel
Save