Package com.log4jviewer.filters

Examples of com.log4jviewer.filters.FilterItemModel


        return ((FilterItemModel) element).isEnabled();
    }

    @Override
    protected void setValue(final Object element, final Object value) {
        FilterItemModel filterItemModel = (FilterItemModel) element;
        filterItemModel.setEnabled((Boolean) value);
        tableViewer.update(element, null);
    }
View Full Code Here


        return true;
    }

    @Override
    protected Object getValue(final Object element) {
        FilterItemModel filterItemModel = (FilterItemModel) element;
        int logFieldIndex = 0;

        for (int i = 0; i < FilterConstants.LOG_FIELDS.length; i++) {
            if (filterItemModel.getFieldType().equals(FilterConstants.LOG_FIELDS[i])) {
                logFieldIndex = i;
                break;
            }
        }
        return logFieldIndex;
View Full Code Here

        return logFieldIndex;
    }

    @Override
    protected void setValue(final Object element, final Object value) {
        FilterItemModel filterItemModel = (FilterItemModel) element;
        FieldType[] fieldTypes = FilterItemModel.FieldType.values();
        filterItemModel.setFieldType(fieldTypes[(Integer) value]);
        tableViewer.update(element, null);
    }
View Full Code Here

    public List<FilterItemModel> getFilterItems(final int filterIndex) {
        List<FilterItemModel> filterItemModels = new LinkedList<FilterItemModel>();
        FilterModel filterModel = filters.get(filterIndex);

        for (int i = 0; i < filterModel.getItemsCount(); i++) {
            FilterItemModel filterItemModel = filterModel.getItem(i);
            filterItemModels.add(filterItemModel);
        }
        return filterItemModels;
    }
View Full Code Here

    public boolean isSelectedFilterIndexValid() {
        return ((selectedFilterIndex >= 0) && (selectedFilterIndex < filters.size()));
    }

    public FilterItemModel createFilterItem() {
        FilterItemModel filterItemModel = new FilterItemModel();
        filterItemModel.setLogicOperand(FilterItemModel.LogicOperand.AND);
        filterItemModel.setFieldType(FilterItemModel.FieldType.LEVEL);
        filterItemModel.setInclude(true);
        filterItemModel.setPattern("");
        filterItemModel.setEnabled(true);
        FilterModel selectedFilter = filters.get(selectedFilterIndex);
        selectedFilter.addItem(filterItemModel);
        return filterItemModel;
    }
View Full Code Here

        when(logMock.getThrowableInfo()).thenReturn(throwable);
        return logMock;
    }

    private static FilterModel createFilterMock() {
        FilterItemModel filterItemMock = mock(FilterItemModel.class);
        when(filterItemMock.getLogicOperand()).thenReturn(FilterItemModel.LogicOperand.AND);
        when(filterItemMock.getFieldType()).thenReturn(FilterItemModel.FieldType.LEVEL);
        when(filterItemMock.isInclude()).thenReturn(true);
        when(filterItemMock.getPattern()).thenReturn("INFO");
        when(filterItemMock.isEnabled()).thenReturn(true);

        FilterModel filterModel = new FilterModel();
        filterModel.addItem(filterItemMock);
        return filterModel;
    }
View Full Code Here

TOP

Related Classes of com.log4jviewer.filters.FilterItemModel

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.