1. /*
  2. * @(#)BasicEditorPaneUI.java 1.19 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.plaf.basic;
  8. import java.awt.*;
  9. import java.awt.event.*;
  10. import java.beans.*;
  11. import java.net.URL;
  12. import java.net.MalformedURLException;
  13. import javax.swing.*;
  14. import javax.swing.text.*;
  15. import javax.swing.plaf.*;
  16. import javax.swing.border.*;
  17. /**
  18. * Provides the look and feel for a JEditorPane.
  19. * <p>
  20. * <strong>Warning:</strong>
  21. * Serialized objects of this class will not be compatible with
  22. * future Swing releases. The current serialization support is appropriate
  23. * for short term storage or RMI between applications running the same
  24. * version of Swing. A future release of Swing will provide support for
  25. * long term persistence.
  26. *
  27. * @author Timothy Prinzing
  28. * @version 1.19 11/29/01
  29. */
  30. public class BasicEditorPaneUI extends BasicTextUI {
  31. /**
  32. * Creates a UI for the JTextPane.
  33. *
  34. * @param c the JTextPane component
  35. * @return the UI
  36. */
  37. public static ComponentUI createUI(JComponent c) {
  38. return new BasicEditorPaneUI();
  39. }
  40. /**
  41. * Creates a new BasicEditorPaneUI.
  42. */
  43. public BasicEditorPaneUI() {
  44. super();
  45. }
  46. /**
  47. * Fetches the name used as a key to lookup properties through the
  48. * UIManager. This is used as a prefix to all the standard
  49. * text properties.
  50. *
  51. * @return the name ("EditorPane")
  52. */
  53. protected String getPropertyPrefix() {
  54. return "EditorPane";
  55. }
  56. /**
  57. * Fetches the EditorKit for the UI. This is whatever is
  58. * currently set in the associated JEditorPane.
  59. *
  60. * @return the editor capabilities
  61. * @see TextUI#getEditorKit
  62. */
  63. public EditorKit getEditorKit(JTextComponent tc) {
  64. JEditorPane pane = (JEditorPane) getComponent();
  65. return pane.getEditorKit();
  66. }
  67. }