Using the Txt2XML View for testing and evaluating Txt2XMLParser library


If the Plugin is installed, you should find a view named Txt2XML-View offered under Window > Show View > Other... in the category Txt2XML-Developer.

The view looks as displayed in the screenshot below.

The Txt2XML-View

Testing Txt2XML formatter with live-evaluation

The Txt2XML-View can operate in real-time or on-demand-mode. To evaluate the Txt2XML-Formatter as you change either the expression or the input you need to perform the following steps:

Once the view is attached to an editor, the Txt2XML-Formatter typed in the corresponding textarea is evaluated on any change of the formatter or the editor-contents. When you change the active editor or activate a view different from the Txt2XML-View, the Txt2XML-View automatically detaches from the editor in order not to slow the usual handling in Eclipse.

Should you want to manually suppress the evaluation of the Txt2XML-Formatter without changing the active editor, click 'Detach' or untick the 'Live-evaluation' Flag.

Below is a screenshot of a situation where some of the txt in the active editor is matched by the Txt2XML-Formatter in the view. The result is evaluated and displayed in the result-textarea.

The formatting of the output is done through the Txt2XMLParser library.

The Txt2XML-View with an input-editor

Time-out and offline evaluation

Since evaluation of expressions against large files may take some time and you may not be interested in real-time evaluation, the evaluation of the Txt2XML-Formatter can be done offline by unsetting the mark at 'Live-evaluation' and using the 'Evaluate'-button if evaluation is in order.

The evaluation of the expression takes place in a separate thread and may be cancelled by the user or is automatically cancelled if it takes too long. The dialog for cancelling the evaluation appears with a small delay so that you will not notice it during fast live-evaluation.