use of org.cytoscape.filter.model.ValidationWarning in project cytoscape-impl by cytoscape.
the class ValidationViewListener method formatTooltip.
public static String formatTooltip(List<ValidationWarning> warnings) {
StringBuilder sb = new StringBuilder();
sb.append("<html>");
sb.append("Filter cannot be applied to current network:<br>");
for (ValidationWarning warning : warnings) {
sb.append(warning.getWarning()).append("<br>");
}
sb.append("</html>");
return sb.toString();
}
use of org.cytoscape.filter.model.ValidationWarning in project cytoscape-impl by cytoscape.
the class TransformerJsonTunable method validate.
public static boolean validate(NamedTransformer<CyNetwork, CyIdentifiable> namedTransformer, TaskMonitor taskMonitor) {
boolean valid = true;
for (Transformer<CyNetwork, CyIdentifiable> transformer : namedTransformer.getTransformers()) {
if (transformer instanceof ValidatableTransformer) {
ValidatableTransformer<CyNetwork, CyIdentifiable> validatableTransformer = (ValidatableTransformer<CyNetwork, CyIdentifiable>) transformer;
List<ValidationWarning> warnings = validatableTransformer.validateCreation();
if (warnings != null && !warnings.isEmpty()) {
valid = false;
for (ValidationWarning warning : warnings) {
taskMonitor.showMessage(Level.ERROR, warning.getWarning());
}
}
}
}
return valid;
}
use of org.cytoscape.filter.model.ValidationWarning in project cytoscape-impl by cytoscape.
the class ValidationManager method runValidation.
private void runValidation(ValidatableTransformer<CyNetwork, CyIdentifiable> transformer) {
ValidationViewListener listener = listeners.get(transformer);
List<ValidationWarning> warnings = transformer.validate(network);
if (listener != null) {
listener.handleValidated(new ValidationEvent(warnings));
}
}
Aggregations