public void run() {
try {
int docNum = nums[0];
DocReconstructor recon = new DocReconstructor(ir, idxFields, numTerms);
recon.addObserver(progress);
Reconstructed doc = recon.reconstruct(docNum);
Object dialog = addComponent(null, "/xml/editdoc.xml", null, null);
putProperty(dialog, "docNum", new Integer(docNum));
Object cbAnalyzers = find(dialog, "cbAnalyzers");
populateAnalyzers(cbAnalyzers);
setInteger(cbAnalyzers, "selected", 0);
Object editTabs = find(dialog, "editTabs");
setString(find(dialog, "docNum"), "text", "Fields of Doc #: " + docNum);
for (int p = 0; p < idxFields.length; p++) {
String key = idxFields[p];
if (!doc.hasField(key)) continue;
IndexableField[] fields = doc.getStoredFields().get(key);
GrowableStringArray recField = doc.getReconstructedFields().get(key);
int count = 0;
if (recField != null) count = 1;
if (fields != null && fields.length > count) count = fields.length;
for (int i = 0; i < count; i++) {
if (i > 0) recField = null; // show it only for the first field