Package org.dashbuilder.dataset.group

Examples of org.dashbuilder.dataset.group.DataSetGroup


     */
    protected void filterApply(String columnId, List<String> values) {
        if (!displayerSettings.isFilterEnabled()) return;

        // For string column filters, create and notify a group interval selection operation.
        DataSetGroup groupOp = dataSetHandler.getGroupOperation(columnId);
        DataSetGroup _groupSelect = null;
        if (groupOp != null && groupOp.getColumnGroup() != null) {
            _groupSelect = groupOp.cloneInstance();
            _groupSelect.setSelectedIntervalNames(values);

        } else {
            _groupSelect = new DataSetGroup();
            _groupSelect.setSelectedIntervalNames(values);
            _groupSelect.setColumnGroup(new ColumnGroup(columnId, columnId, GroupStrategy.DYNAMIC));
        }
        // Notify to those interested parties the selection event.
        if (displayerSettings.isFilterNotificationEnabled()) {
            for (DisplayerListener listener : listenerList) {
                listener.onGroupIntervalsSelected(this, _groupSelect);
View Full Code Here


     */
    protected void filterReset(String columnId) {
        if (!displayerSettings.isFilterEnabled()) return;

        columnSelectionMap.remove(columnId);
        DataSetGroup groupOp = dataSetHandler.getGroupOperation(columnId);
        if (groupOp == null || groupOp.getColumnGroup() == null) {
            groupOp = new DataSetGroup();
            groupOp.setColumnGroup(new ColumnGroup(columnId, columnId, GroupStrategy.DYNAMIC));
        }
        // Notify to those interested parties the reset event.
        if (displayerSettings.isFilterNotificationEnabled()) {
            for (DisplayerListener listener : listenerList) {
                listener.onGroupIntervalsReset(this, Arrays.asList(groupOp));
View Full Code Here

    protected void filterReset() {
        if (!displayerSettings.isFilterEnabled()) return;

        List<DataSetGroup> groupOpList = new ArrayList<DataSetGroup>();
        for (String columnId : columnSelectionMap.keySet()) {
            DataSetGroup groupOp = dataSetHandler.getGroupOperation(columnId);
            if (groupOp == null || groupOp.getColumnGroup() == null) {
                groupOp = new DataSetGroup();
                groupOp.setColumnGroup(new ColumnGroup(columnId, columnId, GroupStrategy.DYNAMIC));
            }
            groupOpList.add(groupOp);

        }
        columnSelectionMap.clear();
View Full Code Here

    public int getLastGroupOpIndex(int fromIndex, String columnId, boolean onlySelections) {
        int target = -1;
        for (int i = fromIndex; i < operationList.size(); i++) {
            DataSetOp op = operationList.get(i);
            if (DataSetOpType.GROUP.equals(op.getType())) {
                DataSetGroup groupOp = (DataSetGroup) op;

                ColumnGroup cg = groupOp.getColumnGroup();
                if (cg != null && columnId != null && !cg.getColumnId().equals(columnId)) {
                    continue;
                }
                if (onlySelections && groupOp.getSelectedIntervalNames().isEmpty()) {
                    continue;
                }
                target= i;
            }
        }
View Full Code Here

    public T group(String columnId, String newColumnId, GroupStrategy strategy, int maxIntervals, DateIntervalType intervalSize) {
        return group(columnId, newColumnId, strategy, maxIntervals, intervalSize.toString());
    }

    public T group(String columnId, String newColumnId, GroupStrategy strategy, int maxIntervals, String intervalSize) {
        DataSetGroup gOp = new DataSetGroup();
        gOp.setColumnGroup(new ColumnGroup(columnId, newColumnId, strategy, maxIntervals, intervalSize));
        dataSetLookup.addOperation(gOp);
        return (T) this;
    }
View Full Code Here

        dataSetLookup.addOperation(gOp);
        return (T) this;
    }

    public T fixed(DateIntervalType type) {
        DataSetGroup gOp = (DataSetGroup) getCurrentOp();
        if (gOp == null || gOp.getColumnGroup() == null) {
            throw new RuntimeException("group() must be called first.");
        }

        ColumnGroup columnGroup = gOp.getColumnGroup();
        columnGroup.setStrategy( GroupStrategy.FIXED );
        columnGroup.setIntervalSize( type.toString() );
        return (T) this;
    }
View Full Code Here

        columnGroup.setIntervalSize( type.toString() );
        return (T) this;
    }

    public T asc() {
        DataSetGroup gOp = (DataSetGroup) getCurrentOp();
        if (gOp == null || gOp.getColumnGroup() == null) {
            throw new RuntimeException("group() must be called first.");
        }

        ColumnGroup columnGroup = gOp.getColumnGroup();
        columnGroup.setAscendingOrder( true );
        return (T) this;
    }
View Full Code Here

        columnGroup.setAscendingOrder( true );
        return (T) this;
    }

    public T desc() {
        DataSetGroup gOp = (DataSetGroup) getCurrentOp();
        if (gOp == null || gOp.getColumnGroup() == null) {
            throw new RuntimeException("group() must be called first.");
        }

        ColumnGroup columnGroup = gOp.getColumnGroup();
        columnGroup.setAscendingOrder( false );
        return (T) this;
    }
View Full Code Here

        columnGroup.setAscendingOrder( false );
        return (T) this;
    }

    public T firstDay(DayOfWeek dayOfWeek) {
        DataSetGroup gOp = (DataSetGroup) getCurrentOp();
        if (gOp == null || gOp.getColumnGroup() == null) {
            throw new RuntimeException("group() must be called first.");
        }

        ColumnGroup columnGroup = gOp.getColumnGroup();
        if (!GroupStrategy.FIXED.equals(columnGroup.getStrategy())) {
            throw new RuntimeException("A fixed group is required.");
        }
        if (!DateIntervalType.DAY_OF_WEEK.equals(DateIntervalType.getByName(columnGroup.getIntervalSize()))) {
            throw new RuntimeException("A fixed DAY_OF_WEEK date group is required.");
View Full Code Here

        columnGroup.setFirstDayOfWeek(dayOfWeek);
        return (T) this;
    }

    public T firstMonth(Month month) {
        DataSetGroup gOp = (DataSetGroup) getCurrentOp();
        if (gOp == null || gOp.getColumnGroup() == null) {
            throw new RuntimeException("group() must be called first.");
        }

        ColumnGroup columnGroup = gOp.getColumnGroup();
        if (!GroupStrategy.FIXED.equals(columnGroup.getStrategy())) {
            throw new RuntimeException("A fixed group is required.");
        }
        if (!DateIntervalType.MONTH.equals(DateIntervalType.getByName(columnGroup.getIntervalSize()))) {
            throw new RuntimeException("A fixed MONTH date group is required.");
View Full Code Here

TOP

Related Classes of org.dashbuilder.dataset.group.DataSetGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.