use of com.sldeditor.ui.detail.config.FieldConfigVendorOption in project sldeditor by robward-scisys.
the class FieldConfigVendorOptionTest method testAddToOptionBox.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#addToOptionBox(javax.swing.Box)}.
*/
@Test
public void testAddToOptionBox() {
FieldConfigVendorOption field = new FieldConfigVendorOption(new FieldConfigCommonData(Double.class, FieldIdEnum.NAME, "label", false), null);
field.addToOptionBox(null);
}
use of com.sldeditor.ui.detail.config.FieldConfigVendorOption in project sldeditor by robward-scisys.
the class FieldConfigVendorOptionTest method testVendorOptionsUpdated.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#vendorOptionsUpdated(java.util.List)}.
*/
@Test
public void testVendorOptionsUpdated() {
RasterSymbolizerDetails panel = new RasterSymbolizerDetails();
VendorOptionRasterFactory vendorOptionRasterFactory = new VendorOptionRasterFactory(getClass(), panel);
// CHECKSTYLE:OFF
List<VendorOptionInterface> veList = vendorOptionRasterFactory.getVendorOptionList("com.sldeditor.ui.detail.vendor.geoserver.raster.VOGeoServerContrastEnhancementNormalizeOverall");
for (VendorOptionInterface extension : veList) {
extension.setParentPanel(panel);
}
FieldConfigVendorOption field = new FieldConfigVendorOption(new FieldConfigCommonData(Double.class, FieldIdEnum.NAME, "label", false), veList);
field.vendorOptionsUpdated(null);
field.createUI();
List<VersionData> vendorOptionVersionsList = new ArrayList<VersionData>();
vendorOptionVersionsList.add(VersionData.getLatestVersion(GeoServerVendorOption.class));
field.vendorOptionsUpdated(vendorOptionVersionsList);
}
use of com.sldeditor.ui.detail.config.FieldConfigVendorOption in project sldeditor by robward-scisys.
the class FieldConfigVendorOptionTest method testSetVisible.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#setVisible(boolean)}.
*/
@Test
public void testSetVisible() {
List<VendorOptionInterface> veList = null;
boolean valueOnly = true;
FieldConfigVendorOption field = new FieldConfigVendorOption(new FieldConfigCommonData(Double.class, FieldIdEnum.NAME, "label", valueOnly), veList);
boolean expectedValue = true;
field.setVisible(expectedValue);
field.createUI();
field.setVisible(expectedValue);
expectedValue = false;
field.setVisible(expectedValue);
}
use of com.sldeditor.ui.detail.config.FieldConfigVendorOption in project sldeditor by robward-scisys.
the class FieldConfigVendorOptionTest method testSetEnabled.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#internal_setEnabled(boolean)}.
* Test method for {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#isEnabled()}.
* Test method for {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#createUI()}.
*/
@Test
public void testSetEnabled() {
// Value only, no attribute/expression dropdown
List<VendorOptionInterface> veList = null;
boolean valueOnly = true;
FieldConfigVendorOption field = new FieldConfigVendorOption(new FieldConfigCommonData(Double.class, FieldIdEnum.NAME, "label", valueOnly), veList);
// Text field will not have been created
boolean expectedValue = true;
field.internal_setEnabled(expectedValue);
assertTrue(field.isEnabled());
// Create text field
field.createUI();
assertEquals(expectedValue, field.isEnabled());
expectedValue = false;
field.internal_setEnabled(expectedValue);
assertTrue(field.isEnabled());
// Has attribute/expression dropdown
valueOnly = false;
FieldConfigVendorOption field2 = new FieldConfigVendorOption(new FieldConfigCommonData(Double.class, FieldIdEnum.NAME, "label", valueOnly), veList);
// Text field will not have been created
expectedValue = true;
field2.internal_setEnabled(expectedValue);
assertTrue(field2.isEnabled());
// Create text field
field2.createUI();
assertEquals(expectedValue, field2.isEnabled());
expectedValue = false;
field2.internal_setEnabled(expectedValue);
assertTrue(field2.isEnabled());
}
use of com.sldeditor.ui.detail.config.FieldConfigVendorOption in project sldeditor by robward-scisys.
the class FieldConfigVendorOptionTest method testAttributeSelection.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.FieldConfigVendorOption#attributeSelection(java.lang.String)}.
*/
@Test
public void testAttributeSelection() {
boolean valueOnly = true;
FieldConfigVendorOption field = new FieldConfigVendorOption(new FieldConfigCommonData(Double.class, FieldIdEnum.NAME, "label", valueOnly), null);
field.attributeSelection(null);
field.createUI();
field.createUI();
assertTrue(field.isEnabled());
field.attributeSelection("test");
assertTrue(field.isEnabled());
field.attributeSelection(null);
assertTrue(field.isEnabled());
}
Aggregations