|
|
@ -7,13 +7,12 @@ import com.fr.design.form.util.XCreatorConstants; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.gui.icheckbox.UICheckBox; |
|
|
|
import com.fr.design.mainframe.widget.editors.WidgetValueEditor; |
|
|
|
import com.fr.design.mainframe.widget.editors.WidgetValueEditor; |
|
|
|
import com.fr.form.ui.CheckBox; |
|
|
|
import com.fr.form.ui.CheckBox; |
|
|
|
import com.fr.form.ui.WidgetValue; |
|
|
|
import com.fr.form.ui.concept.data.ValueInitializer; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.core.PropertyChangeAdapter; |
|
|
|
import com.fr.stable.core.PropertyChangeAdapter; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.JComponent; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.Dimension; |
|
|
|
|
|
|
|
import java.beans.IntrospectionException; |
|
|
|
import java.beans.IntrospectionException; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -28,7 +27,7 @@ public class XCheckBox extends XWidgetCreator { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { |
|
|
|
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { |
|
|
|
return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), new CRPropertyDescriptor[] { |
|
|
|
return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), new CRPropertyDescriptor[]{ |
|
|
|
new CRPropertyDescriptor("text", this.data.getClass()).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Text")) |
|
|
|
new CRPropertyDescriptor("text", this.data.getClass()).setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Text")) |
|
|
|
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") |
|
|
|
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") |
|
|
|
.setPropertyChangeListener(new PropertyChangeAdapter() { |
|
|
|
.setPropertyChangeListener(new PropertyChangeAdapter() { |
|
|
@ -45,7 +44,7 @@ public class XCheckBox extends XWidgetCreator { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void propertyChange() { |
|
|
|
public void propertyChange() { |
|
|
|
WidgetValue value = ((CheckBox) data).getWidgetValue(); |
|
|
|
ValueInitializer value = ((CheckBox) data).getWidgetValue(); |
|
|
|
if (value != null && value.getValue() instanceof Boolean) { |
|
|
|
if (value != null && value.getValue() instanceof Boolean) { |
|
|
|
((UICheckBox) editor).setSelected((Boolean) value.getValue()); |
|
|
|
((UICheckBox) editor).setSelected((Boolean) value.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
@ -82,9 +81,9 @@ public class XCheckBox extends XWidgetCreator { |
|
|
|
return "check_box_16.png"; |
|
|
|
return "check_box_16.png"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void firePropertyChange(){ |
|
|
|
public void firePropertyChange() { |
|
|
|
((UICheckBox) editor).setText(((CheckBox) data).getText()); |
|
|
|
((UICheckBox) editor).setText(((CheckBox) data).getText()); |
|
|
|
WidgetValue value = ((CheckBox) data).getWidgetValue(); |
|
|
|
ValueInitializer value = ((CheckBox) data).getWidgetValue(); |
|
|
|
if (value != null && value.getValue() instanceof Boolean) { |
|
|
|
if (value != null && value.getValue() instanceof Boolean) { |
|
|
|
((UICheckBox) editor).setSelected((Boolean) value.getValue()); |
|
|
|
((UICheckBox) editor).setSelected((Boolean) value.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|