public boolean callback(Event event, Type type, QName name, String path, String message) { // if(paths.contains(path)) return true; StringBuilder s = new StringBuilder(message).append(" "); if (event == Event.CREATION) { paths.add(path); s.append("Create "); } else if (event == Event.MODIFICATION) { paths.add(path); s.append("Modify "); } if (type == Type.ELEMENT) s.append("element '"); else if (type == Type.ATTRIBUTE) s.append("attribute '"); else if (type == Type.TYPE) s.append("type '"); s.append(name.getLocalPart()) .append("' in namespace '") .append(name.getNamespaceURI()) .append("' at path ") .append(path) .append("?"); if (!yesToAll) { int choice = UISupport.yesYesToAllOrNo(s.toString(), "Conflict"); if (choice == 2) { panel.logln(s.append(" FAIL").toString()); return false; } else if (choice == 1) yesToAll = true; } panel.logln(s.append(" OK").toString()); return true; }
public synchronized void run() { try { if (panel.awaitButton(this)) { try { wait(); } catch (InterruptedException e) { e.printStackTrace(); } } else yesToAll = true; if (kill) return; InferredSchemaManager.getInferredSchema(service).learningValidate(xml, this); panel.update(); setTitle("Schema"); InferredSchemaManager.save(service); } catch (XmlException e) { setTitle("Schema (invalid)"); } }