private AbstractCustomRuleSpecification findRuleSpecification(FieldMeta fieldMeta) { IRuleSpecification specification = ruleElement.getRuleSpecification(); if (specification != null) { Visitor findsVisitor = new FindSpecificationVistor(fieldMeta); Object result = specification.accept(findsVisitor); if (result instanceof AbstractCustomRuleSpecification) { return (AbstractCustomRuleSpecification) result; } } return null; }
private void initComponents() { this.setLayout(new MigLayout("align center", "[right]")); Element element = ruleElement.getElement(); List<FieldMeta> fieldList = element.getFieldList(); for (FieldMeta field : fieldList) { RuleItemPanel ruleItemPane = new RuleItemPanel(field, findRuleSpecification(field), edit); ruleItemPaneList.add(ruleItemPane); this.add(ruleItemPane, "wrap"); } }
public RuleElement getUpdatedRuleElement() { ruleElement.setRuleSpecification(getSettedRuleSpecification()); return ruleElement; }