Imported GNU Classpath 0.20
Imported GNU Classpath 0.20 * Makefile.am (AM_CPPFLAGS): Add classpath/include. * java/nio/charset/spi/CharsetProvider.java: New override file. * java/security/Security.java: Likewise. * sources.am: Regenerated. * Makefile.in: Likewise. From-SVN: r109831
This commit is contained in:
parent
bcb36c3e02
commit
2127637945
444 changed files with 75778 additions and 30731 deletions
|
@ -38,8 +38,10 @@ exception statement from your version. */
|
|||
|
||||
package javax.swing.text;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -112,8 +114,7 @@ public class DefaultEditorKit extends EditorKit
|
|||
*/
|
||||
public void actionPerformed(ActionEvent event)
|
||||
{
|
||||
// FIXME: Implement me. Tookit.getSystemClipboard should be used
|
||||
// for that.
|
||||
getTextComponent(event).copy();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,8 +145,7 @@ public class DefaultEditorKit extends EditorKit
|
|||
*/
|
||||
public void actionPerformed(ActionEvent event)
|
||||
{
|
||||
// FIXME: Implement me. Tookit.getSystemClipboard should be used
|
||||
// for that.
|
||||
getTextComponent(event).cut();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,8 +174,7 @@ public class DefaultEditorKit extends EditorKit
|
|||
*/
|
||||
public void actionPerformed(ActionEvent event)
|
||||
{
|
||||
// FIXME: Implement me. Tookit.getSystemClipboard should be used
|
||||
// for that.
|
||||
getTextComponent(event).paste();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -216,19 +215,9 @@ public class DefaultEditorKit extends EditorKit
|
|||
return;
|
||||
|
||||
JTextComponent t = getTextComponent(event);
|
||||
if (t != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
t.getDocument().insertString(t.getCaret().getDot(),
|
||||
event.getActionCommand(), null);
|
||||
}
|
||||
catch (BadLocationException be)
|
||||
{
|
||||
// FIXME: we're not authorized to throw this.. swallow it?
|
||||
}
|
||||
}
|
||||
}
|
||||
if (t != null && t.isEnabled() && t.isEditable())
|
||||
t.replaceSelection(event.getActionCommand());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -309,7 +298,8 @@ public class DefaultEditorKit extends EditorKit
|
|||
*/
|
||||
public void actionPerformed(ActionEvent event)
|
||||
{
|
||||
// FIXME: Implement this.
|
||||
JTextComponent t = getTextComponent(event);
|
||||
t.replaceSelection("\t");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -710,6 +700,53 @@ public class DefaultEditorKit extends EditorKit
|
|||
new InsertContentAction(),
|
||||
new InsertTabAction(),
|
||||
new PasteAction(),
|
||||
new TextAction(beginLineAction)
|
||||
{
|
||||
public void actionPerformed(ActionEvent event)
|
||||
{
|
||||
JTextComponent t = getTextComponent(event);
|
||||
try
|
||||
{
|
||||
// TODO: There is a more efficent solution, but
|
||||
// viewToModel doesn't work properly.
|
||||
Point p = t.modelToView(t.getCaret().getDot()).getLocation();
|
||||
int cur = t.getCaretPosition();
|
||||
int y = p.y;
|
||||
while (y == p.y && cur > 0)
|
||||
y = t.modelToView(--cur).getLocation().y;
|
||||
if (cur != 0)
|
||||
cur++;
|
||||
t.setCaretPosition(cur);
|
||||
}
|
||||
catch (BadLocationException ble)
|
||||
{
|
||||
// Do nothing here.
|
||||
}
|
||||
}
|
||||
},
|
||||
new TextAction(endLineAction)
|
||||
{
|
||||
public void actionPerformed(ActionEvent event)
|
||||
{
|
||||
JTextComponent t = getTextComponent(event);
|
||||
try
|
||||
{
|
||||
Point p = t.modelToView(t.getCaret().getDot()).getLocation();
|
||||
int cur = t.getCaretPosition();
|
||||
int y = p.y;
|
||||
int length = t.getDocument().getLength();
|
||||
while (y == p.y && cur < length)
|
||||
y = t.modelToView(++cur).getLocation().y;
|
||||
if (cur != length)
|
||||
cur--;
|
||||
t.setCaretPosition(cur);
|
||||
}
|
||||
catch (BadLocationException ble)
|
||||
{
|
||||
// Nothing to do here
|
||||
}
|
||||
}
|
||||
},
|
||||
new TextAction(deleteNextCharAction)
|
||||
{
|
||||
public void actionPerformed(ActionEvent event)
|
||||
|
@ -911,7 +948,7 @@ public class DefaultEditorKit extends EditorKit
|
|||
content.append("\n");
|
||||
}
|
||||
|
||||
document.insertString(offset, content.toString(),
|
||||
document.insertString(offset, content.substring(0, content.length() - 1),
|
||||
SimpleAttributeSet.EMPTY);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue