How to add cut,copy,paste functionality ?

Hello everybody,
I have to add cut,copy,paste functionality to my RichTextEditor for which I have already added
buttons to editors toolbar,Now I want to add these three functionalities to my editor.
Can anyone tell me or provide me some code sample for it ?
Thanks

Well Thank you for your response,What I am looking for is ,the user should be able to copy,cut and paste the selected text anywhere,
(e.g.If user selects the text and clicks the COPY button on the RichTextEditor , he can copy that selected text into notepad or any other editor or any other place in the system)
I have written the code for copy and its working properly
System.setClipboard(richTextEditor.selection.text);
I was wondering how to write the code for cut and paste.
many thanks again

Similar Messages

  • 0 down vote favorite share [fb] share [tw]        How to hide cut/copy/paste/Replace- menu on the UIWebView when it is being displayed over the keyboard.  Detail: I am having a HTML from, having text box, displayed using UIWebView. If user types in text b

    How to hide cut/copy/paste/Replace… menu on the UIWebView when it is being displayed over the keyboard.
    Detail: I am having a HTML from, having text box, displayed using UIWebView. If user types in text box it shows the keyboard. Now If user tap and hold on text box it shows a popup menu. Now while keyboard and pop up are being displayed user scrolls the view. At this time it shows pop up over the keyboard which I need to hide.
    I tried setMenuVisible of UIMenuController when popup rect and keyboard rect intersects each other on viewDidScroll but it didn't help me.
    Any clues will help a lot.
    Thanks.

    You are more likely to get an answer if you post programming problems to the Developer forum. This forum is intended for normal user level problems.

  • How to add Cut,Copy and  Paste

    May not seem as easy as we'd all like to believe in an iPhone.
    It needs to be somewhat intuitive and can not break the existing tap/slide/2-finger-stuff mold.
    So, here's a proposal:
    Tap-and-hold then a second-finger tap could launch a pop-up area which could contain the obvious editing commands (cut, copy, paste) This popup could also contain a round-robin area containing the last 'N' OBJECTs that have been 'copied.'
    I say objects because it would be great if it could hold TEXT, IMAGES, SOUNDS, EMAILs, etc.
    And now we need a nice way to easily "select" such 'objects' ... perhaps that same menu could contain "Begin Select" and "End Select." (Yeah, I know that's really archaic... and only works sorta for TEXT, and makes the popup thing so modal as to be very troublesome.)
    I'd like to hear other's thoughts on this... mabe you guys experimenting with the new SDK can offer up something for CutCopy&Paste ??
    thanks,
    tob

    Here is an easy way (in theory, anyway) to implement text selection:
    Replace volume control button functionality by 'freeze' functionality.
    At least for me volume control buttons are useless, but I would LOVE to have copy-paste. It could be let for user to decide (settings), if he/she wants to use volume button either for volume control or freezing the screen, or this functionality could be made context sensitive: when you are in 'text-mode' (Safari, eMail, etc.) volume control button will work as freeze, when you are in 'phone mode' or 'iPod mode', it acts as volume control. This modification could be made by adjusting OS, no need to add new buttons or other HW changes.
    Using this feature would be simple: if you want to select text, you push 'freeze' button, and then moving your finger in the screen won't scroll it down or sideways but lets you select the text. Selecting text downwards below bottom screen limit could scroll and select text further. When text is selected, clicking the text should pop-up contextual menu with copy-paste, and other relevant commands.
    I have emailed this suggestion to Apple.

  • How To set cut/copy/paste for JtextArea

    Hai
    i could not able to set cut copy paste in JTextArea
    pls help me in this filed..
    thanx.

    This will do...... :)
    private Hashtable actionHash = new Hashtable();
    Action ac[]=new Action[3];
    JButton butt[]=new JButton[3];
    int count=0;
    String ac_names[]={DefaultEditorKit.cutAction,DefaultEditorKit.copyAction,DefaultEditorKit.pasteAction};
    Action[] actions = YourTextPane.getActions();
            for (int i=0; i<actions.length; i++)
                String name = (String)actions.getValue (Action.NAME);
    actionHash.put(name, actions[i]);
    for (int i=0; i<actions.length; i++)
    ac[i] = getHashedAction(ac_names[i]);
    butt[i]=new JButton(ac[i]);
    protected Action getHashedAction(String name) {
    return (Action)actionHash.get(name);

  • How do you cut, copy & paste on an iTouch?

    I can't figure this out. Please help!

    Hello there,
    I would check out pages 27 & 28 of the manual. They provides instructions for copy, pasting, and cutting.
    http://manuals.info.apple.com/enUS/iPod_touch_3.0_UserGuide.pdf
    B-rock

  • My cut/copy/paste functions are not working

    This is making things so difficult to do work and it seems to not be working in any of my programs. How do I solve this?
    I am running Mavericks 10.9.1
    Thanks

    Have you tried rebooting?

  • Enabling/Disabling Cut/Copy/Paste buttons

    Here's today's "Tear My Hair Out" problem.
    I'm working on a data manipulation application, where we will be providing the standard cut/copy/paste functionality. We want to disable the menu items and toolbar buttons if there's nothing selected. I know this is possible, since both JDeveloper and NetBeans do it, but I'm at a loss for a clean way to do it.
    The only thing I can come up with is to add key, mouse, and focus listeners to each text component and check the selection whenever an appropriate event happens which could affect it. Obviously a lot of overhead.
    Anyone know a simpler way to do this?
    Thanks.

    Check out the Clipboard class, and the getSystemClipboard() method in Toolkit (I think).
    If you were to store your data on the system clipboard, like most applications, then you can have a single thread which monitors the state of the clipboard and updates the state of the paste button as and when is appropriate.
    Alternatively, use your own clipboard. Just so long as there is ONE resource which stores all the cut/copy data, and changes the state of the paste button accordingly.
    For the cut/copy actions, you will probably have only one method which carries this out, so have this method update the state of the cut/copy buttons.
    This really is very simple. If it's getting too complicated, you're doing it wrong. Hope this helps.

  • Need Cut/Copy/Paste Actions when Right click on JTextArea,JTextField

    How to Implement Cut/Copy/Paste from Contextmenu in JTextFeilds and JTextAreas.
    Thanks and Regards,
    PavanKrs

    Untested code, may take some massaging to work, but this is the gist of it:
    JPopupMenu popup = new JPopupMenu();
    JMenuItem item = new JMenuItem(new DefaultEditorKit.CutAction());
    item.setText("Cut");
    popup.add(item);
    item = new JMenuItem(new DefaultEditorKit.CopyAction());
    item.setText("Copy");
    popup.add(item);
    item = new JMenuItem(new DefaultEditorKit.PasteAction());
    item.setText("Paste");
    popup.add(item);
    textField.setComponentPopupMenu(popup);

  • Enabling \ Disabling of Cut,Copy,Paste image(.gif) on tollbar,

    Hi,
    I am having one problame in Enabling \ Disabling of Cut,Copy,Paste image(.gif) on tollbar,
    On Mouse Click of component on panel these images should enable\disable( like normal cut,copy,paste function.)
    can any body help me on that.
    Thanx,

    I am having one toolbar in a class and a component in other class and i want to enable & disable cut,copy,paste images in toolbar according to comp id.

  • JTextPane- cut,copy,paste

    hello,
    In a JTextPane how to do cut,copy & paste. The selected text will have different attributes(bold,color etc)
    -anu

    It doesn't work.
    they r just calling JTextComponent's cut ,copy & paste mds. It is working without styles(bold, italic etc..).
    anyway thank u
    -anu

  • How do I reinstall the edit button on my Firefox 4 toolbar; cut, copy, paste, and print?

    I recently have been having problems with my Firefox 4 tool bars. Right now, the Edit icons are no longer on the tool bar, specifically Cut, Copy, Paste, and Print. If there were other Edit icons, they too are gone. All the other icons have remained.
    I would appreciate it if you could advise me how to reinstall those specific icons.
    Also recently, ALL my tool bars, and task and status bar disappeared. This was only in Firefox 4.0; IE 8 was not affected. Clicking F11 did not work. I could not function without them. Then, a short time later, they "automatically" reappeared. I have not idea of why the disappeared or reappeared.
    Thank you for any help you can provide.
    Sanford A. Berman

    You can find the Copy, Paste, and Cut buttons next to Firefox > Edit (and in its sub menu) and in the regular Edit menu on the menu bar (press F10 if the menu bar is hidden).
    The buttons next to Firefox > Edit are enabled if there is something to do with them, just like with the toolbar buttons.
    You can find the Copy, Paste, and Cut toolbar buttons in the toolbar palette in the Customize window and drag them on a toolbar.
    Open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout"
    *http://kb.mozillazine.org/Toolbar_customization
    *https://support.mozilla.com/kb/Back+and+forward+or+other+toolbar+items+are+missing

  • With PS 7  create new  Place two objects on the new file  then you may cut copy and paste Cs2  create new  place two object on the new file Cut is not available how does one cut and paste in new file

    With PS 7
    create new
    Place two objects on the new file
    then you may cut copy and paste
    Cs2
    create new
    place two object on the new file
    Cut is not available how does one cut and paste in new file

    If your using File>Place then photoshop cs2 creates what's known as Smart Objects, which photoshop 7 didn't have.
    In photoshop cs2 you can rasterize the smart objects and that should make the Cut function available.
    Select both placed layers, right click on the area to the right of the tumbnail and select Rasterize Layers.
    If in photoshop cs2 you to Help>Photoshop Help and look under Layers>Smart Objects, that should give you a good overview of what smart objects are.

  • [CS3] How to cut/copy/paste text frame without link

    Hi All,
    Please tell me how I will cut/copy and paste text frame with ignoring or removing links of text frame.
    After copying, the original text frame must contain its link but the newly create text frame should contain any link.
    Thanks,
    Aman Alam

    hey thanks for responding. pasting through text edit works, but if i just copy from the quote block and paste in the top of the message body, it keeps the quote formatting. if i Paste as Quotation, then it double-quotes it--two side bars...
    i guess part of the problem that i just realized, too, is that Mail must convert a message to rich text if you choose to quote text in a reply. because otherwise it could not possibly color the text, right? when i paste out of Mail and into Text Edit, the text color i saw in mail is preserved, meaning the text itself must contain formatting data (rich text).
    is there no way to reply to a mail and include the previous message as a quote without switching to rich text?

  • How to implement copy paste functionality with IE

    Hi Experts,
    I am working on jdev 11.1.1.6.0, I have requirement to implement copy & paste functionality with IE Browser in ADF table. I have followed below link to implement the functionality.
    http://one-size-doesnt-fit-all.blogspot.com/2011/04/aftable-restoring-basic-browser-copy.html
    But copy&functionality is working fine, but when table loading I lost vertical/horizontal scroll bar. Can any one suggest me what is wrong here/what i am missing here.
    My logic:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:c="http://java.sun.com/jsp/jstl/core"
              xmlns:sni="/SNIDeclarativeComponentLib">
      <c:set var="tumuiBundle" value="#{adfBundle['sni.tum.view.TestUIBundle']}"/>
      <af:resource type="javascript">
        var globalLastVisitedField = null;
        function captureTableFieldName()
          return function (evt)
            evt.cancel();
            globalLastVisitedField = evt.getSource();
        function copyMenu(evt)
          if (globalLastVisitedField == null)
            alert("copyMenu() Error: No field could be
                                     identified to be in focus");
          else if (navigator.appName != "Microsoft Internet
                                     Explorer")
            alert("Copy function is only
                                     supported in Microsoft Internet Explorer");
          else
            var txt = globalLastVisitedField.getProperty("ItemValue");
            window.clipboardData.setData('Text', "" + txt);
          evt.cancel();
      </af:resource>
      <af:subform id="f1" defaultCommand="srchcb">
        <af:panelStretchLayout id="psl1" topHeight="auto" bottomHeight="auto"
                               styleClass="AFStretchWidth">
          <f:facet name="center">
            <af:panelCollection id="tab" styleClass="AFStretchWidth">
              <af:table value="#{bindings.TestVO.collectionModel}"
                        var="row"
                        rows="#{bindings.TestVO.rangeSize}"
                        emptyText="#{bindings.TestVO.viewable ? 'No data to display.' : 'Access Denied.'}"
                        fetchSize="#{bindings.TestVO.rangeSize}"
                        rowBandingInterval="1"
                        selectionListener="#{bindings.TestVO.collectionModel.makeCurrent}"
                        rowSelection="multiple"
                        id="Table" styleClass="AFStretchWidth"
                        contentDelivery="immediate">
                <f:facet name="contextMenu">
                  <af:popup id="pMenu" contentDelivery="lazyUncached">
                    <af:menu id="mMenu">
                      <af:commandMenuItem text="Copy" id="cmiCopy">
                        <af:clientListener method="copyMenu" type="action"/>
                      </af:commandMenuItem>
                    </af:menu>
                  </af:popup>
                </f:facet>
                <af:column sortProperty="Name" sortable="true"
                           headerText="#{bindings.TestVO.hints.Name.label}"
                           id="c33">
                  <af:outputText value="#{row.Name}" id="Nam">
                    <af:clientListener method="captureTableFieldName()"
                                       type="contextMenu"></af:clientListener>
                    <af:clientAttribute name="ItemValue"
                                        value="#{row.Name}"></af:clientAttribute>
                  </af:outputText>
       </af:column?
       </af:Table>
    -Thanks.

    Hi,
    I can't tell. What I can tell is that the code in the sample you reference for sure doesn't cause this - but it doesn't help you I guess.
    Btw.: Here is a solution that works on all browsers. The solution in the blog (Chris - please forgive me) is a bit awkward to be honest.
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/012-copy-table-cell-values-169137.pdf
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/tablecellcopypaste-168499.zip
    Frank

  • Jeditor pane cut, copy, paste

    I have an applet using jeditor panes. when you right click a popup shows and you can choose to cut, copy, paste, select all. I use the functions copy, cut, paste, selectAll which jeditorpane inherits. This works properly in java 1.3X but in java 1.41 it is not working. Is there cliboard communication problems with java 1.41?

    Hi dhhyde,
    If you are having issues with your cutting, copying and pasting items from your iPad, you may want to try some things to troubleshoot.
    First, quit all running applications and test again -
    iOS: Force an app to close
    Next, I would try restarting the iPad -
    Turn your iOS device off and on (restart) and reset
    If the issue is still present, you may want to restore the iPad as a new device -
    How to erase your iOS device and then set it up as a new device or restore it from backups
    Thanks for using Apple Support Communities.
    Best,
    Brett L  

Maybe you are looking for