当前位置: 首页>>代码示例>>Java>>正文


Java DocumentFilter.remove方法代码示例

本文整理汇总了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);
        }
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:BaseDocument.java

示例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();
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:36,代码来源:AbstractDocument.java

示例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();
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:36,代码来源:AbstractDocument.java


注:本文中的javax.swing.text.DocumentFilter.remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。