Search in sources :

Example 11 with GroupIdEnum

use of com.sldeditor.common.xml.ui.GroupIdEnum in project sldeditor by robward-scisys.

the class GraphicPanelFieldManagerTest method testAddMultiOptionGroup.

/**
 * Test method for {@link com.sldeditor.ui.detail.GraphicPanelFieldManager#addMultiOptionGroup(com.sldeditor.ui.detail.config.base.MultiOptionGroup)}.
 * Test method for {@link com.sldeditor.ui.detail.GraphicPanelFieldManager#getMultiOptionGroup(java.lang.Class, com.sldeditor.common.xml.ui.GroupIdEnum)}.
 */
@Test
public void testAddMultiOptionGroup() {
    Class<?> expectedPanelId = StrokeDetails.class;
    GraphicPanelFieldManager mgr = new GraphicPanelFieldManager(expectedPanelId);
    FieldIdEnum expectedFieldId = FieldIdEnum.NAME;
    FieldConfigString stringField = new FieldConfigString(new FieldConfigCommonData(String.class, expectedFieldId, "test label", false), "button text");
    mgr.addField(stringField);
    MultiOptionGroup multiOption = new MultiOptionGroup();
    GroupIdEnum expectedGroupId = GroupIdEnum.FILLSYMBOL;
    multiOption.setId(expectedGroupId);
    mgr.addMultiOptionGroup(multiOption);
    MultiOptionGroup actualValue = mgr.getMultiOptionGroup(null, null);
    assertNull(actualValue);
    actualValue = mgr.getMultiOptionGroup(expectedPanelId, expectedGroupId);
    assertEquals(multiOption, actualValue);
}
Also used : FieldConfigString(com.sldeditor.ui.detail.config.FieldConfigString) StrokeDetails(com.sldeditor.ui.detail.StrokeDetails) FieldConfigCommonData(com.sldeditor.ui.detail.config.FieldConfigCommonData) FieldConfigString(com.sldeditor.ui.detail.config.FieldConfigString) FieldIdEnum(com.sldeditor.common.xml.ui.FieldIdEnum) MultiOptionGroup(com.sldeditor.ui.detail.config.base.MultiOptionGroup) GraphicPanelFieldManager(com.sldeditor.ui.detail.GraphicPanelFieldManager) GroupIdEnum(com.sldeditor.common.xml.ui.GroupIdEnum) Test(org.junit.Test)

Aggregations

GroupIdEnum (com.sldeditor.common.xml.ui.GroupIdEnum)11 FieldIdEnum (com.sldeditor.common.xml.ui.FieldIdEnum)10 GroupConfigInterface (com.sldeditor.ui.detail.config.base.GroupConfigInterface)8 FieldConfigBase (com.sldeditor.ui.detail.config.FieldConfigBase)6 CurrentFieldState (com.sldeditor.ui.detail.config.base.CurrentFieldState)4 GraphicPanelFieldManager (com.sldeditor.ui.detail.GraphicPanelFieldManager)3 MultiOptionGroup (com.sldeditor.ui.detail.config.base.MultiOptionGroup)3 Test (org.junit.Test)3 StrokeDetails (com.sldeditor.ui.detail.StrokeDetails)2 FieldConfigCommonData (com.sldeditor.ui.detail.config.FieldConfigCommonData)2 FieldConfigString (com.sldeditor.ui.detail.config.FieldConfigString)2 OptionGroup (com.sldeditor.ui.detail.config.base.OptionGroup)2 TreeSelectionData (com.sldeditor.TreeSelectionData)1 VersionData (com.sldeditor.common.vendoroption.VersionData)1 SldEditorTest (com.sldeditor.common.xml.ui.SldEditorTest)1 XMLColourMapEntries (com.sldeditor.common.xml.ui.XMLColourMapEntries)1 XMLFieldAttribute (com.sldeditor.common.xml.ui.XMLFieldAttribute)1 XMLFieldBase (com.sldeditor.common.xml.ui.XMLFieldBase)1 XMLFieldDisabled (com.sldeditor.common.xml.ui.XMLFieldDisabled)1 XMLFieldExpression (com.sldeditor.common.xml.ui.XMLFieldExpression)1