@ -2,6 +2,8 @@ package com.fr.extended.chart;
import com.fr.design.gui.icombobox.UIComboBox ;
import com.fr.design.gui.icombobox.UIComboBox ;
import com.fr.design.i18n.Toolkit ;
import com.fr.design.i18n.Toolkit ;
import com.fr.general.GeneralUtils ;
import com.fr.stable.StringUtils ;
import java.util.List ;
import java.util.List ;
@ -17,6 +19,11 @@ public class UIComboBoxWithNone extends UIComboBox {
public UIComboBoxWithNone ( ) {
public UIComboBoxWithNone ( ) {
super ( ) ;
super ( ) ;
addDefaultItem ( ) ;
addDefaultItem ( ) ;
setDefaultSelectedItem ( ) ;
}
protected void setDefaultSelectedItem ( ) {
setSelectedItem ( StringUtils . EMPTY ) ;
}
}
@Override
@Override
@ -43,7 +50,8 @@ public class UIComboBoxWithNone extends UIComboBox {
//找不到的都选中无。中文的无 英文下是none。
//找不到的都选中无。中文的无 英文下是none。
//改正:找不到的且anObject不是null的 全部选中无。
//改正:找不到的且anObject不是null的 全部选中无。
if ( getSelectedIndex ( ) = = - 1 & & anObject ! = null ) {
//改正:找不到的且anObject不是null的且anObject不是空字符串的 全部选中无。
if ( getSelectedIndex ( ) = = - 1 & & StringUtils . isNotEmpty ( GeneralUtils . objectToString ( anObject ) ) ) {
super . setSelectedItem ( getDefaultLocaleString ( ) ) ;
super . setSelectedItem ( getDefaultLocaleString ( ) ) ;
}
}
}
}