當前位置: 首頁>>代碼示例>>Java>>正文


Java DataSetGroup.getSelectedIntervalList方法代碼示例

本文整理匯總了Java中org.dashbuilder.dataset.group.DataSetGroup.getSelectedIntervalList方法的典型用法代碼示例。如果您正苦於以下問題:Java DataSetGroup.getSelectedIntervalList方法的具體用法?Java DataSetGroup.getSelectedIntervalList怎麽用?Java DataSetGroup.getSelectedIntervalList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.dashbuilder.dataset.group.DataSetGroup的用法示例。


在下文中一共展示了DataSetGroup.getSelectedIntervalList方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testSelectItem

import org.dashbuilder.dataset.group.DataSetGroup; //導入方法依賴的package包/類
@Test
public void testSelectItem() {
    DisplayerSettings departmentList = DisplayerSettingsFactory.newSelectorSettings()
            .dataset(EXPENSES)
            .group(COLUMN_DEPARTMENT)
            .column(COLUMN_DEPARTMENT)
            .column(COLUMN_ID, AggregateFunctionType.COUNT)
            .filterOn(false, true, true)
            .multiple(false)
            .buildSettings();

    SelectorDropDownDisplayer presenter = createSelectorDisplayer(departmentList);
    SelectorDropDownDisplayer.View view = presenter.getView();
    DisplayerListener listener = mock(DisplayerListener.class);
    presenter.draw();

    // Select an item
    reset(view);
    when(dropDownItem.getId()).thenReturn(1);
    presenter.addListener(listener);
    presenter.onItemSelected(dropDownItem);

    // Ensure data does not change
    verify(view, never()).clearItems();
    verify(view, never()).addItem(any());

    // Verify the item selected is correct
    ArgumentCaptor<DataSetGroup> argument = ArgumentCaptor.forClass(DataSetGroup.class);
    verify(view).showResetHint(COLUMN_DEPARTMENT, false);
    verify(view, never()).showSelectHint(COLUMN_DEPARTMENT, false);
    verify(listener).onFilterEnabled(eq(presenter), argument.capture());
    verify(listener, never()).onRedraw(presenter);
    DataSetGroup dataSetGroup = argument.getValue();
    List<Interval> selectedIntervals = dataSetGroup.getSelectedIntervalList();
    assertEquals(selectedIntervals.size(), 1);
    Interval selectedInterval = selectedIntervals.get(0);
    assertEquals(selectedInterval.getName(), "Management");
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:39,代碼來源:SelectorDropDownDisplayerTest.java

示例2: testSelectItem

import org.dashbuilder.dataset.group.DataSetGroup; //導入方法依賴的package包/類
@Test
public void testSelectItem() {
    DisplayerSettings departmentList = DisplayerSettingsFactory.newSelectorSettings()
            .dataset(EXPENSES)
            .group(COLUMN_DEPARTMENT)
            .column(COLUMN_DEPARTMENT)
            .column(COLUMN_ID, AggregateFunctionType.COUNT)
            .filterOn(false, true, true)
            .buildSettings();

    SelectorLabelSetDisplayer presenter = createSelectorDisplayer(departmentList);
    SelectorLabelSetDisplayer.View view = presenter.getView();
    DisplayerListener listener = mock(DisplayerListener.class);
    presenter.draw();

    // Select an item
    reset(view);
    when(labelItem.getId()).thenReturn(1);
    presenter.addListener(listener);
    presenter.onItemSelected(labelItem);

    // Ensure data does not change
    verify(view, never()).clearItems();
    verify(view, never()).addItem(any());

    // Verify the item selected is correct
    ArgumentCaptor<DataSetGroup> argument = ArgumentCaptor.forClass(DataSetGroup.class);
    verify(listener).onFilterEnabled(eq(presenter), argument.capture());
    verify(listener, never()).onRedraw(presenter);
    DataSetGroup dataSetGroup = argument.getValue();
    List<Interval> selectedIntervals = dataSetGroup.getSelectedIntervalList();
    assertEquals(selectedIntervals.size(), 1);
    Interval selectedInterval = selectedIntervals.get(0);
    assertEquals(selectedInterval.getName(), "Management");
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:36,代碼來源:SelectorLabelSetDisplayerTest.java

示例3: testMultipleSelect

import org.dashbuilder.dataset.group.DataSetGroup; //導入方法依賴的package包/類
@Test
public void testMultipleSelect() {
    DisplayerSettings departmentList = DisplayerSettingsFactory.newSelectorSettings()
            .dataset(EXPENSES)
            .group(COLUMN_DEPARTMENT)
            .column(COLUMN_DEPARTMENT)
            .column(COLUMN_ID, AggregateFunctionType.COUNT)
            .filterOn(false, true, true)
            .multiple(true)
            .buildSettings();

    SelectorLabelSetDisplayer presenter = createSelectorDisplayer(departmentList);
    SelectorLabelSetDisplayer.View view = presenter.getView();
    DisplayerListener listener = mock(DisplayerListener.class);
    presenter.draw();

    // Select an item
    reset(view);
    presenter.addListener(listener);
    when(labelItem.getId()).thenReturn(1);
    presenter.onItemSelected(labelItem);
    when(labelItem.getId()).thenReturn(2);
    presenter.onItemSelected(labelItem);

    // Ensure data does not change
    verify(view, never()).clearItems();
    verify(view, never()).addItem(any());

    // Verify the item selected is correct
    ArgumentCaptor<DataSetGroup> argument = ArgumentCaptor.forClass(DataSetGroup.class);
    verify(listener, times(2)).onFilterEnabled(eq(presenter), argument.capture());
    verify(listener, never()).onRedraw(presenter);
    DataSetGroup dataSetGroup = argument.getValue();
    List<Interval> selectedIntervals = dataSetGroup.getSelectedIntervalList();
    assertEquals(selectedIntervals.size(), 2);
    Interval selectedInterval1 = selectedIntervals.get(0);
    Interval selectedInterval2 = selectedIntervals.get(1);
    assertEquals(selectedInterval1.getName(), "Management");
    assertEquals(selectedInterval2.getName(), "Sales");
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:41,代碼來源:SelectorLabelSetDisplayerTest.java

示例4: testMultipleSelect

import org.dashbuilder.dataset.group.DataSetGroup; //導入方法依賴的package包/類
@Test
public void testMultipleSelect() {
    DisplayerSettings departmentList = DisplayerSettingsFactory.newSelectorSettings()
            .dataset(EXPENSES)
            .group(COLUMN_DEPARTMENT)
            .column(COLUMN_DEPARTMENT)
            .column(COLUMN_ID, AggregateFunctionType.COUNT)
            .filterOn(false, true, true)
            .multiple(true)
            .width(100)
            .buildSettings();

    SelectorDropDownDisplayer presenter = createSelectorDisplayer(departmentList);
    SelectorDropDownDisplayer.View view = presenter.getView();
    DisplayerListener listener = mock(DisplayerListener.class);
    presenter.draw();

    // Select an item
    presenter.addListener(listener);
    when(dropDownItem.getId()).thenReturn(1);
    presenter.onItemSelected(dropDownItem);

    // Select another item
    reset(view);
    reset(listener);
    when(dropDownItem.getId()).thenReturn(2);
    presenter.onItemSelected(dropDownItem);

    // Ensure data does not change
    verify(view, never()).clearItems();
    verify(view, never()).addItem(any());

    // Verify the item selected is correct
    ArgumentCaptor<DataSetGroup> argument = ArgumentCaptor.forClass(DataSetGroup.class);
    verify(view).showResetHint(COLUMN_DEPARTMENT, true);
    verify(view, never()).showSelectHint(COLUMN_DEPARTMENT, true);
    verify(view).showCurrentSelection("Management ...", "Management, Sales ");
    verify(listener).onFilterEnabled(eq(presenter), argument.capture());
    verify(listener, never()).onRedraw(presenter);
    DataSetGroup dataSetGroup = argument.getValue();
    List<Interval> selectedIntervals = dataSetGroup.getSelectedIntervalList();
    assertEquals(selectedIntervals.size(), 2);
    Interval selectedInterval1 = selectedIntervals.get(0);
    Interval selectedInterval2 = selectedIntervals.get(1);
    assertEquals(selectedInterval1.getName(), "Management");
    assertEquals(selectedInterval2.getName(), "Sales");

}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:49,代碼來源:SelectorDropDownDisplayerTest.java


注:本文中的org.dashbuilder.dataset.group.DataSetGroup.getSelectedIntervalList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。