How do EditorKit actions work?

I am working with the HTMLEditorKit to create HTML documents and I have got on fine so far with the basics, but I could use some advice on getting more complex actions. I am guessing I need to extend HTMLEditorKit.HTMLTextAction, but I don't really see how to get it so that it creates a new Tag that only lasts for one paragraph- do I need to call another method of the HTMLEditorKit or some part of the HTMLDocument I am writing into? If anyone can offer any guidance as to how this model works generally, I would very much appreciate it.

Thank-you, that is a lot of help.
There are a couple of points I am still having a problem with:
1. If I want to replace the current paragraph with a different tag, for example an <h1> type tag, how can I do that? When I do it currently it just seems to add a new <h1> tag at the end of the page.
2. If I want to start the new tag at the current caret position and put the next paragraph/section of text into it, how would I do that? By this I mean that if I am at the end of the document and I want to start a bulleted list so that the next paragraph is a list rather than a normal paragraph, how can I do this? Currently I seem to be getting the problem that I use my "insertHTML" method and it creates and empty list and puts me in a new paragraph:
<p></p> ===> Insert List ===> <p></p><ul><li></li></ul><p> caret position </p>
In a way I suppose this is the same problem as above, any idea how I can solve it?
Am I doing it wrong by trying to change things through the HTMLEditorKit rather than changing the Document? How can I change the document structure?

