public String getText( final int offset, final int length ) throws BadLocationException { return backend.getText( offset, length ); }
public String getText( final int offset, final int length ) throws BadLocationException { return backend.getText( offset, length ); }
public String getText( final int offset, final int length ) throws BadLocationException { return backend.getText( offset, length ); }
public void getText( final int offset, final int length, final Segment txt ) throws BadLocationException { backend.getText( offset, length, txt ); }
public void getText( final int offset, final int length, final Segment txt ) throws BadLocationException { backend.getText( offset, length, txt ); }
public void getText( final int offset, final int length, final Segment txt ) throws BadLocationException { backend.getText( offset, length, txt ); }
@Override public void insertString( int offs, String str, AttributeSet a ) throws BadLocationException { if ( str == null ) return; boolean proceed = true; if ( pattern != null ) { String tmp = super.getText( 0, offs ) + str + (super.getLength()>offs ? super.getText( offs, super.getLength()-offs ) : ""); Matcher m = pattern.matcher( tmp ); proceed = m.matches(); } if ( proceed == true ) super.insertString( offs, str, a ); }
@Override public void remove( int offs, int len ) throws BadLocationException { boolean proceed = true; if ( pattern != null ) { try { String tmp = super.getText( 0, offs ) + (super.getLength()>(offs+len) ? super.getText( offs+len, super.getLength()-(offs+len) ) : ""); Matcher m = pattern.matcher( tmp ); proceed = m.matches(); } catch ( BadLocationException e ) {} } if ( proceed == true ) super.remove( offs, len ); } }
@Override public String convert(final PlainDocument plainDocument) throws RuntimeException { try { final String text = plainDocument.getText(0, plainDocument.getLength()); final StringBuilder builder = new StringBuilder(); for (final char character : text.toCharArray()) { if (!FieldValueController.this.characterFilter.accept(character)) { continue; } builder.append(character); } return text; } catch (final BadLocationException exception) { return ""; //$NON-NLS-1$ } } };
for (int i = 0; i < text.length();) { try { doc.getText(i, text.length() - i, segment); } catch (BadLocationException e) { throw new Error("Can't get line text");
protected void setText(String text) { try { // remove all text and insert the completed string if (isStrictCompletion()) { super.remove(0, getLength()); super.insertString(0, text, null); } else { String existingText = super.getText(0, getLength()); int matchIndex = existingText.length() <= text.length() ? existingText.length() : text.length(); // try to find a match for (int i = 0; i < existingText.length(); i++) { if (!existingText.substring(0, matchIndex).equalsIgnoreCase(text.substring(0, matchIndex))) { matchIndex--; } } // remove the no-match part and complete with the one in Searchable super.remove(matchIndex, getLength() - matchIndex); super.insertString(matchIndex, text.substring(matchIndex), null); } } catch (BadLocationException e) { throw new RuntimeException(e.toString()); } } }
if (doc.getText(getDot(), 1).equals("\n")) return true; return false;
PlainDocument pd = (PlainDocument) model; try { vals.put(name, encode(pd.getText(0, pd.getLength()))); } catch (BadLocationException e1) { LOGGER.error(e1.getStackTrace()); PlainDocument pd = (PlainDocument) model; try { vals.put(name, encode(pd.getText(0, pd.getLength()))); } catch (BadLocationException e1) { LOGGER.error(e1.getStackTrace()); PlainDocument pd = (PlainDocument) model; try { vals.put(name, encode(pd.getText(0, pd.getLength()))); } catch (BadLocationException e1) { LOGGER.error(e1.getStackTrace());
lines = pDoc.getText(start, end - start).split("\n"); target.select(start, end); } catch (BadLocationException ex) {
lines = pDoc.getText(start, end - start).split("\n"); target.select(start, end); } catch (BadLocationException ex) {