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