Similar Messages

  • How to make Folder Action work on file, subfolder content change?

    Hi!
    I looking for information in how to make a Folder Action, Work Flow or any action from Automator to work on file change and not only on deletion, moving or insertion. What I want to know is if it's possible to trigger some script or app while monitoring a folder and its contents, files and subfolders, changes. Meaning that when I have a file that has its contents updated the action will be triggered like an txt file that I only insert a new line in it, for example.
    Is there any solution that is not third party? Is there an internal Mac OS X solution that would work on Snow Leopard, Lion and Mountain Lion?

    i have same problem. i would like to move automatically saved Word backup copy to another folder, but the folder action doesn't recognize the save as a new file that needs to be acted upon.

  • AIS CC: how undoing the actions of a JS run via app.doScript

    Hello,
    AIS CC (9.0)
    I wrote a JavaScript, which I can properly run through app.doScript(UndoModes.fastEntireScript, etc.).
    Now, at a given time, I would like to programmatically undo the actions of my own script.
    The various resources I have got here (InDesign_ScriptingGuide_JS (CS6), InDesign_ScriptingTutorial, the ExtendScript Toolkit Object Model browser) suggest things (app.undo(), app.documents.item(0).undo(), etc.) which fail, when executed on my AIS CC.
    Any idea or tip, on how to undo actions submitted via doScript on AIS CC?
    Thanks in advance!
    Kind regards,
    GB
    Snippet:
    var main = function()
         // something
    app.doScript(
         main,
         ScriptLanguage.javascript,
         undefined,
         UndoModes.fastEntireScript
         ); // << this works perfectly: the actions in the "main" function are executed
    app.undo(); // << this will fail with "app.undo is not a function"

    Thanks for your fast reply.
    you're undoing the entire script, which is probably not what you want.
    Undoing everything embedded in my "main" function is really what I want to achieve.
    Whether it's a bunch of complex code, or nothing at all (as in my snippet, where "main" contains only a comment line ), it's what I want.
    the recommendation is to us entireScript
    I changed my "UndoModes.fastEntireScript" into "UndoModes.entireScript", as you suggested; with no avail so far: I still get the same "is not a function" error.
    Actually, I have the feeling that I do not understand/master the InDesign DOM here, and am simply trying to make a call to a method (undo) which does not exist in this class (app) - despite the Adobe Reference Manual says it does...
    It sounds an inefficient way to write a script
    My script makes some changes in an InDesign document ("main" function), then exports it to PDF (out of the "main" function).
    Then, the environment I work with (XMPie) will inject variable information in the InDesign document for the next recipient.
    At this time, I need the document to be reset to its original design.
    That's why I need to undo all the changes applied by the "main" function.

  • How does point system works?

    Dear all,
    I am wondering how this point system works? I had 915 points this morning and now end up with 905. Instead of going up, it fluctuates from time to time. Initially, it use to show up next to my name with 915 but then that went down to 514???
    Is it only me or someone else has seen this behaviour?
    I am not points buff but it seems pretty strange that one day infact in the same day the numbers fluctuates like they do in stock exchange.
    Regards
    Jehanzeb

    >
    Amit Gujargoud wrote:
    > I think you misunderstood His words and take it hard. Iu2019m sure he actually
    >  meant in a Cool way. Letu2019s wait until his morning, he will come to you with more cool way
    Nope, in this case, Kartik already has "the hard way" behind him.
    During an investigation into a nest of points gamers in October last year, Kartik was investigated as well for having for having participated in one of the threads. There were many being investigated. Other symptoms matched (we have some strict rules for this) - so the mistake was perhaps understandable - but on the other hand I should perhaps have looked a bit further to see that Kartik's post patterns were different to those of the others (who were not located very far away from Kartik..).
    Anyway... as they faded away into the annual ponits total of those who are being transported into the world where the A.G. calendar is used ( Anno Guestus ) ... Kartik's ID faded away with them.
    Kartik contacted me about it and I took his word for the expanation that he was not involved. I am very glad that I did that, as he has been a big help in the ABAP forums.
    I don't have the exact figures, but last I heard we have deleted more than 50 thousand user ID's for ponits gaming. I am always very carefull when investigating this and there are other people who check it as well before any action is taken.
    To date, to my knowledge, Kartik has been the only mistake we have made. Others have begged for mercy, but that is different. Hence my comment that he should wear the difference like a "battle scar" caused by the "journal entry", until Micheal can possibly fix it.
    As you can see, "we are all guilty of something"   (quote: Inspector Vimes)
    Cheers,
    Julius

  • How to make tablesorter work for GroupedColumns??

    Hi all,
    I imported the class of TableSorter.java to my project. It automatically picks up my normal columns, they all can be sorted.
    but the groupedColumns generated by the drag and drop table node into the design area wont pick up, even i set the property of "onAction" of the column to "Sort"(method) it wont sort the content for me.
    how to make it work?
    thanks

    hi!
    you can get lead selection in the action handler then inset your code for currentContextElement.
    wdContext.currentContextElement().getTableSorter().sort(wdEvent, wdContext.nodeXXX());
    thanks
    vishal

  • How do I Action Script buttons, so the objects lay on the prior object clicked on, in Flash?

    Here's my idea but having problems with the actions scripting:
    Accessories and build your car application in Flash.
    I'm new to the Action Script 3 and I am trying to Action Script my custom graphics for a “build your own car”. Something similar to the Harley Davidson motorcycle builder https://www.harley-davidson.com/en_US/Content/Pages/H-D1/Bike-Builder.html#/locale__en_US/ model__FLD/year__2013
    I have all the graphics (multiple photos, photoshopped and cut out for the different car body colors. I'm doing the same with the car rim choices, etc) All the graphics are sized so they will lay on top of one another seamlessly but I don't know how to Action Script 3 the buttons so you can click on (ex: rim1, or rim2 , etc and see how it looks on car by pulling up the photo on top of the existing background car photo) .
    How would I Action Scrip my "color button" to come up with 10 color swatches I’ve designed and then when you click on the color swatch (ex: red). It will then put the graphic red of the car body that I have already made on top of the existing background photo of the car and so on for each color button?
    Thanks for the help in advance!

    I'm not sure if I do know how to correctly create the Wheels classes and use action scripting. Are the classes you're referring to the parts I labeled btn1, btn2 below? Here's what I have under the main Timeline labeled actions:
    stop() ;
    // Color button code //
    colorbtn.addEventListener(MouseEvent.CLICK, btn1);
    function btn1 (event:MouseEvent) :void{
        gotoAndStop (2);
    // Rims button code //
    rimsbtn.addEventListener(MouseEvent.CLICK, btn2);
    function btn2 (event:MouseEvent) :void{
        gotoAndStop (3);
    //rim1 button code //
    rim1.addEventListener(MouseEvent.CLICK, btn3);
    function btn3 (event:MouseEvent) :void{
        gotoAndStop (4);
    I'm not sure how to fit your code in that you said in your first comment. The //rim1 button code // doesn't currently work.
    I think if I had a sequence of the action script 3 with a button/movie clip layed out for me, I could organize accordingly for my buttons and movie clips. Since they would work the same just would have to have different labels.

  • How integrate BPM Action(Submit,Approve) with ADF using worklist APIs

    Hi All,
    Can anyone please help me to say that how to implement the work-list APIs for integrating BPM Actions (Submit,Approve etc.) in Custom ADF page?
    Thanks in Adv.

    Hi Renuka,
    There are basically two ways to create an ADF UI for a BPM Task:
    1. Generate it from the task
    2. Create a ADF Taskflow based on Human Workflow Task
    Since I tell this by heart, I might be slightly wrong in the terms.
    You probably want to try the second option. It is accessible from the "New Gallery". You'll have to provide the Human Task from the BPM project, but then you can build up the ADF Taskflow by your self, based on the customizations of the rest of your application.
    Should not be rocket science for someone with ADF11g experience. Since it is not my dayly job, I need to figure it out every time again ;). But I did it in the past and it wasn't so hard.
    Regards,
    Martien

  • How can I transfer work from one computer to another?

    How can I transfer work from one computer to another?

    Welcome to the forum.
    I can think of three basic ways to accomplish what you wish to do:
    Use the Project Archiver to archive your Project (and check the box to gather the media files), to an external HDD. Probably the easiest way to do it.
    Copy the Project and ALL media files to an external HDD, but be prepared to relink the media files to the Project, as the drive letter (part of the Absolute Path) will have changed.
    Edit loosely, and Share to an AV file, which will be Imported into a New Project on that second computer. Or, edit VERY tightly, and do the same. I like the first, as removing, replacing Transitions, etc., can be much more difficult, unless that "tight edit" is 100% done.
    Good luck,
    Hunt
    Message was edited by: Bill Hunt to correct formatting

  • How export to csv work in safari browser? In my application export to csv open like a raw data in new tab. But other browsers working great!. Need to open in a csv file or save it as a csv file.

    How export to csv work in safari browser?
    In my application export to csv open like a raw data in new tab.
    But other browsers working great!.
    Need to open in a csv file or save it as a csv file.
    Please suggest me. Thank you in advance!.

    Hi Adrian,
    Why don't you try any another software for opening CSV files then Notepad ? According to my experience, you can use these softwares to open an CSV files and they are:-
    Microsoft Excel
    Open Office Calc
    Google Docs
    Also there is an additional tool available known as CSV viewer. You may try this, download it from here http://www.csvviewer.com/
    I've never used Notepad for opening CSV files, because sometimes it contains some symbols which are not not at all compatibile with Notepad.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • How enter prise search works in sharepoint 2010

    In my organization enterprise search is configured ,
    -- sharepoint farm has
    -- two index servers ( share point server search  service is  configured in this servers)
    two web front end servers(sharepoint foundation web applications, and  share point server search  service is  configured in this servers)
    - two  application servers( central admin service is running)
    - one sql server
    here i am new to this area
    here how entr prise search works,  why index servers used
    index data stored sepratly in thi servers?
    and when user query for any documentid where it will search initially
    i know the concept of search there are 3 things
    1) query
    2)index
    3)crawler
    adil

    Hi,
    In Microsoft SharePoint Server 2010 Search, index partitions are groups of query components, each of which holds a subset of the full text index and which return search results to the query originator. Each index partition is associated with a specific property
    database containing metadata associated with a specific set of crawled content.
    The index server manages the crawling and indexing of SharePoint Server content and maintains the index file. The index service works with the query service to let you search SharePoint Server content.
    Every SharePoint Server deployment must have at least one index server. Additional index servers may be necessary as the deployment grows. There can only be one index server per server farm.
    If you use the web front end as your query server.  This tells the index server to propagate its index to the WFEs that are set as query servers so that they have a local copy of the index.
    When someone does a search (this is done on the WFE), then that WFE will search itself locally instead of going across the network to query the index server.  
    This increases speed at the time of query, but it of course introduces additional overhead in terms of having multiple full copies of the index on the network and the network demand of propagating those index copies all the time. 
    If you select the query role on your index server, then the index will not get propagated and all searches will query the index server across the network.  
    For more information, you can refer to the following article.
    http://www.sharepointpitstop.com/2012/08/sharepointsearch-index-query-crawl.html
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Macbook pro to HDTV, video is working but audio is not working, how to make audio work as well

    Macbook pro to HDTV, video is working but audio is not working, how to make audio work as well

    If you use an HDMI cable, the audiostream will be integrated, so there will be sound when using an HDMI cable!
    Not necessarily.  That only works as stated if you have one of the most recent MBP's that has a built-in HDMI port.
    If the MBP only has a Thunderbolt or miniDisplayPort, you need an appropriate adapter cable and even if you use an HDMI adapter or cable to connect to your HDTV there is no guarantee it will carry audio.  You have to determine if your specific MBP model supports audio out through its miniDisplayPort or Thunderbolt output, and whether the adapter does likewise.

  • How do you connect your photoshop elements on your computer to your account online? and how do you create a customized url? how does the gallery work and how do you access it? i have trouble signing in on my program from my computer to connect to the onli

    how do you connect your photoshop elements on your computer to your account online? and how do you create a customized url? how does the gallery work and how do you access it? i have trouble signing in on my program from my computer to connect to the online photoshop, and I really want to create my own customized url and post photos to my gallery and share them with the world, family, and friends, but i need help because i can't figure how to do any of this, would really appreciate feedback and assistance, thanks, - claire conlon

    To add to sig's reply, "calibrating" does not calibrate Lithiu-Ion batteries, it calibrates the charge reporting circuitry.  If you look at the effect of deep discharging Lithium-Ion batteries in the data from the independent test group, Battery University, you will see that doing so shortens the life of the battery significantly. It looks like an optimum balance between use and life is at a discharge level of 50%.

  • How can two users work on iMovie?  My husband is working on a memorial video for a family member who passed, I plan to edit but he had to take his computer to work.  I have the iMovie project on a zip drive.  How do I get it to open in my imovie?

    How can two users work on iMovie?  My husband is working on a memorial video for a family member who passed, I plan to edit but he had to take his computer to work.  I have the iMovie project on a zip drive.  How do I get it to open in my imovie? 

    You will need an external drive that is formatted as MAC OS EXTENDED (journaled).
    Move the Project, Events, and any photos and music to the external drive by following the instructions in this post.
    https://discussions.apple.com/docs/DOC-4141
    Be sure to use CONSOLIDATE MEDIA to get the photos and music. Then plug this drive into your computer and you will be able to edit.

  • Does anyone know how the cutout filter works and is there a way of achieving the same effect without using filters to get more control over final look?

    does anyone know how the cutout filter works and is there a way of achieving the same effect without using filters to get more control over final look?

    Several ways to get similar results.  Image > Adjustments > Posturize with low values similar to what you'd use n Cutout.  This is the most flexible way I can think of as you keep the image in RGB mode with layers intact.  A more radical approach would be to reduce bit depth using Indexed Colour.  You'll need to experiment with settings, try changing Forced to Primaries, and Matte to Foreground Color.  There's no going back from this route, although you can change the mode back to RGB to re-enable layers, adjustment layers etc.
    A nice thing about the Filter gallery filters is that you can change the layer to a Smart object with all the control that gives you.
    Now if only this forum could filter out bizarre content.

  • Is there a way to know how many hours of work did a project demanded ?

    Is there a way to know how many hours of work did a project demanded (even if it was on multiple days, sessions or cross-working other projects)?
    I am using Adobe Premiere Pro CS6 on windows 7.
    Thaks,
    Mihai

    There is no feature for that in Premiere Pro.  I suggest that you keep a project log either in a spreadsheet, database, Notepad or Wordpad file, or a hand written one.
    You can file a feature request here:
    Adobe - Feature Request/Bug Report Form

