Implementing bullet list in JTextPane

I found an example here:
http://forum.java.sun.com/thread.jsp?forum=4&thread=162662
.. which describes how to create a TextAction for implementing bullet lists with a HTMLEditorKit.
The problem is that I use StyledEditorKit.
Anyone know how to implement a "StyledEditorKit.BulletAction" ?

It amazes me though that this is something that has to be done from scratch ...
Me too!
But it's not too bad, this is how I did it:
1) Add a unicode prefix to represent the bullet:
     if (type.startsWith("CIRCLE"))     liType="\u25CB";
     else if (type.startsWith("DISC"))     liType="\u25CF";
     else if (type.startsWith("SQUARE")) liType="\u25A0";
     doc.insertString(doc.getLength(),liType+" "+liText,null);2) use the FontMetrics to set the outdent:
     FontMetrics     fontmetrics=getFontMetrics(font);
     FLOAT=fontmetrics.stringWidth(doc.getText(start,2));
     StyleConstants.setLeftIndent(aset,50f*listLevel-(listLevel-1)*FLOAT);
     StyleConstants.setFirstLineIndent(aset,-FLOAT);You can see the end-product [url http://home.comcast.net/~viravan/f7.htm]here
;o)
V.V.

Similar Messages

  • How to display a bulletted list

    Hi All,
    I'd like to display a list of agreements to the user as a bulleted list.  It's all the things that the user is agreeing to when they submit the application.
    What would be ideal is if there is a controller that I can bind to an array, and it will display each item in the array as a single bulleted list item.  The list of agreements will vary depending on how the user as filled out the application, and if I do it this way I could simply pass in a collection with all the items they are agreeing to.
    But I haven't been able to even figure out how to display a bulleted list.  I've found some posts online that address how you might do this if you're working on an editor, but I don't need editable text--I just want to display a bulleted list to users.  It seems like this is a basic feature that must be in Flex 4 somewhere, and I don't want to go reinventing the wheel.
    Thanks!
      -Josh

    Ok, here's what I came up with for a bulleted list that you can bind an ArrayCollection of String items to.  Thoughts?  Any issues with this implementation?
    I looked into a custom ItemRenderer, but this seemed much simpler and it's all I need in my case--a bulleted list.
    I'm aware that no escaping of the input strings is being done, but that's actually intentionally--I may wish to pass in strings that include additional markup to make certain words/phrases bold.
    The reason for the getter and setter on the dataProvider property is to ensure that anytime a new assignment is made to that property the change listeners are setup.
    I'm interested in feedback on how I could do this better or differently, to best take advantage of the facilities Flex offers.
    Thanks!
      -Josh
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx"
               width="100%">
         <s:layout>
              <s:VerticalLayout/>
         </s:layout>
         <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <fx:Script>
              <![CDATA[
                   import mx.collections.ArrayCollection;
                   import mx.events.CollectionEvent;
                   import mx.events.FlexEvent;
                   private var _dataProvider:ArrayCollection;
                   public function get dataProvider():ArrayCollection{
                        if(_dataProvider == null){
                             dataProvider = new ArrayCollection();
                        return _dataProvider;
                   public function set dataProvider(value:ArrayCollection):void{
                        _dataProvider = value;
                        this.ensureBulletedListTextIsBuilt(dataProvider);
                        this.dataProvider.addEventListener(CollectionEvent.COLLECTION_CHANGE,handleItemsChange,false,0,true)
                   protected function handleItemsChange(event:CollectionEvent):void{
                        var collection:ArrayCollection = event.target as ArrayCollection;
                        this.ensureBulletedListTextIsBuilt(collection);
                   protected function ensureBulletedListTextIsBuilt(collection:ArrayCollection):void{
                        var html:String = "";
                        for each(var item:String in collection){
                             html += "<li>" + item + "</li>";
                        bulletedListText.htmlText = html;
              ]]>
         </fx:Script>
         <mx:Text id="bulletedListText" width="100%" />
    </s:Group>

  • The bullet list, numbered list and the normal text is not converting when I am converting from RH 9 to MS Word 2010

    Hi all,
    Greetings for the day
    I am created a new CSS in Robohelp 9. I have also created a new template in Word 2010. The style sets for different information elements like (Heading, bullets, body text, ) are more or less same between the CSS and the new templates. I am also able to map the .css styles to Word template when I am converting from RH to Word as I am getting the necessary option in the drop-down list.
    However, when the output is generated, the bullet, the numbered list and the body text is not converting at all. The body text works sometimes. However, the numbered list and bullet list is coming out as images.
    If anybody knows the solution, I can share the .css and Word template.
    Thanks in advance.
    Regards,
    Parag Deb

    Create a new project with two or three topics containing lists of both types. Generate a printed output that shows the problem. Then zip it up and send it to me. See the Contact page on my site for instructions.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Bullets & lists (Korean)

    When I try to add an additional item in Korean in the "Bullets & Lists", the bullet symbol disappears.
    Is there any possible solution for this problem?

    If you put the cursor in a text box, you have those options; they represent a kind of formatting that isn't available in a cell of a table.
    You can type a bullet into a cell manually, of course.

  • Bullets & Lists disabled

    Does anyone know how to enable Bullets & Lists in Numbers 3.1? When I go to the "Inspector", i.e., Format --> Text, all the control components within the Bullets and Lists section are disabled (i.e., grayed-out).  Does anyone know a way to enable them?
    -Thanks

    If you put the cursor in a text box, you have those options; they represent a kind of formatting that isn't available in a cell of a table.
    You can type a bullet into a cell manually, of course.

  • Creating Custom Bullets & Lists in Pages 5.0

    I cannot figure out how to create a custom numbered list in Pages 5.0. I had custom LISTS on my 4.3 Docs that did not migrate to 5.0. How do I create duplicate LIST STYLE in 5.0?
    Thank you for your help.

    On the format menu on the right side, there is the font section, alignment section, spacing section, and bullets & lists section. Next to the bullets & lists section is a drop-down menu of preset lists. At the top-right of this menu is a plus sign. Clicking on this will allow you to create a new list in that menu and title it. From there, you will have to manually create your custom list change the type of bullets (numbers, roman numerals, letters, etc.) -- you might need to click on the disclosure triangle to the left of the bullets & lists title to see this part. When you finish with your custom list, there will be an asterik next to the title of the list, and if you click on that title, the drop-down menu will open up again and you can hit "Update" next to your list name. This should save the style for that custom list. Here is the most important part: When you have finished making this list, make sure you save the document as a template and select that template if you ever want to use that list. I have found that a custom list in a document (saved or deleted) that is not made into a template does not carry over into other documents. Setting up this custom list may take a while, but hopefully it will work and make things easier. I hope this makes sense, and let me know if you cannot understand something. Hopefully this picture will help too.

  • Bulleted Lists in Text Boxes?

    Hi all,
    Apologies if this has been asked before - I've searched but to no avail.
    Can one, in a text document, have a bulleted list in a text box? I've tried, but when the text to be bulleted in the text box is selected, the toolbar and the 'Format' drop-down menu changes and the 'Bullets On/Off' button is not available.
    I've tried customising the toolbars (which I feel I shouldn't have to do anyway), but this doesn't work. I've tried to cut and paste in bulletted points from normal text (which I feel I shouldn't have to do either) but this doesn't work either.
    Any suggestions, or is this a bug/feature?
    With thanks,
    Sean.

    If you mean the text function in the drawing toolbar, it isn't possible.
    You should use frames.

  • How can I create a bulleted list where each line builds in independently?

    I would like to make a bulleted list in my video where each bullet fades in as the person says them in the video (it is not at a constant rate). So far the only way I've accomplished this is to stack 6 or 7 of the 'Fade' title generators on top of eachother and adjust the length of them to match the audio. It seems like there must be a better way to do this as this solution is quite combersum when trying to align all the bullets (wish there was a bullet format in the text formatting box) and it uses a lot of computing power to make adjustments on so many generators. Thanks.

    I am sure there is a way to do this in FCP or Motion. However, what I do is to build my bulleted list in Keynote against a green background. Set up the Keynote presentation as 1920x1080.
    I then use it in FCP or iMovie as a greenscreen effect.
    After creating the bullets in Keynote, I export them as a QuickTIme Movie with a timed advance. I then import the QuickTime movie and edit it as I need it.
    Keynote has dozens of text effects and builds, including the fade that you need.
    Here is a quick and dirty sample.

  • How do I format bullet lists in the Notes tab?

    I have a transcript of the audio narration in the Notes section of my source PowerPoint slides. When I publish with Adobe Presenter, these transcripts appear in the Notes tab in the published course. However, when I publish my course, any bullet lists that I may have formatted in the Notes view in PowerPoint, do not format correctly in the published course. The text of the bullets is there, but the bullet formatting is missing.
    I am using Adobe Presenter 8, PowerPoint 2007, and I'm running on Windows 7 Professional. I have tried saving my PowerPoint file in the PPTX format and in the older PPT format. Neither retains the bullet-list formatting in the published course.
    Is there a trick to getting lists to format correctly in the Notes tab?
        -Ray

    Hello,
    Can you please email us the sample of your presentation (or the entire presentation) which contains those slide notes.
    We will check it on our systems and get back to you with a workaround/solution.
    Please email the presentation at [email protected]
    Regards,
    mukul

  • Cannot figure out why my bullet lists aren't correctly aligned

    Hello,
    I hope someone can help me on this because I'm totally lost. I've spend hours trying to figure out where the problem comes from, reading posts on-line, searching documentation, etc. and I'm getting nowhere. I'm struggling with bulleted lists which just won't aligned correctly with text paragraphs. I would expect the bullet to be horizontally aligned with previous/next paragraphs and the list text to be indented so that the bullet stands out to the left. Kind of almost the default one gets when creating a simple <ul> list without any formatting.
    This problem can be seen here. The bullets are outside their div. I've tried using "list-type-position: inside" on <ul> and/or <li>—this gets the bullets back inside the div but then the text isn't properly indented with respect to the bullet.
    I assume I've got some CSS precedence problem, but I can't find out where it is. I've validated my code with Dreamweaver CS4 + browser compatibility check. There are some issues left which I'm working on, but as far as I understand they shouldn't be related to this list problem. The only other parts where I'm using unordered lists are the top and side menus, but I've used explicit descendant selectors (I think) to avoid spreading my styling to other elements. Where am I wrong??
    I'm still new to HTML/CSS and learning, so be tolerant with my mistakes! I'm aware that I still have got tons to learn.
    Emilie

    Have you tried giving your ul a left margin with css,
    e.g.
    ul {
    margin-left: 1em;
    You can also use negative values to move it the other way.
    HTH

  • Want to change a bulleted list to a checkbox list -- HELP

    Why is this so hard? I have a list of software product features, I want the list to have checkboxes rather than bullets so readers will feel urge to check off features when comparing software to other solutions. DOESNT HAVE TO BE INTERACTIVE. Just a visual. Just a G&*$^#*!)*%! checkbox. I have spent a half hour trying to find a solution to this SIMPLE F9823769 thing. Why so difficult? Wasting of time ion simple tasks not happy. On CC (online) version 9, not on a Mac so don't assume it. Thanks for help

    Or, Alt click the the Bulleted List icon, List Type/Bullets, Bullet Character/Add and look for the checkbox. Then you'll have it as an option to apply when need it.

  • Why are spaces missing at end of wrapped lines in bulleted lists

    Hi -
    Acrobat 11.0.10, Word 2013, Windows 7 ... Sometimes tagged PDFs don't have spaces at the end of wrapping lines in bulleted lists, throughout the document. In text edit mode the cursor movement indicates no space exists. Selecting with text touch-up shows no space. In accessible text the last word on line runs into first word on next line.  JAWS mis-pronounces those words as if they are one word.  PAC preview also shows the words running together. 
    Adding a space in text edit mode works for a few minutes, but when file is saved & reopened spaces are gone, even if, immediately after adding the spaces, I select the block of LBody text with text touch-up and re-tag it and initially spaces appear to have been added.
    Is starting to happen on a routine basis, different source files, different people/computers generating the PDFs, multiple computer reboots, Acrobat repair run, MS Office repair run. But not consistent ... e.g., if someone generated PDF with no spaces at end, someone else can generate from same source and spaces are present.
    Any ideas?
    Thanks

    Thanks 'C' student, nice to know it's not just us - "misery loves company" and all that.
    So far besides your reply there's deafening silence.
    Come on, folks, don't any of you experts have a solution for this? Or at least an inkling of an idea what may be causing this? It's starting to happen all the time now, becoming a major problem.  We may have to start by getting Acrobat to self-tag rather than starting with the tags generated from the source programs, but that adds time and effort because Acrobat's tags for our often complex documents are laughable and have, ironically, such poor syntax.
    Is there a way to get a discussion seen by more people?

  • Copying sub-bulleted list _and_ keeping the master format

    Super basic question: how to make sub-bulleted lists formatted nicely?
    It's a follow up of the above topic. When I copy paste a full slide, it loses the property that sub-lists (pressing tab) come with smaller bullets. I can of course re-apply master, but then all my changes to the text (e.g. colored or bolded text) goes back do the default font. This is really annoying, it means that I cannot copy-paste slides from one presentation to another

    I have no problem with drag and drop on any of our systems.
    Your installation is faulty, try Resetting Keynote perform all the steps in the correct order
    remove Keynote version 6.5, you must use an application removal tool for this procedure to work:    Appcleaner is free, I use Appzapper
    empty the trash
    Shut Down the Mac (Apple menu > Shut Down)
    wait 10 seconds, then press the power button
    Immediately after you hear the startup tone, hold down the Shift key, release the Shift key when you see the grey Apple screen
    start up will take a few minutes longer than usual as the Mac is performing a repair routine
    restart the Mac normally, (don’t hold down any keys during startup)
    install Keynote from the Mac App Store

  • How to justify the text of a bulleted list

    Does anyone know if it is possible to justify the text of a bulleted list in the same way as for a paragraph? I can do it in Microsoft Word but I can't seem to do it in Illustrator.
    When I justify the text of a paragraph in Illustrator it works perfectly fine. But when I do it for bulleted text, it gets all weird. Can anyone offer any advice? I'd greatly appreciate it!

    The only solution I'm seeing is this older post from CS3 that directs you to use the inDesign text engine.
    http://forums.adobe.com/thread/467763
    Typographically having a bullet list aligned other then flush left rag right seems unnatural. I would like if you could post a screen shot of the Word doc that is aligned the way you envision your text aligning in Illustrator.

  • How can I Create a multilevel bulleted list in RH HTML 7?

    Hi!
    I'm trying to create a multilevel bulleted list in RH 7 (HTML) but keep messing it up. I can change the bullets and use some from the gallery, but when I indent to create a second level, bullets are the same. If I change bullets style, I change the whole set up. Do I have to manually create a bulleted sublevel amd apply it manually everytime?
    By looking at the available menu in the Styles window, nothing seems to guide me towars automatically creating different levels. Am I missing something?
    Thanks for your help.

    EDIT
    Oh, dopey me! Peter just reminded me, offline, that this feature wasn't even in RH 7. Duhhh...guess I just blew by that little qualifier.
    So, the revised answer is: you couldn't in RH 7, and you still can't in RH 8.
    That feature is not working properly. Please submit a bug report to Adobe; the more they hear from us the better.
    Good luck,
    Leon

Maybe you are looking for

  • Calling a report from another report in after parameter form

    hi, I'm calling Emp.rdf report with deptno as parameter and if the parameter is '10' then i have to call dept.rdf function AfterPForm return boolean is begin if :p_deptno =10 then      srw.run_report('report=c:\reports\dept.rdf destype=screen p_deptn

  • How to enable commenting into pdf files using java?

    Hi All, Is there any way available to enable comments into pdf files through java. I have a Adobe Reader 9 and also I want put some comments into pdf file, but the reader is not allowed to place a comment into pdf file before enabling the Comments in

  • How to create a link to a web page that is connected to the database?

    i am developing a web form in java using Oracle's JDeveloper. i created the form which is connected to the database and now i want to put a link in a page that when clicked it shows the form and populates it if necessary. i have no idea how to do tha

  • Lotus Notes LDAP Queries

    According to the manual, Ironport has a problem resolving some variations of Lotus Notes email addresses. It seems if the email address isn't specifically listed in the Name and Address Book, then the LDAP query will fail. Is there anyway to workarou

  • Merge with MSN

    What happened to my Skype contacts after a merge with MSN