mirror of
https://github.com/mirror/jdownloader.git
synced 2024-11-23 03:59:51 +00:00
PackagizerFilterRuleDialog:
-updated RuleMatcher to support multiple test links PackagizerSingleTestTableModel: -updated matches column build>full git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@30988 ebf7c1c2-ba36-0410-9fe8-c592906822b4 Former-commit-id: b874b7fe0c7a06908fdeae7e90e259759ee34b90
This commit is contained in:
parent
f2ca2353da
commit
6ce82c6407
@ -8,6 +8,7 @@ import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.ButtonGroup;
|
||||
@ -110,30 +111,30 @@ public class PackagizerFilterRuleDialog extends ConditionDialog<PackagizerRule>
|
||||
}
|
||||
|
||||
public static class RuleMatcher {
|
||||
private Boolean matches = null;
|
||||
private PackagizerRule rule;
|
||||
private final HashSet<CrawledLink> matches = new HashSet<CrawledLink>();
|
||||
private final PackagizerRule rule;
|
||||
|
||||
public RuleMatcher(PackagizerRule rule) {
|
||||
public RuleMatcher(final PackagizerRule rule) {
|
||||
this.rule = rule;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the matches
|
||||
*/
|
||||
public Boolean getMatches() {
|
||||
return matches;
|
||||
public boolean matches(final CrawledLink link) {
|
||||
synchronized (matches) {
|
||||
return matches.contains(link);
|
||||
}
|
||||
}
|
||||
|
||||
public PackagizerRule getRule() {
|
||||
return rule;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param matches
|
||||
* the matches to set
|
||||
*/
|
||||
public void setMatches(boolean matches) {
|
||||
this.matches = matches;
|
||||
public void setMatches(final CrawledLink link, final PackagizerRuleWrapper lgr) {
|
||||
synchronized (matches) {
|
||||
matches.add(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -795,7 +796,7 @@ public class PackagizerFilterRuleDialog extends ConditionDialog<PackagizerRule>
|
||||
|
||||
@Override
|
||||
protected void set(CrawledLink link, PackagizerRuleWrapper lgr) {
|
||||
matcher.setMatches(true);
|
||||
matcher.setMatches(link, lgr);
|
||||
super.set(link, lgr);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class PackagizerSingleTestTableModel extends ExtTableModel<CrawledLink> {
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -2808142012367413057L;
|
||||
private RuleMatcher rule;
|
||||
private final RuleMatcher rule;
|
||||
|
||||
public PackagizerSingleTestTableModel(RuleMatcher rule) {
|
||||
super("PackagizerSingleTestTableModel");
|
||||
@ -51,7 +51,7 @@ public class PackagizerSingleTestTableModel extends ExtTableModel<CrawledLink> {
|
||||
|
||||
@Override
|
||||
protected Icon getIcon(CrawledLink value) {
|
||||
if (Boolean.TRUE.equals(rule.getMatches())) {
|
||||
if (rule.matches(value)) {
|
||||
return NewTheme.I().getIcon("true", 16);
|
||||
} else {
|
||||
return NewTheme.I().getIcon("false", 16);
|
||||
|
Loading…
Reference in New Issue
Block a user