PageRenderTime 44ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-5-pre1/org/gjt/sp/jedit/buffer/BufferListener.java

#
Java | 150 lines | 16 code | 9 blank | 125 comment | 0 complexity | 0f502a061a092abfe6c4d843b7075655 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  1. /*
  2. * BufferListener.java - Buffer listener interface
  3. * :tabSize=8:indentSize=8:noTabs=false:
  4. * :folding=explicit:collapseFolds=1:
  5. *
  6. * Copyright (C) 2001, 2005 Slava Pestov
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version 2
  11. * of the License, or any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. */
  22. package org.gjt.sp.jedit.buffer;
  23. /**
  24. * A interface for notification of changes to buffer text.<p>
  25. *
  26. * This interface is new in jEdit 4.3pre3. The text area was made independent
  27. * of the rest of jEdit, and thus this class could no longer depend on
  28. * <code>org.gjt.sp.jedit.Buffer</code>.<p>
  29. *
  30. * While the
  31. * {@link org.gjt.sp.jedit.msg.BufferUpdate} EditBus message is used for
  32. * general buffer state changes, this interface is used for events which are
  33. * fired frequently, or for which performance is essential.<p>
  34. *
  35. * Because this interface is subject to change in the future, you
  36. * should subclass <code>BufferAdapter</code> instead of
  37. * implementing it directly.
  38. *
  39. * @author Slava Pestov
  40. * @version $Id: BufferListener.java 12504 2008-04-22 23:12:43Z ezust $
  41. * @since jEdit 4.3pre3
  42. */
  43. public interface BufferListener
  44. {
  45. //{{{ foldLevelChanged() method
  46. /**
  47. * Called when line fold levels change.
  48. * @param buffer The buffer in question
  49. * @param startLine The start line number
  50. * @param endLine The end line number
  51. * @since jEdit 4.3pre3
  52. */
  53. void foldLevelChanged(JEditBuffer buffer, int startLine, int endLine);
  54. //}}}
  55. //{{{ contentInserted() method
  56. /**
  57. * Called when text is inserted into the buffer.
  58. * @param buffer The buffer in question
  59. * @param startLine The first line
  60. * @param offset The start offset, from the beginning of the buffer
  61. * @param numLines The number of lines inserted
  62. * @param length The number of characters inserted
  63. * @since jEdit 4.3pre3
  64. */
  65. void contentInserted(JEditBuffer buffer, int startLine, int offset,
  66. int numLines, int length);
  67. //}}}
  68. //{{{ contentRemoved() method
  69. /**
  70. * Called when text is removed from the buffer.
  71. * @param buffer The buffer in question
  72. * @param startLine The first line
  73. * @param offset The start offset, from the beginning of the buffer
  74. * @param numLines The number of lines removed
  75. * @param length The number of characters removed
  76. * @since jEdit 4.3pre3
  77. */
  78. void contentRemoved(JEditBuffer buffer, int startLine, int offset,
  79. int numLines, int length);
  80. //}}}
  81. //{{{ preContentInserted() method
  82. /**
  83. * Called when text is about to be inserted in the buffer.
  84. * @param buffer The buffer in question
  85. * @param startLine The first line
  86. * @param offset The start offset, from the beginning of the buffer
  87. * @param numLines The number of lines inserted
  88. * @param length The number of characters inserted
  89. * @since jEdit 4.3pre11
  90. */
  91. void preContentInserted(JEditBuffer buffer, int startLine, int offset,
  92. int numLines, int length);
  93. //}}}
  94. //{{{ preContentRemoved() method
  95. /**
  96. * Called when text is about to be removed from the buffer, but is
  97. * still present.
  98. * @param buffer The buffer in question
  99. * @param startLine The first line
  100. * @param offset The start offset, from the beginning of the buffer
  101. * @param numLines The number of lines to be removed
  102. * @param length The number of characters to be removed
  103. * @since jEdit 4.3pre3
  104. */
  105. void preContentRemoved(JEditBuffer buffer, int startLine, int offset,
  106. int numLines, int length);
  107. //}}}
  108. //{{{ transactionComplete() method
  109. /**
  110. * Called after an undo or compound edit has finished. The text area
  111. * uses this event to queue up and collapse cleanup operations so they
  112. * are only run once during a long transaction (such as a "Replace All"
  113. * operation.)
  114. *
  115. * @param buffer The buffer in question
  116. * @since jEdit 4.3pre3
  117. */
  118. void transactionComplete(JEditBuffer buffer);
  119. //}}}
  120. //{{{ foldHandlerChanged() method
  121. /**
  122. * Called to notify the text area that folds need to be collapsed if
  123. * the "collapseFolds" property is set. This method is called after the
  124. * buffer has been loaded, and also if the user changes the fold
  125. * handler.
  126. *
  127. * @param buffer The buffer in question
  128. * @since jEdit 4.3pre3
  129. */
  130. void foldHandlerChanged(JEditBuffer buffer);
  131. //}}}
  132. //{{{ foldHandlerChanged() method
  133. /**
  134. * Called to notify the text area that the buffer has been reloaded.
  135. *
  136. * @param buffer The buffer in question
  137. * @since jEdit 4.3pre3
  138. */
  139. void bufferLoaded(JEditBuffer buffer);
  140. //}}}
  141. }