Skip to content

Commit

Permalink
Implements #146
Browse files Browse the repository at this point in the history
  • Loading branch information
CoreyD97 committed Apr 8, 2022
1 parent b969b00 commit c5f1b7b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ public void actionPerformed(ActionEvent actionEvent) {
+ "" + context.getFullLabel() + " CONTAINS \"" + selectedText + "\"");
}
});

JMenuItem andNotFilter = new JMenuItem(new AbstractAction("AND NOT") {
@Override
public void actionPerformed(ActionEvent actionEvent) {
loggerPlusPlus.getLogViewController().getLogFilterController().setFilter(logTable.getCurrentFilter().toString() + " && !("
+ "" + context.getFullLabel() + " CONTAINS \"" + selectedText + "\")");
}
});

JMenuItem orFilter = new JMenuItem(new AbstractAction("OR") {
@Override
public void actionPerformed(ActionEvent actionEvent) {
Expand All @@ -102,6 +111,7 @@ public void actionPerformed(ActionEvent actionEvent) {
}
});
addToCurrentFilter.add(andFilter);
addToCurrentFilter.add(andNotFilter);
addToCurrentFilter.add(orFilter);
filterMenu.add(addToCurrentFilter);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ public void actionPerformed(ActionEvent actionEvent) {
logTableController.getLogViewController().getLogFilterController().setFilter(newFilter);
}
});

JMenuItem andNotFilter = new JMenuItem(new AbstractAction("AND NOT") {
@Override
public void actionPerformed(ActionEvent actionEvent) {
String newFilter = logTable.getCurrentFilter().addConditionToFilter(LogicalOperator.AND, selectedField, ComparisonOperator.NOT_EQUAL, columnValueString);
logTableController.getLogViewController().getLogFilterController().setFilter(newFilter);
}
});

JMenuItem orFilter = new JMenuItem(new AbstractAction(LogicalOperator.OR.getLabel()) {
@Override
public void actionPerformed(ActionEvent actionEvent) {
Expand All @@ -79,6 +88,7 @@ public void actionPerformed(ActionEvent actionEvent) {
}
});
addToCurrentFilter.add(andFilter);
addToCurrentFilter.add(andNotFilter);
addToCurrentFilter.add(orFilter);
this.add(addToCurrentFilter);
}
Expand Down

0 comments on commit c5f1b7b

Please sign in to comment.