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


Java ColumnType类代码示例

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


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

示例1: init

import org.dashbuilder.dataset.ColumnType; //导入依赖的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

示例2: initColumnListBox

import org.dashbuilder.dataset.ColumnType; //导入依赖的package包/类
protected void initColumnListBox() {
    view.clearColumnSelector();

    for (int i=0; i<metadata.getNumberOfColumns(); i++) {
        String columnId = metadata.getColumnId(i);
        ColumnType columnType = metadata.getColumnType(i);

        // Only add columns that match the target type.
        // When the target is not specified or is numeric then all the columns are eligible
        if (targetType == null || columnType == null || isColumnNumeric() || targetType.equals(columnType)) {
            view.addColumnItem(columnId);
            if (columnId != null && columnId.equals(groupFunction.getSourceId())) {
                view.setSelectedColumnIndex(i);
            }
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:ColumnFunctionEditor.java

示例3: onCreateFilter

import org.dashbuilder.dataset.ColumnType; //导入依赖的package包/类
public void onCreateFilter() {
    int selectedIdx = view.getSelectedColumnIndex();
    String columnId = metadata.getColumnId(selectedIdx);
    ColumnType columnType = metadata.getColumnType(selectedIdx);
    CoreFunctionFilter columnFilter = FilterFactory.createCoreFunctionFilter(
            columnId, columnType,
            ColumnType.DATE.equals(columnType) ? CoreFunctionType.TIME_FRAME : CoreFunctionType.NOT_EQUALS_TO);

    if (filter == null) {
        filter = new DataSetFilter();
    }
    filter.addFilterColumn(columnFilter);

    ColumnFilterEditor columnFilterEditor = beanManager.lookupBean(ColumnFilterEditor.class).newInstance();
    columnFilterEditor.init(metadata, columnFilter);
    columnFilterEditor.expand();

    view.addColumnFilterEditor(columnFilterEditor);
    view.resetSelectedColumn();
    view.showNewFilterHome();
    changeEvent.fire(new DataSetFilterChangedEvent(filter));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:DataSetFilterEditor.java

示例4: onSelectFilterFunction

import org.dashbuilder.dataset.ColumnType; //导入依赖的package包/类
public void onSelectFilterFunction() {
    int selectedIdx = view.getSelectedFunctionIndex();
    if (selectedIdx >= 0) {
        CoreFunctionFilter coreFilter = getCoreFilter();
        CoreFunctionType functionType = getAvailableFunctions(coreFilter).get(selectedIdx);

        ColumnType columnType = metadata.getColumnType(coreFilter.getColumnId());
        List params = FilterFactory.createParameters(columnType, functionType);
        coreFilter.setType(functionType);
        coreFilter.setParameters(params);

        initFilterSelector();
        fireFilterChanged();

        if (!initFilterConfig().isEmpty()) {
            view.showFilterConfig();
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:ColumnFilterEditor.java

示例5: createParamInputWidget

import org.dashbuilder.dataset.ColumnType; //导入依赖的package包/类
protected FunctionParameterEditor createParamInputWidget(final CoreFunctionFilter coreFilter, final int paramIndex) {
    final List paramList = coreFilter.getParameters();
    ColumnType columnType = metadata.getColumnType(coreFilter.getColumnId());
    CoreFunctionType functionType = coreFilter.getType();
    boolean isMultiple = CoreFunctionType.IN.equals(functionType) || CoreFunctionType.NOT_IN.equals(functionType);

    if (ColumnType.DATE.equals(columnType)) {
        if (CoreFunctionType.TIME_FRAME.equals(coreFilter.getType())) {
            return createTimeFrameWidget(paramList, paramIndex);
        }
        return createDateInputWidget(paramList, paramIndex);
    }

    if (!isMultiple) {
        if (ColumnType.NUMBER.equals(columnType)) {
            return createNumberInputWidget(paramList, paramIndex);
        }
        return createTextInputWidget(paramList, paramIndex);
    } else {
        if (ColumnType.NUMBER.equals(columnType)) {
            return createMultipleNumberInputWidget(paramList);
        }
        return createMultipleTextInputWidget(paramList);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:26,代码来源:ColumnFilterEditor.java

示例6: testUpdateFunctionsAvailable

import org.dashbuilder.dataset.ColumnType; //导入依赖的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

示例7: testCreateLabelFilter

import org.dashbuilder.dataset.ColumnType; //导入依赖的package包/类
@Test
public void testCreateLabelFilter() {
    DataSetFilterEditor filterEditor = new DataSetFilterEditor(filterView, beanManager, changedEvent);
    filterEditor.init(null, metadata);
    reset(filterView);
    when(filterView.getSelectedColumnIndex()).thenReturn(0);

    filterEditor.onCreateFilter();
    verify(changedEvent).fire(any(DataSetFilterChangedEvent.class));

    DataSetFilter filter = filterEditor.getFilter();
    assertNotNull(filter);
    assertEquals(filter.getColumnFilterList().size(), 1);

    ColumnFilter expected = FilterFactory.createCoreFunctionFilter("column1", ColumnType.LABEL, CoreFunctionType.NOT_EQUALS_TO);
    assertEquals(filter.getColumnFilterList().get(0), expected);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:DataSetFilterEditorTest.java

示例8: testCreateDateFilter

import org.dashbuilder.dataset.ColumnType; //导入依赖的package包/类
@Test
public void testCreateDateFilter() {
    DataSetFilterEditor filterEditor = new DataSetFilterEditor(filterView, beanManager, changedEvent);
    filterEditor.init(null, metadata);
    reset(filterView);
    when(filterView.getSelectedColumnIndex()).thenReturn(2);

    filterEditor.onCreateFilter();
    verify(changedEvent).fire(any(DataSetFilterChangedEvent.class));

    DataSetFilter filter = filterEditor.getFilter();
    assertNotNull(filter);
    assertEquals(filter.getColumnFilterList().size(), 1);

    ColumnFilter expected = FilterFactory.createCoreFunctionFilter("column3", ColumnType.DATE, CoreFunctionType.TIME_FRAME);
    assertEquals(filter.getColumnFilterList().get(0), expected);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:DataSetFilterEditorTest.java

示例9: testNumberParam

import org.dashbuilder.dataset.ColumnType; //导入依赖的package包/类
@Test
public void testNumberParam() throws Exception {
    double number = 1000.23;
    NumberFormat numberFormat = NumberFormat.getNumberInstance();
    when(view.formatNumber(number)).thenReturn(numberFormat.format(number));
    setupEditor(ColumnType.NUMBER, CoreFunctionType.EQUALS_TO, number);

    int n = CoreFunctionType.getSupportedTypes(ColumnType.NUMBER).size()-1;
    verify(view).clearFunctionSelector();
    verify(view, times(n)).addFunctionItem(any(CoreFunctionType.class));
    verify(view, never()).addFunctionItem(CoreFunctionType.TIME_FRAME);
    verify(view, never()).addFunctionItem(CoreFunctionType.LIKE_TO);

    verify(view).clearFilterConfig();
    verify(view).addFilterConfigWidget(numberParameterEditor);
    verify(view).setFunctionSelected("col = " + numberFormat.format(number));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:ColumnFilterEditorTest.java

示例10: testDateParam

import org.dashbuilder.dataset.ColumnType; //导入依赖的package包/类
@Test
public void testDateParam() throws Exception {
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
    String dateStr = "23-11-2020 23:59:59";
    Date d = dateFormat.parse(dateStr);
    when(view.formatDate(d)).thenReturn(dateStr);
    setupEditor(ColumnType.DATE, CoreFunctionType.EQUALS_TO, d);

    int n = CoreFunctionType.getSupportedTypes(ColumnType.DATE).size()-1;
    verify(view).clearFunctionSelector();
    verify(view, times(n)).addFunctionItem(any(CoreFunctionType.class));
    verify(view).addFunctionItem(CoreFunctionType.TIME_FRAME);
    verify(view, never()).addFunctionItem(CoreFunctionType.LIKE_TO);

    verify(view).clearFilterConfig();
    verify(view).addFilterConfigWidget(dateParameterEditor);
    verify(view).setFunctionSelected("col = " + dateStr);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:ColumnFilterEditorTest.java

示例11: createDisplayerConstraints

import org.dashbuilder.dataset.ColumnType; //导入依赖的package包/类
@Override
public DisplayerConstraints createDisplayerConstraints() {
    DataSetLookupConstraints lookupConstraints = new DataSetLookupConstraints()
            .setGroupRequired(true)
            .setGroupColumn(true)
            .setMinColumns(2)
            .setMaxColumns(3)
            .setExtraColumnsAllowed(true)
            .setGroupsTitle(view.getGroupsTitle())
            .setColumnsTitle(view.getColumnsTitle())
            .setColumnTypes(new ColumnType[] {
                    ColumnType.LABEL,
                    ColumnType.NUMBER});

    return new DisplayerConstraints(lookupConstraints)
               .supportsAttribute(DisplayerAttributeDef.TYPE)
               .supportsAttribute(DisplayerAttributeDef.SUBTYPE)
               .supportsAttribute(DisplayerAttributeDef.RENDERER)
               .supportsAttribute(DisplayerAttributeGroupDef.COLUMNS_GROUP)
               .supportsAttribute(DisplayerAttributeGroupDef.FILTER_GROUP)
               .supportsAttribute(DisplayerAttributeGroupDef.REFRESH_GROUP)
               .supportsAttribute(DisplayerAttributeGroupDef.GENERAL_GROUP)
               .supportsAttribute(DisplayerAttributeDef.CHART_WIDTH)
               .supportsAttribute(DisplayerAttributeDef.CHART_HEIGHT)
               .supportsAttribute(DisplayerAttributeGroupDef.CHART_MARGIN_GROUP);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:27,代码来源:GoogleMapDisplayer.java

示例12: testDataPush

import org.dashbuilder.dataset.ColumnType; //导入依赖的package包/类
@Test
public void testDataPush() {

    // Google renderer draw calls are processed asynchronously
    // A ready() call needs to be executed in order to ignite the real chart display
    GoogleBarChartDisplayer barChart = createBarChartDisplayer(byYear);
    barChart.ready();

    GoogleBarChartDisplayer.View view = barChart.getView();
    verify(view).dataClear();
    verify(view).dataAddColumn(ColumnType.LABEL, COLUMN_DATE, COLUMN_DATE);
    verify(view).dataAddColumn(eq(ColumnType.NUMBER), anyString(), anyString());
    verify(view).dataRowCount(4);
    verify(view, times(4)).dataSetValue(anyInt(), anyInt(), anyString());
    verify(view, times(4)).dataSetValue(anyInt(), anyInt(), any(Double.class));
    verify(view).dataFormatNumberColumn(anyString(), eq(1));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:GoogleDisplayerDataTest.java

示例13: createDisplayerConstraints

import org.dashbuilder.dataset.ColumnType; //导入依赖的package包/类
@Override
public DisplayerConstraints createDisplayerConstraints() {
    DataSetLookupConstraints lookupConstraints = new DataSetLookupConstraints()
            .setGroupRequired(true)
            .setGroupColumn(true)
            .setMaxColumns(2)
            .setMinColumns(2)
            .setExtraColumnsAllowed(false)
            .setGroupsTitle(getView().getGroupsTitle())
            .setColumnsTitle(getView().getColumnsTitle())
            .setColumnTypes(new ColumnType[] {
                    ColumnType.LABEL,
                    ColumnType.NUMBER});

    return new DisplayerConstraints(lookupConstraints)
            .supportsAttribute(DisplayerAttributeDef.TYPE)
            .supportsAttribute(DisplayerAttributeDef.RENDERER)
            .supportsAttribute(DisplayerAttributeGroupDef.COLUMNS_GROUP)
            .supportsAttribute(DisplayerAttributeGroupDef.FILTER_GROUP)
            .supportsAttribute(DisplayerAttributeGroupDef.REFRESH_GROUP)
            .supportsAttribute(DisplayerAttributeGroupDef.GENERAL_GROUP)
            .supportsAttribute(DisplayerAttributeGroupDef.CHART_GROUP );
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:LienzoPieChartDisplayer.java

示例14: createDisplayerConstraints

import org.dashbuilder.dataset.ColumnType; //导入依赖的package包/类
@Override
public DisplayerConstraints createDisplayerConstraints() {

    DataSetLookupConstraints lookupConstraints = new DataSetLookupConstraints()
            .setGroupRequired(true)
            .setGroupColumn(true)
            .setMaxColumns(-1)
            .setMinColumns(1)
            .setExtraColumnsAllowed(true)
            .setGroupsTitle(view.getGroupsTitle())
            .setColumnsTitle(view.getColumnsTitle())
            .setColumnTypes(new ColumnType[] {
                    ColumnType.LABEL});

    return new DisplayerConstraints(lookupConstraints)
            .supportsAttribute( DisplayerAttributeDef.TYPE )
            .supportsAttribute( DisplayerAttributeGroupDef.COLUMNS_GROUP )
            .supportsAttribute( DisplayerAttributeGroupDef.FILTER_GROUP )
            .supportsAttribute( DisplayerAttributeGroupDef.REFRESH_GROUP )
            .supportsAttribute( DisplayerAttributeGroupDef.GENERAL_GROUP );
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:22,代码来源:SelectorDisplayer.java

示例15: lookup

import org.dashbuilder.dataset.ColumnType; //导入依赖的package包/类
public IntervalBuilder lookup(ColumnType columnType, GroupStrategy strategy) {
    if (ColumnType.LABEL.equals(columnType)) {
        if (GroupStrategy.FIXED.equals(strategy)) return intervalBuilderDynamicLabel;
        if (GroupStrategy.DYNAMIC.equals(strategy)) return intervalBuilderDynamicLabel;
    }
    if (ColumnType.DATE.equals(columnType)) {
        if (GroupStrategy.FIXED.equals(strategy)) return intervalBuilderFixedDate;
        if (GroupStrategy.DYNAMIC.equals(strategy)) return intervalBuilderDynamicDate;
        return intervalBuilderDynamicDate;
    }
    if (ColumnType.NUMBER.equals(columnType)) {
        return intervalBuilderDynamicLabel;
    }
    if (ColumnType.TEXT.equals(columnType)) {
        throw new IllegalArgumentException( CommonConstants.INSTANCE.exc_text_columns_no_grouping());
    }
    return null;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:ClientIntervalBuilderLocator.java


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