use of org.eclipse.nebula.widgets.nattable.test.fixture.PropertiesFixture in project nebula.widgets.nattable by eclipse.
the class AbstractLayerTest method persistablesAreSaved.
@Test
public void persistablesAreSaved() throws Exception {
PersistableFixture persistable = new PersistableFixture();
PropertiesFixture properties = new PropertiesFixture();
this.dataLayer.registerPersistable(persistable);
this.dataLayer.saveState("test_prefix", properties);
Assert.assertTrue(persistable.stateSaved);
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.PropertiesFixture in project nebula.widgets.nattable by eclipse.
the class DisplayColumnStyleEditorCommandHandlerTest method saveStateForMultipleLabels.
@Test
public void saveStateForMultipleLabels() throws Exception {
CellStyleFixture style1 = new CellStyleFixture(HorizontalAlignmentEnum.LEFT);
CellStyleFixture style2 = new CellStyleFixture(HorizontalAlignmentEnum.RIGHT);
this.handlerUnderTest.stylesToPersist.put("label1", style1);
this.handlerUnderTest.stylesToPersist.put("label2", style2);
PropertiesFixture propertiesFixture = new PropertiesFixture();
this.handlerUnderTest.saveState("prefix", propertiesFixture);
assertEquals(HorizontalAlignmentEnum.LEFT.name(), propertiesFixture.getProperty("prefix.userDefinedColumnStyle.label1.style.horizontalAlignment"));
assertEquals(HorizontalAlignmentEnum.RIGHT.name(), propertiesFixture.getProperty("prefix.userDefinedColumnStyle.label2.style.horizontalAlignment"));
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.PropertiesFixture in project nebula.widgets.nattable by eclipse.
the class DisplayColumnStyleEditorCommandHandlerTest method loadStateForMultipleLabels.
@Test
public void loadStateForMultipleLabels() throws Exception {
PropertiesFixture propertiesFixture = new PropertiesFixture().addStyleProperties("prefix.userDefinedColumnStyle.USER_EDITED_STYLE_FOR_INDEX_0").addStyleProperties("prefix.userDefinedColumnStyle.USER_EDITED_STYLE_FOR_INDEX_1");
this.handlerUnderTest.loadState("prefix", propertiesFixture);
Style style = (Style) this.configRegistryFixture.getConfigAttribute(CellConfigAttributes.CELL_STYLE, DisplayMode.NORMAL, "USER_EDITED_STYLE_FOR_INDEX_0");
assertEquals(HorizontalAlignmentEnum.LEFT, style.getAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT));
style = (Style) this.configRegistryFixture.getConfigAttribute(CellConfigAttributes.CELL_STYLE, DisplayMode.NORMAL, "USER_EDITED_STYLE_FOR_INDEX_1");
assertEquals(VerticalAlignmentEnum.TOP, style.getAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT));
}
use of org.eclipse.nebula.widgets.nattable.test.fixture.PropertiesFixture in project nebula.widgets.nattable by eclipse.
the class DisplayColumnStyleEditorCommandHandlerTest method loadStateForMultipleMixedLabels.
@Test
public void loadStateForMultipleMixedLabels() throws Exception {
PropertiesFixture propertiesFixture = new PropertiesFixture().addStyleProperties("prefix.userDefinedColumnStyle.USER_EDITED_STYLE_FOR_INDEX_0").addStyleProperties("prefix.userDefinedColumnStyle.USER_EDITED_STYLE_FOR_INDEX_1").addStyleProperties("prefix.userDefinedColumnStyle.USER_EDITED_STYLE");
this.handlerUnderTest.loadState("prefix", propertiesFixture);
Style style = (Style) this.configRegistryFixture.getConfigAttribute(CellConfigAttributes.CELL_STYLE, DisplayMode.NORMAL, "USER_EDITED_STYLE_FOR_INDEX_0");
assertEquals(HorizontalAlignmentEnum.LEFT, style.getAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT));
style = (Style) this.configRegistryFixture.getConfigAttribute(CellConfigAttributes.CELL_STYLE, DisplayMode.NORMAL, "USER_EDITED_STYLE_FOR_INDEX_1");
assertEquals(VerticalAlignmentEnum.TOP, style.getAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT));
style = (Style) this.configRegistryFixture.getConfigAttribute(CellConfigAttributes.CELL_STYLE, DisplayMode.NORMAL, "USER_EDITED_STYLE");
assertEquals(VerticalAlignmentEnum.TOP, style.getAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT));
}
Aggregations