Java 类com.intellij.openapi.editor.ex.SoftWrapChangeListener 实例源码

项目:tools-idea    文件:SoftWrapsStorage.java   
/**
 * Inserts given soft wrap to {@link #myWraps} collection at the given index.
 *
 * @param softWrap          soft wrap to store
 * @param notifyListeners   flag that indicates if registered listeners should be notified about soft wrap registration
 * @return                  previous soft wrap object stored for the same offset if any; <code>null</code> otherwise
 */
@SuppressWarnings({"ForLoopReplaceableByForEach"})
@Nullable
public SoftWrap storeOrReplace(SoftWrapImpl softWrap, boolean notifyListeners) {
  int i = getSoftWrapIndex(softWrap.getStart());
  if (i >= 0) {
    return myWraps.set(i, softWrap);
  }

  i = -i - 1;
  myWraps.add(i, softWrap);
  if (notifyListeners) {
    // Use explicit loop as profiling shows that iterator-based processing is quite slow.
    for (int j = 0; j < myListeners.size(); j++) {
      SoftWrapChangeListener listener = myListeners.get(j);
      listener.softWrapAdded(softWrap);
    }
  }
  return null;
}
项目:intellij-ce-playground    文件:SoftWrapsStorage.java   
public void notifyListenersAboutChange() {
  for (SoftWrapChangeListener listener : myListeners) {
    listener.softWrapsChanged();
  }
}
项目:intellij-ce-playground    文件:SoftWrapModelWindow.java   
@Override
public boolean addSoftWrapChangeListener(@NotNull SoftWrapChangeListener listener) {
  return false;
}
项目:tools-idea    文件:SoftWrapsStorage.java   
private void notifyListenersAboutRemoval() {
  for (SoftWrapChangeListener listener : myListeners) {
    listener.softWrapsRemoved();
  }
}
项目:consulo    文件:SoftWrapsStorage.java   
public void notifyListenersAboutChange() {
  for (SoftWrapChangeListener listener : myListeners) {
    listener.softWrapsChanged();
  }
}
项目:consulo    文件:SoftWrapModelWindow.java   
@Override
public boolean addSoftWrapChangeListener(@Nonnull SoftWrapChangeListener listener) {
  return false;
}
项目:intellij-ce-playground    文件:SoftWrapsStorage.java   
/**
 * Registers given listener within the current model
 *
 * @param listener    listener to register
 * @return            <code>true</code> if given listener was not registered before; <code>false</code> otherwise
 */
public boolean addSoftWrapChangeListener(@NotNull SoftWrapChangeListener listener) {
  return myListeners.add(listener);
}
项目:tools-idea    文件:SoftWrapsStorage.java   
/**
 * Registers given listener within the current model
 *
 * @param listener    listener to register
 * @return            <code>true</code> if given listener was not registered before; <code>false</code> otherwise
 */
public boolean addSoftWrapChangeListener(@NotNull SoftWrapChangeListener listener) {
  return myListeners.add(listener);
}
项目:consulo    文件:SoftWrapsStorage.java   
/**
 * Registers given listener within the current model
 *
 * @param listener    listener to register
 * @return            <code>true</code> if given listener was not registered before; <code>false</code> otherwise
 */
public boolean addSoftWrapChangeListener(@Nonnull SoftWrapChangeListener listener) {
  return myListeners.add(listener);
}