You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
2.5 KiB
80 lines
2.5 KiB
3 years ago
|
package com.fr.plugin.shdcmap.data;
|
||
|
|
||
|
import com.fr.design.gui.icombobox.UIComboBox;
|
||
|
import com.fr.design.i18n.Toolkit;
|
||
|
import com.fr.extended.chart.AbstractExtendedChartTableDataPane;
|
||
|
import com.fr.extended.chart.ExtendedCustomFieldComboBoxPane;
|
||
|
|
||
|
/**
|
||
|
* @author duan.jingliang
|
||
|
* @date 2020/11/18
|
||
|
*/
|
||
|
public class CustomDataPane extends AbstractExtendedChartTableDataPane<CustomDataConfig> {
|
||
|
|
||
|
private UIComboBox code;
|
||
|
private UIComboBox name;
|
||
|
private UIComboBox type;
|
||
|
private UIComboBox icon;
|
||
|
private UIComboBox coords;
|
||
|
private UIComboBox convert;
|
||
|
|
||
|
@Override
|
||
|
protected ExtendedCustomFieldComboBoxPane createExtendedCustomFieldComboBoxPane() {
|
||
|
return new ExtendedCustomFieldComboBoxPane(){
|
||
|
@Override
|
||
|
protected boolean valueComboBoxHasNone() {
|
||
|
return true;
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
protected String[] fieldLabels() {
|
||
|
return new String[]{
|
||
|
Toolkit.i18nText("Plugin-ShdcMap_code"),
|
||
|
Toolkit.i18nText("Plugin-ShdcMap_name"),
|
||
|
Toolkit.i18nText("Plugin-ShdcMap_type"),
|
||
|
Toolkit.i18nText("Plugin-ShdcMap_icon"),
|
||
|
Toolkit.i18nText("Plugin-ShdcMap_coords"),
|
||
|
Toolkit.i18nText("Plugin-ShdcMap_convert")
|
||
|
};
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
protected UIComboBox[] filedComboBoxes() {
|
||
|
if (null == code) {
|
||
|
code = new UIComboBox();
|
||
|
name = new UIComboBox();
|
||
|
type = new UIComboBox();
|
||
|
icon = new UIComboBox();
|
||
|
coords = new UIComboBox();
|
||
|
convert = new UIComboBox();
|
||
|
}
|
||
|
return new UIComboBox[]{
|
||
|
code, name, type, icon, coords, convert
|
||
|
};
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
protected void populate(CustomDataConfig dataConfig) {
|
||
|
populateField(code, dataConfig.getCode());
|
||
|
populateField(name, dataConfig.getName());
|
||
|
populateField(type, dataConfig.getType());
|
||
|
populateField(icon, dataConfig.getIcon());
|
||
|
populateField(coords, dataConfig.getCoords());
|
||
|
populateField(convert, dataConfig.getConvert());
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
protected CustomDataConfig update() {
|
||
|
CustomDataConfig dataConfig = new CustomDataConfig();
|
||
|
updateField(code, dataConfig.getCode());
|
||
|
updateField(name, dataConfig.getName());
|
||
|
updateField(type, dataConfig.getType());
|
||
|
updateField(icon, dataConfig.getIcon());
|
||
|
updateField(coords, dataConfig.getCoords());
|
||
|
updateField(convert, dataConfig.getConvert());
|
||
|
return dataConfig;
|
||
|
}
|
||
|
}
|