当前位置: 首页>>代码示例>>Java>>正文


Java GroupFunction类代码示例

本文整理汇总了Java中org.dashbuilder.dataset.group.GroupFunction的典型用法代码示例。如果您正苦于以下问题:Java GroupFunction类的具体用法?Java GroupFunction怎么用?Java GroupFunction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GroupFunction类属于org.dashbuilder.dataset.group包,在下文中一共展示了GroupFunction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onAddColumn

import org.dashbuilder.dataset.group.GroupFunction; //导入依赖的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));
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:DataSetLookupEditor.java

示例2: getExistingDataColumnIds

import org.dashbuilder.dataset.group.GroupFunction; //导入依赖的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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:22,代码来源:DisplayerEditor.java

示例3: init

import org.dashbuilder.dataset.group.GroupFunction; //导入依赖的package包/类
public void init(DataSetMetadata metadata,
                 GroupFunction groupFunction,
                 ColumnType targetType,
                 String columnTitle,
                 boolean functionsEnabled,
                 boolean canDelete) {

    this.groupFunction = groupFunction;
    this.targetType = targetType;
    this.metadata = metadata;
    this.functionsEnabled = functionsEnabled;

    columnDetailsEditor.init(metadata, this.groupFunction);
    view.setColumnSelectorTitle(columnTitle);
    view.setDeleteOptionEnabled(canDelete);
    initColumnListBox();

    if (functionsEnabled && (targetType == null || isColumnNumeric())) {
        view.setFunctionSelectorEnabled(true);
        initFunctionListBox();
    } else {
        view.setFunctionSelectorEnabled(false);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:ColumnFunctionEditor.java

示例4: testViewInitialization

import org.dashbuilder.dataset.group.GroupFunction; //导入依赖的package包/类
@Test
public void testViewInitialization() {
    GroupFunction groupFunction = new GroupFunction("column1", "column1", null);
    presenter.init(metadata, groupFunction, null, "Title", false, false);

    verify(view).setDeleteOptionEnabled(false);
    verify(view, never()).setDeleteOptionEnabled(true);

    verify(view).setColumnSelectorTitle("Title");
    verify(view).clearColumnSelector();
    verify(view, times(3)).addColumnItem(anyString());
    verify(view).setSelectedColumnIndex(0);

    verify(view).setFunctionSelectorEnabled(false);
    verify(view, never()).setFunctionSelectorEnabled(true);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:ColumnFunctionEditorTest.java

示例5: testUpdateFunctionsAvailable

import org.dashbuilder.dataset.group.GroupFunction; //导入依赖的package包/类
@Test
public void testUpdateFunctionsAvailable() {
    GroupFunction groupFunction = new GroupFunction("column1", "column1", AggregateFunctionType.COUNT);
    presenter.init(metadata, groupFunction, null, "Title", true, true);

    List<AggregateFunctionType> typeListColumn1 = presenter.getSupportedFunctionTypes();
    List<AggregateFunctionType> typeListLabel = presenter.getSupportedFunctionTypes(ColumnType.LABEL);
    assertEquals(typeListColumn1.size(), typeListLabel.size());
    verify(view).clearFunctionSelector();
    verify(view, times(typeListLabel.size())).addFunctionItem(any(AggregateFunctionType.class));

    reset(view);
    when(view.getSelectedColumnId()).thenReturn("column2");
    presenter.onColumnSelected();

    List<AggregateFunctionType> typeListColumn2 = presenter.getSupportedFunctionTypes();
    List<AggregateFunctionType> typeListNumber = presenter.getSupportedFunctionTypes(ColumnType.NUMBER);
    assertEquals(typeListColumn2.size(), typeListNumber.size());
    assertEquals(presenter.getGroupFunction().getSourceId(), "column2");
    verify(view).clearFunctionSelector();
    verify(view, times(typeListNumber.size())).addFunctionItem(any(AggregateFunctionType.class));
    verify(changeEvent).fire(any(GroupFunctionChangedEvent.class));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:ColumnFunctionEditorTest.java

示例6: testDeleteColumns

import org.dashbuilder.dataset.group.GroupFunction; //导入依赖的package包/类
@Test
public void testDeleteColumns() {
    DataSetLookup lookup = DataSetLookupFactory.newDataSetLookupBuilder()
            .dataset(POPULATION_UUID)
            .column("year")
            .column("population")
            .buildLookup();

    GroupFunction year = lookup.getLastGroupOp().getGroupFunction("year");
    presenter.init(DATA_MULTIPLE, lookup);

    reset(view);
    presenter.onColumnFunctionDeleted(new GroupFunctionDeletedEvent(year));

    verify(view).clearColumnList();
    verify(view, times(1)).addColumnEditor(any(ColumnFunctionEditor.class));
    verify(event).fire(any(DataSetLookupChangedEvent.class));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:DataSetLookupEditorTest.java

示例7: verifySettings

import org.dashbuilder.dataset.group.GroupFunction; //导入依赖的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());
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:27,代码来源:DataManagementServiceImplTest.java

示例8: format

import org.dashbuilder.dataset.group.GroupFunction; //导入依赖的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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:14,代码来源:AbstractDisplayerSettingsBuilder.java

示例9: getFirstGroupFunctions

import org.dashbuilder.dataset.group.GroupFunction; //导入依赖的package包/类
public List<GroupFunction> getFirstGroupFunctions() {
    List<DataSetGroup> groupOpList = dataSetLookup.getOperationList(DataSetGroup.class);
    if (groupOpList.isEmpty()) {
        return null;
    }
    return groupOpList.get(0).getGroupFunctions();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:8,代码来源:DataSetLookupEditor.java

示例10: getFirstGroupFunctionIdx

import org.dashbuilder.dataset.group.GroupFunction; //导入依赖的package包/类
public int getFirstGroupFunctionIdx(GroupFunction gf) {
    List<DataSetGroup> groupOpList = dataSetLookup.getOperationList(DataSetGroup.class);
    if (groupOpList.isEmpty()) {
        return -1;
    }
    return groupOpList.get(0).getGroupFunctionIdx(gf);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:8,代码来源:DataSetLookupEditor.java

示例11: getGroupFunctionLastIdx

import org.dashbuilder.dataset.group.GroupFunction; //导入依赖的package包/类
int getGroupFunctionLastIdx(List<GroupFunction> groupFunctions,
                            String sourceId) {
    int last = -1;
    for (GroupFunction gf : groupFunctions) {
        if (gf.getSourceId().equals(sourceId)) {
            int idx = getGroupFunctionColumnIdx(gf.getColumnId());
            if (last == -1 || last < idx) {
                last = idx;
            }
        }
    }
    return last;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:14,代码来源:DataSetLookupEditor.java

示例12: onColumnFunctionChanged

import org.dashbuilder.dataset.group.GroupFunction; //导入依赖的package包/类
void onColumnFunctionChanged(@Observes GroupFunctionChangedEvent event) {
    GroupFunction gf = event.getGroupFunction();
    String newColumnId = lookupConstraints.buildUniqueColumnId(dataSetLookup,
                                                               gf);
    gf.setColumnId(newColumnId);
    changeEvent.fire(new DataSetLookupChangedEvent(dataSetLookup));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:8,代码来源:DataSetLookupEditor.java

示例13: onColumnFunctionDeleted

import org.dashbuilder.dataset.group.GroupFunction; //导入依赖的package包/类
void onColumnFunctionDeleted(@Observes GroupFunctionDeletedEvent event) {
    List<GroupFunction> functionList = getFirstGroupFunctions();
    boolean canDelete = functionList.size() > lookupConstraints.getMinColumns();

    GroupFunction removed = event.getGroupFunction();
    int index = getFirstGroupFunctionIdx(removed);
    if (canDelete && index >= 0) {

        functionList.remove(index);
        updateColumnControls();
        changeEvent.fire(new DataSetLookupChangedEvent(dataSetLookup));
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:14,代码来源:DataSetLookupEditor.java

示例14: init

import org.dashbuilder.dataset.group.GroupFunction; //导入依赖的package包/类
public void init(DataSetMetadata metadata, GroupFunction groupFunction) {
    this.column = groupFunction;
    this.metadata = metadata;

    if (StringUtils.isBlank(column.getColumnId())) {
        view.setColumnId(column.getSourceId());
    }
    else {
        view.setColumnId(column.getColumnId());
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:12,代码来源:ColumnDetailsEditor.java

示例15: testLabelTarget

import org.dashbuilder.dataset.group.GroupFunction; //导入依赖的package包/类
@Test
public void testLabelTarget() {
    GroupFunction groupFunction = new GroupFunction("column1", "column1", null);
    presenter.init(metadata, groupFunction, ColumnType.LABEL, "Title", true, true);

    verify(view).clearColumnSelector();
    verify(view, times(1)).addColumnItem(anyString());
    verify(view).setSelectedColumnIndex(0);

    verify(view).setFunctionSelectorEnabled(false);
    verify(view, never()).setFunctionSelectorEnabled(true);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:13,代码来源:ColumnFunctionEditorTest.java


注:本文中的org.dashbuilder.dataset.group.GroupFunction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。