private boolean parseRanges() {

		// format: 1
		//         1,4
		//         1-4
		//         1-4,8
		//         -8, 0xc, 0x10:0x20
		//         -0x20:-0x10

		String value = textField.getText();
		String[] parts = value.split(",");
		for (String rangeText : parts) {
			if (!addRange(rangeText)) {
				return false;
			}
		}
		return true;
	}
<code>show</code> displays the dialog, gets the user input

@return false if the user cancelled the operation
Ghidra/Framework/Docking/src/main/java/docking/widgets/dialogs/NumberRangeInputDialog.java