/** * Returns any logical value for the raw value in the specified context * * @param value * @param context * @return logical value for the raw value */ protected IValue getLogicalValue(IValue value, IPresentationContext context) throws CoreException { return getLogicalValue(value, new ArrayList<String>(), context); }
/** * Returns any logical value for the raw value. This method will recurse * over the returned value until the same structure is encountered again (to * avoid infinite recursion). * * @param value raw value to possibly be replaced by a logical value * @param previousStructureIds * the list of logical structures that have already been applied * to the returned value during the recursion of this method. * Callers should always pass in a new, empty list. * @return logical value if one is calculated, otherwise the raw value is returned */ protected IValue getLogicalValue(IValue value, List<String> previousStructureIds, IPresentationContext context) throws CoreException { if (isShowLogicalStructure(context)) { ILogicalStructureType[] types = DebugPlugin.getLogicalStructureTypes(value); if (types.length > 0) { ILogicalStructureType type = DebugPlugin.getDefaultStructureType(types); if (type != null && !previousStructureIds.contains(type.getId())) { IValue logicalValue = getLogicalStructureCache().getLogicalStructure(type, value); previousStructureIds.add(type.getId()); return getLogicalValue(logicalValue, previousStructureIds, context); } } } return value; }
return EMPTY; IValue logicalValue = getLogicalValue(value, context); if (logicalValue instanceof IIndexedValue) { IIndexedValue indexedValue = (IIndexedValue) logicalValue;