public boolean checkTest() {
NbEditorDocument doc = (NbEditorDocument) UpdateNodeTask.getInstance().getLastDocument();//lastResult.getSnapshot().getSource().getDocument(false);// ElementProvider.getInstance().getEditorCookie();//TopComponent.getRegistry().getActivated().getLookup().lookup(EditorCookie.class);
LyDataObject o = (LyDataObject) doc.getDocumentProperties().get("stream");
if (o.getPrimaryFile().getPath().equals("E:/Mutopia/Test.ly")) {
OutputHandler.clear("Test");
ListAll all = new ListAll() {
@Override
public void println(String test) {
Color color = Color.BLUE;
if (test.startsWith("----")) {
color = color.RED;
}
if (test.startsWith("+++++")) {
color = color.GREEN;
}
if (test.startsWith("ReParsererror")) {
color = color.MAGENTA.darker().darker();
}
if (test.startsWith("midierror")) {
color = color.BLUE.darker().darker();
}
OutputHandler.output("Test", test, color, new OutputListener() {
public void outputLineSelected(OutputEvent oe) {
//throw new UnsupportedOperationException("Not supported yet.");
}
public void outputLineAction(OutputEvent oe) {
String s = oe.getLine();
String typ = s.split(":")[0];
if (typ.equals("Parsererror")) {
String file = s.substring(typ.length() + 1).split("->")[0] + ".ly";
String sline = s.split("at line")[1].split(",")[0].trim();
Executor.openLine(file, Integer.parseInt(sline));
//System.out.println(file + "-" + sline + "-");
}
if (typ.equals("ReParsererror")) {
String file = s.substring(typ.length() + 1).split("->")[0] + ".ly";
// String sline = s.split("at line")[1].split(",")[0].trim();
Executor.openLine(file, 1);
//System.out.println(file + "-" + sline + "-");
}
if (typ.equals("midierror")) {
String file = s.substring(typ.length() + 1).split("->")[0] + ".ly";
// String sline = s.split("at line")[1].split(",")[0].trim();
Executor.openLine(file, 1);
//System.out.println(file + "-" + sline + "-");
}
if (typ.startsWith("----")||typ.startsWith("++++++")) {
String file = s.substring(typ.length() + 1)+ ".ly";
// String sline = s.split("at line")[1].split(",")[0].trim();
Executor.openLine(file, 1);
//-----reparsed:E:\Mutopia\HoretzkyF\horetzky3\horetzky3
}
// throw new UnsupportedOperationException("Not supported yet.");
}
public void outputLineCleared(OutputEvent oe) {
//throw new UnsupportedOperationException("Not supported yet.");
}
});
super.println(test);
}
};
all.start();
return true;
} else {
return false;
}