Exemplo n.º 1
0
 private static void initLAF() {
   try {
     initializeLookAndFeel();
   } catch (InitializationException e) {
     ErrorManager.notifyWarning(e.getMessage(), e.getCause());
   }
 }
Exemplo n.º 2
0
  public static int getDimension(
      Properties props, final String defaultPropertyName, final int defaultValue) {
    int dimension = defaultValue;
    String propertyName = defaultPropertyName;
    if (props.getProperty(propertyName + "." + UiUtils.getLAF()) != null) {
      propertyName = propertyName + "." + UiUtils.getLAF();
    }

    if (props.getProperty(propertyName) != null) {
      try {
        dimension = Integer.parseInt(props.getProperty(propertyName).trim());
      } catch (NumberFormatException e) {
        final String warning =
            ResourceUtils.getString(
                UiUtils.class,
                RESOURCE_FAILED_TO_PARSE_SYSTEM_PROPERTY,
                propertyName,
                props.getProperty(propertyName));

        ErrorManager.notifyWarning(warning, e);
      }
    }
    return dimension;
  }