From e5610988d7aba18beaa20b2fccaa2e938b681160 Mon Sep 17 00:00:00 2001 From: John Camelon Date: Tue, 31 May 2005 19:23:26 +0000 Subject: [PATCH] Patch for David Daoust. Cleaning up the Indexer View. --- .../ui/tests/IndexerView/IndexerNodeLeaf.java | 104 ++++++++---------- 1 file changed, 45 insertions(+), 59 deletions(-) diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerNodeLeaf.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerNodeLeaf.java index f791977d35f..a36b91929f0 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerNodeLeaf.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/IndexerView/IndexerNodeLeaf.java @@ -10,7 +10,6 @@ **********************************************************************/ package org.eclipse.cdt.ui.tests.IndexerView; -import org.eclipse.cdt.core.browser.PathUtil; import org.eclipse.cdt.core.parser.util.ArrayUtil; import org.eclipse.cdt.internal.core.index.IEntryResult; import org.eclipse.cdt.internal.core.index.IIndex; @@ -60,14 +59,12 @@ public class IndexerNodeLeaf implements IAdaptable { private class IndexerPropertySource implements IPropertySource { private static final String IENTRYRESULT = "IEntryResult"; //$NON-NLS-1$ + private static final String NAME = "Name"; //$NON-NLS-1$ private static final String IENTRYRESULT_GETWORD__ = "IEntryResult#getWord()"; //$NON-NLS-1$ - private static final String REFERENCES = "References"; //$NON-NLS-1$ - private static final String REFERENCE_NUMBER_ = "reference# "; //$NON-NLS-1$ - private static final String OFFSETS = "Offsets"; //$NON-NLS-1$ - private static final String OFFSETS_NUMBER = "offsets for #"; //$NON-NLS-1$ + private static final String REFS = "References"; //$NON-NLS-1$ private static final String OFFSETS_LINE = "Line "; //$NON-NLS-1$ private static final String OFFSETS_OFFSET = "Offset "; //$NON-NLS-1$ - private static final int DEFAULT_DESCRIPTOR_SIZE = 4; + private static final int DEFAULT_DESCRIPTOR_SIZE = 64; IEntryResult entryResult = null; public IndexerPropertySource(IEntryResult result) { @@ -83,62 +80,51 @@ public class IndexerNodeLeaf implements IAdaptable { TextPropertyDescriptor text = null; - // get the reference descriptors - int[] references = entryResult.getFileReferences(); - if (references != null) { - for (int j = 0; j < references.length; ++j) { - String file = fileMap[references[j]]; - if (file != null) { - String id = REFERENCE_NUMBER_ + String.valueOf(j); - text = new TextPropertyDescriptor(new TextDescriptorId(id, PathUtil.getWorkspaceRelativePath(file).toOSString()), id); - text.setCategory(REFERENCES); - descriptors = (IPropertyDescriptor[])ArrayUtil.append(IPropertyDescriptor.class, descriptors, text); + // Add reference block + int[] references = entryResult.getFileReferences(); + int[][]offsets = entryResult.getOffsets(); + int[][]offsetLengths = entryResult.getOffsetLengths(); + if (offsets != null){ + for (int j=0; j