/[classpath]/classpath/javax/swing/JTextPane.java
ViewVC logotype

Diff of /classpath/javax/swing/JTextPane.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2.2.4 by gnu_andrew, Wed Nov 2 00:43:47 2005 UTC revision 1.2.2.5 by gnu_andrew, Sun Nov 27 21:00:38 2005 UTC
# Line 47  import javax.swing.text.Document; Line 47  import javax.swing.text.Document;
47  import javax.swing.text.EditorKit;  import javax.swing.text.EditorKit;
48  import javax.swing.text.Element;  import javax.swing.text.Element;
49  import javax.swing.text.MutableAttributeSet;  import javax.swing.text.MutableAttributeSet;
50    import javax.swing.text.SimpleAttributeSet;
51  import javax.swing.text.Style;  import javax.swing.text.Style;
52    import javax.swing.text.StyleConstants;
53  import javax.swing.text.StyledDocument;  import javax.swing.text.StyledDocument;
54  import javax.swing.text.StyledEditorKit;  import javax.swing.text.StyledEditorKit;
55    
# Line 192  public class JTextPane Line 194  public class JTextPane
194     */     */
195    public void insertComponent(Component component)    public void insertComponent(Component component)
196    {    {
197      // TODO: One space must be inserted here with attributes set to indicate      SimpleAttributeSet atts = new SimpleAttributeSet();
198      // that the component must be displayed here. Have to figure out the      atts.addAttribute(StyleConstants.ComponentAttribute, component);
199      // attributes.      atts.addAttribute(StyleConstants.NameAttribute,
200                          StyleConstants.ComponentElementName);
201        try
202          {
203            getDocument().insertString(getCaret().getDot(), " ", atts);
204          }
205        catch (BadLocationException ex)
206          {
207            AssertionError err = new AssertionError("Unexpected bad location");
208            err.initCause(ex);
209            throw err;
210          }
211    }    }
212    
213    /**    /**
# Line 204  public class JTextPane Line 217  public class JTextPane
217     */     */
218    public void insertIcon(Icon icon)    public void insertIcon(Icon icon)
219    {    {
220      // TODO: One space must be inserted here with attributes set to indicate      SimpleAttributeSet atts = new SimpleAttributeSet();
221      // that the icon must be displayed here. Have to figure out the      atts.addAttribute(StyleConstants.IconAttribute, icon);
222      // attributes.      atts.addAttribute(StyleConstants.NameAttribute,
223                          StyleConstants.IconElementName);
224        try
225          {
226            getDocument().insertString(getCaret().getDot(), " ", atts);
227          }
228        catch (BadLocationException ex)
229          {
230            AssertionError err = new AssertionError("Unexpected bad location");
231            err.initCause(ex);
232            throw err;
233          }
234    }    }
235    
236    /**    /**

Legend:
Removed from v.1.2.2.4  
changed lines
  Added in v.1.2.2.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26