Package jmri.util.swing
Class ValidationNotifications
- java.lang.Object
-
- jmri.util.swing.ValidationNotifications
-
public class ValidationNotifications extends java.lang.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 Summary
Constructors Constructor Description ValidationNotifications()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
parseBinDecHexByte(java.lang.String s, int limit, boolean decimal, java.lang.String errMsg, javax.swing.JPanel comp)
Parse a string for binary, decimal or hex byte value.
-
-
-
Constructor Detail
-
ValidationNotifications
public ValidationNotifications()
-
-
Method Detail
-
parseBinDecHexByte
public static final int parseBinDecHexByte(java.lang.String s, int limit, boolean decimal, java.lang.String errMsg, javax.swing.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 parsedlimit
- upper bound of value to be parseddecimal
- flag for decimal or hex defaultcomp
- Parent componenterrMsg
- Message to be displayed if Number FormatException encountered- Returns:
- the byte value, -1 indicates failure
-
-