PageRenderTime 40ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-3-pre5/org/gjt/sp/jedit/msg/RegisterChanged.java

#
Java | 61 lines | 25 code | 7 blank | 29 comment | 0 complexity | 42fdce00d259b9e7d4eba545ade6a99c 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. * RegisterChanged.java - Register changed message
  3. * Copyright (C) 2004 Nicholas O'Leary
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version 2
  8. * of the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. */
  19. package org.gjt.sp.jedit.msg;
  20. import org.gjt.sp.jedit.EBComponent;
  21. import org.gjt.sp.jedit.EBMessage;
  22. import org.gjt.sp.jedit.Registers;
  23. /**
  24. * Message sent when a register is updated.
  25. * @author Nicholas O'Leary
  26. * @version $Id: RegisterChanged.java 5115 2004-09-01 23:20:37Z spestov $
  27. *
  28. * @since jEdit 4.3pre1
  29. */
  30. public class RegisterChanged extends EBMessage
  31. {
  32. private char registerName;
  33. /**
  34. * Creates a new registers changed message.
  35. * @param source The message source
  36. */
  37. public RegisterChanged(EBComponent source, char name)
  38. {
  39. super(source);
  40. registerName = name;
  41. }
  42. public char getRegisterName()
  43. {
  44. return registerName;
  45. }
  46. public String getRegisterValue()
  47. {
  48. return Registers.getRegister(registerName).toString();
  49. }
  50. public String paramString()
  51. {
  52. return "register=" + registerName + "," + super.paramString();
  53. }
  54. }