|
|
|
@ -4,9 +4,12 @@ import com.fr.design.event.UIObserver;
|
|
|
|
|
import com.fr.design.event.UIObserverListener; |
|
|
|
|
import com.fr.design.foldablepane.UIExpandablePane; |
|
|
|
|
import com.fr.design.gui.ispinner.UISpinner; |
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
import com.fr.design.mainframe.widget.BasicPropertyPane; |
|
|
|
|
import com.fr.design.widget.WidgetBoundsPaneFactory; |
|
|
|
|
|
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
import com.fr.general.IOUtils; |
|
|
|
|
import com.fr.poly.group.PolyBoundsGroup; |
|
|
|
|
import com.fr.report.poly.TemplateBlock; |
|
|
|
|
|
|
|
|
@ -104,7 +107,12 @@ public class PolyBlockProperTable extends JPanel {
|
|
|
|
|
if (isPopulating || block == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
block.setBlockName(blockPropertyPane.getWidgetNameField().getText()); |
|
|
|
|
if (blockPropertyPane.getWidgetNameField() != null) { |
|
|
|
|
String toSetWidgetName = blockPropertyPane.getWidgetNameField().getText(); |
|
|
|
|
if (isBlockNameValid(toSetWidgetName, block.getBlockName())) { |
|
|
|
|
block.setBlockName(toSetWidgetName); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget()); |
|
|
|
|
boundsgroup.setValue(x.getValue(), 0, 1); |
|
|
|
|
boundsgroup.setValue(y.getValue(), 1, 1); |
|
|
|
@ -112,4 +120,23 @@ public class PolyBlockProperTable extends JPanel {
|
|
|
|
|
boundsgroup.setValue(height.getValue(), 3, 1); |
|
|
|
|
firePropertyEdit(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
*校验一下要设置的名称,不能为空,不能重名 |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
private boolean isBlockNameValid(String toSetWidgetName, String currentWidgetName) { |
|
|
|
|
if (toSetWidgetName == null || toSetWidgetName.isEmpty()) { |
|
|
|
|
blockPropertyPane.getWidgetNameField().setText(currentWidgetName); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
for (int i = 0; i < this.designer.getTarget().getBlockCount(); i++) { |
|
|
|
|
if (!ComparatorUtils.equals(currentWidgetName, toSetWidgetName) && ComparatorUtils.equals(toSetWidgetName, this.designer.getTarget().getBlock(i).getBlockName())) { |
|
|
|
|
blockPropertyPane.getWidgetNameField().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, IOUtils.readIcon("com/fr/design/form/images/joption_failure.png")); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|