Need help in Insertion of Element in DefaultStyledDocument

Hello:
I am developing an XML editor by extending the DefaultStyledDocument of javax.swing.text package. I am not able to insert an element in the document.
This is what I have done: (I need to insert one BranchElement, with two leaf child elements.)
I inserted the text in the document corresponding to the first child element using insertString() method. In the insertUpdate() method of the document, I am creating the branch element and its first child covering the inserted text. I then call the insertUpdate() method of DefaultStyledDocument. Similarly, I insert text corresponding to the second child and modify the element structure inside insertUpdate() and then call the insertUpdate() of DefaultStyledDocument().
At the end of the execution, the element structure is okay, but all the inserted text also becomes a part of the previous element.
for example,
if I have the following element structure at the beginning: (element offsets are in the square brackets besides their names, child elements are indented.)
html [0 2]
start-leaf [0 1]
end-leaf [1 2]
and I insert body at position 1 with its two children (each of length 1)
I get the following element structure:
html [0 4]
start-leaf [0 3] //why this?
body [1 3]
start-leaf[1 3] //why this instead of [1 2]?
end-leaf [2 3]
end-leaf [3 4]
And, I am not able to see the Views corresponding to the inserted elements.
(I tried without modifying the element structure explicitely, but it doesn't work that way.Also, I am able to remove elements from the document. In that case also I am following a similar logic: remove the data from the document using remove() method and modify the element structure inside removeUpdate(). and it seems to work fine.)
Can anyone please help me understand why this is happening?
Thanks a lot!

like this ??
SQL> Create Table t1
  2  (a Number,
  3   b Number);
Table created
SQL>  Create Table t2
  2  (a Number,
  3   b Number,
  4   c Number Not Null);
Table created
SQL>  Insert Into t1 Values (1,2);
1 row inserted
SQL> commit;
Commit complete
SQL>  Insert Into t2 Select t.*,3 From t1 t;
1 row inserted
SQL> commit;
Commit complete
SQL> select * from t1;
         A          B
         1          2
SQL> select * from t2;
         A          B          C
         1          2          3
SQL> hope this helps you

Similar Messages

  • Need Help in Inserting first ever record

    I need help in inserting my first ever record from an OAF page.
    I've created an AM 'MasterAM', added 'MasterVO' to it. Created a Page CreatePG which has a submit button, id = Apply
    Below is processRequest of CreateCo
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (!pageContext.isFormSubmission()) {
    am.invokeMethod("createRecord", null);
    and below is processFormRequest
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("Apply") != null)
    OAViewObject vo = (OAViewObject)am.findViewObject("MasterVO1");
    am.invokeMethod("apply");
    pageContext.forwardImmediately("OA.jsp?page=/abcd/oracle/apps/per/selfservice/xxdemo/webui/CreatePG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    Below are 'createRecord' and 'apply' in MasterAMImpl
    public void createRecord(){
    OAViewObject vo = (OAViewObject)getMasterVO1();
    if (!vo.isPreparedForExecution()) {
    vo.executeQuery();
    Row row = vo.createRow();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    public void apply() {
    getTransaction().commit();
    When I run the page, it opens and I try to enter some data and press Apply. it does not insert into the table.
    Could anyone help me out.
    My jdeveloper version is 10.1.3.3.0.3

    I am facing the same issue.
    rows get inserted into the tbale, but only whol columns have the data.
    all the attributes are correctly mapped to view instance and view attribute.
    My VO has 1 EO and , i have joined another table to get desctriptions of the field.
    could that be the problem ?
    ex :
    select item , desc
    from t , master
    where t.cola=master.colb
    table t is the custom table I want the data to go in. but only who columns appear after commiting.
    any clues ?

  • I need help in Downloading Adobe Elements for my Mac & Adobe Acrobat for my laptop...I have been battling for the last day.

    I need help in Downloading Adobe Elements for my Mac & Adobe Acrobat for my laptop...I have been battling for the last day.

    ~graffiti wrote:
    PjonesCET wrote:
    I know if you attempt to download and exe file to Mac from a Mac Partition you'll get something like. Cannot not understand file format octet-stream. This means it does not recognize MS execute files.
    Not necesarily. I've done it a few times.
    PjonesCET wrote:
    I'm not sure you can download a PC copy of Acrobat 9 unless you operating from bootcamp or other such application and running the PC partition.
    Yes. You can.
    I've learned something. New. This must be recently changed. That last time I clicked on a Link I though was a dmg file and turned out it was and exe file my Macs wouldn't allow me to do so. But haven't tried recently everytime and exe file comes up I cancel. I gues I am used to the time everytime a Virus or some other nasty was downloaded it was packaged in and exe file and Macs owuldn't allow it. I suppose with the INtel guts now they can no longer refuse to download.

  • Need help retrieving my photoshop elements 2.0 due to virus scan removing it

    need help retrieving my photoshop elements 2.0 due to virus scan removing it - i have everything removed from scan in quarantine but have no idea which  one is what i need to reverse and allow my photoshop elements 2.0 (old version, I know, but I love it) to work again

    Use the anti-virus program to reverse everything it quarantined and in future ensure the anti-virus program settings let you check and decide what items to quarantine and what to ignore. Letting an anti-virus program quarantine things automatically is a recipe for disaster.
    You could also check if you have a System Restore point from before the anti-virus run.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children
    If this post or another user's post resolves the original issue, please mark the posts as correct and/or helpful accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks.

  • Need help with Adobe Premiere Elements 2

    I can drag a large high rez jpeg into timeline. Then when I click to playback....it gets more pixelated. That's a bad beginning. Then, when I go to export it, I've tried several extensions. All look bad during playback on YouTube. This should be pretty simple. High quality jpeg, but is fuzzy in movie. What's going wrong?

    hi Bill -
    ok fine. I have PSDs too. I tried what you said.
    I put a PSD right beside a JPEG in the timeline. I rendered it (which I
    didn't know to do because the instructions don't even mention it. The
    instructions are terrible. Seems it leaves out a lot of info.)
    So, then I click PLAY on my monitor. I see no difference between the PSD
    and the JPEG yet. So, if I want to put this on YouTube, what's the best way
    exactly, without gettting too technical?  It looks like I have the choice
    between Exporting in Mpeg or Quicktime or Windows Media. I think youtube
    likes wmv.
    From: Bill Hunt <[email protected]>
    To: Tommy Midyette <[email protected]>
    Date: 6/3/2010 10:01:24 AM
    Subject: need help with Adobe Premiere Elements 2
    >
    When you drag the stills to the Timeline, there should be a red line
    above them. Press Enter to Render the Timeline.
     
    Do not know the particulars of PrE 2, but in later versions, you can
    Rt-click on the Program Monitor, and choose Magnification = 100%, rather
    than Fit. You might have to resize your Program Monitor, but check at 100%.
     
    Also remember a few points:
     
    1.) You are looking at a DVD-quality image now, and that was designed
    with low-rez CRT TV's in mind, and NOT hi-rez computer monitors. DVD vs
    hi-rez sources and displays is probably less than what VHS vs DVD was, not
    that long ago.
    2.) You are looking at an emulation, a preview
    3.) Your images have already been compressed to JPEG once, loosing
    quality. That is why I always work in PSD, especially if there has already
    been one JPEG compression, whether in camera, or in the image processing
    stage. I keep JPEG either out of my workflow, or as limited, as is
    possible. Some do not see the quality loss with JPEG compression, but I do,
    and if I can create images that are as good as it gets, I know that my
    clients will be happy.
     
    Good luck,
     
    Hunt
    >

  • I need help installing Adobe photoshope elements 12

    I need help downloading adobe photoshop elements 12

    HI Marlene McGann
    Download it from below link : http://prodesigntools.com/photoshop-elements-12-direct-download-links-premiere.html
    Follow the Important instructions given on the page to start your download.
    Use your serial key to activate it.
    ~Mandy

  • I need help to deactivate Photoshop elements. But my old computer is broken.

    I need help to deactivate Photoshop elements. But my old computer is broken.

    I've not done it, but I understand that Adobe can fix it for you here:
    Contact Customer Care

  • Need Help with Inserting Timeline Markers

    Friends,
    I have not use my premiere element 3.2 since 2008 and forgot some of the procedures. now, I need help with the insertion of Timeline Markers. I did what the Help Page showed me. But the markers were not effective in the resulting DVD, or, even when viewing the video in the editing page as if thye were not there! Here is what I did:.
    1)  Click the Timeline button.
    2)  Click in an empty space in a video or audio track in the Timeline to make the Timeline active and deselect any clips.
    3)  Move the current-time indicator in the Timeline to the frame where I need the marker.
    4)  Click the Add Marker icon in the Timeline to place the Marker 5 times where I want them.
    5)  Verified that each Timeline Marker is present at the intended place.
    6)  Burned DVD
    7)  Can NOT jump to any of the intended Marker in the Resulting DVD during playback.
    The question is "What did I do wrong or didn't do?" It seems that I did the same before and worked! Please advise!
    Also, what are the significance of the Red line just below the Timeline and the yellow bars inside the video and audio frames. But after preforming Timeline/Render Work Area, they were all gone? What purposes do they serve and what is the significance of Rendering? Thank you for your help!
    I repeat the process and did a Rendering before making the DVD also. It did not help!
    Andy Lim

    Steve,
    Long time no talk! You used to help me out many times when the PE-1 through PE-3 came out. I was HOPING you would still be around and you are! You came through again this time! Many thanks to you.
    I use the Add DVD Scene button to insert the Markers. They are Green. Made a DVD and the markers work OK although ythey are "effective" during play back using the editing window.
    While that problem was solved, will you come back and answer the other two questions concerning Rendering and the Red/Yellow lines? I would appreciate it very much!
    Andy Lim
    ~~~~~~~~~~~~~~~~

  • Need help with INSERT and WITH clause

    I wrote sql statement which correctly work, but how i use this statment with INSERT query? NEED HELP. when i wrote insert i see error "ORA 32034: unsupported use of with clause"
    with t1 as(
    select a.budat,a.monat as period,b.vtweg,
    c.gjahr,c.buzei,c.shkzg,c.hkont, c.prctr,
    c.wrbtr,
    c.matnr,
    c.menge,
    a.monat,
    c.zuonr
    from ldw_v1.BKPF a,ldw_v1.vbrk b, ldw_v1.bseg c
    where a.AWTYP='VBRK' and a.BLART='RV' and a.BUKRS='8431' and a.awkey=b.vbeln
    and a.bukrs=c.bukrs and a.belnr=c.belnr and a.gjahr=c.gjahr and c.koart='D'
    and c.ktosl is null and c.gsber='4466' and a.gjahr>='2011' and b.vtweg='01'
    ,t2 as(
    select a.BUKRS,a.BELNR, a.GJAHR,t1.vtweg,t1.budat,t1.monat from t1, ldw_v1.bkpf a
    where t1.zuonr=a.xblnr and a.blart='WL' and bukrs='8431'
    ,tcogs as (
    select t2.budat,t2.monat,t2.vtweg, bseg.gjahr,bseg.hkont,bseg.prctr,
    sum(bseg.wrbtr) as COGS,bseg.matnr,bseg.kunnr,sum(bseg.menge) as QUANTITY
    from t2, ldw_v1.bseg
    where t2.bukrs=bseg.bukrs and t2.belnr=bseg.BELNR and t2.gjahr=bseg.gjahr and BSEG.KOART='S'
    group by t2.budat,t2.monat,t2.vtweg, bseg.gjahr,bseg.hkont,bseg.prctr,
    bseg.matnr,bseg.kunnr
    ,t3 as
    select a.budat,a.monat,b.vtweg,
    c.gjahr,c.buzei,c.shkzg,c.hkont, c.prctr,
    case when c.shkzg='S' then c.wrbtr*(-1)
    else c.wrbtr end as NTS,
    c.matnr,c.kunnr,
    c.menge*(-1) as Quantity
    from ldw_v1.BKPF a,ldw_v1.vbrk b, ldw_v1.bseg c
    where a.AWTYP='VBRK' and a.BLART='RV' and a.BUKRS='8431' and a.awkey=b.vbeln
    and a.bukrs=c.bukrs and a.belnr=c.belnr and a.gjahr=c.gjahr and c.koart='S'
    and c.ktosl is null and c.gsber='4466' and a.gjahr>='2011' and b.vtweg='01'
    ,trevenue as (
    select t3.budat,t3.monat,t3.vtweg, t3.gjahr,t3.hkont,t3.prctr,
    sum(t3.NTS) as NTS,t3.matnr,t3.kunnr,sum(t3.QUANTITY) as QUANTITY
    from t3
    group by t3.budat,t3.monat,t3.vtweg, t3.gjahr,t3.hkont,t3.prctr,t3.matnr,t3.kunnr
    select NVL(tr.budat,tc.budat) as budat,
    NVL(tr.monat,tc.monat) as monat,
    NVL(tr.vtweg,tc.vtweg) as vtweg,
    NVL(tr.gjahr, tc.gjahr) as gjahr,
    tr.hkont as NTS_hkont,
    tc.hkont as COGS_hkont,
    NVL(tr.prctr,tc.prctr) as prctr,
    NVL(tr.MATNR, tc.MATNR) as matnr,
    NVL(tr.kunnr, tc.kunnr) as kunnr,
    NVL(tr.Quantity, tc.Quantity) as Quantity,
    tr.NTS as NTS,
    tc.COGS as COGS
    from trevenue TR full outer join tcogs TC
    on TR.BUDAT=TC.BUDAT and TR.MONAT=TC.MONAT and TR.GJAHR=TC.GJAHR
    and TR.MATNR=TC.MATNR and TR.KUNNR=TC.KUNNR and TR.QUANTITY=TC.QUANTITY
    and TR.VTWEG=TC.VTWEG and TR.PRCTR=TC.PRCTR
    Edited by: user13566113 on 25.03.2011 5:26

    Without seeing what you tried it is hard to say what you did wrong, but this is how it would work
    SQL> create table t ( n number );
    Table created.
    SQL> insert into t
      2  with test_data as
      3    (select 1 x from dual union all
      4     select 2 x from dual union all
      5     select 3 x from dual union all
      6     select 4 x from dual)
      7  select x from test_data;
    4 rows created.
    SQL>

  • Need help in insert statment query

    Hi,
    I have a table T1 with values like
    col1
    1
    2
    3
    4
    I need to write insert statment for t2 as
    insert into t2(col1,col2) values ('AA',select col1 from t1);
    The output of T2 should be
    col1 col2
    AA 1
    AA 2
    AA 3
    AA 4
    Any help in modifying the query.
    Ashish

    What is wrong with this?
    INSERT INTO id_own_dw.id_t_dw_org_dq_tgt
           (cost_center_cod_vc_old,
            cost_center_cod_vc_new
         SELECT '3016052',<<<_-- this you can replace with your varibale in pl/sql block
                cost_center_cod_vc
           FROM id_own_dw.id_t_dw_msl_org_cctr2mkdiv
          WHERE busi_unit_cod_vc = '3016496'

  • Need help ASAP with photoshop elements 11

    Please I need help its photoshop elements 11 but I can't put up the pic I need help with could someone help me out by using Facebook, Amanda Jayne Clarke I have a pic of a little girl n a horse
    Please i need help ASAP

    well you can find many tutorials about how to change background in Photoshop Elements. It ranges all the way from using magic extractor to making a selection using lasso and magnetic lasso tools. But I really prefer using a mask for it. Here is how I would change the background of image A and use Image B as the background.
    Open image B in photoshop elements editor- expert mode.
    go to file->place and choose the image A to place over image B
    go to layers panel by choosing Window-> layers from menu bar. Right click the layer A choose simplify layer.
    with layer A selected, choose layer>layer mask> reveal All from menu bar. It would create a layer mask on the layer A.
    Select the mark layer of layer A, choose the brush tool and change foreground color to black. Paint all over the are you want to remove from the layer A. if you make an error, change the color white to get your image area back. it is a good practice to use lower opacity(~60) while using layer mark as it gives you more control over with how much opacity you want to remove the background
    Happy Editing

  • I need help reinstalling Adobe Photoshop Elements 12 and Premium Elements 12. I have opaid for these programs however my computer recently needed to be reset via recovery and they were erased, Any help? The link Adobe chat gave me download something-but t

    Help. Need to reinstall Adobe Photoshop Elements 12 and Premier Elements 12. Both are pre paid programs that I had on computer, however the system needed to be reset via recovery and these programs were erased> Since I already forked out the cash for these I'd like to be using them as I am an artist and need the programs. Please, any help? Ideas?

    You should try to keep the title short and sweet and put the details in the message... it's a mystery what happened regarding the download link, so here's some...
    PSE 10, 11, 12 - http://helpx.adobe.com/photoshop-elements/kb/photoshop-elements-10-11-downloads.html
    PE 10, 11, 12 - http://helpx.adobe.com/premiere-elements/kb/premiere-elements-10-11-downloads.html

  • Need Help With Adobe Photoshop Elements 2.0

    I have and use Adobe Acrobat and three versions of Adobe Photoshop Elements (2, 5 and 7). I use version 2 frequently as I'm more familiar with it and it's simpler to use for what I need to do. All was fine until recently when my computer was installed with Windows 8. Now I can't save photo edits from Version 2.0...... it aborts each time I try. Why is that? It is costing me a lot of wasted time. The other versions that i have don't do that. Need help. Thanks. Stu Snyder.

    The first thing i would try is deleting the Photoshop Elements 2.0 Prefs folder as explained in the post #2 linked to below:
    http://forums.adobe.com/thread/1254224?tstart=30
    Does it happen when trying to save as any file format or just a certain one like jpeg?
    Have you tried saving a photo to a different place like your desktop?

  • Need help installing Adobe Photoshop Elements 12

    I am unable to install adobe photoshop elements 12, need help.

    What problem are you having exactly?
    Which operating system?
    Any error messages or error codes?

  • Need help with inserting frame with scrolling images

    Hi,
        Im a beginner and need help putting a single box/frame with scrolling images in the middle of my layout, so that when viewed in browser, the header and footer remain in place, while the images and info in the frame in the centre of the page can be scrolled down/up?

    You can use an iframe element <iframe src="" width="" height="" scrolling="yes"> though if you're concerned with crawlers you should avoid frames as much as possible. 

Maybe you are looking for

  • How to change the "name of column" property of an text item in runtime?

    How to change the "name of column" property of an text item in runtime? I look the properties of items in help and found nothing about this! It's possible?

  • Report on fonts from batch of documents

    Hi, does anyone know if there is a script that can go through a folder of a thousand indesign files and create a report (with two choices) of what fonts are used. Choice 1: Just a list of fonts have been used without repeating what fonts have been us

  • Cant point page to diffrent table/view?

    Hi Guys, I have a page with select PK_ID, CUS_ID, CLO_ID, CLO_DELETE_IN, CLO_UPDT_TD, CLO_UPDT_USER_ID, CLO_SOFTLOCK_TS, Username "Changed By" from "CDB_CNRCLT02" "CDB_CNRCLT02" where CUS_ID= :P1_REPORT_SEARCH sql, I have replace CDB_CNRCLT02 table w

  • Adobe flash player CPU usage

    I recently purchased MacBook Pro with retina display , I use Adobe flash player a lot , and it takes a lot of my computer's CPU percentage , how can I reduce the CPU usage ? Is there any adjustable resolution ( for flash player ) that I can reduce ?

  • Direct Input Programs in SAP

    Hi, Can anybody provide me the list of Direct Input programs available in SAP. Thanks, Sunil.