精华内容
下载资源
问答
  • Select-and-copy and Undo

    2020-12-06 23:20:59
    <div><p>It looks like that in 2.17.1016.610 a select-and-copy operation takes up a slot in the undo queue. This is weird since it does not modify the text. <p>Steps to reproduce: 1. Open a new file. ...
  • Copy/Paste Undo editor bug

    2020-11-30 11:34:59
    <div><p>Copy and paste something, paste it ...<p>Original thread: <a href="http://community.mybb.com/thread-158872.html">Copy/Paste Undo editor bug</a></p>该提问来源于开源项目:mybb/mybb</p></div>
  • <p>I am noticing somewhat odd behaviour using Undo/Redo that affects the line numbers column, and the save state of the file. <p>Steps to reproduce: <ol><li>Open an existing document.</li><li>Ensure &...
  • <div><p>Fix #1437 Copy/Paste Undo editor bug</p><p>该提问来源于开源项目:mybb/mybb</p></div>
  • <div><p>TAStudio tends to hang for long periods of time (10 minutes to an hour) when using ctrl-z undo or ctrl-c+ctrl-v copy+paste. The hangs don't seem to completely crash the emulator, ...
  • - copy them (click-drag with control pressed) - undo crashes with segmentation fault. <p>EDIT: seems to happen in special occasions only, I try to figure out. What I also found: When undo works, it ...
  • <ul><li>Undo/redo buttons are refreshed after copy-pasting;</li><li>Repeating code is moved into a separate method</li></ul> <h3>Reviewers</h3><p>该提问来源于开源项目:DynamoDS/Dynamo</p></div>
  • package clipborad;import javax.swing.JTextArea;import java.awt.datatransfer.*;import java.awt.*;import javax.swing.*;...import javax.swing.undo.*;import javax.swing.text.*;import javax.s...

    package clipborad;

    import javax.swing.JTextArea;

    import java.awt.datatransfer.*;

    import java.awt.*;

    import javax.swing.*;

    import java.io.*;

    import javax.swing.undo.*;

    import javax.swing.text.*;

    import javax.swing.event.*;

    import java.awt.event.*;

    /**

    * Title: 用JAVA实现Undo、Redo,Copy、Paste、Cut

    * Description:用JAVA实现Undo、Redo,Copy、Paste、Cut

    * Copyright:    Copyright (c) 2001

    * Company:

    * @author: 彭建雄

    * @version 1.0

    */

    public class ClipTextArea extends JTextArea  implements ClipboardOwner{

    Clipboard strBoard = this.getToolkit().getSystemClipboard();

    UndoManager undo = new UndoManager();

    Document doc = getDocument();

    public ClipTextArea() {

    doc.addUndoableEditListener(new UndoableEditListener(){

    public void undoableEditHappened(UndoableEditEvent e) {

    doc_addedit(e);}

    });

    addActionMap();

    }

    public void addActionMap()

    {

    getActionMap().put(“Undo”, new AbstractAction(“Undo”) {

    public void actionPerformed(ActionEvent evt) {

    try {

    if (undo.canUndo()) {

    undo.undo();

    }

    } catch (CannotUndoException e) {

    }

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke(“control Z”), “Undo”);

    getActionMap().put(“Redo”,new AbstractAction(“Redo”) {

    public void actionPerformed(ActionEvent evt) {

    try

    {

    if (undo.canRedo()) {

    undo.redo();

    }

    } catch (CannotRedoException e) {

    }

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke(“control R”), “Redo”);

    getActionMap().put(“Copy”,new AbstractAction(“Copy”) {

    public void actionPerformed(ActionEvent evt) {

    copy();

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke(“control C”), “Copy”);

    getActionMap().put(“Cut”,new AbstractAction(“Cut”) {

    public void actionPerformed(ActionEvent evt) {

    cut();

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke(“control X”), “Cut”);

    getActionMap().put(“Paste”,new AbstractAction(“Paste”) {

    public void actionPerformed(ActionEvent evt) {

    paste();

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke(“control V”), “Paste”);

    }

    public void copy()

    {

    String sCopy = getSelectedText();

    if (sCopy != null)

    {

    StringSelection sSelection = new StringSelection(sCopy);

    strBoard.setContents(sSelection,this);

    }

    }

    public void cut()

    {

    String sCopy = getSelectedText();

    if (sCopy != null)

    {

    StringSelection sSelection = new StringSelection(sCopy);

    strBoard.setContents(sSelection,this);

    this.replaceSelection(“”);

    }

    }

    public void paste()

    {

    Transferable sTransf = strBoard.getContents(this);

    if (sTransf!=null)

    {

    try

    {

    String sPaste = (String)sTransf.getTransferData(DataFlavor.stringFlavor);

    this.replaceRange(sPaste,getSelectionStart(),getSelectionEnd());

    }

    catch(UnsupportedFlavorException e)

    {

    }

    catch(IOException ioe)

    {

    }

    }

    }

    public void lostOwnership(Clipboard clipboard,Transferable contents)

    {

    }

    void doc_addedit(UndoableEditEvent e)

    {

    undo.addEdit(e.getEdit());

    }

    }

    展开全文
  • <div><p>I can not do ... For example - copy, paste, undo a last action. All these and more are not working on the keyboard what can i do?</p><p>该提问来源于开源项目:pencil2d/pencil</p></div>
  • programlover原作package clipborad;import javax.swing.JTextArea;import java.awt.datatransfer.*;import java.awt.*;import javax.swing.*;...import javax.swing.undo.*;http://www.gaodaima.com/64...

    programlover原作

    package clipborad;

    import javax.swing.JTextArea;

    import java.awt.datatransfer.*;

    import java.awt.*;

    import javax.swing.*;

    import java.io.*;

    import javax.swing.undo.*;

    http://www.gaodaima.com/64851.html用JAVA实现Undo、Redo,Copy、Paste、Cut_java

    import javax.swing.text.*;

    import javax.swing.event.*;

    import java.awt.event.*;

    /**

    * Title: 用JAVA实现Undo、Redo,Copy、Paste、Cut

    * Description:用JAVA实现Undo、Redo,Copy、Paste、Cut

    * Copyright: Copyright (c) 2001

    * Company:

    * @author: 彭建雄

    * @version 1.0

    */

    public class ClipTextArea extends JTextArea implements ClipboardOwner{

    Clipboard strBoard = this.getToolkit().getSystemClipboard();

    UndoManager undo = new UndoManager();

    Document doc = getDocument();

    public ClipTextArea() {

    doc.addUndoableEditListener(new UndoableEditListener(){

    public void undoableEditHappened(UndoableEditEvent e) {

    doc_addedit(e);}

    });

    addActionMap();

    }

    public void addActionMap()

    {

    getActionMap().put("Undo", new AbstractAction("Undo") {

    public void actionPerformed(ActionEvent evt) {

    try {

    if (undo.canUndo()) {

    undo.undo();

    }

    } catch (CannotUndoException e) {

    }

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke("control Z"), "Undo");

    getActionMap().put("Redo",new AbstractAction("Redo") {

    public void actionPerformed(ActionEvent evt) {

    try

    {

    if (undo.canRedo()) {

    undo.redo();

    }

    } catch (CannotRedoException e) {

    }

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke("control R"), "Redo");

    getActionMap().put("Copy",new AbstractAction("Copy") {

    public void actionPerformed(ActionEvent evt) {

    copy();

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke("control C"), "Copy");

    getActionMap().put("Cut",new AbstractAction("Cut") {

    public void actionPerformed(ActionEvent evt) {

    cut();

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke("control X"), "Cut");

    getActionMap().put("Paste",new AbstractAction("Paste") {

    public void actionPerformed(ActionEvent evt) {

    paste();

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke("control V"), "Paste");

    }

    public void copy()

    {

    String sCopy = getSelectedText();

    if (sCopy != null)

    {

    StringSelection sSelection = new StringSelection(sCopy);

    strBoard.setContents(sSelection,this);

    }

    }

    public void cut()

    {

    String sCopy = getSelectedText();

    if (sCopy != null)

    {

    StringSelection sSelection = new StringSelection(sCopy);

    strBoard.setContents(sSelection,this);

    this.replaceSelection("");

    }

    }

    public void paste()

    {

    Transferable sTransf = strBoard.getContents(this);

    if (sTransf!=null)

    {

    try

    {

    String sPaste = (String)sTransf.getTransferData(DataFlavor.stringFlavor);

    this.replaceRange(sPaste,getSelectionStart(),getSelectionEnd());

    }

    catch(UnsupportedFlavorException e)

    {

    }

    catch(IOException ioe)

    {

    }

    }

    }

    public void lostOwnership(Clipboard clipboard,Transferable contents)

    {

    }

    void doc_addedit(UndoableEditEvent e)

    {

    undo.addEdit(e.getEdit());

    }

    }

    欢迎大家阅读《用JAVA实现Undo、Redo,Copy、Paste、Cut_java》,跪求各位点评,若觉得好的话请收藏本文,by 搞代码

    e7ce419cf2d6ad34d01da2ceb8829eed.png

    微信 赏一包辣条吧~

    023a57327877fb4402bcc76911ec18ea.png

    支付宝 赏一听可乐吧~

    展开全文
  • <div><p>That leaves this as an texteditor unusable.</p><p>该提问来源于开源项目:capnmidnight/Primrose</p></div>
  • <p>How can we Disable Copy/Paste/Undo/Redo/Drag and Drop in AJAX Chat Text Area completely? <p>For fight against spam, and security? <p>Regards</p><p>该提问来源于开源项目:Frug/AJAX-Chat</p></...
  • <div><p>The keyboard shortcuts on title are unavailable on Mac OS X <p>OS: 10.13.6 (17G65) APP: v1.0.0</p><p>该提问来源于开源项目:dsheiko/puppetry</p></div>
  • The total time spent in the undo action seems to be unchanged on Vermilion. I may be missing something. <p>Also please consider my design decision to allow a second re-draw of the layers panel in the...
  • package clipborad;import javax.swing.JTextArea;import java.awt.datatransfer.*;import java.awt.*;import javax.swing.*;...import javax.swing.undo.*;import javax.swing.text.*;import javax.s...

    package clipborad;

    import javax.swing.JTextArea;

    import java.awt.datatransfer.*;

    import java.awt.*;

    import javax.swing.*;

    import java.io.*;

    import javax.swing.undo.*;

    import javax.swing.text.*;

    import javax.swing.event.*;

    import java.awt.event.*;

    /**

    * Title: 用JAVA实现Undo、Redo,Copy、Paste、Cut

    * Description:用JAVA实现Undo、Redo,Copy、Paste、Cut

    * Copyright:    Copyright (c) 2001

    * Company:

    * @author: 彭建雄

    * @version 1.0

    */

    public class ClipTextArea extends JTextArea  implements ClipboardOwner{

    Clipboard strBoard = this.getToolkit().getSystemClipboard();

    UndoManager undo = new UndoManager();

    Document doc = getDocument();

    public ClipTextArea() {

    doc.addUndoableEditListener(new UndoableEditListener(){

    public void undoableEditHappened(UndoableEditEvent e) {

    doc_addedit(e);}

    });

    addActionMap();

    }

    public void addActionMap()

    {

    getActionMap().put("Undo", new AbstractAction("Undo") {

    public void actionPerformed(ActionEvent evt) {

    try {

    if (undo.canUndo()) {

    undo.undo();

    }

    } catch (CannotUndoException e) {

    }

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke("control Z"), "Undo");

    getActionMap().put("Redo",new AbstractAction("Redo") {

    public void actionPerformed(ActionEvent evt) {

    try

    {

    if (undo.canRedo()) {

    undo.redo();

    }

    } catch (CannotRedoException e) {

    }

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke("control R"), "Redo");

    getActionMap().put("Copy",new AbstractAction("Copy") {

    public void actionPerformed(ActionEvent evt) {

    copy();

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke("control C"), "Copy");

    getActionMap().put("Cut",new AbstractAction("Cut") {

    public void actionPerformed(ActionEvent evt) {

    cut();

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke("control X"), "Cut");

    getActionMap().put("Paste",new AbstractAction("Paste") {

    public void actionPerformed(ActionEvent evt) {

    paste();

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke("control V"), "Paste");

    }

    public void copy()

    {

    String sCopy = getSelectedText();

    if (sCopy != null)

    {

    StringSelection sSelection = new StringSelection(sCopy);

    strBoard.setContents(sSelection,this);

    }

    }

    public void cut()

    {

    String sCopy = getSelectedText();

    if (sCopy != null)

    {

    StringSelection sSelection = new StringSelection(sCopy);

    strBoard.setContents(sSelection,this);

    this.replaceSelection("");

    }

    }

    public void paste()

    {

    Transferable sTransf = strBoard.getContents(this);

    if (sTransf!=null)

    {

    try

    {

    String sPaste = (String)sTransf.getTransferData(DataFlavor.stringFlavor);

    this.replaceRange(sPaste,getSelectionStart(),getSelectionEnd());

    }

    catch(UnsupportedFlavorException e)

    {

    }

    catch(IOException ioe)

    {

    }

    }

    }

    public void lostOwnership(Clipboard clipboard,Transferable contents)

    {

    }

    void doc_addedit(UndoableEditEvent e)

    {

    undo.addEdit(e.getEdit());

    }

    }

    down_info.asp?id=6113

    展开全文
  • 用JAVA实现Undo、Redo,Copy、Paste、Cut (转)[@more@]package clipborad;import x..JTextArea;import java.awt.datatraner.*;import java.awt.*;import javax.swing.*;import java.io.*;import javax.swing.undo.*;...

    用JAVA实现Undo、Redo,Copy、Paste、Cut (转)[@more@]

    package clipborad;

    import x..JTextArea;

    import java.awt.datatraner.*;

    import java.awt.*;

    import javax.swing.*;

    import java.io.*;

    import javax.swing.undo.*;

    import javax.swing.text.*;

    import javax.swing.event.*;

    import java.awt.event.*;

    /**

    * Title: 用JAVA实现Undo、Redo,Copy、Paste、Cut

    * Description:用JAVA实现Undo、Redo,Copy、Paste、Cut

    * Copyright:  Copyright (c) 2001

    * Company:

    * @author: 彭建雄

    * @version 1.0

    */

    public class ClipTextArea extends JTextArea  implements ClipboardOwner{

    Clipboard strBoard = this.getToolkit().getSystemClipboard();

    Unanager undo = new UndoManager();

    Document doc = getDocument();

    public ClipTextArea() {

    doc.addUndoableEditListener(new UndoableEditListener(){

    public void undoableEditHappened(UndoableEditEvent e) {

    doc_addedit(e);}

    });

    addActionMap();

    }

    public void addActionMap()

    {

    getActionMap().put("Undo", new AbstractAction("Undo") {

    public void actionPerformed(ActionEvent evt) {

    try {

    if (undo.canUndo()) {

    undo.undo();

    }

    } catch (CannotUndoException e) {

    }

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke("control Z"), "Undo");

    getActionMap().put("Redo",new AbstractAction("Redo") {

    public void actionPerformed(ActionEvent evt) {

    try

    {

    if (undo.canRedo()) {

    undo.redo();

    }

    } catch (CannotRedoException e) {

    }

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke("control R"), "Redo");

    getActionMap().put("Copy",new AbstractAction("Copy") {

    public void actionPerformed(ActionEvent evt) {

    copy();

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke("control C"), "Copy");

    getActionMap().put("Cut",new AbstractAction("Cut") {

    public void actionPerformed(ActionEvent evt) {

    cut();

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke("control X"), "Cut");

    getActionMap().put("Paste",new AbstractAction("Paste") {

    public void actionPerformed(ActionEvent evt) {

    paste();

    }

    });

    getInputMap().put(KeyStroke.getKeyStroke("control V"), "Paste");

    }

    public void copy()

    {

    String py = getedText();

    if (sCopy != null)

    {

    StringSelection sSelection = new StringSelection(sCopy);

    strBoard.setContents(sSelection,this);

    }

    }

    public void cut()

    {

    String sCopy = getSelectedText();

    if (sCopy != null)

    {

    StringSelection sSelection = new StringSelection(sCopy);

    strBoard.setContents(sSelection,this);

    this.replaceSelection("");

    }

    }

    public void paste()

    {

    Transferable sTransf = strBoard.getContents(this);

    if (sTransf!=null)

    {

    try

    {

    String sPaste = (String)sTransf.getTransferData(DataFlavor.stringFlavor);

    this.replaceRange(sPaste,getSelectionStart(),getSelectionEnd());

    }

    catch(UnsupportedFlavorException e)

    {

    }

    catch(IOException ioe)

    {

    }

    }

    }

    public void lostOwnership(Clipboard clipboard,Transferable contents)

    {

    }

    void doc_addedit(UndoableEditEvent e)

    {

    undo.addEdit(e.getEdit());

    }

    }

    展开全文
  • <div><h1>Bug report for ... redo: Does not clean up certain blocks from the paste when doing //undo - however, going one more //undo and then a //redo puts the object in it's expected state ...
  • package clipborad;import javax.swing.JTextArea;import java.awt.datatransfer.*;import java.awt.*;import javax.swing.*;...import javax.swing.undo.*;import javax.swing.text.*;import javax.s...
  • <div><p>Previously app did not allow you to copy and paste and other standard keyboard shortcuts on Mac. It now does. </p><p>该提问来源于开源项目:eNkru/freelook</p></div>
  • <div><p>😄 Any thoughts about this?</p><p>该提问来源于开源项目:ppizarror/pygame-menu</p></div>
  • Undo3

    2020-12-02 12:02:31
    <p>To understand these numbers: Undo buffer maintains diffs, which is usually 1-2 line object per undo, and a top, which is a copy of the entire screenplay. With a big enough script, the memory ...
  • Board undo

    2020-12-30 20:05:44
    undo() on the same board gives a nice boost compared to board_copy() + board_play() (~10% on x64, 20% on x86 iirc). Middle ladder reader especially benefits a lot, i've see x6 / x12 speedups ...
  • <div><p><img alt="DeepinScreenshot_select-area_20200327001555" src="https://user-images.githubusercontent.com/22892227/77697591-31e95280-6fc0-11ea-8497-118af58e80d3.png" /></p>该提问来源于开源项目&#...
  • Now copy history image (image2)(I did a ctrl_shift+c and did not change any checkboxes) ctrl+v on image 1. See changes are applied and history shows the changes and the crop initially done on ...
  • 用JAVA实现Undo、Redo,Copy、Paste、Cut (转)[@more@]package clipborad; import Javax.swing.JTextArea;import java.awt.datatr...
  • This way, commands like Undo can be overridden by CodeMirror when an editor has focus, but fall through to the default implementation when a text field has focus. <p>This pull request also fixes menu...
  • upgrade undo

    2021-01-11 18:30:57
    history and a copy of dev->iop, and when is done it replaces it. <p>It handles the delete of modules on dev->iop, that have to be done when the user undo a new multi-instance or redo a delete ...
  • 1. copy and paste yy : copy 光标所在的行 nyy: copy n line yw: copy 光标所在的单词 nyw: copy 光标所在位置到其后的n 个单词(未必是同一行) y$: copy 光标所在位置到行尾($是行尾的标示) ny$: copy 光标所在位置...
  • 用JAVA实现Undo、Redo,Copy、Paste、Cut

    千次阅读 2001-10-16 18:20:00
    package clipborad;import javax.swing.JTextArea;import java.awt.datatransfer.*;import java.awt.*;import javax.swing.*;...import javax.swing.undo.*;import javax.swing.text.*;import javax

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 693
精华内容 277
关键字:

copyundo