/** * remove * * @param fb * @param offset * @param length * @throws BadLocationException */ @Override public void remove(final FilterBypass fb, final int offset, final int length) throws BadLocationException { if (offset >= promptPosition) { super.remove(fb, offset, length); } }
@Override public void remove(FilterBypass fb, int offset, int length) throws BadLocationException { Document doc = fb.getDocument(); StringBuilder sb = new StringBuilder(); sb.append(doc.getText(0, doc.getLength())); sb.delete(offset, offset + length); if (isInteger(sb.toString())) { super.remove(fb, offset, length); } }
public void remove(DocumentFilter.FilterBypass fb, int offset, int length) throws BadLocationException { // Typically called for back-space. Document theDoc = fb.getDocument(); int docLength = theDoc.getLength(); if (docLength != offset + 1) // User trying to move the caret back and edit. Not allowed. return; super.remove(fb, offset, length); }
@Override public void remove(FilterBypass fb, int offset, int length) throws BadLocationException { Document doc = fb.getDocument(); StringBuilder sb = new StringBuilder(); sb.append(doc.getText(0, doc.getLength())); sb.delete(offset, offset + length); if (test(sb.toString())) { super.remove(fb, offset, length); } else { // warn the user and don't allow the insert } }
public void remove(FilterBypass fb, int offset, int length) throws BadLocationException { /* Queue a copy of the event and then modify the textarea */ eventHistory.add(new TextRemoveEvent(offset, length)); super.remove(fb, offset, length); }
@Override public void remove(FilterBypass fb, int i, int i1) throws BadLocationException { super.remove(fb, i, i1); if (listener != null) listener.lengthChanged(textComponent.getText().length(), textComponent); }
@Override public void remove(DocumentFilter.FilterBypass fb, int offset, int length) throws BadLocationException { if (filter == null) super.remove(fb, offset, length); else filter.remove(fb, offset, length); }