Class ValidationNotifications

java.lang.Object
jmri.util.swing.ValidationNotifications

public class ValidationNotifications extends Object
Utilities for displaying Validation Messages.
This file is part of JMRI.

JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

  • Constructor Details

  • Method Details

    • parseBinDecHexByte

      public static final int parseBinDecHexByte(String s, int limit, boolean decimal, String errMsg, JPanel comp)
      Parse a string for binary, decimal or hex byte value. Displays error message Dialog if unable to parse.

      0b, 0d or 0x prefix will force parsing of binary, decimal or hex, respectively. Entries with no prefix are parsed as decimal if decimal flag is true, otherwise hex.

      Parameters:
      s - string to be parsed
      limit - upper bound of value to be parsed
      decimal - flag for decimal or hex default
      comp - Parent component
      errMsg - Message to be displayed if Number FormatException encountered
      Returns:
      the byte value, -1 indicates failure