/[classpath]/classpath/javax/swing/text/DefaultEditorKit.java
ViewVC logotype

Diff of /classpath/javax/swing/text/DefaultEditorKit.java

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

revision 1.10 by mkoch, Fri Oct 22 12:44:01 2004 UTC revision 1.11 by mkoch, Mon Jan 10 18:16:15 2005 UTC
# Line 1  Line 1 
1  /* DefaultEditorKit.java --  /* DefaultEditorKit.java --
2     Copyright (C) 2002, 2004 Free Software Foundation, Inc.     Copyright (C) 2002, 2004, 2005  Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 40  package javax.swing.text; Line 40  package javax.swing.text;
40    
41  import java.awt.Toolkit;  import java.awt.Toolkit;
42  import java.awt.event.ActionEvent;  import java.awt.event.ActionEvent;
43    import java.io.BufferedReader;
44  import java.io.IOException;  import java.io.IOException;
45  import java.io.InputStream;  import java.io.InputStream;
46    import java.io.InputStreamReader;
47  import java.io.OutputStream;  import java.io.OutputStream;
48    import java.io.OutputStreamWriter;
49  import java.io.Reader;  import java.io.Reader;
50  import java.io.Writer;  import java.io.Writer;
51    
# Line 84  public class DefaultEditorKit extends Ed Line 87  public class DefaultEditorKit extends Ed
87      {      {
88        super(cutAction);        super(cutAction);
89      }      }
90    
91      public void actionPerformed(ActionEvent event)      public void actionPerformed(ActionEvent event)
92      {      {
93      }      }
# Line 96  public class DefaultEditorKit extends Ed Line 100  public class DefaultEditorKit extends Ed
100      {      {
101        super(defaultKeyTypedAction);        super(defaultKeyTypedAction);
102      }      }
103    
104      public void actionPerformed(ActionEvent event)      public void actionPerformed(ActionEvent event)
105      {      {
106        JTextComponent t = getTextComponent(event);        JTextComponent t = getTextComponent(event);
# Line 123  public class DefaultEditorKit extends Ed Line 128  public class DefaultEditorKit extends Ed
128      {      {
129        super(insertBreakAction);        super(insertBreakAction);
130      }      }
131    
132      public void actionPerformed(ActionEvent event)      public void actionPerformed(ActionEvent event)
133      {      {
134      }      }
# Line 147  public class DefaultEditorKit extends Ed Line 153  public class DefaultEditorKit extends Ed
153      {      {
154        super(insertTabAction);        super(insertTabAction);
155      }      }
156    
157      public void actionPerformed(ActionEvent event)      public void actionPerformed(ActionEvent event)
158      {      {
159      }      }
# Line 159  public class DefaultEditorKit extends Ed Line 166  public class DefaultEditorKit extends Ed
166      {      {
167        super(pasteAction);        super(pasteAction);
168      }      }
169    
170      public void actionPerformed(ActionEvent event)      public void actionPerformed(ActionEvent event)
171      {      {
172      }      }
# Line 364  public class DefaultEditorKit extends Ed Line 372  public class DefaultEditorKit extends Ed
372      return null;      return null;
373    }    }
374    
375    public void read(InputStream in, Document doc, int pos)    public void read(InputStream in, Document document, int offset)
376      throws BadLocationException, IOException      throws BadLocationException, IOException
377    {    {
378        read(new InputStreamReader(in), document, offset);
379    }    }
380    
381    public void read(Reader in, Document doc, int pos)    public void read(Reader in, Document document, int offset)
382      throws BadLocationException, IOException      throws BadLocationException, IOException
383    {    {
384        BufferedReader reader = new BufferedReader(in);
385    
386        String line;
387        StringBuffer content = new StringBuffer();
388    
389        while ((line = reader.readLine()) != null)
390          content.append(line);
391        
392        document.insertString(offset, content.toString(),
393                              SimpleAttributeSet.EMPTY);
394    }    }
395    
396    public void write(OutputStream out, Document doc, int pos, int len)    public void write(OutputStream out, Document document, int offset, int len)
397      throws BadLocationException, IOException      throws BadLocationException, IOException
398    {    {
399        write(new OutputStreamWriter(out), document, offset, len);
400    }    }
401    
402    public void write(Writer out, Document doc, int pos, int len)    public void write(Writer out, Document document, int offset, int len)
403      throws BadLocationException, IOException      throws BadLocationException, IOException
404    {    {
405    }    }

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

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