< prev index next >

application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/JfrPropertySheet.java

Print this page




 322                                         } else if (value instanceof Object[]) {
 323                                                 return limitedDeepToString((Object[]) value, this::getValueString);
 324                                         } else if (value instanceof Collection<?>) {
 325                                                 selectedTypes = new HashSet<IType<?>>((Collection<IType<?>>) value)
 326                                                         .stream().collect(Collectors.toSet());
 327                                                 return limitedDeepToString(((Collection<?>) value).toArray(), this::getValueString);
 328                                         }
 329                                         return TypeHandling.getValueString(value);
 330                                 }
 331 
 332                                 @Override
 333                                 protected String getToolTipTextTyped(PropertySheetRow p) {
 334                                         Object value = p.getValue();
 335                                         if (value instanceof IQuantity) {
 336                                                 return TypeHandling.getNumericString(((IQuantity) value).numberValue());
 337                                         }
 338                                         return JfrPropertySheet.getVerboseString(value);
 339                                 };
 340                         }).build();
 341 

 342         private static void updateSelectedTypes(Object value) {
 343                 if (value instanceof IType<?>) {
 344                         selectedTypes = new HashSet<IType<?>>();
 345                         selectedTypes.add((IType<?>) value);
 346                 }
 347                 else if (value instanceof Collection<?>) {
 348                         selectedTypes = new HashSet<IType<?>>((Collection<IType<?>>) value)
 349                                         .stream().collect(Collectors.toSet());
 350                 }
 351         }
 352 
 353         private static String limitedDeepToString(Object[] array, Function<Object, String> valueToStringProvider) {
 354                 return limitedDeepToString(array, new StringBuilder(), true, valueToStringProvider);
 355         }
 356 
 357         private static String limitedDeepToString(
 358                 Object[] array, StringBuilder builder, boolean isRootArray, Function<Object, String> valueToStringProvider) {
 359                 int maxCharacters = FlightRecorderUI.getDefault().getPreferenceStore()
 360                                 .getInt(PreferenceKeys.PROPERTY_MAXIMUM_PROPERTIES_ARRAY_STRING_SIZE);
 361                 int omitted = 0;




 322                                         } else if (value instanceof Object[]) {
 323                                                 return limitedDeepToString((Object[]) value, this::getValueString);
 324                                         } else if (value instanceof Collection<?>) {
 325                                                 selectedTypes = new HashSet<IType<?>>((Collection<IType<?>>) value)
 326                                                         .stream().collect(Collectors.toSet());
 327                                                 return limitedDeepToString(((Collection<?>) value).toArray(), this::getValueString);
 328                                         }
 329                                         return TypeHandling.getValueString(value);
 330                                 }
 331 
 332                                 @Override
 333                                 protected String getToolTipTextTyped(PropertySheetRow p) {
 334                                         Object value = p.getValue();
 335                                         if (value instanceof IQuantity) {
 336                                                 return TypeHandling.getNumericString(((IQuantity) value).numberValue());
 337                                         }
 338                                         return JfrPropertySheet.getVerboseString(value);
 339                                 };
 340                         }).build();
 341 
 342         @SuppressWarnings("unchecked")
 343         private static void updateSelectedTypes(Object value) {
 344                 if (value instanceof IType<?>) {
 345                         selectedTypes = new HashSet<IType<?>>();
 346                         selectedTypes.add((IType<?>) value);
 347                 }
 348                 else if (value instanceof Collection<?>) {
 349                         selectedTypes = new HashSet<IType<?>>((Collection<IType<?>>) value)
 350                                         .stream().collect(Collectors.toSet());
 351                 }
 352         }
 353 
 354         private static String limitedDeepToString(Object[] array, Function<Object, String> valueToStringProvider) {
 355                 return limitedDeepToString(array, new StringBuilder(), true, valueToStringProvider);
 356         }
 357 
 358         private static String limitedDeepToString(
 359                 Object[] array, StringBuilder builder, boolean isRootArray, Function<Object, String> valueToStringProvider) {
 360                 int maxCharacters = FlightRecorderUI.getDefault().getPreferenceStore()
 361                                 .getInt(PreferenceKeys.PROPERTY_MAXIMUM_PROPERTIES_ARRAY_STRING_SIZE);
 362                 int omitted = 0;


< prev index next >