use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.
the class FieldConfigBaseTest method testGetPanel.
/**
* Test method for {@link com.sldeditor.ui.detail.config.FieldConfigBase#getPanel()}.
*/
@Test
public void testGetPanel() {
boolean valueOnly = true;
FieldIdEnum expectedFieldId = FieldIdEnum.NAME;
String expectedLabel = "test label";
TestFieldConfigBase field = new TestFieldConfigBase(new FieldConfigCommonData(String.class, expectedFieldId, expectedLabel, valueOnly));
assertNull(field.getPanel());
}
use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.
the class FieldConfigBaseTest method testValueUpdated.
/**
* Test method for {@link com.sldeditor.ui.detail.config.FieldConfigBase#valueUpdated()}.
*/
@Test
public void testValueUpdated() {
FieldIdEnum expectedFieldId = FieldIdEnum.NAME;
String expectedLabel = "test label";
TestFieldConfigBase field = new TestFieldConfigBase(new FieldConfigCommonData(String.class, expectedFieldId, expectedLabel, false));
TestUpdateSymbolInterface listener = new TestUpdateSymbolInterface();
field.addDataChangedListener(listener);
assertFalse(listener.hasBeenCalled());
field.valueUpdated();
assertTrue(listener.hasBeenCalled());
assertEquals(ExpressionTypeEnum.E_VALUE, field.getExpressionType());
}
use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.
the class FieldConfigBaseTest method testGetLabel.
/**
* Test method for {@link com.sldeditor.ui.detail.config.FieldConfigBase#getLabel()}.
*/
@Test
public void testGetLabel() {
boolean valueOnly = true;
FieldIdEnum expectedFieldId = FieldIdEnum.NAME;
String expectedLabel = "test label";
TestFieldConfigBase field = new TestFieldConfigBase(new FieldConfigCommonData(String.class, expectedFieldId, expectedLabel, valueOnly));
assertTrue(expectedLabel.compareTo(field.getLabel()) == 0);
}
use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.
the class FieldConfigBaseTest method testShowOptionField.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.FieldConfigBase#showOptionField(boolean)}.
*/
@Test
public void testShowOptionField() {
FieldIdEnum expectedFieldId = FieldIdEnum.NAME;
String expectedLabel = "test label";
TestFieldConfigBase field = new TestFieldConfigBase(new FieldConfigCommonData(String.class, expectedFieldId, expectedLabel, false));
field.showOptionField(true);
field.setOptionFieldValue(true);
field.createUI();
field.showOptionField(false);
field.setOptionFieldValue(false);
assertNotNull(field.toString());
}
use of com.sldeditor.common.xml.ui.FieldIdEnum in project sldeditor by robward-scisys.
the class FieldConfigBaseTest method testIsValueOnly.
/**
* Test method for {@link com.sldeditor.ui.detail.config.FieldConfigBase#isValueOnly()}.
*/
@Test
public void testIsValueOnly() {
boolean valueOnly = true;
FieldIdEnum expectedFieldId = FieldIdEnum.NAME;
String expectedLabel = "test label";
TestFieldConfigBase field = new TestFieldConfigBase(new FieldConfigCommonData(String.class, expectedFieldId, expectedLabel, valueOnly));
assertEquals(valueOnly, field.isValueOnly());
valueOnly = false;
field = new TestFieldConfigBase(new FieldConfigCommonData(String.class, expectedFieldId, expectedLabel, valueOnly));
assertEquals(valueOnly, field.isValueOnly());
}
Aggregations