logicOperandColumnTitle,
logicOperandColumnWidth);
logicOperandColumn.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(final Object element) {
FilterItemModel filterItemModel = (FilterItemModel) element;
FilterItemModel firstItem = (FilterItemModel) tableViewer.getElementAt(0);
String logicOperand = "";
if (!filterItemModel.equals(firstItem)) {
logicOperand = filterItemModel.getLogicOperand().getValue();
logger.debug("Filter's rule logic operand: {}", logicOperand);
}
return logicOperand;
}
});
logicOperandColumn.setEditingSupport(new RulesLogicCellEditor(tableViewer));
// 'Field type' filter's rule column
final String fieldTypeColumnTitle = "Field type";
final int fieldTypeColumnWidth = 85;
TableViewerColumn fieldTypeColumn = createSingleColumn(tableViewer,
fieldTypeColumnTitle,
fieldTypeColumnWidth);
fieldTypeColumn.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(final Object element) {
FilterItemModel filterItemModel = (FilterItemModel) element;
String fieldType = filterItemModel.getFieldType().getValue();
logger.debug("Filter's rule field type: {}", fieldType);
return fieldType;
}
});
fieldTypeColumn.setEditingSupport(new RulesFieldTypeCellEditor(tableViewer));
// 'Include' filter's rule column
final String includeColumnTitle = "Include";
final int includeColumnWidth = 60;
TableViewerColumn includeColumn = createSingleColumn(tableViewer, includeColumnTitle,
includeColumnWidth);
includeColumn.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(final Object element) {
FilterItemModel filterItemModel = (FilterItemModel) element;
String filterItemInclude = FilterConstants.EXCLUDE;
if (filterItemModel.isInclude()) {
filterItemInclude = FilterConstants.INCLUDE;
}
logger.debug("Filter's rule include: {}", filterItemInclude);
return filterItemInclude;
}
});
includeColumn.setEditingSupport(new RulesIncludeCellEditor(tableViewer));
// 'Match pattern' filter's rule column
final String patternColumnTitle = "Match pattern";
final int patternColumnWidth = 250;
TableViewerColumn matchPatternColumn = createSingleColumn(tableViewer,
patternColumnTitle,
patternColumnWidth);
matchPatternColumn.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(final Object element) {
FilterItemModel filterItemModel = (FilterItemModel) element;
String matchPattern = filterItemModel.getPattern();
logger.debug("Filter's rule match pattern: {}", matchPattern);
return matchPattern;
}
});
matchPatternColumn.setEditingSupport(new RulesMatchPatternCellEditor(tableViewer));