use of main.system.entity.ConditionMaster.CONDITION_TEMPLATES in project Eidolons by IDemiurge.
the class FilterMaster method newFilter.
public static void newFilter() {
Conditions conditions = new Conditions();
OBJ_TYPE TYPE = ArcaneVault.getSelectedOBJ_TYPE();
CONDITION_TEMPLATES[] templates = CONDITION_TEMPLATES.values();
while (true) {
// CHOOSE TYPE? OR USE SELECTED TAB!
int i = DialogMaster.optionChoice(templates, "choose filter template");
if (i == -1) {
break;
}
CONDITION_TEMPLATES template = CONDITION_TEMPLATES.values()[i];
String value = DialogMaster.inputText("Enter filter's value name");
if (StringMaster.isEmpty(value)) {
break;
}
VALUE val = ContentManager.findValue(value);
value = DialogMaster.inputText("Enter filtering value");
if (StringMaster.isEmpty(value)) {
break;
}
conditions.add(new ConditionMaster().getConditionFromTemplate(template, StringMaster.getValueRef(KEYS.MATCH, val), value));
}
if (conditions.isEmpty()) {
return;
}
if (TYPE == null) {
}
// Document node = XML_Converter.getDoc(XML_Converter.openXml("conditions")
// + XML_Converter.closeXml("conditions"));
// String conditionString = XML_Converter.getStringFromXML(node);
TypeFilter filter = new TypeFilter(conditions, TYPE);
// save!
filters.add(filter);
ArcaneVault.getMainBuilder().getTabBuilder().addFilter(filter);
}
Aggregations