Maybe you are looking for

  • [Solved] E4200 - External hard drive not recognized

    My external hard drive, a 2TB WD Elements, does not appear in the storage list in the web utility of my E4200. The drive is formated as NTFS, single partition. It works fine if I connect it to a computer. If I connect a 4GB USB flash drive (FAT32) to

  • How Can I update my app new version to the registered devices

    Well, we have developed an in-house app using the Unity3d Game Engine. I'm using a Developer Enterprise account, and have already created the proper certificates, registered the devices (7 ipads) and generated the provisioning Profile. I have already

  • Problem with non english caracter

    Hi, I'm using JRockit 1.5.0_03, I have a problem with pages with non english caracters. is it possible to change certain properties of JVM like "user.country", "file.encoding" or "user.language"? If yes, how can I change it? Thanks in advanced

  • Aperture keeps prompting for my serial number...

    I was cleaning some stuff off my hard drive the other day, and ever since then, every time I open Aperture, a "Licensing" window comes up asking for my name, organization, and serial number.  I enter the serial number, and everything works (and my li

  • Why wont Youtube videos load when using Firefox 3.6.3?

    I've been having issues with youtube when using firefox, the video doesnt load or show up for that matter its just a black screen where the video should be and on the bottom left hand corner of Mozzilla it says "done" I've tried everything, I updated