use of com.sldeditor.ui.detail.config.FieldConfigVendorOption in project sldeditor by robward-scisys.
the class FieldConfigVendorOptionTest method testGenerateExpression.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#generateExpression()}. Test
* method for {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#getStringValue()}.
* Test method for
* {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#populateExpression(java.lang.Object)}.
*/
@Test
public void testGenerateExpression() {
boolean valueOnly = true;
List<VendorOptionInterface> veList = null;
FieldConfigVendorOption field = new FieldConfigVendorOption(new FieldConfigCommonData(Double.class, FieldIdEnum.NAME, "label", valueOnly), veList);
assertNull(field.getStringValue());
field.populateExpression(null);
}
use of com.sldeditor.ui.detail.config.FieldConfigVendorOption in project sldeditor by robward-scisys.
the class MultiOptionGroup method populateOptionGroup.
/**
* Populate option group.
*
* @param fieldConfigManager the field config manager
* @param optionBox the option box
* @param groupConfigList the group config list
*/
private void populateOptionGroup(GraphicPanelFieldManager fieldConfigManager, Box optionBox, List<GroupConfigInterface> groupConfigList) {
for (GroupConfigInterface groupConfigI : groupConfigList) {
groupConfigI.createTitle(optionBox, null);
if (groupConfigI instanceof GroupConfig) {
GroupConfig groupConfig = (GroupConfig) groupConfigI;
for (FieldConfigBase field : groupConfig.getFieldConfigList()) {
field.createUI();
field.revertToDefaultValue();
FieldPanel component = field.getPanel();
optionBox.add(component);
fieldConfigManager.addField(field);
optionFieldList.add(field);
if (field instanceof FieldConfigVendorOption) {
((FieldConfigVendorOption) field).addToOptionBox(optionBox);
}
}
populateOptionGroup(fieldConfigManager, optionBox, groupConfig.getSubGroupList());
} else if (groupConfigI instanceof MultiOptionGroup) {
MultiOptionGroup multiOptionGroupConfig = (MultiOptionGroup) groupConfigI;
fieldConfigManager.addMultiOptionGroup(multiOptionGroupConfig);
multiOptionGroupConfig.createUI(fieldConfigManager, optionBox, parent, this.panelId);
}
}
}
use of com.sldeditor.ui.detail.config.FieldConfigVendorOption in project sldeditor by robward-scisys.
the class FieldConfigVendorOptionTest method testRevertToDefaultValue.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#revertToDefaultValue()}.
*/
@Test
public void testRevertToDefaultValue() {
List<VendorOptionInterface> veList = null;
boolean valueOnly = true;
FieldConfigVendorOption field = new FieldConfigVendorOption(new FieldConfigCommonData(Double.class, FieldIdEnum.NAME, "label", valueOnly), veList);
field.revertToDefaultValue();
field.createUI();
field.revertToDefaultValue();
}
use of com.sldeditor.ui.detail.config.FieldConfigVendorOption in project sldeditor by robward-scisys.
the class FieldConfigVendorOptionTest method testCreateCopy.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#createCopy(com.sldeditor.ui.detail.config.FieldConfigBase)}.
*/
@Test
public void testCreateCopy() {
boolean valueOnly = true;
class TestFieldConfigVendorOption extends FieldConfigVendorOption {
public TestFieldConfigVendorOption(FieldConfigCommonData commonData, List<VendorOptionInterface> veList) {
super(commonData, veList);
}
public FieldConfigPopulate callCreateCopy(FieldConfigBase fieldConfigBase) {
return createCopy(fieldConfigBase);
}
}
TestFieldConfigVendorOption field = new TestFieldConfigVendorOption(new FieldConfigCommonData(Double.class, FieldIdEnum.NAME, "label", valueOnly), null);
FieldConfigVendorOption copy = (FieldConfigVendorOption) field.callCreateCopy(null);
assertNull(copy);
copy = (FieldConfigVendorOption) field.callCreateCopy(field);
assertEquals(field.getFieldId(), copy.getFieldId());
assertTrue(field.getLabel().compareTo(copy.getLabel()) == 0);
assertEquals(field.isValueOnly(), copy.isValueOnly());
}
Aggregations