congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
DefaultStyledDocument.remove
Code IndexAdd Tabnine to your IDE (free)

How to use
remove
method
in
javax.swing.text.DefaultStyledDocument

Best Java code snippets using javax.swing.text.DefaultStyledDocument.remove (Showing top 20 results out of 315)

origin: ron190/jsql-injection

@Override
public void remove(int offs, int len) throws BadLocationException {
  synchronized (this.docLock) {
    super.remove(offs, len);
    this.color(offs, -len);
    this.documentReader.update(offs, -len);
  }
}
origin: org.gosu-lang.gosu/gosu-lab

@Override
public void remove( int offset, int length ) throws BadLocationException
{
 super.remove( offset, length );
 processChangedLines( offset, 0 );
}
origin: org.fudaa.framework.ctulu/ctulu-bu

 public void remove(int _start, int _len) throws BadLocationException {
  super.remove(_start, _len);
  colorize(_start, 0);
 }
}
origin: zgqq/mah

@Override
public void remove(int offs, int len) throws BadLocationException {
  setOldState();
  super.remove(offs, len);
}
origin: Waikato/weka-trunk

/**
 * Applies syntax highlighting after the document has been updated.
 * 
 * @param offset the offset of the deletion
 * @param length the length of the deletion
 * @throws BadLocationException if offsets are invalid
 */
@Override
public void remove(int offset, int length) throws BadLocationException {
 super.remove(offset, length);
 processChangedLines(offset, 0);
}
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Applies syntax highlighting after the document has been updated.
 * 
 * @param offset the offset of the deletion
 * @param length the length of the deletion
 * @throws BadLocationException if offsets are invalid
 */
@Override
public void remove(int offset, int length) throws BadLocationException {
 super.remove(offset, length);
 processChangedLines(offset, 0);
}
origin: org.owasp.jbrofuzz/jbrofuzz

  @Override
  public void remove(final int offset, final int length)
  throws BadLocationException {
    super.remove(offset, length);
    processChangedLines(offset, length);
  }
}
origin: org.armedbear.lisp/abcl

@Override
public void remove(int offs, int len) throws BadLocationException {
 synchronized(reader) {
  int bufferStart = getLength() - inputBuffer.length();
  if(offs < bufferStart) {
   throw new BadLocationException("Can only remove after " + bufferStart, offs);
  }
  super.remove(offs, len);
  inputBuffer.delete(offs - bufferStart, offs - bufferStart + len);
 }
}
 
origin: chatty/chatty

public void clearAll() {
  try {
    doc.remove(0, doc.getLength());
    resetNewlineRequired();
    kit.clearImages();
  } catch (BadLocationException ex) {
    Logger.getLogger(ChannelTextPane.class.getName()).log(Level.SEVERE, null, ex);
  }
}

origin: cmu-phil/tetrad

private void setParseText(String text) {
  try {
    // Add the text to the document
    expressionTextDoc.remove(0, expressionTextPane.getText().length());
    expressionTextDoc.insertString(0, text, null);
  } catch (BadLocationException e) {
    e.printStackTrace();
    throw new RuntimeException(e);
  }
}
origin: net.sf.squirrel-sql.thirdparty-non-maven/ostermiller-syntax

public void remove(int offs, int len) throws BadLocationException {
  synchronized (docLock) {
    super.remove(offs, len);
    color(offs, -len);
    documentReader.update(offs, -len);
  }
}
origin: apache/ctakes

 @Override
 public void actionPerformed( final ActionEvent event ) {
   final int option = _chooser.showOpenDialog( null );
   if ( option != JFileChooser.APPROVE_OPTION ) {
    return;
   }
   String text = "";
   final File file = _chooser.getSelectedFile();
   try {
    text = Files.lines( Paths.get( file.getPath() ) ).collect( Collectors.joining( "\n" ) );
   } catch ( IOException ioE ) {
    LOGGER.error( ioE.getMessage() );
    return;
   }
   try {
    _piperDocument.remove( 0, _piperDocument.getLength() );
    _piperDocument.insertString( 0, text, null );
   } catch ( BadLocationException blE ) {
    LOGGER.warn( blE.getMessage() );
   }
   _runButton.setEnabled( false );
 }
}
origin: apache/ctakes

private void createNewPiper() {
 final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern( "MMMM dd, yyyy" );
 final LocalDate date = LocalDate.now();
 final String text = "//       ***  Piper File  ***\n" +
           "//       Created by " + System.getProperty( "user.name" ) + "\n" +
           "//       on " + date.format( dateFormatter ) + "\n\n";
 try {
   _piperDocument.remove( 0, _piperDocument.getLength() );
   _piperDocument.insertString( 0, text, null );
   _textPane.setCaretPosition( _piperDocument.getLength() );
 } catch ( BadLocationException blE ) {
   LOGGER.warn( blE.getMessage() );
 }
 _runButton.setEnabled( false );
}
origin: org.apache.jackrabbit/jackrabbit-index-filters

  protected void initializeReader() throws IOException {
    InputStream in;
    try {
      in = blob.getStream();
    } catch (RepositoryException e) {
      throw new IOException(e.getMessage());
    }
    try {
      doc.remove(0, doc.getLength());
      rek.read(in, doc, 0);
      String text = doc.getText(0, doc.getLength());
      delegate = new StringReader(text);
    } catch (BadLocationException e) {
      throw new IOException(e.getMessage());
    } finally {
      in.close();
    }
  }
};
origin: org.fudaa.framework.ctulu/ctulu-bu

public void uncolorize() {
 try {
  String text = getText(0, getLength());
  super.remove(0, getLength());
  super.insertString(0, text, null);
 } catch (BadLocationException ex) {}
}
origin: apache/ctakes

public void loadPiperFile( final String path ) {
 final PiperFileReader reader = new PiperFileReader();
 final String text = loadPiperText( reader, path );
 try {
   _piperDocument.remove( 0, _piperDocument.getLength() );
   _piperDocument.insertString( 0, text, null );
 } catch ( BadLocationException blE ) {
   LOGGER.warn( blE.getMessage() );
 }
 _cliChars.clear();
 _cliCharToName.clear();
 _cliCharToValue.clear();
 for ( int i = 0; i < STANDARD_CHARS.length; i++ ) {
   _charToName.put( STANDARD_CHARS[ i ], STANDARD_NAMES[ i ] );
 }
 if ( !loadPiperCli( reader, text ) ) {
   error( "Could not load Piper File: " + path );
   return;
 }
 _piperPath = path;
 _runButton.setEnabled( true );
 _cliTable.revalidate();
 _cliTable.repaint();
}
origin: otros-systems/otroslogviewer

private void updatePatterns() {
 final String text = loggerConfigTextPane.getText();
 final List<LogPattern> resultList = getLogPatterns(text);
 try {
  styledDocument.remove(0, styledDocument.getLength());
  for (LogPattern result : resultList) {
   resultTextPane.insertIcon(result.isValid() ? Icons.STATUS_OK : Icons.STATUS_ERROR);
   styledDocument.insertString(styledDocument.getLength(), " " + result.getPattern() + "\n", defaultStyle);
  }
 } catch (BadLocationException ignore) {
 }
 if (resultList.isEmpty()) {
  resultTextPane.setText("No logger patterns detected in project opened in IDE.");
 }
}
origin: org.fudaa.framework.ctulu/ctulu-bu

 super.remove(_start, _len);
 super.insertString(_start, text, null);
} catch (BadLocationException ex) {
   int ei = _start + mm.getStartIndex() + mr.getEndIndex();
   super.remove(si, ei - si);
   super.insertString(si, newtext, getStyle(key.style));
origin: chatty/chatty

/**
 * Remove text from chat, while also handling Emotes in the removed section
 * correctly.
 *
 * @param start Start offset
 * @param len Length of section to remove
 * @throws BadLocationException 
 */
private void remove(int start, int len) throws BadLocationException {
  Debugging.edt();
  int startLine = doc.getDefaultRootElement().getElementIndex(start);
  int endLine = doc.getDefaultRootElement().getElementIndex(start+len);
  Set<Long> before = Util.getImageIds(doc, startLine, endLine);
  doc.remove(start, len);
  if (!before.isEmpty()) {
    Set<Long> after = Util.getImageIds(doc, startLine, endLine);
    if (Debugging.isEnabled("gifd", "gifd2")) {
      Debugging.println(String.format("Removed %d+%d (Before: %s After: %s)",
          start, len, before, after));
    }
    before.removeAll(after);
    for (long id : before) {
      kit.clearImage(id);
    }
  }
}

origin: chatty/chatty

  doc.remove(startOffset,endOffset);
} catch (BadLocationException ex) {
javax.swing.textDefaultStyledDocumentremove

Popular methods of DefaultStyledDocument

  • <init>
  • getLength
  • insertString
  • getText
  • setCharacterAttributes
  • addDocumentListener
  • setDocumentFilter
  • addUndoableEditListener
  • createPosition
  • getParagraphElement
  • getCharacterElement
  • setParagraphAttributes
  • getCharacterElement,
  • setParagraphAttributes,
  • getDefaultRootElement,
  • insert,
  • addStyle,
  • fireInsertUpdate,
  • fireRemoveUpdate,
  • getEndPosition,
  • getStyle

Popular in Java

  • Finding current android device location
  • setContentView (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • String (java.lang)
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JLabel (javax.swing)
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now