JEditorPane: how to replace small parts of the document?

Hi
Im trying to create an application that will allow two people to type into two different JEditorPanes, but have the two people essentially editing the same document. So if one person types someting into thier frame, I want that modification sent to the other frame as well.
The problem I've come across is how to make changes to the contents of the frame without interfering with the person whos trying to type into it. That problem boils down to how do you replace only a small part of the document whithout taking control of the users caret?

Hopfully I got your problem right. To change only small parts of the EditorPane's document should not be the probelm you can get it with EditorPane.getDocument(). But I think you have to take control over the caret, because the when user 1 has finished editing and sends the doc to user 2 who is editing the doc, user 2's caret position will change because the document length has changed.
The easiest way would be to add an input area (TextArea) for each user where they can type theit text and than to add the text into the document when they press enter, so you don't have the trouble with te caret position. If you don't want to do this then you could try that: the input of the users is cached while they are typing (not changing the doc) till they press enter. Then the doc is send to the other user, the users doc in the pane is updated and his current typing is added to the end of the new received doc. You can figure out the correct position by doc.getLength() and set the new caret position to doc.length + currentTyping.length
Hope that helps
Eryk

Similar Messages

  • How to set only part of the document as "read-only"?

    Hi,
    I am using SharePoint 2010. I would like to set some of the columns as "read-only" while some of them are still editable. If I use Advanced Settigns>Item-Level Permissions, I can only set the whole document as "read-only".
    Is there a way I can do what I wannt?
    Thanks a lot!

    Hi,
     There is no OOTB way to set a column as read-only.  I think you want to make some of the fields as Read-Only in the EditForm.aspx. If so, then you can use the Javascript to do. 
    Add a Content editor webpart to the Editform.aspx page and place the javascript method to make a field read-only.
    You can use the _spBodyOnLoadFunctionNames.push("MakeReadOnly()") method to assocaite your method to the EditForm.
    Here are the links which will help you.
    http://dishasharepointworld.blogspot.in/2011/08/read-only-field-in-sharepoint.html
    http://nishantrana.wordpress.com/2009/01/30/read-only-field-in-sharepoint-editformaspx/
    http://www.jbmurphy.com/2010/06/01/how-to-make-a-field-in-a-sharepoint-edit-form-readonly/
    *******Don't forgot to MARK AS ANSWER / VOTE AS HELPFUL if it really helps************
    R.Mani http://rmanimaran.wordpress.com

  • When previewing images by clicking on the thumbnail in an Event for example, I've been finding that many images preview in a 'zoomed in' way so only a small part of the photos is previewed in a highly magnified view.

    When previewing images by clicking on the thumbnail in an Event for example, I've been finding that many images preview in a 'zoomed in' way so only a small part of the photos is previewed in a highly magnified view.
    Initially I could find no cause. Then I tried right click - Edit and on the affected images, always get this warning:
    "Image Cannot Be Edited - This photo was previously edited with another application or with an early version of Iphoto. Duplicate this photo to edit it." and a "Duplicate To Edit" Button is displayed. 
    The external Editor defined for iPhoto is Adobe Photoshop Elements.
    Now, I reckon the MUST be others out there affected by this same apparent Preview bug, yet my searches have not revealed any answers.  Also seems impossible to find a contact number for adobe???
    Thanks

    Start '''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Firefox in Safe Mode]''' {web Link} by holding down the '''<Shift ''(Mac Options)'' >''' key, and then starting Firefox. Is the problem still there?

  • I have adobe illustrator CS5. When I save a document as a pdf and open it again later to edit Adobe reader can't read the whole document because it only shows part of the document. It is very frustrating. How can I fix this?

    I have adobe illustrator CS5. When I save a document as a pdf and open it again later to edit Adobe reader can't read the whole document because it only shows part of the document. It is very frustrating. How can I fix this?

    keokipineapples schrieb:
    I do have all of my files I am working on located on an external drive. I plan to transfer them directly to the hard drive
    Transfer them to your harddisk immediately.
    External drives are not offiially supported and the source of errors of all kinds including complete loss of files.
    Illustrator support for networks and removable media

  • How can I put part od the iTunes music library of iTunes music on an external drive in order to free up disk space?

    How can I put part od the iTunes music library of iTunes music on an external drive in order to free up disk space?

    see this
    http://support.apple.com/kb/HT4527
    http://support.apple.com/kb/HT1364
    Peace, Clyde

  • Periodically my safari (on various web sites) becomes "unclickable" or only a small part of the clickable object causes a click to be possible. Any solutions?

    Periodically my safari (on various web sites) becomes "unclickable" or only a small part of the clickable object causes a click to be possible. Any solutions?

    Periodically my safari (on various web sites) becomes "unclickable" or only a small part of the clickable object causes a click to be possible. Any solutions?

  • Oversize documents being rendered with parts of the document cut off due to the large size

    We are invoking web services on LiveCycle Server ES 8.2 to convert non pdf documents to pdf. We noticed that oversized documents are rendered with parts of it cut off when submitted for conversion.
    Has anyone seen this before and how we can resolve this?
    Thanks in advance.

    The oversized file issue happens when we try to convert legal size documents. Part of the document is cut off.
    Any documents wider than 8 and 1/2 by 11 has this issues.

  • When I share a pages document as a PDF (via e-mail) all the pictures change from the original document, most are missing with just a few of them repeated in the spots where others had been.  How do I do this without the document changing?

    When I share a pages document as a PDF (via e-mail) all the pictures change from the original document, most are missing with just a few of them repeated in the spots where others had been.  How do I do this without the document changing?
    I need to be able to send it to a PC in order to print it.

    Hard to say what is happening without examining the file.
    If you like click on my blue name and email me both the .pages file and the the .pdf you have made from it.
    Peter
    ps It would help to say what version of Pages you are using and on what you are running it. iOS or Mac and what version.

  • I am using Adobe XI Pro and in various parts of the document there is brown / biege lettering when on the document it shows as black.  My printer guy has been in and checked it out top to bottom and that part is fine.  I have tried to print the same docum

    I am using Adobe XI Pro and in various parts of the document there is brown / biege lettering when on the document it shows as black.  My printer guy has been in and checked it out top to bottom and that part is fine.  I have tried to print the same document and it comes out fine.  Any ideas ?   Using Windows 7 Service Pack 1

    Sorry my bad.  I have tried to print the same document on another printer and all the formatting is fine. 

  • How to configure which changes in the document triggers Event Handler again

    Hi Experts
    Due to some reason after creation of Purchase Order, the event handler is not created in EM system. Now is there any way to resend this PO to EM? For example, is it possible to trigger Event Handler by changing some field in PO? If it is possible that way, Could you guide how to configure which changes in the document (PO/SO/Delivery/Shipment) can trigger Event Handler in EM system?
    Thanks
    Ravi

    Hello Ravi,
    if you change the PO Header/Item the respective EH  should be created if the Relevance condition is fullfilled.
    I'm not sure if it also works in the case that you change the PO Header and EH for PO Items will be created.
    Best regards,
    Steffen

  • XPath+XSLT: Re-adding parts of the document after XPath eval. (fragment)

    Hello all,
    Sorry, I know that this is not strictly a Java related problem, but who knows if there are standard API functions for that...
    Imagine this simple XML document:
    <document>
       <meta>
         [some deeper structs]
       </meta>
       <content>
          <chapter id="1">
          </chapter>
          <chapter id="2">
          </chapter>
          <chapter id="3">
          </chapter>
       </content>
    </document>Normally, I transform the entire document via XSLT e.g. to XHTML. But if I want just to extract e.g. the first chapter using XPath evaluation, I do not have other "static" parts of the document, e.g. the meta part or the document root.
    Currently, I am adding this very complicated by having the XPath evaluation as a string and by prepending and appending the "static" part in order to have a fully working XSL transformation (e.g. "<document><meta>[...]</meta><content>" + xpathEval + "</content></document>")...
    Are there any best practises? I think using XPath is very nice for this kind but maybe the wrong way and I should filter another way? Hope there is an elegant way whith sticking to XPath though...
    Thanks and regards,
    Timo

    Rehi DrClap,
    Thanks for your reply.
    Yes, that is pretty fine, but the problem is that I have some "static" parts like the "meta" tree are outside the "chapter n" tree.
    And just selecting for my chapter will result in just that tree but not the entire document pattern including the document root and the meta part.
    XSLT being more SAX'ish, I think I have to rebuild my document using DOM in a way that I do some consecutive XPath selections like for meta and chapter, create the root node, append them and then XSL transform that new document. However, that are much steps and not good for larger documents.
    Thx and regards,
    Timo

  • I created a magazine using a IDD template including bleeds. When I exported to make a PDF, it cut off part of the document when uploading for printing. When I incude bleeds, it makes the document too big for printing. I need help :)

    I created a magazine using a template including bleeds. When I exported to make a PDF, it cut off part of the document when uploading for printing. When I incude bleeds, it makes the document too big for printing. I need help

    eehenry wrote:
    It is a problem with a secondary provider, "mag cloud" .
    Right, so to advise you we'd need to know the particulars of MagCloud's spec for your project; format, trim size, bleed, etc.
    It's doubtful that anything happened "when uploading for printing," so long as you were uploading a PDF, as opposed to the native InDesign file. Did the PDF look right to you before uploading?

  • I am having trouble printing  and am only getting part of the document which i have no margins set any help??

    i am having trouble printing  and am only getting part of the document  i have no margins set any help??

    What version of Pages?
    What Printer?
    If it is Pages '09, turn Comments off.
    Peter

  • Show part of the document

    For example, I have the following document:
    <url> http://www.abc.com </url>
    <headline> A headline for this article </headline>
    <pub_date> 20001208 </pub_date>
    <text>
    This is a document content
    </text>
    I know that I can use session (field) for the tags.
    Can I compare the content of <pub_date> with the query.
    Can I retrive part of the document, say, just the <text> content only?
    Thanks

    Hi,
    Could you tell me what version of Word are you using?
    Templates (including Normal.dot) are stored in C:\Documents and Settings\user name\Application Data\Microsoft\Templates.
    It’s possible that normal.dot file under your profile is corrupted. You can copy the normal.dot file under the normal profile to your store path.
    If there is anything else that I can do for you regarding this issue, feel free to post back.
    Best regards,
    Greta Ge
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • How can I select only a small part of the image to clone or edit etc?

    I want to select part of the image to clone is, and just edit the selected part. I know i can do this on photoshop but how do i do it on Aperture?

    You use the "Retouche" brush in Aperture and set it to "clone".
    Option-Click on the location you want to clone from to select a source, and then brush over the location where you want to clone to. The cloned region will follow the shape of the brushed area. You do not lasso the shape to to copy and paste it like in Photoshop.
    For example: Duplicating a penguin: The sourcepoint has been set to the beak of the second penguin, and then I brushed along the path where I want to penguin clone to appear.
    If I brush the whole area eventually the penguin will be copied completely. You'll have to experiment a bit with the brush size and softnees to ensure that the cloned object will blend in.
    Regards
    Léonie

Maybe you are looking for