|
|
|
@ -6,15 +6,18 @@ import com.fr.design.gui.icheckbox.UICheckBox;
|
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.gui.xtable.TableUtils; |
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
import com.fr.design.mainframe.FormDesigner; |
|
|
|
|
import com.fr.design.mainframe.WidgetPropertyPane; |
|
|
|
|
import com.fr.design.mainframe.widget.editors.ExtendedPropertyEditor; |
|
|
|
|
import com.fr.design.mainframe.widget.editors.StringEditor; |
|
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
import com.fr.general.IOUtils; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.JOptionPane; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.beans.PropertyChangeEvent; |
|
|
|
@ -31,7 +34,6 @@ public class CRPropertyDescriptorPane {
|
|
|
|
|
private PropertyEditor propertyEditor; |
|
|
|
|
private boolean isPopulate = true; |
|
|
|
|
private FormDesigner designer; |
|
|
|
|
|
|
|
|
|
public CRPropertyDescriptorPane(CRPropertyDescriptor crPropertyDescriptor, XCreator xCreator, FormDesigner designer) { |
|
|
|
|
this.crPropertyDescriptor = crPropertyDescriptor; |
|
|
|
|
this.xCreator = xCreator; |
|
|
|
@ -136,8 +138,18 @@ public class CRPropertyDescriptorPane {
|
|
|
|
|
try { |
|
|
|
|
Object value = propertyEditor.getValue(); |
|
|
|
|
Method m = crPropertyDescriptor.getWriteMethod(); |
|
|
|
|
if (ComparatorUtils.equals(m.getName(), "setWidgetName")) { |
|
|
|
|
String toSetWidgetName = value.toString(); |
|
|
|
|
String currentWidgetName = widget.getWidgetName(); |
|
|
|
|
boolean exist = designer.getTarget().isNameExist(toSetWidgetName) && !ComparatorUtils.equals(toSetWidgetName, currentWidgetName); |
|
|
|
|
if (toSetWidgetName.isEmpty()) { |
|
|
|
|
value = currentWidgetName; |
|
|
|
|
} else if (exist) { |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
m.invoke(widget, value); |
|
|
|
|
|
|
|
|
|
crPropertyDescriptor.firePropertyChanged(); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
|
|