Browse Source

CHART-15263 系列添加无

feature/big-screen
shine 4 years ago
parent
commit
2d9479f52d
  1. 7
      designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java
  2. 4
      designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java

7
designer-chart/src/main/java/com/fr/design/chartx/component/AbstractCustomFieldComboBoxPane.java

@ -82,6 +82,10 @@ public abstract class AbstractCustomFieldComboBoxPane<T> extends BasicBeanPane<T
return false;
}
protected boolean seriesComboBoxHasNone() {
return false;
}
public void checkBoxUse(boolean hasUse) {
nameOrValue.setEnabled(hasUse);
useFieldValuePane.checkBoxUse(hasUse);
@ -147,8 +151,7 @@ public abstract class AbstractCustomFieldComboBoxPane<T> extends BasicBeanPane<T
private void initComponents() {
series = new UIComboBox();
series = seriesComboBoxHasNone() ? new UIComboBoxWithNone() : new UIComboBox();
value = valueComboBoxHasNone() ? new UIComboBoxWithNone() : new UIComboBox();
value.addItemListener(new ItemListener() {
@Override

4
designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java

@ -41,7 +41,9 @@ public class UIComboBoxWithNone extends UIComboBox {
public void setSelectedItem(Object anObject) {
super.setSelectedItem(anObject);
if (getSelectedIndex() == -1) {//找不到的都选中无。中文的无 英文下是none。
//找不到的都选中无。中文的无 英文下是none。
//改正:找不到的且anObject不是null的 全部选中无。
if (getSelectedIndex() == -1 && anObject != null) {
super.setSelectedItem(getDefaultLocaleString());
}
}

Loading…
Cancel
Save