import javax.xml.parsers.DocumentBuilderFactory;\r
import javax.xml.parsers.ParserConfigurationException;\r
\r
+import org.eclipse.core.resources.IProject;\r
import org.eclipse.core.resources.IResource;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTraceDefinition.InputAttribute;\r
import org.eclipse.linuxtools.internal.tmf.ui.parsers.custom.CustomXmlTraceDefinition.InputElement;\r
\r
@Override\r
public TmfContext seekEvent(final ITmfLocation<?> location) {\r
- final CustomXmlTraceContext context = new CustomXmlTraceContext(NULL_LOCATION, ITmfContext.INITIAL_RANK);\r
+ final CustomXmlTraceContext context = new CustomXmlTraceContext(NULL_LOCATION, ITmfContext.UNKNOWN_RANK);\r
if (NULL_LOCATION.equals(location) || !new File(getPath()).isFile())\r
return context;\r
try {\r
return context;\r
} catch (final FileNotFoundException e) {\r
e.printStackTrace();\r
- return new CustomXmlTraceContext(NULL_LOCATION, ITmfContext.INITIAL_RANK);\r
+ return new CustomXmlTraceContext(NULL_LOCATION, ITmfContext.UNKNOWN_RANK);\r
} catch (final IOException e) {\r
e.printStackTrace();\r
- return new CustomXmlTraceContext(NULL_LOCATION, ITmfContext.INITIAL_RANK);\r
+ return new CustomXmlTraceContext(NULL_LOCATION, ITmfContext.UNKNOWN_RANK);\r
} finally {\r
if (raFile != null) {\r
try {\r
}\r
\r
@Override\r
- public TmfEvent parseEvent(final ITmfContext tmfContext) {\r
+ public CustomXmlEvent parseEvent(final ITmfContext tmfContext) {\r
if (!(tmfContext instanceof CustomXmlTraceContext))\r
return null;\r
\r
readElement(buffer, raFile);\r
} else if (c == '/' && numRead == 1) {\r
break; // found "</"\r
- } else if (c == '-' && numRead == 3 && buffer.substring(buffer.length() - 3, buffer.length() - 1).equals("!-")) {\r
+ } else if (c == '-' && numRead == 3 && buffer.substring(buffer.length() - 3, buffer.length() - 1).equals("!-")) { //$NON-NLS-1$\r
readComment(buffer, raFile); // found "<!--"\r
} else if (i == '>')\r
if (buffer.charAt(buffer.length() - 2) == '/') {\r
numRead++;\r
final char c = (char)i;\r
buffer.append(c);\r
- if (c == '>' && numRead >= 2 && buffer.substring(buffer.length() - 3, buffer.length() - 1).equals("--"))\r
+ if (c == '>' && numRead >= 2 && buffer.substring(buffer.length() - 3, buffer.length() - 1).equals("--")) //$NON-NLS-1$\r
{\r
break; // found "-->"\r
}\r
public CustomTraceDefinition getDefinition() {\r
return fDefinition;\r
}\r
+\r
+ /* (non-Javadoc)\r
+ * @see org.eclipse.linuxtools.tmf.core.trace.ITmfTrace#validate(org.eclipse.core.resources.IProject, java.lang.String)\r
+ */\r
+ @Override\r
+ public boolean validate(IProject project, String path) {\r
+ return fileExists(path);\r
+ }\r
}\r