@Override protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException { return getElements(getAllChildren(parent, context), index, length); }
/** * 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; int partitionSize = computeParitionSize(indexedValue); if (partitionSize > 1) { int offset = indexedValue.getInitialOffset();
@Override protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException { return getAllChildren(element, context).length; }
protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException { if (displayReferencesAsChild(element)){ return true; } return super.hasChildren(element, context, monitor); }
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException { int count = super.getChildCount(element, context, monitor); if (displayReferencesAsChild(element)){ count++; } return count; }
/** * Gets all the children variables for the parent * @param parent the parent IVariable * @param context the context the children will be presented in * @return an array of all children or an empty array if none * @throws CoreException */ protected Object[] getAllChildren(Object parent, IPresentationContext context) throws CoreException { IVariable variable = (IVariable) parent; IValue value = variable.getValue(); if (value != null) { return getValueChildren(variable, value, context); } return EMPTY; }
int length = value.getSize(); int partitionDepth = 0; int preferredSize = getArrayPartitionSize(); int remainder = length % preferredSize; length = length / preferredSize;