/** * Returns the logical offset of the given line. * <p> * * @param lineIndex index of line * @return the logical starting offset of the line. When there are not any lines, * getOffsetAtLine(0) is a valid call that should answer 0. * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT when lineIndex is out of range</li> * </ul> */ public int getOffsetAtLine(int lineIndex) { if (lineIndex == 0) return 0; if ((lineIndex >= lineCount) || (lineIndex < 0)) error(SWT.ERROR_INVALID_ARGUMENT); int start = lines[lineIndex][0]; if (start > gapEnd) { return start - (gapEnd - gapStart); } else { return start; } } /**
/** * Returns the logical offset of the given line. * <p> * * @param lineIndex index of line * @return the logical starting offset of the line. When there are not any lines, * getOffsetAtLine(0) is a valid call that should answer 0. * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT when lineIndex is out of range</li> * </ul> */ @Override public int getOffsetAtLine(int lineIndex) { if (lineIndex == 0) return 0; if ((lineIndex >= lineCount) || (lineIndex < 0)) error(SWT.ERROR_INVALID_ARGUMENT); int start = lines[lineIndex][0]; if (start > gapEnd) { return start - (gapEnd - gapStart); } else { return start; } } /**
/** * Returns the logical offset of the given line. * <p> * * @param lineIndex index of line * @return the logical starting offset of the line. When there are not any lines, * getOffsetAtLine(0) is a valid call that should answer 0. * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT when lineIndex is out of range</li> * </ul> */ @Override public int getOffsetAtLine(int lineIndex) { if (lineIndex == 0) return 0; if ((lineIndex >= lineCount) || (lineIndex < 0)) error(SWT.ERROR_INVALID_ARGUMENT); int start = lines[lineIndex][0]; if (start > gapEnd) { return start - (gapEnd - gapStart); } else { return start; } } /**
/** * Returns the logical offset of the given line. * <p> * * @param lineIndex index of line * @return the logical starting offset of the line. When there are not any lines, * getOffsetAtLine(0) is a valid call that should answer 0. * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT when lineIndex is out of range</li> * </ul> */ @Override public int getOffsetAtLine(int lineIndex) { if (lineIndex == 0) return 0; if ((lineIndex >= lineCount) || (lineIndex < 0)) error(SWT.ERROR_INVALID_ARGUMENT); int start = lines[lineIndex][0]; if (start > gapEnd) { return start - (gapEnd - gapStart); } else { return start; } } /**
/** * Returns the logical offset of the given line. * <p> * * @param lineIndex index of line * @return the logical starting offset of the line. When there are not any lines, * getOffsetAtLine(0) is a valid call that should answer 0. * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_ARGUMENT when lineIndex is out of range</li> * </ul> */ @Override public int getOffsetAtLine(int lineIndex) { if (lineIndex == 0) return 0; if ((lineIndex >= lineCount) || (lineIndex < 0)) error(SWT.ERROR_INVALID_ARGUMENT); int start = lines[lineIndex][0]; if (start > gapEnd) { return start - (gapEnd - gapStart); } else { return start; } } /**
/** * Adds a <code>TextChangeListener</code> listening for * <code>TextChangingEvent</code> and <code>TextChangedEvent</code>. A * <code>TextChangingEvent</code> is sent before changes to the text occur. * A <code>TextChangedEvent</code> is sent after changes to the text * occurred. * <p> * * @param listener the listener * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> */ public void addTextChangeListener(TextChangeListener listener) { if (listener == null) error(SWT.ERROR_NULL_ARGUMENT); StyledTextListener typedListener = new StyledTextListener(listener); textListeners.addElement(typedListener); } /**
/** * Adds a <code>TextChangeListener</code> listening for * <code>TextChangingEvent</code> and <code>TextChangedEvent</code>. A * <code>TextChangingEvent</code> is sent before changes to the text occur. * A <code>TextChangedEvent</code> is sent after changes to the text * occurred. * <p> * * @param listener the listener * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> */ @Override public void addTextChangeListener(TextChangeListener listener) { if (listener == null) error(SWT.ERROR_NULL_ARGUMENT); StyledTextListener typedListener = new StyledTextListener(listener); textListeners.add(typedListener); } /**
/** * Adds a <code>TextChangeListener</code> listening for * <code>TextChangingEvent</code> and <code>TextChangedEvent</code>. A * <code>TextChangingEvent</code> is sent before changes to the text occur. * A <code>TextChangedEvent</code> is sent after changes to the text * occurred. * <p> * * @param listener the listener * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> */ @Override public void addTextChangeListener(TextChangeListener listener) { if (listener == null) error(SWT.ERROR_NULL_ARGUMENT); StyledTextListener typedListener = new StyledTextListener(listener); textListeners.add(typedListener); } /**
/** * Adds a <code>TextChangeListener</code> listening for * <code>TextChangingEvent</code> and <code>TextChangedEvent</code>. A * <code>TextChangingEvent</code> is sent before changes to the text occur. * A <code>TextChangedEvent</code> is sent after changes to the text * occurred. * <p> * * @param listener the listener * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> */ @Override public void addTextChangeListener(TextChangeListener listener) { if (listener == null) error(SWT.ERROR_NULL_ARGUMENT); StyledTextListener typedListener = new StyledTextListener(listener); textListeners.add(typedListener); } /**
/** * Adds a <code>TextChangeListener</code> listening for * <code>TextChangingEvent</code> and <code>TextChangedEvent</code>. A * <code>TextChangingEvent</code> is sent before changes to the text occur. * A <code>TextChangedEvent</code> is sent after changes to the text * occurred. * <p> * * @param listener the listener * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> */ @Override public void addTextChangeListener(TextChangeListener listener) { if (listener == null) error(SWT.ERROR_NULL_ARGUMENT); StyledTextListener typedListener = new StyledTextListener(listener); textListeners.add(typedListener); } /**
/** * Removes the specified <code>TextChangeListener</code>. * <p> * * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> */ public void removeTextChangeListener(TextChangeListener listener){ if (listener == null) error(SWT.ERROR_NULL_ARGUMENT); for (int i = 0; i < textListeners.size(); i++) { TypedListener typedListener = (TypedListener) textListeners.elementAt(i); if (typedListener.getEventListener () == listener) { textListeners.removeElementAt(i); break; } } } /**
/** * Removes the specified <code>TextChangeListener</code>. * <p> * * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> */ @Override public void removeTextChangeListener(TextChangeListener listener){ if (listener == null) error(SWT.ERROR_NULL_ARGUMENT); for (int i = 0; i < textListeners.size(); i++) { TypedListener typedListener = textListeners.get(i); if (typedListener.getEventListener () == listener) { textListeners.remove(i); break; } } } /**
/** * Removes the specified <code>TextChangeListener</code>. * <p> * * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> */ @Override public void removeTextChangeListener(TextChangeListener listener){ if (listener == null) error(SWT.ERROR_NULL_ARGUMENT); for (int i = 0; i < textListeners.size(); i++) { TypedListener typedListener = textListeners.get(i); if (typedListener.getEventListener () == listener) { textListeners.remove(i); break; } } } /**
/** * Removes the specified <code>TextChangeListener</code>. * <p> * * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> */ @Override public void removeTextChangeListener(TextChangeListener listener){ if (listener == null) error(SWT.ERROR_NULL_ARGUMENT); for (int i = 0; i < textListeners.size(); i++) { TypedListener typedListener = textListeners.get(i); if (typedListener.getEventListener () == listener) { textListeners.remove(i); break; } } } /**
/** * Removes the specified <code>TextChangeListener</code>. * <p> * * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT when listener is null</li> * </ul> */ @Override public void removeTextChangeListener(TextChangeListener listener){ if (listener == null) error(SWT.ERROR_NULL_ARGUMENT); for (int i = 0; i < textListeners.size(); i++) { TypedListener typedListener = textListeners.get(i); if (typedListener.getEventListener () == listener) { textListeners.remove(i); break; } } } /**
if ((index >= lineCount) || (index < 0)) error(SWT.ERROR_INVALID_ARGUMENT); int start = lines[index][0]; int length = lines[index][1];
if ((index >= lineCount) || (index < 0)) error(SWT.ERROR_INVALID_ARGUMENT); int start = lines[index][0]; int length = lines[index][1];
if ((index >= lineCount) || (index < 0)) error(SWT.ERROR_INVALID_ARGUMENT); int start = lines[index][0]; int length = lines[index][1];
if ((index >= lineCount) || (index < 0)) error(SWT.ERROR_INVALID_ARGUMENT); int start = lines[index][0]; int length = lines[index][1];
if ((index >= lineCount) || (index < 0)) error(SWT.ERROR_INVALID_ARGUMENT); int start = lines[index][0]; int length = lines[index][1];