📄 abstractdocument.html
字号:
<A NAME="AbstractDocument(javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.AttributeContext)"><!-- --></A><H3>AbstractDocument</H3><PRE>protected <B>AbstractDocument</B>(<A HREF="../../../javax/swing/text/AbstractDocument.Content.html">AbstractDocument.Content</A> data, <A HREF="../../../javax/swing/text/AbstractDocument.AttributeContext.html">AbstractDocument.AttributeContext</A> context)</PRE><DL><DD>Constructs a new AbstractDocument, wrapped around some specified content storage mechanism.<DD><DL><DT><B>Parameters:</B><DD><CODE>data</CODE> - the content<DD><CODE>context</CODE> - the attribute context</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getDocumentProperties()"><!-- --></A><H3>getDocumentProperties</H3><PRE>public <A HREF="../../../java/util/Dictionary.html">Dictionary</A> <B>getDocumentProperties</B>()</PRE><DL><DD>Support for managing a set of properties. Callers can use the documentProperties dictionary to annotate the document with document-wide properties.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a non null Dictionary<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/AbstractDocument.html#setDocumentProperties(java.util.Dictionary)"><CODE>setDocumentProperties(java.util.Dictionary)</CODE></A></DL></DD></DL><HR><A NAME="setDocumentProperties(java.util.Dictionary)"><!-- --></A><H3>setDocumentProperties</H3><PRE>public void <B>setDocumentProperties</B>(<A HREF="../../../java/util/Dictionary.html">Dictionary</A> x)</PRE><DL><DD>Replace the document properties dictionary for this document.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>x</CODE> - the new dictionary<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/AbstractDocument.html#getDocumentProperties()"><CODE>getDocumentProperties()</CODE></A></DL></DD></DL><HR><A NAME="fireInsertUpdate(javax.swing.event.DocumentEvent)"><!-- --></A><H3>fireInsertUpdate</H3><PRE>protected void <B>fireInsertUpdate</B>(<A HREF="../../../javax/swing/event/DocumentEvent.html">DocumentEvent</A> e)</PRE><DL><DD>Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the event<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/event/EventListenerList.html"><CODE>EventListenerList</CODE></A></DL></DD></DL><HR><A NAME="fireChangedUpdate(javax.swing.event.DocumentEvent)"><!-- --></A><H3>fireChangedUpdate</H3><PRE>protected void <B>fireChangedUpdate</B>(<A HREF="../../../javax/swing/event/DocumentEvent.html">DocumentEvent</A> e)</PRE><DL><DD>Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the event<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/event/EventListenerList.html"><CODE>EventListenerList</CODE></A></DL></DD></DL><HR><A NAME="fireRemoveUpdate(javax.swing.event.DocumentEvent)"><!-- --></A><H3>fireRemoveUpdate</H3><PRE>protected void <B>fireRemoveUpdate</B>(<A HREF="../../../javax/swing/event/DocumentEvent.html">DocumentEvent</A> e)</PRE><DL><DD>Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the event<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/event/EventListenerList.html"><CODE>EventListenerList</CODE></A></DL></DD></DL><HR><A NAME="fireUndoableEditUpdate(javax.swing.event.UndoableEditEvent)"><!-- --></A><H3>fireUndoableEditUpdate</H3><PRE>protected void <B>fireUndoableEditUpdate</B>(<A HREF="../../../javax/swing/event/UndoableEditEvent.html">UndoableEditEvent</A> e)</PRE><DL><DD>Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>e</CODE> - the event<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/event/EventListenerList.html"><CODE>EventListenerList</CODE></A></DL></DD></DL><HR><A NAME="getListeners(java.lang.Class)"><!-- --></A><H3>getListeners</H3><PRE>public <A HREF="../../../java/util/EventListener.html">EventListener</A>[] <B>getListeners</B>(<A HREF="../../../java/lang/Class.html">Class</A> listenerType)</PRE><DL><DD>Return an array of all the listeners of the given type that were added to this model.<DD><DL></DL></DD><DD><DL><DT><B>Since: </B><DD>1.3</DD></DL></DD></DL><HR><A NAME="getAsynchronousLoadPriority()"><!-- --></A><H3>getAsynchronousLoadPriority</H3><PRE>public int <B>getAsynchronousLoadPriority</B>()</PRE><DL><DD>Get the asynchronous loading priority. If less than zero, the document should not be loaded asynchronously.<DD><DL></DL></DD></DL><HR><A NAME="setAsynchronousLoadPriority(int)"><!-- --></A><H3>setAsynchronousLoadPriority</H3><PRE>public void <B>setAsynchronousLoadPriority</B>(int p)</PRE><DL><DD>Set the asynchronous loading priority.<DD><DL></DL></DD></DL><HR><A NAME="render(java.lang.Runnable)"><!-- --></A><H3>render</H3><PRE>public void <B>render</B>(<A HREF="../../../java/lang/Runnable.html">Runnable</A> r)</PRE><DL><DD>This allows the model to be safely rendered in the presence of currency, if the model supports being updated asynchronously. The given runnable will be executed in a way that allows it to safely read the model with no changes while the runnable is being executed. The runnable itself may <em>not</em> make any mutations. <p> This is implemented to aquire a read lock for the duration of the runnables execution. There may be multiple runnables executing at the same time, and all writers will be blocked while there are active rendering runnables. If the runnable throws an exception, its lock will be safely released. There is no protection against a runnable that never exits, which will effectively leave the document locked for it's lifetime. <p> If the given runnable attempts to make any mutations in this implementation, a deadlock will occur. There is no tracking of individual rendering threads to enable detecting this situation, but a subclass could incur the overhead of tracking them and throwing an error. <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#render(java.lang.Runnable)">render</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>r</CODE> - the renderer to execute.</DL></DD></DL><HR><A NAME="getLength()"><!-- --></A><H3>getLength</H3><PRE>public int <B>getLength</B>()</PRE><DL><DD>Returns the length of the data. This is the number of characters of content that represents the users data.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Document.html#getLength()">getLength</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 length >= 0<DT><B>See Also: </B><DD><A HREF="../../../javax/swing/text/Document.html#getLength()"><CODE>Document.getLength()</CODE></A></DL></DD></DL><HR><A NAME="addDocumentListener(javax.swing.event.DocumentListener)"><!-- --></A><H3>addDocumentListener</H3><PRE>public void <B>addDocumentListener</B>(<A HREF="../../../javax/swing/event/DocumentListener.html">DocumentListener</A> listener)</PRE><DL><DD>Adds a document listener for notification of any changes.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Document.html#addDocumentListener(javax.swing.event.DocumentListener)">addDocumentListener</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#addDocumentListener(javax.swing.event.DocumentListener)"><CODE>Document.addDocumentListener(javax.swing.event.DocumentListener)</CODE></A></DL></DD></DL><HR><A NAME="removeDocumentListener(javax.swing.event.DocumentListener)"><!-- --></A><H3>removeDocumentListener</H3><PRE>public void <B>removeDocumentListener</B>(<A HREF="../../../javax/swing/event/DocumentListener.html">DocumentListener</A> listener)</PRE><DL><DD>Removes a document listener.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Document.html#removeDocumentListener(javax.swing.event.DocumentListener)">removeDocumentListener</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="addUndoableEditListener(javax.swing.event.UndoableEditListener)"><!-- --></A><H3>addUndoableEditListener</H3><PRE>public void <B>addUndoableEditListener</B>(<A HREF="../../../javax/swing/event/UndoableEditListener.html">UndoableEditListener</A> listener)</PRE><DL><DD>Adds an undo listener for notification of any changes. Undo/Redo operations performed on the UndoableEdit will cause the appropriate DocumentEvent to be fired to keep the view(s) in sync with the model.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/swing/text/Document.html#addUndoableEditListener(javax.swing.event.UndoableEditListener)">addUndoableEditListener</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#addUndoableEditListener(javax.swing.event.UndoableEditListener)"><CODE>Document.addUndoableEditListener(javax.swing.event.UndoableEditListener)</CODE></A></DL></DD></DL><HR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -