@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); } }
@Override public void remove( int offset, int length ) throws BadLocationException { super.remove( offset, length ); processChangedLines( offset, 0 ); }
public void remove(int _start, int _len) throws BadLocationException { super.remove(_start, _len); colorize(_start, 0); } }
@Override public void remove(int offs, int len) throws BadLocationException { setOldState(); super.remove(offs, len); }
/** * 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); }
/** * 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); }
@Override public void remove(final int offset, final int length) throws BadLocationException { super.remove(offset, length); processChangedLines(offset, length); } }
@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); } }
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); } }
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); } }
public void remove(int offs, int len) throws BadLocationException { synchronized (docLock) { super.remove(offs, len); color(offs, -len); documentReader.update(offs, -len); } }
@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 ); } }
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 ); }
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(); } } };
public void uncolorize() { try { String text = getText(0, getLength()); super.remove(0, getLength()); super.insertString(0, text, null); } catch (BadLocationException ex) {} }
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(); }
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."); } }
/** * 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); } } }
doc.remove(startOffset,endOffset); } catch (BadLocationException ex) {