use of org.eclipse.nebula.widgets.nattable.layer.LabelStack in project nebula.widgets.nattable by eclipse.
the class ColumnOverrideLabelAccumulatorTest method testRegisterOverridesEllipseOnTop.
@Test
public void testRegisterOverridesEllipseOnTop() {
this.labelAccumulator.registerColumnOverridesOnTop(0, TEST_LABEL1);
this.labelAccumulator.registerColumnOverridesOnTop(0, TEST_LABEL2, TEST_LABEL3);
LabelStack configLabels = new LabelStack();
this.labelAccumulator.accumulateConfigLabels(configLabels, 0, 0);
Assert.assertEquals(3, configLabels.getLabels().size());
Assert.assertEquals(TEST_LABEL2, configLabels.getLabels().get(0));
Assert.assertEquals(TEST_LABEL3, configLabels.getLabels().get(1));
Assert.assertEquals(TEST_LABEL1, configLabels.getLabels().get(2));
}
use of org.eclipse.nebula.widgets.nattable.layer.LabelStack in project nebula.widgets.nattable by eclipse.
the class ColumnOverrideLabelAccumulatorTest method testRegisterOverridesOnTop.
@Test
public void testRegisterOverridesOnTop() {
this.labelAccumulator.registerColumnOverridesOnTop(0, TEST_LABEL1);
this.labelAccumulator.registerColumnOverridesOnTop(0, TEST_LABEL2);
LabelStack configLabels = new LabelStack();
this.labelAccumulator.accumulateConfigLabels(configLabels, 0, 0);
Assert.assertEquals(2, configLabels.getLabels().size());
Assert.assertEquals(TEST_LABEL2, configLabels.getLabels().get(0));
Assert.assertEquals(TEST_LABEL1, configLabels.getLabels().get(1));
}
use of org.eclipse.nebula.widgets.nattable.layer.LabelStack in project nebula.widgets.nattable by eclipse.
the class ColumnOverrideLabelAccumulatorTest method testRegisterOverrides.
@Test
public void testRegisterOverrides() {
this.labelAccumulator.registerColumnOverrides(0, TEST_LABEL1);
this.labelAccumulator.registerColumnOverrides(0, TEST_LABEL2);
LabelStack configLabels = new LabelStack();
this.labelAccumulator.accumulateConfigLabels(configLabels, 0, 0);
Assert.assertEquals(2, configLabels.getLabels().size());
Assert.assertEquals(TEST_LABEL1, configLabels.getLabels().get(0));
Assert.assertEquals(TEST_LABEL2, configLabels.getLabels().get(1));
}
use of org.eclipse.nebula.widgets.nattable.layer.LabelStack in project nebula.widgets.nattable by eclipse.
the class RowSizeConfigurationCommandTest method setup.
@Before
public void setup() {
this.dataLayer = new DataLayer(new DummyBodyDataProvider(4, 4));
this.dataLayer.setConfigLabelAccumulator(new IConfigLabelAccumulator() {
@Override
public void accumulateConfigLabels(LabelStack configLabels, int columnPosition, int rowPosition) {
configLabels.addLabel("ROW_" + rowPosition);
}
});
}
use of org.eclipse.nebula.widgets.nattable.layer.LabelStack in project nebula.widgets.nattable by eclipse.
the class SummaryRowIntegrationTest method defaultConfigLabelsAreAdded.
@Test
public void defaultConfigLabelsAreAdded() throws Exception {
ColumnOverrideLabelAccumulator labelAcc = new ColumnOverrideLabelAccumulator(this.layerStackWithSummary);
labelAcc.registerColumnOverrides(0, "myLabel");
((ViewportLayer) this.layerStackWithSummary).setConfigLabelAccumulator(labelAcc);
LabelStack configLabels = this.natTable.getConfigLabelsByPosition(0, 4);
List<String> labels = configLabels.getLabels();
assertEquals(3, labels.size());
assertEquals(SummaryRowLayer.DEFAULT_SUMMARY_COLUMN_CONFIG_LABEL_PREFIX + 0, labels.get(0));
assertEquals(SummaryRowLayer.DEFAULT_SUMMARY_ROW_CONFIG_LABEL, labels.get(1));
assertEquals("myLabel", labels.get(2));
}
Aggregations