/**
* Selects the passed in field, returning true if it is found,
* false otherwise.
*/
private boolean select(final JFormattedTextField ftf, final AttributedCharacterIterator iterator, final DateFormat.Field field) {
final int max = ftf.getDocument().getLength();
iterator.first();
do {
final Map<Attribute,Object> attrs = iterator.getAttributes();
if (attrs == null || !attrs.containsKey(field)) continue;
final int start = iterator.getRunStart(field);
final int end = iterator.getRunLimit(field);
if (start != -1 && end != -1 && start <= max && end <= max) {
ftf.select(start, end);
}
return true;
} while (iterator.next() != CharacterIterator.DONE);
return false;
}
AquaSpinnerUI.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:OpenJSharp
作者:
评论列表
文章目录