本文整理汇总了Java中org.dashbuilder.dataset.group.DataSetGroup类的典型用法代码示例。如果您正苦于以下问题:Java DataSetGroup类的具体用法?Java DataSetGroup怎么用?Java DataSetGroup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DataSetGroup类属于org.dashbuilder.dataset.group包,在下文中一共展示了DataSetGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: filterApply
import org.dashbuilder.dataset.group.DataSetGroup; //导入依赖的package包/类
/**
* Filter the values of the given column.
*
* @param columnId The name of the column to filter.
* @param intervalList A list of interval selections to filter for.
*/
public void filterApply(String columnId, List<Interval> intervalList) {
if (displayerSettings.isFilterEnabled()) {
// For string column filters, init the group interval selection operation.
DataSetGroup groupOp = dataSetHandler.getGroupOperation(columnId);
groupOp.setSelectedIntervalList(intervalList);
// Notify to those interested parties the selection event.
if (displayerSettings.isFilterNotificationEnabled()) {
for (DisplayerListener listener : listenerList) {
listener.onFilterEnabled(this, groupOp);
}
}
// Drill-down support
if (displayerSettings.isFilterSelfApplyEnabled()) {
dataSetHandler.drillDown(groupOp);
redraw();
}
}
}
示例2: filterReset
import org.dashbuilder.dataset.group.DataSetGroup; //导入依赖的package包/类
/**
* Clear any filter on the given column.
*
* @param columnId The name of the column to reset.
*/
public void filterReset(String columnId) {
if (displayerSettings.isFilterEnabled()) {
columnSelectionMap.remove(columnId);
DataSetGroup groupOp = dataSetHandler.getGroupOperation(columnId);
// Notify to those interested parties the reset event.
if (displayerSettings.isFilterNotificationEnabled()) {
for (DisplayerListener listener : listenerList) {
listener.onFilterReset(this, Arrays.asList(groupOp));
}
}
// Apply the selection to this displayer
if (displayerSettings.isFilterSelfApplyEnabled()) {
dataSetHandler.drillUp(groupOp);
redraw();
}
}
}
示例3: onAddColumn
import org.dashbuilder.dataset.group.DataSetGroup; //导入依赖的package包/类
void onAddColumn() {
if (lookupConstraints.areExtraColumnsAllowed()) {
DataSetGroup op = getFirstGroupOp();
List<GroupFunction> functionList = op.getGroupFunctions();
GroupFunction last = functionList.get(functionList.size() - 1);
GroupFunction clone = last.cloneInstance();
String newColumnId = lookupConstraints.buildUniqueColumnId(dataSetLookup,
clone);
clone.setColumnId(newColumnId);
functionList.add(clone);
updateColumnControls();
changeEvent.fire(new DataSetLookupChangedEvent(dataSetLookup));
}
}
示例4: getExistingDataColumnIds
import org.dashbuilder.dataset.group.DataSetGroup; //导入依赖的package包/类
List<String> getExistingDataColumnIds() {
DataSet dataSet = displayerSettings.getDataSet();
DataSetLookup dataSetLookup = displayerSettings.getDataSetLookup();
List<String> columnIds = new ArrayList<String>();
if (dataSet != null) {
for (DataColumn dataColumn : dataSet.getColumns()) {
columnIds.add(dataColumn.getId());
}
}
else if (dataSetLookup != null) {
int idx = dataSetLookup.getLastGroupOpIndex(0);
if (idx != -1) {
DataSetGroup groupOp = dataSetLookup.getOperation(idx);
for (GroupFunction groupFunction : groupOp.getGroupFunctions()) {
columnIds.add(groupFunction.getColumnId());
}
}
}
return columnIds;
}
示例5: verifySettings
import org.dashbuilder.dataset.group.DataSetGroup; //导入依赖的package包/类
private void verifySettings(DisplayerSettings settings) {
assertEquals(DATASOURCE_UUID + SEPARATOR + SCHEMA + SEPARATOR + TABLE,
settings.getDataSetLookup().getDataSetUUID());
assertEquals(TABLE,
settings.getTitle());
assertEquals(true,
settings.isTitleVisible());
assertEquals(20,
settings.getTablePageSize());
assertEquals(true,
settings.isTableSortEnabled());
assertEquals(1,
settings.getDataSetLookup().getOperationList().size());
DataSetGroup dataSetOp = (DataSetGroup) settings.getDataSetLookup().getOperationList().get(0);
List<GroupFunction> groupFunctions = dataSetOp.getGroupFunctions();
assertEquals(COLUMNS_COUNT,
groupFunctions.size());
for (int i = 0; i < groupFunctions.size(); i++) {
assertEquals(DATA_COLUMN + String.valueOf(i),
groupFunctions.get(i).getColumnId());
}
assertEquals(COLUMN_WIDTH * COLUMNS_COUNT,
settings.getTableWidth());
}
示例6: format
import org.dashbuilder.dataset.group.DataSetGroup; //导入依赖的package包/类
public T format(String name, String pattern) {
DataSetOp op = getCurrentOp();
if (op == null || !(op instanceof DataSetGroup)) {
throw new RuntimeException("column(...) must be called first.");
}
DataSetGroup gOp = (DataSetGroup) getCurrentOp();
List<GroupFunction> columns = gOp.getGroupFunctions();
if (columns.isEmpty()) {
throw new RuntimeException("column(...) must be called first.");
}
GroupFunction lastColumn = columns.get(columns.size() - 1);
return format(lastColumn.getColumnId(), name, pattern);
}
示例7: onFilterEnabled
import org.dashbuilder.dataset.group.DataSetGroup; //导入依赖的package包/类
@Override
public void onFilterEnabled(Displayer displayer, DataSetGroup groupOp) {
if (displayerSettings.isFilterListeningEnabled()) {
if (dataSetHandler.filter(groupOp)) {
redraw();
}
}
}
示例8: onFilterReset
import org.dashbuilder.dataset.group.DataSetGroup; //导入依赖的package包/类
@Override
public void onFilterReset(Displayer displayer, List<DataSetGroup> groupOps) {
if (displayerSettings.isFilterListeningEnabled()) {
boolean applied = false;
for (DataSetGroup groupOp : groupOps) {
if (dataSetHandler.unfilter(groupOp)) {
applied = true;
}
}
if (applied) {
redraw();
}
}
}
示例9: getFirstGroupOp
import org.dashbuilder.dataset.group.DataSetGroup; //导入依赖的package包/类
public DataSetGroup getFirstGroupOp() {
List<DataSetGroup> groupOpList = dataSetLookup.getOperationList(DataSetGroup.class);
if (groupOpList.isEmpty()) {
return null;
}
return groupOpList.get(0);
}
示例10: isFirstGroupOpDateBased
import org.dashbuilder.dataset.group.DataSetGroup; //导入依赖的package包/类
public boolean isFirstGroupOpDateBased() {
DataSetGroup first = getFirstGroupOp();
if (first == null) {
return false;
}
ColumnGroup cg = first.getColumnGroup();
if (cg == null) {
return false;
}
ColumnType type = getColumnType(cg.getSourceId());
return ColumnType.DATE.equals(type);
}
示例11: getFirstGroupFunctions
import org.dashbuilder.dataset.group.DataSetGroup; //导入依赖的package包/类
public List<GroupFunction> getFirstGroupFunctions() {
List<DataSetGroup> groupOpList = dataSetLookup.getOperationList(DataSetGroup.class);
if (groupOpList.isEmpty()) {
return null;
}
return groupOpList.get(0).getGroupFunctions();
}
示例12: getFirstGroupFunctionIdx
import org.dashbuilder.dataset.group.DataSetGroup; //导入依赖的package包/类
public int getFirstGroupFunctionIdx(GroupFunction gf) {
List<DataSetGroup> groupOpList = dataSetLookup.getOperationList(DataSetGroup.class);
if (groupOpList.isEmpty()) {
return -1;
}
return groupOpList.get(0).getGroupFunctionIdx(gf);
}
示例13: getFirstGroupColumnId
import org.dashbuilder.dataset.group.DataSetGroup; //导入依赖的package包/类
public String getFirstGroupColumnId() {
List<DataSetGroup> groupOpList = dataSetLookup.getOperationList(DataSetGroup.class);
if (groupOpList.isEmpty()) {
return null;
}
DataSetGroup groupOp = groupOpList.get(0);
if (groupOp.getColumnGroup() == null) {
return null;
}
return groupOp.getColumnGroup().getSourceId();
}
示例14: onDateGroupChanged
import org.dashbuilder.dataset.group.DataSetGroup; //导入依赖的package包/类
void onDateGroupChanged(@Observes DataSetGroupDateChanged event) {
ColumnGroup columnGroup = event.getColumnGroup();
DataSetGroup groupOp = getFirstGroupOp();
if (groupOp != null) {
groupOp.setColumnGroup(columnGroup);
changeEvent.fire(new DataSetLookupChangedEvent(dataSetLookup));
}
}
示例15: testNotifications
import org.dashbuilder.dataset.group.DataSetGroup; //导入依赖的package包/类
@Test
public void testNotifications() {
AbstractDisplayer deptPieChart = (AbstractDisplayer) displayerLocator.lookupDisplayer(byDepartment);
DisplayerListener listener = mock(DisplayerListener.class);
deptPieChart.addListener(listener);
deptPieChart.draw();
deptPieChart.filterUpdate(COLUMN_DEPARTMENT, 0);
verify(listener).onFilterEnabled(eq(deptPieChart), any(DataSetGroup.class));
verify(listener, never()).onRedraw(deptPieChart);
deptPieChart.filterReset();
verify(listener).onFilterReset(eq(deptPieChart), anyList());
verify(listener, never()).onRedraw(deptPieChart);
}