1. /*
  2. * @(#)Style.java 1.16 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package javax.swing.text;
  11. import java.awt.Component;
  12. import javax.swing.event.ChangeListener;
  13. import javax.swing.event.ChangeEvent;
  14. import java.util.Enumeration;
  15. import java.util.Hashtable;
  16. /**
  17. * A collection of attributes to associate with an element in a document.
  18. * Since these are typically used to associate character and paragraph
  19. * styles with the element, operations for this are provided. Other
  20. * customized attributes that get associated with the element will
  21. * effectively be name-value pairs that live in a hierarchy and if a name
  22. * (key) is not found locally, the request is forwarded to the parent.
  23. * Commonly used attributes are seperated out to facilitate alternative
  24. * implementations that are more efficient.
  25. *
  26. * @author Timothy Prinzing
  27. * @version 1.16 02/02/00
  28. */
  29. public interface Style extends MutableAttributeSet {
  30. /**
  31. * Fetches the name of the style. A style is not required to be named,
  32. * so null is returned if there is no name associated with the style.
  33. *
  34. * @return the name
  35. */
  36. public String getName();
  37. /**
  38. * Adds a listener to track whenever an attribute
  39. * has been changed.
  40. *
  41. * @param l the change listener
  42. */
  43. public void addChangeListener(ChangeListener l);
  44. /**
  45. * Removes a listener that was tracking attribute changes.
  46. *
  47. * @param l the change listener
  48. */
  49. public void removeChangeListener(ChangeListener l);
  50. }