public void determineMaximum(final Content content) { int i = 0; for (final ObjectAssociation field : fields) { maxValues[i] = 0; final CollectionFacet collectionFacet = content.getAdapter().getSpecification().getFacet(CollectionFacet.class); for (final ObjectAdapter element : collectionFacet.iterable(content.getAdapter())) { final ObjectAdapter value = field.get(element); final double doubleValue = NumberAdapters.doubleValue(field, value); maxValues[i] = Math.max(maxValues[i], doubleValue); } i++; } }
public void openHelp(final View forView) { if (forView != null) { String description = null; String help = null; String name = null; if (forView != null && forView.getContent() != null) { final Content content = forView.getContent(); description = content.getDescription(); help = content.getHelp(); name = content.getId(); name = name == null ? content.title() : name; } helpViewer.open(forView.getAbsoluteLocation(), name, description, help); } }
public double getLengthFor(final Content content, final int fieldNo) { return NumberAdapters.doubleValue(fields[fieldNo], fields[fieldNo].get(content.getAdapter())) / maxValues[fieldNo]; }