PageRenderTime 64ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-5-pre1/org/gjt/sp/jedit/msg/BufferChanging.java

#
Java | 66 lines | 23 code | 6 blank | 37 comment | 2 complexity | 59aa4445643e74f5d277a61b253ca391 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. * BufferChanging.java - Buffer changing (specialized Edit Pane update message)
  3. * :tabSize=8:indentSize=8:noTabs=false:
  4. * :folding=explicit:collapseFolds=1:
  5. *
  6. * Copyright (C) 2006 Alan Ezust
  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.msg;
  23. import java.util.Arrays;
  24. import org.gjt.sp.jedit.Buffer;
  25. import org.gjt.sp.jedit.EditPane;
  26. import org.gjt.sp.util.Log;
  27. /** An EBMessage sent by the EditPane just before the buffer changes.
  28. *
  29. * jEdit core emits this whenever the EditPane's buffer changes.
  30. *
  31. * Known plugins to be using this: BufferLocal, Navigator.
  32. *
  33. * @since jEdit 4.3pre4
  34. * @version $Id: BufferChanging.java 16342 2009-10-14 10:07:18Z kpouer $
  35. */
  36. public class BufferChanging extends PositionChanging
  37. {
  38. /**
  39. * @param editPane the editPane that sent the message
  40. * @param newBuffer the buffer that will soon be displayed.
  41. */
  42. public BufferChanging(EditPane editPane, Buffer newBuffer)
  43. {
  44. super(editPane, EditPaneUpdate.BUFFER_CHANGING);
  45. if (newBuffer == null)
  46. {
  47. String s = Arrays.toString(Thread.currentThread().getStackTrace());
  48. Log.log (Log.ERROR, this, "BufferChanging to null Buffer? Emit PositionChanging instead." + s);
  49. }
  50. m_buffer = newBuffer;
  51. }
  52. /**
  53. * @return the new buffer that is about to be displayed
  54. */
  55. public Buffer getBuffer()
  56. {
  57. return m_buffer;
  58. }
  59. private Buffer m_buffer;
  60. }