예제 #1
0
 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++;
   }
 }
예제 #2
0
  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);
    }
  }
예제 #3
0
 public double getLengthFor(final Content content, final int fieldNo) {
   return NumberAdapters.doubleValue(fields[fieldNo], fields[fieldNo].get(content.getAdapter()))
       / maxValues[fieldNo];
 }