|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요 : 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 |
java.lang.Objectjavax.swing.text.EditorKit
javax.swing.text.DefaultEditorKit
javax.swing.text.StyledEditorKit
javax.swing.text.html.HTMLEditorKit
public class HTMLEditorKit
Swing 의 JEditorPane 텍스트 컴퍼넌트는, EditorKit 로 불리는 플러그 인 기구에 의해, 다양한 종류의 컨텐츠를 지원하고 있습니다. HTML 는 매우 일반적인 형식이므로, 부분적인 지원를 디폴트로 제공하고 있습니다. 이 클래스가 제공하는 디폴트의 지원는, HTML 3.2 (일부의 확장을 포함한다)를 지원하고 있어, 현재 4.0 의 지원를 향해 이행중입니다. 현재 <applet> 태그는 지원되고 있지 않습니다만, <object> 태그의 일부분은 지원되고 있습니다.
HTML EditorKit 는 몇개의 목표를 가져 제공되고 있어 이것은 HTML 를 모델화하는 수법으로 반영되고 있습니다. 그러한 목표가, 클래스의 설계에 실질적인 영향을 주고 있습니다.
HTML 의 모델화는,HTMLDocument
클래스에서 제공되고 있습니다. HTML 의 모델화에 대해서는,HTMLDocument
클래스의 설명을 참조해 주세요. 편집의 지원는, 주로 text 패키지로 제공됩니다.
HTMLFactory
클래스에 의해 제공됩니다. 뷰세트를 변경하려면 , HTMLFactory 를 서브 클래스화 또는 옮겨놓은 다음, getViewFactory 메소드를 다시 구현해 다른 팩토리를 돌려주도록(듯이) 합니다.
JEditorPane.setPage
를 사용해 로드하는 경우에 비동기에 로드 되는 문서를 작성합니다. 이것은, 문서의 프로퍼티에 의해 제어됩니다. createDefaultDocument 메소드를 오버라이드(override) 하면, 프로퍼티을 변경할 수 있습니다. 작업의 배치는,HTMLDocument.HTMLReader
클래스가 실시해, 실제의 작업은 text 패키지의 DefaultStyledDocument
및 AbstractDocument
클래스가 실시합니다.
이 기능은,StyleSheet
클래스에 의해 제공됩니다. HTML 의 표현은, EditorKit 의 StyleSheet 프로퍼티의 설정에 의해, 자유롭게 바꿀 수가 있습니다.
상자의 클래스의 개요 | |
---|---|
static class |
HTMLEditorKit.HTMLFactory
HTML 용의 뷰를 작성하는 팩토리입니다. |
static class |
HTMLEditorKit.HTMLTextAction
HTML 를 기존의 문서에 삽입하는데 편리한 편리한 메소드를 제공하는, abstract Action 입니다. |
static class |
HTMLEditorKit.InsertHTMLTextAction
InsertHTMLTextAction 는, 기존의 HTML 문서에 임의의 HTML 캐릭터 라인을 삽입하기 위해서 사용합니다. |
static class |
HTMLEditorKit.LinkController
관련하는 컴퍼넌트를 감시해, 필요에 따라서 하이퍼 링크 이벤트를 발생시키는 클래스입니다. |
static class |
HTMLEditorKit.Parser
퍼서가 지원하는 인터페이스입니다. |
static class |
HTMLEditorKit.ParserCallback
구문 분석의 결과가, 이러한 콜백 메소드를 호출합니다. |
클래스 javax.swing.text. StyledEditorKit 로부터 상속된 상자의 클래스/인터페이스 |
---|
StyledEditorKit.AlignmentAction , StyledEditorKit.BoldAction , StyledEditorKit.FontFamilyAction , StyledEditorKit.FontSizeAction , StyledEditorKit.ForegroundAction , StyledEditorKit.ItalicAction , StyledEditorKit.StyledTextAction , StyledEditorKit.UnderlineAction |
클래스 javax.swing.text. DefaultEditorKit 로부터 상속된 상자의 클래스/인터페이스 |
---|
DefaultEditorKit.BeepAction , DefaultEditorKit.CopyAction , DefaultEditorKit.CutAction , DefaultEditorKit.DefaultKeyTypedAction , DefaultEditorKit.InsertBreakAction , DefaultEditorKit.InsertContentAction , DefaultEditorKit.InsertTabAction , DefaultEditorKit.PasteAction |
필드의 개요 | |
---|---|
static String |
BOLD_ACTION
볼드 처리 식별자입니다. |
static String |
COLOR_ACTION
색선택 처리 식별자입니다. |
static String |
DEFAULT_CSS
태그 표시를 설정하는 디폴트의 CSS (Cascading Style Sheet) 파일입니다. |
static String |
FONT_CHANGE_BIGGER
다음 사이즈에의 폰트 확대 식별자입니다. |
static String |
FONT_CHANGE_SMALLER
다음 사이즈에의 폰트 축소 식별자입니다. |
static String |
IMG_ALIGN_BOTTOM
이미지를 하단에 가지런히 합니다. |
static String |
IMG_ALIGN_MIDDLE
이미지를 중앙에 가지런히 합니다. |
static String |
IMG_ALIGN_TOP
이미지를 상단에 가지런히 합니다. |
static String |
IMG_BORDER
이미지를 경계에 가지런히 합니다. |
static String |
ITALIC_ACTION
이탤릭 처리 식별자입니다. |
static String |
LOGICAL_STYLE_ACTION
논리 스타일 선택 처리 식별자입니다. |
static String |
PARA_INDENT_LEFT
단락의 왼쪽 인덴트 처리 식별자입니다. |
static String |
PARA_INDENT_RIGHT
단락의 오른쪽 인덴트 처리 식별자입니다. |
생성자 의 개요 | |
---|---|
HTMLEditorKit ()
HTMLEditorKit 를 구축해, StyleContext 를 작성해, 스타일 시트를 로드합니다. |
메소드의 개요 | |
---|---|
Object |
clone ()
편집 킷의 카피를 작성합니다. |
Document |
createDefaultDocument ()
이 형태의 에디터에 적절하고 있는 미초기화 텍스트 스토리지 모델을 작성합니다. |
protected void |
createInputAttributes (Element element,
MutableAttributeSet set)
element 의 AttributeSet 내의 키와 값의 페어를 set 에 카피합니다. |
void |
deinstall (JEditorPane c)
킷이 JEditorPane 로부터 삭제되고 있을 때 불려 갑니다. |
AccessibleContext |
getAccessibleContext ()
이 편집 킷에 관련한 AccessibleContext 를 돌려줍니다. |
Action [] |
getActions ()
에디터의 커멘드 리스트를 가져옵니다. |
String |
getContentType ()
이 킷이 지원하는 MIME 타입의 데이터를 가져옵니다. |
Cursor |
getDefaultCursor ()
디폴트의 커서를 돌려줍니다. |
MutableAttributeSet |
getInputAttributes ()
서식 첨부 편집 액션에 사용되는 입력 속성을 돌려줍니다. |
Cursor |
getLinkCursor ()
하이퍼 링크상에서 사용하는 커서를 설정합니다. |
protected HTMLEditorKit.Parser |
getParser ()
HTML 스트림의 읽어들여에 사용하는 퍼서를 가져옵니다. |
StyleSheet |
getStyleSheet ()
HTML 요소의 draw에 사용되고 있는 스타일 세트를 돌려줍니다. |
ViewFactory |
getViewFactory ()
이 킷이 작성한 임의의 모델의 뷰를 작성하는데 적합한 팩토리를 가져옵니다. |
void |
insertHTML (HTMLDocument doc,
int offset,
String html,
int popDepth,
int pushDepth,
HTML.Tag insertTag)
기존의 문서에 HTML 를 삽입합니다. |
void |
install (JEditorPane c)
킷이 JEditorPane 에 인스톨 될 때 불려 갑니다. |
boolean |
isAutoFormSubmission ()
html 폼의 송신이 자동적으로 처리되는지, FormSubmitEvent 가 트리거될 뿐(만큼)인지를 나타냅니다. |
void |
read (Reader in,
Document doc,
int pos)
지정된 스트림로부터 컨텐츠를 삽입합니다. |
void |
setAutoFormSubmission (boolean isAuto)
html 폼의 송신이 자동적으로 처리되는지, FormSubmitEvent 가 트리거될 뿐(만큼)인지를 나타냅니다. |
void |
setDefaultCursor (Cursor cursor)
디폴트의 커서를 설정합니다. |
void |
setLinkCursor (Cursor cursor)
링크상에서 사용하는 커서를 설정합니다. |
void |
setStyleSheet (StyleSheet s)
각종의 HTML 요소의 draw에 사용되는 스타일 세트를 설정합니다. |
void |
write (Writer out,
Document doc,
int pos,
int len)
이 타입의 컨텐츠 핸들러에 적절한 형식에서, 문서로부터 스트림에 컨텐츠를 기입합니다. |
클래스 javax.swing.text. StyledEditorKit 로부터 상속된 메소드 |
---|
getCharacterAttributeRun |
클래스 javax.swing.text. DefaultEditorKit 로부터 상속된 메소드 |
---|
createCaret , read , write |
클래스 java.lang. Object 로부터 상속된 메소드 |
---|
equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
필드의 상세 |
---|
public static final String DEFAULT_CSS
public static final String BOLD_ACTION
public static final String ITALIC_ACTION
public static final String PARA_INDENT_LEFT
public static final String PARA_INDENT_RIGHT
public static final String FONT_CHANGE_BIGGER
public static final String FONT_CHANGE_SMALLER
public static final String COLOR_ACTION
public static final String LOGICAL_STYLE_ACTION
public static final String IMG_ALIGN_TOP
public static final String IMG_ALIGN_MIDDLE
public static final String IMG_ALIGN_BOTTOM
public static final String IMG_BORDER
생성자 의 상세 |
---|
public HTMLEditorKit()
메소드의 상세 |
---|
public String getContentType()
text/html
의 타입을 지원합니다.
DefaultEditorKit
내의 getContentType
public ViewFactory getViewFactory()
StyledEditorKit
내의 getViewFactory
public Document createDefaultDocument()
StyledEditorKit
내의 createDefaultDocument
public void read(Reader in, Document doc, int pos) throws IOException , BadLocationException
doc
가 HTMLDocument 의 인스턴스인 경우, HTML 3.2 텍스트를 읽어들입니다. 빈 상태(empty)이 아닌 문서에의 HTML 의 삽입은, 본체 요소 내부에서 실시할 필요가 있습니다. 본체에 삽입하지 않는 경우, 예외가 throw 됩니다. 빈 상태(empty)이 아닌 문서에 삽입하는 경우, 본체 외부의 태그 (헤드, 타이틀)는 모두 삭제됩니다.
DefaultEditorKit
내의 read
in
- read원의 스트림doc
- 삽입처pos
- 컨텐츠를 배치한다
문서내의 위치
IOException
- 입출력 에러가 발생했을 경우
BadLocationException
- pos 가 문서내의
무효인 위치를 나타내는 경우
RuntimeException
- pos 가 무효인 경우
(결과적으로 BadLocationException 가 된다)public void insertHTML(HTMLDocument doc, int offset, String html, int popDepth, int pushDepth, HTML.Tag insertTag) throws BadLocationException , IOException
doc
- 삽입처의 문서offset
- HTML 의 삽입 위치의 오프셋(offset)popDepth
- 삽입전에 생성된다
ElementSpec.EndTagType 태그의 수pushDepth
- 종료 태그의 생성 후, 삽입전에 생성된다
ElementSpec.JoinNextDirection 의 방향을 가진다
ElementSpec.StartTagType 의 태그의 수insertTag
- 문서에의 삽입을 개시하는 최초의 태그
RuntimeException
- pos 가 무효인 경우
(결과적으로 BadLocationException 가 된다)
BadLocationException
IOException
public void write(Writer out, Document doc, int pos, int len) throws IOException , BadLocationException
DefaultEditorKit
내의 write
out
- 기입처의 스트림doc
- 기입원pos
- 컨텐츠를 취득한다
문서내의 위치len
- 써내는 양
IOException
- 입출력 에러가 발생했을 경우
BadLocationException
- pos 가 문서내의
무효인 위치를 나타내는 경우public void install(JEditorPane c)
StyledEditorKit
내의 install
c
- JEditorPanepublic void deinstall(JEditorPane c)
StyledEditorKit
내의 deinstall
c
- JEditorPanepublic void setStyleSheet(StyleSheet s)
public StyleSheet getStyleSheet()
public Action [] getActions()
StyledEditorKit
내의 getActions
protected void createInputAttributes(Element element, MutableAttributeSet set)
element
의 AttributeSet 내의 키와 값의 페어를 set
에 카피합니다. 이 메소드는, 컴퍼넌트, 아이콘, 요소명의 각 속성은 카피하지 않습니다. 서브 클래스에서는, 어느 속성을 카피해 어느 속성을 카피하지 않는가를 변경할 수도 있습니다. 다만, 최초로 set
내의 모든 속성을 반드시 삭제해 주세요. 이 메소드는, caret가 다른 위치로 이동할 때마다 불려 갑니다.
StyledEditorKit
내의 createInputAttributes
public MutableAttributeSet getInputAttributes()
StyledEditorKit
내의 getInputAttributes
public void setDefaultCursor(Cursor cursor)
public Cursor getDefaultCursor()
public void setLinkCursor(Cursor cursor)
public Cursor getLinkCursor()
public boolean isAutoFormSubmission()
FormSubmitEvent
가 트리거될 뿐(만큼)인지를 나타냅니다.
setAutoFormSubmission(boolean)
public void setAutoFormSubmission(boolean isAuto)
FormSubmitEvent
가 트리거될 뿐(만큼)인지를 나타냅니다. 디폴트에서는, true 로 설정됩니다.
isAutoFormSubmission
,
FormSubmitEvent
public Object clone()
StyledEditorKit
내의 clone
Cloneable
protected HTMLEditorKit.Parser getParser()
public AccessibleContext getAccessibleContext()
Accessible
내의 getAccessibleContext
|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요 : 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.