Satyam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.bestray.healthcareemr.Util;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;
// TODO: Auto-generated Javadoc
/**
* The Class PhoneNumberMaxLimit.
*
* @author User1
*/
public class PhoneNumberMaxLimit extends PlainDocument {
/** The limit. */
private int limit;
public PhoneNumberMaxLimit() {
}
/**
* Instantiates a new phone number max limit.
*
* @param limit the limit
*/
public PhoneNumberMaxLimit(int limit) {
super();
this.limit = limit;
}
/* (non-Javadoc)
* @see javax.swing.text.PlainDocument#insertString(int, java.lang.String, javax.swing.text.AttributeSet)
*/
public void insertString( int offset, String str, AttributeSet attr ) throws BadLocationException {
if (str == null) return;
if ((getLength() + str.length()) <= limit) {
super.insertString(offset, str, attr);
}
}
}
|
Revision |
Author |
Commited |
Message |
1
|
girijabapi
|
Fri 20 Jul, 2018 05:59:17 +0000 |
|