⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 abstractdocument.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<A NAME="removeUndoableEditListener(javax.swing.event.UndoableEditListener)"><!-- --></A><H3>removeUndoableEditListener</H3><PRE>public void <B>removeUndoableEditListener</B>(<A HREF="../../../javax/swing/event/UndoableEditListener.html">UndoableEditListener</A>&nbsp;listener)</PRE><DL><DD>Removes an undo listener.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Document.html#removeUndoableEditListener(javax.swing.event.UndoableEditListener)">removeUndoableEditListener</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/Document.html">Document</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - the listener<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/Document.html#removeDocumentListener(javax.swing.event.DocumentListener)"><CODE>Document.removeDocumentListener(javax.swing.event.DocumentListener)</CODE></A></DL></DD></DL><HR><A NAME="getProperty(java.lang.Object)"><!-- --></A><H3>getProperty</H3><PRE>public final <A HREF="../../../java/lang/Object.html">Object</A> <B>getProperty</B>(<A HREF="../../../java/lang/Object.html">Object</A>&nbsp;key)</PRE><DL><DD>A convenience method for looking up a property value. It is equivalent to: <pre> getDocumentProperties().get(key); </pre><DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Document.html#getProperty(java.lang.Object)">getProperty</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/Document.html">Document</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - the non-null property key<DT><B>Returns:</B><DD>the value of this property or null<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/AbstractDocument.html#getDocumentProperties()"><CODE>getDocumentProperties()</CODE></A></DL></DD></DL><HR><A NAME="putProperty(java.lang.Object, java.lang.Object)"><!-- --></A><H3>putProperty</H3><PRE>public final void <B>putProperty</B>(<A HREF="../../../java/lang/Object.html">Object</A>&nbsp;key,                              <A HREF="../../../java/lang/Object.html">Object</A>&nbsp;value)</PRE><DL><DD>A convenience method for storing up a property value.  It is equivalent to: <pre> getDocumentProperties().put(key, value); </pre> If value is null this method will remove the property<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Document.html#putProperty(java.lang.Object, java.lang.Object)">putProperty</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/Document.html">Document</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - the non-null key<DD><CODE>value</CODE> - the value<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/AbstractDocument.html#getDocumentProperties()"><CODE>getDocumentProperties()</CODE></A></DL></DD></DL><HR><A NAME="remove(int, int)"><!-- --></A><H3>remove</H3><PRE>public void <B>remove</B>(int&nbsp;offs,                   int&nbsp;len)            throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Removes some content from the document. Removing content causes a write lock to be held while the actual changes are taking place.  Observers are notified of the change on the thread that called this method. <p> This method is thread safe, although most Swing methods are not. Please see  <A HREF="http://java.sun.com/products/jfc/swingdoc-archive/threads.html">Threads and Swing</A> for more information.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Document.html#remove(int, int)">remove</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/Document.html">Document</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>offs</CODE> - the starting offset >= 0<DD><CODE>len</CODE> - the number of characters to remove >= 0<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - the given remove position is not a valid    position within the document<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/Document.html#remove(int, int)"><CODE>Document.remove(int, int)</CODE></A></DL></DD></DL><HR><A NAME="insertString(int, java.lang.String, javax.swing.text.AttributeSet)"><!-- --></A><H3>insertString</H3><PRE>public void <B>insertString</B>(int&nbsp;offs,                         <A HREF="../../../java/lang/String.html">String</A>&nbsp;str,                         <A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;a)                  throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Inserts some content into the document. Inserting content causes a write lock to be held while the actual changes are taking place, followed by notification to the observers on the thread that grabbed the write lock. <p> This method is thread safe, although most Swing methods are not. Please see  <A HREF="http://java.sun.com/products/jfc/swingdoc-archive/threads.html">Threads and Swing</A> for more information.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Document.html#insertString(int, java.lang.String, javax.swing.text.AttributeSet)">insertString</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/Document.html">Document</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>offs</CODE> - the starting offset >= 0<DD><CODE>str</CODE> - the string to insert; does nothing with null/empty strings<DD><CODE>a</CODE> - the attributes for the inserted content<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - the given insert position is not a valid    position within the document<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/Document.html#insertString(int, java.lang.String, javax.swing.text.AttributeSet)"><CODE>Document.insertString(int, java.lang.String, javax.swing.text.AttributeSet)</CODE></A></DL></DD></DL><HR><A NAME="getText(int, int)"><!-- --></A><H3>getText</H3><PRE>public <A HREF="../../../java/lang/String.html">String</A> <B>getText</B>(int&nbsp;offset,                      int&nbsp;length)               throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Gets a sequence of text from the document.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Document.html#getText(int, int)">getText</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/Document.html">Document</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - the starting offset >= 0<DD><CODE>length</CODE> - the number of characters to retrieve >= 0<DT><B>Returns:</B><DD>the text<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - the range given includes a position    that is not a valid position within the document<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/Document.html#getText(int, int)"><CODE>Document.getText(int, int)</CODE></A></DL></DD></DL><HR><A NAME="getText(int, int, javax.swing.text.Segment)"><!-- --></A><H3>getText</H3><PRE>public void <B>getText</B>(int&nbsp;offset,                    int&nbsp;length,                    <A HREF="../../../javax/swing/text/Segment.html">Segment</A>&nbsp;txt)             throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Gets some text from the document potentially without making a copy.  The character array returned in the given <code>Segment</code> should never be mutated. This kind of access to the characters of the document is provided to help make the rendering potentially more efficient.  The caller should make no assumptions about the lifetime of the returned character array, which should be copied if needed beyond the use for rendering.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Document.html#getText(int, int, javax.swing.text.Segment)">getText</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/Document.html">Document</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>offset</CODE> - the starting offset >= 0<DD><CODE>length</CODE> - the number of characters to retrieve >= 0<DD><CODE>txt</CODE> - the Segment object to retrieve the text into<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - the range given includes a position    that is not a valid position within the document</DL></DD></DL><HR><A NAME="createPosition(int)"><!-- --></A><H3>createPosition</H3><PRE>public <A HREF="../../../javax/swing/text/Position.html">Position</A> <B>createPosition</B>(int&nbsp;offs)                        throws <A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></PRE><DL><DD>Returns a position that will track change as the document is altered. <p> This method is thread safe, although most Swing methods are not. Please see  <A HREF="http://java.sun.com/products/jfc/swingdoc-archive/threads.html">Threads and Swing</A> for more information.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Document.html#createPosition(int)">createPosition</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/Document.html">Document</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>offs</CODE> - the position in the model >= 0<DT><B>Returns:</B><DD>the position<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/swing/text/BadLocationException.html">BadLocationException</A></CODE> - if the given position does not   represent a valid location in the associated document<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/Document.html#createPosition(int)"><CODE>Document.createPosition(int)</CODE></A></DL></DD></DL><HR><A NAME="getStartPosition()"><!-- --></A><H3>getStartPosition</H3><PRE>public final <A HREF="../../../javax/swing/text/Position.html">Position</A> <B>getStartPosition</B>()</PRE><DL><DD>Returns a position that represents the start of the document.  The  position returned can be counted on to track change and stay  located at the beginning of the document.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Document.html#getStartPosition()">getStartPosition</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/Document.html">Document</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the position</DL></DD></DL><HR><A NAME="getEndPosition()"><!-- --></A><H3>getEndPosition</H3><PRE>public final <A HREF="../../../javax/swing/text/Position.html">Position</A> <B>getEndPosition</B>()</PRE><DL><DD>Returns a position that represents the end of the document.  The position returned can be counted on to track change and stay  located at the end of the document.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Document.html#getEndPosition()">getEndPosition</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/Document.html">Document</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the position</DL></DD></DL><HR><A NAME="getRootElements()"><!-- --></A><H3>getRootElements</H3><PRE>public <A HREF="../../../javax/swing/text/Element.html">Element</A>[] <B>getRootElements</B>()</PRE><DL><DD>Gets all root elements defined.  Typically, there will only be one so the default implementation is to return the default root element.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Document.html#getRootElements()">getRootElements</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/Document.html">Document</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the root element</DL></DD></DL><HR><A NAME="getDefaultRootElement()"><!-- --></A><H3>getDefaultRootElement</H3><PRE>public abstract <A HREF="../../../javax/swing/text/Element.html">Element</A> <B>getDefaultRootElement</B>()</PRE><DL><DD>Returns the root element that views should be based upon unless some other mechanism for assigning views to element structures is provided.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Document.html#getDefaultRootElement()">getDefaultRootElement</A></CODE> in interface <CODE><A HREF="../../../javax/swing/text/Document.html">Document</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the root element<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/Document.html#getDefaultRootElement()"><CODE>Document.getDefaultRootElement()</CODE></A></DL></DD></DL><HR><A NAME="getBidiRootElement()"><!-- --></A><H3>getBidiRootElement</H3><PRE>public <A HREF="../../../javax/swing/text/Element.html">Element</A> <B>getBidiRootElement</B>()</PRE><DL><DD>Returns the root element of the bidirectional structure for this document.  Its children represent character runs with a given Unicode bidi level.<DD><DL></DL></DD></DL><HR><A NAME="getParagraphElement(int)"><!-- --></A><H3>getParagraphElement</H3><PRE>public abstract <A HREF="../../../javax/swing/text/Element.html">Element</A> <B>getParagraphElement</B>(int&nbsp;pos)</PRE><DL><DD>Get the paragraph element containing the given position.  Sub-classes must define for themselves what exactly constitutes a paragraph.  They should keep in mind however that a paragraph should at least be the unit of text over which to run the Unicode bidirection

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -