/jEdit/tags/jedit-4-3-pre13/org/gjt/sp/jedit/buffer/BufferAdapter.java

# · Java · 138 lines · 19 code · 9 blank · 110 comment · 0 complexity · 3f9f3ce6f1abf3dd96ffb9008ff3e958 MD5 · raw file

  1. /*
  2. * BufferAdapter.java - Buffer listener adapter
  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. * An adapter you can subclass to avoid having to implement all the methods
  25. * of the {@link BufferListener} interface.
  26. * @author Slava Pestov
  27. * @version $Id: BufferAdapter.java 10708 2007-09-21 19:41:03Z kpouer $
  28. * @since jEdit 4.3pre3
  29. */
  30. public abstract class BufferAdapter implements BufferListener
  31. {
  32. //{{{ foldLevelChanged() method
  33. /**
  34. * Called when line fold levels change.
  35. * @param buffer The buffer in question
  36. * @param start The start line number
  37. * @param end The end line number
  38. * @since jEdit 4.3pre3
  39. */
  40. public void foldLevelChanged(JEditBuffer buffer, int start, int end)
  41. {
  42. } //}}}
  43. //{{{ contentInserted() method
  44. /**
  45. * Called when text is inserted into the buffer.
  46. * @param buffer The buffer in question
  47. * @param startLine The first line
  48. * @param offset The start offset, from the beginning of the buffer
  49. * @param numLines The number of lines inserted
  50. * @param length The number of characters inserted
  51. * @since jEdit 4.3pre3
  52. */
  53. public void contentInserted(JEditBuffer buffer, int startLine, int offset,
  54. int numLines, int length) {}
  55. //}}}
  56. /**
  57. * Called when text is about to be inserted in the buffer.
  58. *
  59. * @param buffer The buffer in question
  60. * @param startLine The first line
  61. * @param offset The start offset, from the beginning of the buffer
  62. * @param numLines The number of lines inserted
  63. * @param length The number of characters inserted
  64. * @since jEdit 4.3pre11
  65. */
  66. public void preContentInserted(JEditBuffer buffer, int startLine, int offset, int numLines, int length)
  67. {
  68. }
  69. //{{{ preContentRemoved() method
  70. /**
  71. * Called when text is about to be removed from the buffer, but is
  72. * still present.
  73. * @param buffer The buffer in question
  74. * @param startLine The first line
  75. * @param offset The start offset, from the beginning of the buffer
  76. * @param numLines The number of lines to be removed
  77. * @param length The number of characters to be removed
  78. * @since jEdit 4.3pre3
  79. */
  80. public void preContentRemoved(JEditBuffer buffer, int startLine, int offset,
  81. int numLines, int length) {}
  82. //}}}
  83. //{{{ contentRemoved() method
  84. /**
  85. * Called when text is removed from the buffer.
  86. * @param buffer The buffer in question
  87. * @param startLine The first line
  88. * @param offset The start offset, from the beginning of the buffer
  89. * @param numLines The number of lines removed
  90. * @param length The number of characters removed
  91. * @since jEdit 4.3pre3
  92. */
  93. public void contentRemoved(JEditBuffer buffer, int startLine, int offset,
  94. int numLines, int length) {}
  95. //}}}
  96. //{{{ transactionComplete() method
  97. /**
  98. * Called after an undo or compound edit has finished. The text area
  99. * uses this event to queue up and collapse cleanup operations so they
  100. * are only run once during a long transaction (such as a "Replace All"
  101. * operation.)
  102. *
  103. * @param buffer The buffer in question
  104. * @since jEdit 4.3pre3
  105. */
  106. public void transactionComplete(JEditBuffer buffer) {}
  107. //}}}
  108. //{{{ foldHandlerChanged() method
  109. /**
  110. * Called to notify the text area that folds need to be collapsed if
  111. * the "collapseFolds" property is set. This method is called after the
  112. * buffer has been loaded, and also if the user changes the fold
  113. * handler.
  114. *
  115. * @param buffer The buffer in question
  116. * @since jEdit 4.3pre3
  117. */
  118. public void foldHandlerChanged(JEditBuffer buffer) {}
  119. //}}}
  120. //{{{ foldHandlerChanged() method
  121. /**
  122. * Called to notify the text area that the buffer has been reloaded.
  123. *
  124. * @param buffer The buffer in question
  125. * @since jEdit 4.3pre3
  126. */
  127. public void bufferLoaded(JEditBuffer buffer) {}
  128. //}}}
  129. }