本文整理汇总了Java中javax.swing.text.DocumentFilter.remove方法的典型用法代码示例。如果您正苦于以下问题:Java DocumentFilter.remove方法的具体用法?Java DocumentFilter.remove怎么用?Java DocumentFilter.remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.text.DocumentFilter
的用法示例。
在下文中一共展示了DocumentFilter.remove方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: remove
import javax.swing.text.DocumentFilter; //导入方法依赖的package包/类
/** Removes portion of a document */
public @Override void remove(int offset, int length) throws BadLocationException {
// if (LOG_EDT.isLoggable(Level.FINE)) { // Only permit operations in EDT
// if (!SwingUtilities.isEventDispatchThread()) {
// throw new IllegalStateException("BaseDocument.insertString not in EDT: offset=" + // NOI18N
// offset + ", len=" + length); // NOI18N
// }
// }
// Always acquire atomic lock (it simplifies processing and improves readability)
atomicLockImpl();
try {
checkModifiable(offset);
DocumentFilter filter = getDocumentFilter();
if (filter != null) {
filter.remove(getFilterBypass(), offset, length);
} else {
handleRemove(offset, length);
}
} finally {
atomicUnlockImpl(true);
}
}
示例2: remove
import javax.swing.text.DocumentFilter; //导入方法依赖的package包/类
/**
* Removes a piece of content from this <code>Document</code>.
*
* <p>If a {@link DocumentFilter} is installed in this document, the
* corresponding method of the filter object is called. The
* <code>DocumentFilter</code> is called even if <code>length</code>
* is zero. This is different from {@link #replace}.</p>
*
* <p>Note: When <code>length</code> is zero or below the call is not
* forwarded to the underlying {@link AbstractDocument.Content} instance
* of this document and no exception is thrown.</p>
*
* @param offset the start offset of the fragment to be removed
* @param length the length of the fragment to be removed
*
* @throws BadLocationException if <code>offset</code> or
* <code>offset + length</code> or invalid locations within this
* document
*/
public void remove(int offset, int length) throws BadLocationException
{
writeLock();
try
{
DocumentFilter f = getDocumentFilter();
if (f == null)
removeImpl(offset, length);
else
f.remove(getBypass(), offset, length);
}
finally
{
writeUnlock();
}
}
示例3: remove
import javax.swing.text.DocumentFilter; //导入方法依赖的package包/类
/**
* Removes a piece of content from this <code>Document</code>.
*
* <p>If a {@link DocumentFilter} is installed in this document, the
* corresponding method of the filter object is called. The
* <code>DocumentFilter</code> is called even if <code>length</code>
* is zero. This is different from {@link #replace}.</p>
*
* <p>Note: When <code>length</code> is zero or below the call is not
* forwarded to the underlying {@link AbstractDocument.Content} instance
* of this document and no exception is thrown.</p>
*
* @param offset the start offset of the fragment to be removed
* @param length the length of the fragment to be removed
*
* @throws BadLocationException if <code>offset</code> or
* <code>offset + length</code> or invalid locations within this
* document
*/
public void remove(int offset, int length) throws BadLocationException
{
writeLock();
try
{
DocumentFilter f = getDocumentFilter();
if (f == null)
removeImpl(offset, length);
else
f.remove(getBypass(), offset, length);
}
finally
{
writeUnlock();
}
}