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 |
|
|
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 |
|
|
87 |
{ |
{ |
88 |
super(cutAction); |
super(cutAction); |
89 |
} |
} |
90 |
|
|
91 |
public void actionPerformed(ActionEvent event) |
public void actionPerformed(ActionEvent event) |
92 |
{ |
{ |
93 |
} |
} |
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); |
128 |
{ |
{ |
129 |
super(insertBreakAction); |
super(insertBreakAction); |
130 |
} |
} |
131 |
|
|
132 |
public void actionPerformed(ActionEvent event) |
public void actionPerformed(ActionEvent event) |
133 |
{ |
{ |
134 |
} |
} |
153 |
{ |
{ |
154 |
super(insertTabAction); |
super(insertTabAction); |
155 |
} |
} |
156 |
|
|
157 |
public void actionPerformed(ActionEvent event) |
public void actionPerformed(ActionEvent event) |
158 |
{ |
{ |
159 |
} |
} |
166 |
{ |
{ |
167 |
super(pasteAction); |
super(pasteAction); |
168 |
} |
} |
169 |
|
|
170 |
public void actionPerformed(ActionEvent event) |
public void actionPerformed(ActionEvent event) |
171 |
{ |
{ |
172 |
} |
} |
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 |
} |
} |