private void saveRule() {
        if (isAdding) {
            Rule r = new Rule(this.edName.getText(), this.edUrl.getText(), this.edRegExpr.getText(), true);

            RulesManager.getInstance().getRulesList().add(r);
        } else {
            // Edit an existing rule
            Rule r = RulesManager.getInstance().getRuleByName(edName.getText());
            if (r != null) {
                r.setRuleURL(edUrl.getText());
                r.setRuleRegExpr(edRegExpr.getText());
            }
        }        
    }