Different styles to the portlet regions

Oracle Portal 9.0.2.2.22
How to apply different styles to the portlet regions within a page?
Regards
Rajesh Kumar

Hi Rajesh -
Unfortunately you can only change the style of item regions, not portlet regions. If you only need to change the portlet background color there is a little trick you can do with version 9.0.2.6 (I do not have a 9.0.2.2 build to try with)
Place the portlet that should have a different background color on a different page. Set the Style property for this page. The style should set the Common background color as the color you wish to be the portlet background color. In the style, set the portlet background color to NULL (allowing the common background color to show through). In the page properties, on the optional tab, expose this page as a page portlet, and ensure the page does not use the style of the page on which the portlet is placed.
Now expose the page portlet on the page you originally wanted the portlet to show.
Hope this helps. I would be interested to know if this also works in 9.0.2.2 as in 9.0.2.6.
Thanks,
Candace

Similar Messages

  • Assigning Different Style Classes to Portlet Columns

    Is it possible to use the CSS mill to create a style sheet that assigns certain properties to particular columns in the portal body? For example if I wanted the third column in my page layout to tell portlets to turn their borders off and have a gray background while keeping the borders and white background for the other columns.
    I was also told that narrow portlets and wide portlets reference different style classes but I don't see them from viewing the source from my browser. I see platportletNarrowHeader and platportletWideHeader which is for the Portlet Title Bars but not the body. If I wanted all narrow columns to reference a different style class than wide, how could I go about that?

    Allow me to clarify how this works.
    It isn't so much of a difference between narrow portlets and wide portlets, it is a difference between portlets in the narrow columns and portlets in the wide column. (Narrow portlets can be placed in the wide column.)
    Portlets in the wide column reference the styles platportletHeaderBg, platportletWideHeader, and platportletBorder.
    Portlets in the narrow column reference the styles platportletHeaderBg, platportletNarrowHeader, platportletBorder, and platportletLightBg.
    As you can see there are some styles that the two have in common. platportletHeaderBg controls the table row that contains a portlet header. platportletBorder controls the table that contains the portlet content.
    For portlets in the narrow column platportletNarrowHeader controls the text inside the portlet header (the portlet's name). platportletLightBg controls the table row that contains the portlet content.
    For portlets in the wide column platportletWideHeader controls the text inside the portlet header (the portlet's name). There is no style that controls the table row that contains the portlet content for portlets in the wide column. Instead it uses the color of the body of the page.
    So changing the common styles will affect all columns, while changing the narrow column or wide column specific styles will affect those columns. So you can't just change the style for a third column.
    If you want to go beyond those limitations it would involve making a code change in MyPortalContentView.

  • CSS on a template shows a different style on the actual web page.

    I have created a template and made my sub pages according to
    the template. Late I have made some changes to the template and all
    the changes (Basic HTML changes) got effected on the pages that
    referring the this template.
    The I attached a style sheet that does some styling to my
    menu area (Which is a non editable area according to the template).
    When I update the site the pages didn't show up the expected
    styling. Instead they show some different styling.
    I am using Dreamweaver 8 and tested the site on both firefox
    2 and IE 7.
    Can anyone help me to solve this?

    They do not turn to a light color. There is no a:hover rule
    that would
    require that. You have this -
    .navigation:hover{
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: bold;
    color: #000000;
    background-color: #FE0035;
    display: block;
    padding: 8px;
    width: auto;
    which is exactly what I see (although it is unnecessarily
    verbose). It
    could be this -
    .navigation:hover{
    background-color: #FE0035;
    since those other styles are covered in the definition for
    .navigation. But
    in both cases, the COLOR value is #000000. The background
    color change is
    what you declre in the CSS (yellow -> red).
    > What I am getting is the menu in green color text and at
    the mouse move
    > over
    > they turn to black. !!!??
    The menu is not green - it's black. It may look green because
    of the yellow
    background. Make the background white - you'll see.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Asanke" <[email protected]> wrote in
    message
    news:g3o40l$gmr$[email protected]..
    > What you are saying is u can see the links on the
    left(Which is the menu
    > in the
    > page) appears in color black, and when the mouse moves
    over them they turn
    > in
    > to a light color and the back ground turned in to a dark
    color?
    > :(
    > What I am getting is the menu in green color text and at
    the mouse move
    > over
    > they turn to black. !!!??
    >

  • Portlets with different styles

    Hello,
    I have created different pages with different styles. Then I added portlets to this pages and then I have published all the pages as portlets, and also I don't mark the option "Use Style Of Page On Which Portlet Is Placed" because I want that each portlet has
    its own style.
    In my home page I have another style completely different than the pages that I
    have created before. So I have introduce all of this portlets in my home page.
    It is supposed that I have to have a page with portlets which have a different
    style each, but I haven't. All of them have the style of my home page. How can
    I put different styles to the portlets that are in the same page?
    Thanks,
    Carmen

    You can use CSS selectors for that. But that will only work in superior browsers, not in inferior browsers.

  • Apex 4.1 different font text in Reports Region and Interactive reporting

    Hi everybody,
    In my APEX 4.1 page, I have two regions using the same ''Reports region" Template but font text are different. Why The first region is an interactive reporting. The second it's a report. I know that each one has his own data for sure but the same region template .Spaces between colons are different. Is it normal ?  I want to have the same font text for the two regions.
    Thanks in advance. Bye.

    Apex4.0+HTML_DB1.6 wrote:
    Theme 13 is not an APEX 4.x theme ? How I can know that is one of this serie ?
    Legacy themes are flagged with a "*" in the theme gallery. Standards mode themes are not. (I don't have access to APEX 4.1 at present to be able to identify specific themes.)
    Properties of interactive report components, is it possible to take a look on this properties or it's a "black box" ?
    You can either look in the global APEX style sheet, or (probably more usefully) use a browser web inspector to examine the CSS properties of the IR components in the page.

  • How to move elements within the master region of a Master/Detail spry data set?

    Hi there,
    I am unsure of how to move the different items within the master region of a master/detail spry dataset. The default style is such that if I include 3 or more elements e.g. Thumb, etc., they are stacked vertically :
    How do I move them so that they can be positioned differently? The look I am going for is one where the thumb image is positioned to the left while the other items are stacked alongside it so that the end effect for the master region would look like this:
    I greatly appreciate the help! Thanks!

    This is the complete page
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Check :: Fashion+Lifestyle</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryEffects.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryHTMLDataSet.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMasterDetail_final.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
    <!--
    var cal4 = new Spry.Data.HTMLDataSet("calendarList.html", "calendarList", {sortOnLoad: "When", sortOrderOnLoad: "ascending"});
    cal4.setColumnType("Thumb", "html");
    cal4.setColumnType("Picture", "html");
    cal4.setColumnType("When", "date");
    function MM_effectAppearFade(targetElement, duration, from, to, toggle)
        Spry.Effect.DoFade(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
    function closeAd() {
        document.getElementById('adRollover').style.visibility='hidden';   
    function MM_effectBlind(targetElement, duration, from, to, toggle)
        Spry.Effect.DoBlind(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
    function MM_effectSlide(targetElement, duration, from, to, toggle)
        Spry.Effect.DoSlide(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
    function MM_effectGrowShrink(targetElement, duration, from, to, toggle, referHeight, growFromCenter)
        Spry.Effect.DoGrow(targetElement, {duration: duration, from: from, to: to, toggle: toggle, referHeight: referHeight, growCenter: growFromCenter});
    //-->
    </script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="pageContainer">
        <div id="adBanners">
            <div id="halfBanner"><a href="#" onClick="document.getElementById('adRollover').style.visibility='visible';"><img src="images/banner_half_1.jpg" alt="Half Banner" width="237" height="90" /></a></div>
            <div id="leaderboardBanner"><a href="#"><img src="images/banner_leaderboard_1.jpg" width="728" height="90" alt="Leaderboard Banner" /></a></div>
            <div class="clearFloats"></div>
        </div><!--div#adBanners-->
        <div id="mainHeader">
            <div id="homepageLink"><a href="index.html"><img src="images/spacer.gif" width="400" height="100" /></a></div>
            <ul id="MenuBar1" class="MenuBarHorizontal">
                <li><a href="feature.html">FEATURES</a></li>
                <li><a href="#">FASHION</a></li>
                <li><a href="calendar.html" class="on">CALENDAR</a></li>
                <li><a href="#">VIDEO</a></li>
                <li><a href="blog.html">BLOG</a></li>
            </ul>
        </div><!--div#mainHeader-->
        <div class="MasterDetail">
          <div class="DetailContainer" id="event" spry:detailregion="cal4">
            <div class="DetailPicture">{Picture}</div>
            <div class="DetailColumn DetailTitle">{What}</div>
            <div class="DetailColumn"><div class="DetailLabel">WHEN:</div> {When}
            </div>
            <div class="DetailColumn"><div class="DetailLabel">WHERE:</div> {Where}
            </div>
            <div class="DetailColumn">{Details}</div>
          </div>
          <div id="calHeader"><p><img src="images/calendar_hdr.gif" width="492" height="100" /></p></div>
          <div spry:region="cal4" class="MasterContainer" onclick="MM_effectAppearFade(this, 1000, 0, 100, false); MM_effectBlind('event', 1000, '0%', '100%', false);">
            <div class="MasterColumn" spry:repeat="cal4" spry:setrow="cal4" spry:hover="MasterColumnHover" spry:select="MasterColumnSelected"><div class="MasterColumnPicture">{Thumb}</div>
              <div class="MasterColumnTitle">{What}</div>
              <div class="MasterColumnText"><div class="DetailLabel">WHEN:</div> {When}</div>
              <div class="MasterColumnText"><div class="DetailLabel">WHERE:</div> {Where}</div>
              <div style="clear:both"></div>
            </div>
          </div>
          <br style="clear:both" />
        </div>
    </div><!--div#pageContainer-->
    <div id="footer">
        <div class="text">Use of this site constitutes acceptance of our User Agreement and Privacy Policy. &copy; 2008 Adobe All rights reserved. The material on this site may not be reproduced, distributed, transmitted, cached, or otherwise used, except with the prior written permission of Adobe is a trademark owned by Adobe.</div>
    </div><!--div#footer-->
    <div id="adRollover" style="visibility: hidden;">
    <script language="javascript">
        if (AC_FL_RunContent == 0) {
            alert("This page requires AC_RunActiveContent.js.");
        } else {
            AC_FL_RunContent(
                'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
                'width', '536',
                'height', '479',
                'src', 'watch_ad',
                'quality', 'high',
                'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                'align', 'middle',
                'play', 'true',
                'loop', 'true',
                'scale', 'showall',
                'wmode', 'transparent',
                'devicefont', 'false',
                'id', 'watch_ad',
                'bgcolor', '#ffffff',
                'name', 'watch_ad',
                'menu', 'true',
                'allowFullScreen', 'false',
                'allowScriptAccess','sameDomain',
                'movie', 'watch_ad',
                'salign', ''
                ); //end AC code
    </script>
    <noscript>
        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="536" height="479" id="watch_ad" align="middle">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="false" />
        <param name="movie" value="watch_ad.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />
        <param name="wmode" value="transparent" /><embed src="watch_ad.swf" quality="high" bgcolor="#ffffff" width="536" height="479" name="watch_ad" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
        </object>
    </noscript>
    </div>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    </body>
    </html>

  • Reports in portlet region (Portal)

    Hello!
    I have a report that have a link to another report and is integrated to Portal, but when the second report is called it was displayed in all the page and i want that is displayed in the portlet region, what i have to do to display the second report in the portlet region over the first report?
    mi call to 2nd report is this:
    function F_DEPTNOFormatTrigger return boolean is
    begin
    SRW.SET_HYPERLINK('http://<host>:<port>/reports/rwservlet?prueba2&report=Prueba2&deptno='||:deptno );
    return (TRUE);
    end;
    thanks a lot!

    hello,
    you did not specify which version of the application serve we are talking about. i assume 9.0.2, since you are describing an in-line rendering of the report content.
    in 9.0.4 we moved to using iframes to do the portlet rendering (if your browser supports it) as iframes allow you in-line linking, meaning the called report will render inside the portlet. in 9.0.2 this is not possible.
    thanks,
    ph.

  • Tutorial: How to work with different styles?

    Hi all
    I got the task to learn how to use different styles in Reports so I can assign different styles to the same report. Is there a tutorial available describing this?
    Thank you.
    Joshua Muheim

    Hi Dirk,
    I think some people are misunderstanding your issue, or are just sidestepping it.
    Do you basically have three seperate Service Desk configurations on one Solution Manager? Meaning their own subjects, categories, actions, org structures, statuses, etc...
    Perhaps the Service Provider functionality could help you. I haven't used it before but my understanding is it's for people supporting multiple customers with the Service Desk.
    I think Christian gave you the best route to start exploring. Good luck and let us know how it goes.
    I might be wrong but I think this is not possible. It is always ABA Message/Basis Notification/SLF1 (however you call it) which will be created in first place.
    You may change the transaction type which will be generated from this automatically. For instance from SLFN to ZLFN. (Probably it is possible to modify this copy procedure to get ZLF1 if iBase component is SID1, ZLF2 if SID2, and so on - but I did not have a look into this yet).
    If you raise the message from different systems your message will contain the appropriate iBase component.
    regards,
    Jason

  • Different Style on Last Paragraph?

    I have a style that sets a paragraph rule below each paragraph to act as a divider. I need to apply this in many paces, however I would like the last paragraph in each section to have no rule. Is this possible?
    I don't want to have to apply a different style to the last paragraph in each section because the text is regularly updated...

    Which is still not an automated solution...it would need to be run after every edit.
    Right it wouldn't be completely automatic, but you wouldn't have to run it after every edit—just after the final edit.
    It isn't clear if the text is flowing between frames, the OP's #6 makes it sound like it's 1 frame. If it is flowing you can check if a paragraph's last line is the last line of a frame, so it still could be done with flowing text.
    So this AppleScript gets every story in the document and checks the story's paragraphs. If the paragraph has a style sheet applied with rule below on and it's the last paragraph, the rule below gets turned off, otherwise the rule gets turned on.
    tell application "Adobe InDesign CC 2014"
        tell active document
            --get the document stories
            set s to every story
            repeat with x in s
                --check each paragraph
                set ps to object reference of every paragraph of x
                repeat with i from 1 to count of ps
                    set p to item i of ps
                    --if it's the last paragraph and the p style has a rule below set it to off, else make sure it is on
                    if i is equal to (count of ps) then
                        if rule below of applied paragraph style of p then set rule below of p to false
                    else
                        if rule below of applied paragraph style of p then set rule below of p to true
                    end if
                end repeat
            end repeat
        end tell
    end tell

  • How to apply different styles to Portlets on the same Portal page?

    How do you apply different styles to Portlets on the same Portal page?
    I'm new to this kind of thing, but understand that something called "cascading style sheets" can help here?
    What are these, how do you use them, and can you make different Portlets (all types - PL/SQL, Java, Applications, etc) on the same Portal page have different styles assigned?
    Thanks!

    Jeff,
    Apply Oracle Portal styles at the region level. Your portlets within each region will inherit the style defined for the region.
    You may want to check out Report #40050 at portalcenter.oracle.com, "Design an Attractive and Compelling Portal Interface" for a good overview of the various design features of Oracle Portal.
    Here is the link:
    http://portalcenter.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/OTN_CONTENT/MAINPAGE/OWSF_2003_PAPERS/40050_STOVER.PDF
    Regards,
    Jay

  • Define Style for portlet region

    Hi,
    I want to 2 portlets on a part of the page and they should have a different background.
    but when "portlet" in the region attributes is selected only a preview of the style
    is given but i can't select an other one.
    I need another color there because its part of the navigation and it looks nicer when there are no white gaps.
    How chan I set this ?
    Thanks
    Michael

    Hello
    I am not sure which version you are using, but I know that in rel. 2 you can define diferent style from region to region that contains items, but the style that reflects portlets is always applied for the page not the portlet itself. You can not change the portlet style on the region settings. That means, that you can not have 2 different styles on portlets on one page. That's atleast how I understood it, since I wanted to have different background colour on portlets myself.
    Hope this helps!

  • Why Portlet regions cannot have their own style ? We need to use it.

    We need to visually group portlets on the same page.
    So we need to give different background different
    But Portlet regions cannot have their own style.
    So we cannot do it.
    Can we by pass this restriction? How ? ( We try to use html template, html content layout. But they don’t work.)
    Is this restriction will remove from future versions? (especilly 11g)
    Thanks.

    We ran into the same thing. I'm assuming you want to display different portlets on the same page with different looks. Here are a few things you might try (depending on the portlets, of course).
    - Adding another .css file in the cascade within the UI template
    - If using page portlets, add your own formatting to the page
    - Use dynamic pages with hard-coded formatting
    None of these will work for all cases, mind you. But it might give you a starting point. Good luck!

  • How do I pass parameter to different portlet regions from another page?

    How do I pass parameter to different portlet regions from
    another page?
    I have a page that with two regions. Each region has a report
    that uses the same information to generate its report.
    Individually running the reports, I can use p_arg_names and
    p_arg_values to get what I want. However, when I run the page
    that has both portlets, my .show is gone and I cannot get it to
    use the p_arg_names, etc. Do you have any idea how to overcome
    this? Thanks for any help.

    How do I pass parameter to different portlet regions from
    another page?
    I have a page that with two regions. Each region has a report
    that uses the same information to generate its report.
    Individually running the reports, I can use p_arg_names and
    p_arg_values to get what I want. However, when I run the page
    that has both portlets, my .show is gone and I cannot get it to
    use the p_arg_names, etc. Do you have any idea how to overcome
    this? Thanks for any help.

  • Can I replace the keys on a MB air with keys of a different style?

    So I'm in the market for a MBA, but I'm not the hugest fan of the keyboard. What I am a huge fan of is this: http://store.apple.com/us/product/MB110LL/B?fnode=MTY1NDA1Mg . I type on this keyboard every day, and it has quite literally become the highlight of my day. Something about it is just so... intuitive. For those who haven't used it, it uses the same key style as the white MacBooks of old, but with a metal background.
    My question is this: can I replace the stock keycaps on the MBA with the ones from the other Apple Keyboard?
    Will this require an extensive amount of service from Apple, or can I do it myself?
    Any and all help is appreciated- thanks for reading.

    I wouldnt suggest doing that type of modification.  Apple will not do that for you.  If you are intent on that keyboard and your MB Air has bluetooth spend the extra $20 and get the wireless one.

  • Different Styles in PlainView - Syntax Highlighting?

    Hi,
    I've managed to extend PlainView and looking at old JEdit code I have the syntax highlighting working for the most part. However, at certain times while typing the cursor starts to get way ahead of the text it's typing. And as I backspace on the line the cursor eventually gets closer to the character the closer it gets to the start of the line.
    I'm overridding the "drawUnselectedText()" method in PlainView to do the coloring.
    Here's the code, you can see the call to SyntaxUtilities.paintSyntaxLine() which is JEdit's class to do the drawing.
             * Renders the given range in the model as normal unselected text. This
             * is implemented to paint colors based upon the token-to-color
             * translations. To reduce the number of calls to the Graphics object,
             * text is batched up until a color change is detected or the entire
             * requested range has been reached.
             * @param g
             *            the graphics context
             * @param x
             *            the starting X coordinate
             * @param y
             *            the starting Y coordinate
             * @param p0
             *            the beginning position in the model
             * @param p1
             *            the ending position in the model
             * @returns the location of the end of the range
             * @exception BadLocationException
             *                if the range is invalid
            protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException {
                System.out.println("p0: " + p0 + " p1: " + p1 + " x: " + x + " y: " + y);
                // Get the start of the element
                int lineIndex = doc.getDefaultRootElement().getElementIndex(p0);
                // Get the element for the line
                Element elem = doc.getDefaultRootElement().getElement(lineIndex);
                System.out.println("lineIndex: " + lineIndex + " elemStartIDX: " + elem.getStartOffset() + " elemEndIDX: " + elem.getEndOffset());
                // Get the line text
                doc.getText(p0, p1 - p0, currentLineText);
                // If highlighting, mark the tokens
                if (marker != null) {
                    Token t = marker.markTokens(currentLineText, lineIndex);
                    x = SyntaxUtilities.paintSyntaxLine(currentLineText, t, styles, this, g, x, y, p0, p1);
                    System.out.println("Painted line at: " + x);
                } else {
                    // No highlighting requested, draw normal text
                    Font defaultFont = g.getFont();
                    Color defaultColor = styles[0].getColor(); // Default color of text
                    g.setFont(defaultFont);
                    g.setColor(defaultColor);
                    x = Utilities.drawTabbedText(currentLineText, x, y, g, this, p0);
                // Set the last line processed
                lastLine  = lineIndex;
                return x;
    Here is the code from the paintSyntaxLine() method:
         * Paints the specified line onto the graphics context. Note that this
         * method munges the offset and count values of the segment.
         * @param line
         *            The line segment
         * @param tokens
         *            The token list for the line
         * @param styles
         *            The syntax style list
         * @param expander
         *            The tab expander used to determine tab stops. May be null
         * @param gfx
         *            The graphics context
         * @param x
         *            The x co-ordinate
         * @param y
         *            The y co-ordinate
         * @return The x co-ordinate, plus the width of the painted string
        public static int paintSyntaxLine(Segment line, Token tokens, SyntaxStyle[] styles, TabExpander expander, Graphics gfx, int x, int y, int p0, int p1) {
            Font defaultFont = gfx.getFont();
            Color defaultColor = Color.black;
            FontMetrics fm = gfx.getFontMetrics(defaultFont);
            int offset = 0;
            while (tokens != null && tokens.id != Token.END) {
                int length = tokens.length;
                if (tokens.id == Token.NULL) {
                    if (!defaultColor.equals(gfx.getColor()))
                        gfx.setColor(defaultColor);
                    if (!defaultFont.equals(gfx.getFont()))
                        gfx.setFont(defaultFont);
                } else {
                    styles[tokens.id].setGraphicsFlags(gfx, defaultFont);
    //                fm = gfx.getFontMetrics();//[tokens.id].getStyledFont(defaultFont);
    //                FontMetrics dfm = Toolkit.getDefaultToolkit().getFontMetrics(defaultFont);
    //                System.out.println("Font Info: CharWidth[" + fm.charWidth(line.array[p1])+"], Max Advance[" + fm.getMaxAdvance()+"]");
    //                System.out.println("Default Font Info: CharWidth[" + dfm.charWidth(line.array[p1])+"], DMax Advance[" + dfm.getMaxAdvance()+"]");
    ////                x = fm.charsWidth(line.array, p0, length);
                line.count = length;
                x = Utilities.drawTabbedText(line, x, y, gfx, expander, p0);
                line.offset += length;
                offset += length;
                tokens = tokens.next;
            return x;
    I'm not sure what the problem is..i thought it might be an issue with the View and drawing multiple font styles. Since plain view only deals with a single font color and size. I tried using LabelView but that seems to need a StyledDocument and I had problems when I tried to use DefaultStyledDocument for my syntaxdocument. I was getting strange offset issues when using the Segment class.
    Here's what I posted: http://forum.java.sun.com/thread.jspa?threadID=780801
    I am using PlainDocument because that seemed to be what everyone was using for a syntax editor..since the structure of the document in a Plain Document is less complex.
    I orginally started out using the setCharacterAttributes() method on the DefaultStyledDocument and letting the views draw the text. That all seemed to work except for the "segment offset" issue. And I wasn't sure where the best spot to get the document to redraw subsequent lines in the case of changing a multiline comment, etc.
    So, everything I read about others attempts for syntax highlighters seems to use either StyledEditorKit with a fixed language set with custom parsing and using the setCharacterAttributes method. Or they use the plaindocument approach with a custom view..(which no one seems to share the source) or the project just simply uses the JEditTextArea directly (which we can't do in our product).
    We don't need multiple fonts per-line.. The document will always use one font face (Arial, Helvetica, etc) but may use different styles per word (bold, italic, etc).
    I thought I'd need to use FontMetrics to get the size of the font and such. But there didn't seem to be a difference in measurements based on the style of the font. (i.,e A bold font has the same charWidth('m') size as a regular style.
    At least that's what my test program showed..
    The other thing I noticed is that when the document is successfully colored and I use the mouse to select a region of text, the style of the text reverts back to normal. I'm sure that's because I only override the drawUnselectedText() method.
    Any ideas? Is there anyone who has successfully done this?
    Thanks,
    - Tim

    I just tried using a proportional font in my editor, and now I'm seeing your runaway-caret problem. Specifically, the caret remains in sync with the text as long as no bold characters are encountered, but it gets noticeably farther out of whack with each bold character it passes. I suspect that, when you measured the charWidth, your FontMetrics object wasn't really based on a bold font, because bold versions of proportional fonts are larger. And of course, the model/view conversion methods assume that the same style of the same font is used throughout the document. I've never had to deal with that problem, since I've always used monospaced fonts by preference, and bold versions of monospaced fonts really are the same size as the non-bold versions. I suggest you do the same, because getting this to work with proportional fonts look like a major hassle.

Maybe you are looking for

  • Using ARD to send UNIX command to add item to dock

    The ARD 3 Admin Guide, page 132, says the following command sequence will install an item in the dock of the target computer(s): 4) Type or paste the following UNIX command (replace /PathToApplication with your own path to the desired application, an

  • Oracle 6i Formula Column

    Hi Techies, I have an Oracle 6i report which has a parameter form. It takes the argument Contract_Num as an input. Based on the value of the Contract_Num, a formula column displays a string. Now I dont want to use the parameter form. I have simply mo

  • SAP: CA certificate missing in database while importing certificate in ABAP

    Hi We have a similar problem as the one described in CA certificate missing in database while importing certificate in ABAP however we ordered the certificate from SAP. The only error is: CA certificate missing in database Message no. TRUST057 Diagno

  • Outlook 2011 won't sync with Address Book iCal, etc.

    We recently adopted Outlook for the Mac 2011 (we used Exchange) for our platform because of Exchange compatibility issues with other applications.  Despite the clear statement in Outlook Sync Services that it will sync with Address Book and iCal, I c

  • Create new IIDXMLElement

    Working on a project that stores a lot of meta data in the document structure (backing store). This content is not mapped to page content. Using the various command utils ( i.e. IXMLElementCommands)  to create IIDXMLElements one at a time really slow