|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
| 개요 : 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 | |||||||||
java.lang.Objectjavax.swing.text.DocumentFilter
public class DocumentFilter
DocumentFilter 는, 이름이 가리키도록(듯이) Document 변경 메소드의 필터입니다. DocumentFilter 를 포함하는 Document 가,insert 또는 remove 를 개입시켜 변경되면(자), 적당한 메소드 호출이 DocumentFilter 에 전송 됩니다. 디폴트의 구현에서는, 변경이 가능합니다. 서브 클래스는, 경우에 응해 메소드를 슈퍼 클래스상에 호출하는지, 건네받은 FilterBypass 에 필요한 메소드를 호출하는 것으로, 변경에 필터를 설정할 수 있습니다. 서브 클래스는, 변경을 Document 에 콜백 하는 것이 아니라, 슈퍼 클래스나 FilterBypass 에의 호출을 실시할 필요가 있습니다.
remove 또는 insertString 가 DocumentFilter 상에서 불려 가면(자),DocumentFilter 는 FilterBypass 를 여러 차례 또는 다른 영역에 대해서 콜백 할 수 있습니다만,remove 또는 insertString 메소드로부터 반환된 뒤에,FilterBypass 에 콜백 해서는 안됩니다.
Document | 상자의 클래스의 개요 | |
|---|---|
static class |
DocumentFilter.FilterBypass
Document 에의 콜백을 회피해, Document 를 변경하는 경우에 사용됩니다. |
| 생성자 의 개요 | |
|---|---|
DocumentFilter ()
|
|
| 메소드의 개요 | |
|---|---|
void |
insertString (DocumentFilter.FilterBypass fb,
int offset,
String string,
AttributeSet attr)
지정한 Document 에 텍스트를 삽입하기 전에 불려 갑니다. |
void |
remove (DocumentFilter.FilterBypass fb,
int offset,
int length)
지정한 Document 의 지정한 범위를 삭제하기 전에 불려 갑니다. |
void |
replace (DocumentFilter.FilterBypass fb,
int offset,
int length,
String text,
AttributeSet attrs)
지정한 Document 로 텍스트의 범위를 옮겨놓기 전에 불려 갑니다. |
| 클래스 java.lang. Object 로부터 상속된 메소드 |
|---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
| 생성자 의 상세 |
|---|
public DocumentFilter()
| 메소드의 상세 |
|---|
public void remove(DocumentFilter.FilterBypass fb,
int offset,
int length)
throws BadLocationException
FilterBypass 를 필요에 따라서 직접 호출합니다.
fb - Document 의 변경에 사용하는 FilterBypassoffset - 선두로부터의 오프셋(offset) >= 0length - 삭제 대상의 문자수 >= 0
BadLocationException - 삭제 범위의 일부가 문서의 유효한 부분이 아니었던 경우.
예외내의 위치는,
최초로 검출된 부정한 위치
public void insertString(DocumentFilter.FilterBypass fb,
int offset,
String string,
AttributeSet attr)
throws BadLocationException
fb - Document 의 변경에 사용하는 FilterBypassoffset - 컨텐츠를 삽입하는 문서내의 오프셋(offset). 0 이상.
지정 위치나 그 뒤의 변경을 추적한다
모든 위치가 이동string - 삽입하는 캐릭터 라인attr - 삽입된 컨텐츠에 관련짓는 속성.
속성이 없는 경우는 null 도 가능
BadLocationException - 지정된 삽입 위치가
문서내의 유효한 위치가 아닌 경우
public void replace(DocumentFilter.FilterBypass fb,
int offset,
int length,
String text,
AttributeSet attrs)
throws BadLocationException
fb - Document 의 변경에 사용하는 FilterBypassoffset - Document 에서의 위치length - 삭제하는 텍스트의 길이text - 삽입하는 텍스트. null 의 경우, 텍스트는 삽입되지 않는attrs - 삽입된 텍스트의 속성을 나타내는 AttributeSet.
null 도 가능
BadLocationException - 지정된 삽입 위치가
문서내의 유효한 위치가 아닌 경우
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
| 개요 : 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 | |||||||||
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.