Syntax (keywords) highlighting ?

Hi all,
I am writing a JAVA code editor.
How can I highlight JAVA keyword according to JAVA syntax library. Such as this, static, System.out.println
Thank you

You need to do a search first. This has been discussed a great deal on this forum - in the upper right, type "syntax highlighting" and search. You will get back numerous links to threads in which this very topic has been discussed. Read those threads and figure out what you want to do. Try to code some examples and post again when you have specific questions about your application.
Good luck!

Similar Messages

  • Kwick Fields - keyword highlighting of custom attributes

    Does the PT 5 API support keyword highlighting of custom attributes? I'd like to return a custom attribute to be displayed on the search results page. The attribute is a paragraph of content, an executive summary of the document.
    I realize I could map our executive summary to the plumtree description attribute. This would solve everything automatically since summary already supports keyword highlighting. However, there seams to be a 255 character limit on the plumtree summary field. Our executive summary field is probably over a 1,000 characters and we cannot have it truncated. ***Can we increase the size of the plumtree summary field beyond 255 chars?
    Any other insights/suggestions may be helpful.
    Thank you!

    Scott,
    I'm not completely clear on what you want to do - display keyword matches that happen to be in the executive summary? Or always display the executive summary, in place of (or in addition to) the keyword matches?
    For the former, you can map your executive summary to a custom property, and then add that property to the "banner fields alias" in the Search Results Manager utility (for 5.0.2 and higher). The executive summary will then be treated just like the description, but shouldn't suffer from the 255-character limit.
    For the latter (ie. always display the summary), you'll have to do a UI customization, and also implement a PEI (portal event interface). The PEI will add your executive summary property to the set of properties that the search server returns for each result. Then, your UI customization will override class GroupedResultsViewHelper to display your property in place of (or in addition to) the keyword-highlighted summary.
    (We're looking at ways of making this customization process easier in future releases.)
    As for lifting the length limit on the Description property itself - I know of no way to do that.
    Craig

  • How to make keyword highlight in JEditorPane

    I want to write a simple editor which can make keywords syntax highlight.Then I download an example from http://java.sun.com/products/jfc/tsc/articles/text/editor_kit/index.html .But when I run this example I find it has two problems.(This example's name is JavaEditorKit)
    when I insert a " in the editor or I insert a /* from the begin of editor, the example while throw several exceptions.
    java.lang.NullPointerException
    at sun.tool.java...............
    at sun.tool.java..................
    If somebody meet this problem,please help me or email to me ([email protected])

    http://www.japisoft.com/syntaxcolor/
    I tried downloading your app but it didn't work. I went to your samples directory:
    a) the "modeler" seemed to work
    b) the "simple" program started but there was only a "?" in the combobox so no highlighting occurred when I loaded a file
    c) the "file-sample" hasn't been compiled.

  • How do I turn off the keyword highlighting in my MSDN search results?

    Whenever I do a search, all my keywords get highlighted in the returned results with no evident way to turn off the highlighting.  I can't stand looking at the results with all that ridiculous highlighting!!
    How do I turn the highlighting OFF ????
    Charles S. Cotton

    Something here may help.
    http://windows.microsoft.com/en-us/windows/change-webpage-colors-fonts#1TC=windows-7
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • IDE in Jar file

    Hi all my friends!
    I want to do many Java application that requires powerful machine. Well, it is better that I can afford one but it is just a deam. Instead, my school has some very high performance machines ( P4 2.8 G). I really want to use that machine for my programming but unfortunately they do not have any editor like JCreator that I always use. Of course I can use notepad and compile in DOS but I for large project, it is a waste of resource.
    So I have an idea of having an IDE like Sun One Studio , allow me GUI , syntax, keyword highlight and allow me to compile program using button. But it should be written in Java as machine in school does not allow any INSTALATION. My question is that, theoretically, is it feasible idea ( accessing to low level of Windows machine using Java).
    Regards.

    #2 IDE of choice and strongly moving to #1 is Eclipse, created by IBM and supported by a large community including Oracle, Borland, BEA, Rationale, and over 200 others. It is open-source, free to use, highly extensible with possibly the best pluggable architecture, 100's of free plugins to add on, and works amazingly well. IDEA IntelliJ is probably the next best IDE although on JDJ Borland is rated #1 over Eclipse. Go to www.eclipse.org and get a taste of one of the most powerful java architectures you'll find, not only for IDE but their 3.0 version is soon to be used by many applications. I would get the 2.1.2 version though, as the 3.0 is not yet released and the Mx versions are mostly unstable.
    Otherwise, there is always jedit.org, which is a very good editor as well.

  • How to highlight keywords?

    Hello,
    I have some scripts for view creation stored in files with extension .vw. When I open this view in SQL Developer, keywords are not highlighted probably because SQL Developer doesn't recognize this extension.
    Is there any way how to force SQL Developer to highlight the keywords even for filetypes with unknown extension?
    Thanks for help, Dan

    Hello Jeff,
    I finally managed to test this more...
    Currently I am using W7 64bit.
    1) Open new instance of SQL Developer, go to Tools -> Preferences -> File Types (as Jim mentioned)
    What is the purpose of this window? Is it necessary to add the extension of file where I want to highlight the syntax? We are using different extension for different DB objects. So e.g. insert scripts have extension .dat. So lets say, I didn't add the .dat extension into the SQL Developer File Types preferences window and now open some .dat file with insert statements. Should it highlight the syntax or not?
    2) Lets say, I want to add the .vw extension. I click the "Add..." button, enter "vw", click OK. New extension is created, File Type is set to "Text Document" and the "Open with SQL Developer" option is checked in the checkbox and in the grid as well...
    3) Now I change the File Type to "PL/SQL". The option "Open with SQL Developer" is now unchecked in the checkbox, but still checked in the grid. So I believe you are wrongly actualizing the checkbox or the grid... Confirm the preferences. Then return to the preferences again and uncheck the "Open with SQL Developer" option. Find some file with extension .vw and press Enter. You will get an error message. Notice this message is different from that you get when you try to open file with completly unknown extension (e.g. .xyz). So I also think SQL Developer modified Win registry not fully correctly...
    4) Go back to that Preference window and now check the "Open with SQL Developer" option. Confirm. Find some .vw file and press Enter. You will get the "File pathname has changed, reload?" message.
    What this means? No matter what you choose, the file is not opened.
    5) Now when I open the veiw simply from File -> Open, it is opened as a Worksheet and syntax is highlighted. This is strange because yesterday this was not working. I believe it's because I am playing with this extension so long, so even Developer recognized it ;)
    6) To reproduce it, simply choose another extension and check if the syntax is highlighted or not. Now I tested the .dat extension. It is added in the File Types list, File Type is set to SQL Script but the file is still being opened as "Source" so nothing gets highlighted.

  • PDF indexing of Word.doc Keywords: kind of disappointing

    If we could embed document properties like Keywords in Word, and then convert Word.docs to PDFs , and then index the PDFs using Acrobat Pro, theoretically it would allow for lightning-fast keyword search and review, through a zillion PDFs.
    Except, there are unexpected glitches that are either undocumented... or, if the documentation exists, it's either hard to find or too scantily worded.
    Here's a few things I've observed, using Windows XP, Office 2007 and Acrobat 8 Pro:
    1. Word document properties only transfer over to PDF if you use the Acrobat tab in Word's ribbon to generate the PDF via PDFMaker, which apparently invokes some 'more robust' implementation of Distiller, than occurs if you simply use the print dialog to print to PDF.  THIS IS PROBABLY A BIG SOURCE OF USER CONFUSION THAT DISCOURAGES MANY USERS FROM GOING ANY FURTHER WITH EXPERIMENTING WITH PDF INDEXING OF WORD DOCUMENT PROPERTIES.  IT CAN LEAD YOU TO CONCLUDE THAT NONE OF THE WORD DOCUMENT PROPERTIES EXCEPT FOR TITLE, CAN SURVIVE A PDF CONVERSION.
    2. When you invoke PDFMaker, when the "Save Adobe PDF File As" dialog appears, you must click on the button at the bottom that is labeled "Adobe PDF conversion Options' and verify that the "Convert document information" check box is checked. (This may be able to be set as a permanent user preference somewhere, but I'm not quite sure where.)
    3. The Properties fields in Word that will come over, include Title, Author, Subject, and Keywords.  (The Comments field is ignored, as far as I can tell.)
    4. You can now index the PDFs, and these Properties fields will also be indexed.....well, Sort Of.
    5. "Sort Of", because if you then search for any of the text in your Properties fields, (like for example you search for a word or phrase that you've embedded in their Keywords fields), the advanced search result won't be displayed quite the way 'found hits' normally display in a PDF index search results screen.   You may expect to see the contents of those Keywords fields, show up in the search results in a long list of 'found' file icons with ALL (or a generous selection) of their surrounding Keywords also displayed, and with the specified found keyword highlighted in BOLD.
    But, that's not what happens. What you really get is an icon showing the contents of the Title field (which you didn't search for.) It basically means that Acrobat has found a document with something you searched for, in it....but Acrobat is not going to show it to you as easily as you are accustomed to seeing it. You only have two choices: (1) either hover your mouse over each found file's Title icon, one by one, until its screentip-type popup window appears, showing you all the contents of all four of that document's Properties fields; or (2) click on the icon, display the PDF, go to File Properties, and observe that file's properties dialog box.
    This is disappointing: the fast, easy, contextual lookup advantages you've enjoyed with regular PDF index searches appear to be unavailable when it comes to viewing search results on indexed document properties. I can understand the logic; (why show other keywords surrounding the searched-for keyword? If they're not in a sentence, there's really no contextual relationship, and therefore no reason to show them.)
    However, what if users wanted to store logically related keywords in a deliberate organized pattern..ie,
    Texas, Car, 1999, Ford, Mustang, Green
    Texas, Car, 2000, Ford, Mustang, White
    Texas, Car, 2000, Ford, Mustang, Yellow
    Texas, Car, 2000, Chevrolet, Corvette, Blue
    Ohio, Car, 2006, Honda, Civic, Silver
    ...etc.
    In this context, all keywords are logically related; it could be a big advantage to be able to use PDF Index search to instantly find and view a list of all 5,328 White 2000 Ford Mustangs located in Texas....then pop up their insurance.doc PDFs for further details.
    Allowing the user to set a preference to 'show all stored propery values in the search results' instead of an arbitrary length string of surrounding values, could also be very helpful, so that the full information depicted in the above example could actually be fully displayed, not arbitrarily truncated.
    I guess the only workaround is to forget Word's Document Properties, and just embed keywords within the document itself, such as maybe at the end of the document, maybe colored white (so they can't be easily seen).  Formatting them as hidden text doesn't work; Acrobat ignores hidden text when you convert from Word to PDF.

    I seem to get hard returns in all cases. That is why I had the short answer. I do not remember if saving as a DOC got rid of the hard returns. Of course the simplest way to find out is to try it. I went to another machine and the Save As to a DOC file did not put in the hard returns (cut and paste did). I should note that the PDF was produced from a totally different word processor and was not a WORD native document. That would suggest it is not dependent on the tags that can be included by WORD and PDF Maker.

  • FireFox plugin (Adobe Acrobat 10.1.9.22) isn't highlighting searched words, anymore

    Hello, everyone.
    I worked on a project, last year, that created Solr collections of PDF files, and allowed users to search the PDFs for whatever keywords the user enters.  One of the nice things about the project was that the FireFox plugin could read the keyword(s) entered by users and highlight them in the PDF being displayed within the browser.
    When I first started on that project, I think we were using FireFox 17.  NetAdmins recently upgraded everyone's browsers to FF24.4 (plugin Acrobat 10.1.9.22) and this highlighting feature seems to have been removed.  OR, it could be that code needs to be updated in order for it to work as it once did.
    What do I need to do to get the keyword highlighting in PDFs functional, again?  Or has the plugin been modified so that it won't work, anymore?  (This is a feature that our customer really likes.)
    V/r,
    ^_^

    It's not enough that the Adobe plugin is installed. You have to make sure it is actually being used... See here:
    http://helpx.adobe.com/acrobat/kb/pdf-browser-plugin-configuration.html

  • Keywords: how to unselect all keywords in Keyword Panel

    I know the answer will be ridiculously simple, but what am I doing wrong here:
    I am in Grid view with the Keyword Panel expanded on the left side of the screen. One of the keywords is highlighted--let's say, as an example, I have "wildflowers" highlighted.
    Let's say I decide I need to search for a slide but don't want to search within that keyword. If I enter my search term in the Find input box, it just looks within the keyword I happen to have selected.
    In order to make the Find search look at all my images regardless of keyword, I have to select ALL the keywords.
    There must be an easier way to unhighlight all keywords in the Keyword Panel. It seems you can move the highlight up and down but you always have one keyword highlighted.
    Help.
    Stan

    >I think I see that the only way to remove the highlight from all Keywords is to go up to the Library bar and select All Photographs.
    Stan, you can also click on any collection or any folder, or Previous Import or Quick Collection. Note that Ctrl-B is the shortcut to display the Quick Collection.
    > In the Library modules left panel, the top sections top item is All Photographs.
    Bob, Judith is trying to avoid that by hopefully using a shortcut key to display All Photographs. But there isn't one.

  • Document Preview with Word highlight in arabic

    Hi All,
    We have business requirement in which we need to display search result document to be preview however we want the word enter in search box to be highlight in document preview.
    We are ready with third party product as well.
    We are looking for this product to be supporting arabic languages 
    We are using extensive managed properties as we have design our own filter webparts for better result.
    Regards, Sachin

    Hi Sachin,
    Based on your description, my understanding is that you want to make the search keywords highlighted in document preview.
    By default, SharePoint uses Office Web Apps to preview the documents in search results and it does not support highlighting the keyword in document preview.
    So to achieve this goal, we need to use the products which supports to highlight the keyword in document preview to integrated with SHarePoint.
    The links below which introduce some products support to highlight the keyword in document preview for your references and regarding to the Arabic languages support, you may need to consult this from their side:
    http://www.sharepointreviews.com/component/content/article/56-search/422-Longitude-Search-by-BA-Insight.html
    http://www.surfray.com/blog/2012/07/16/document-preview-in-sharepoint-2013/
    Thank you for your understanding.
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • Keywords for Video RSS

    Does anyone here know the proper syntax keywords should be in for the video RSS? For some reason the search is not finding the keywords.

    This could be an OS permission issue.  Is this an internal or external drive?  I can add keywords of .wmv files.

  • Highlighting Tools for Text: Where Are They?

    How do you highlight a text in pages like you do in word? In Word it's on the toolbar. You can use yellow, but have the option to use other colors as well. How do I activate this feature?
    Thanks in advance!

    Hello
    Welcome to the club.
    It seems that you missed something:
    Pages is NOT Word so it is quite normal that some features are different and even than some available in W are missing in Pages as some missing in W are available in Pages.
    About your question, you may search for the keyword "highlight" in the help or in the PDF User's guide as I did.
    I got the responce but it's not too late to learn how to search by yourself
    Yvan KOENIG (from FRANCE samedi 29 décembre 2007 19:38:43)

  • Keywords checkbox won't show check

    From time to time, I can't get the check mark to show to the left of the desired sub keyword when I am cataloging images. The sub keyword highlights and won't do anything else. As a result, none of the images become assigned until I restart Bridge or sometimes the computer. What do I need to do, or is this a bug in Bridge? I tried purging the cache in Preferences and got no solution.
    Thanks in advance for your help!

    David,
    If you browse existing threads or do a forum search. you will find numerous warnings
    NOT to use the global Purge Cache in Bridge preferences. It's broken, and the cache will
    NOT rebuild properly after using it.
    Go through the Tools menu in Bridge (Tools > Cache > Purge cache for
    foldername) for each folder, one by one.
    Are you running Bridge 2.1.1.9? What exact version of the OS?
    Rebuild your preferences by holding down Option as you launch Bridge and checking the boxes in the dialog box that comes up.

  • JTextPane Colour Highlighting

    Im doing up a prototype of a compiler, i have certain keywords like "if"s and "elses" etc etc which i would like to be colour coded differently!!! My problem is when i have big files the time it takes to colour code and display is horrendous!!! I just want to know am i going about the right way in highlighting my keywords?? is there a better way or how can i improve my current code!!! any suggestions at all are welcome!! heres a sample of code..
    public class MyDoc extends DefaultStyledDocument
    static MutableAttributeSet setAttr, ifAttr, defaultAttr;
    public MyDoc()
    setAttr = new SimpleAttributeSet();
    StyleConstants.setForeground(setAttr, Color.red);
    ifAttr = new SimpleAttributeSet();
    StyleConstants.setForeground(ifAttr, Color.blue);
    defaultAttr = new SimpleAttributeSet();
    StyleConstants.setForeground(defaultAttr, Color.black);
    public void insertString(int offs, String str, AttributeSet a) throws
    BadLocationException
    if (str == null) return;
    StringTokenizer tokenizer = new StringTokenizer(str," \n",true);
    try
    while( tokenizer.hasMoreTokens())
    String token = (String)tokenizer.nextElement();
    if(token.length() == 0)
    continue;
    if (token.compareTo("set") == 0)
    super.insertString(offs, token, setAttr);
    } else if (token.compareTo("if") == 0)
    super.insertString(offs, token, ifAttr);
    } else
    super.insertString(offs,token, defaultAttr);
    offs = offs + token.length();
    } catch (BadLocationException ble)
    System.err.println("MyDoc::insertString()"+ble.toString());
    }catch(Exception e)
    System.err.println("MyDoc::insertString()"+e.toString());
    bottom line is that im looking for some other way, more elegant way of getting keywords highlighted, the above is nasty!!!
    cheers people,
    JB.

    I have tried a couple of different approaches for using threads:
    1) Load the data into the text pane and then use a thread for highlighting. The highlighting got messed up if you type data in the text pane while the highlighting thread is working. This approach won't work with the current structure of the SyntaxDocument.
    2) Load data into the text pane in smaller pieces. This approach shows a little more promise as the text pane is shown with initial data in a couple of seconds. However, the entire load time goes from 15 to 26 seconds. During this 26 second load time you can type data and scroll, but the text pane reacts very slowly. I haven't verified that data inserted into the document by typing does not cause problems with data being loaded into the document by the background thread. (Swing components are not thread safe, but hopefully insertion of data into the document is). Here is the test class:
    import java.awt.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class LoadTextPane extends JFrame
         char[] data;
         JTextPane textPane;
         public LoadTextPane(String fileName)
              EditorKit editorKit = new StyledEditorKit()
                   public Document createDefaultDocument()
                        return new SyntaxDocument();
              textPane = new JTextPane();
             textPane.setEditorKitForContentType("text/java", editorKit);
             textPane.setContentType("text/java");
              JScrollPane sp = new JScrollPane(textPane);
              getContentPane().add( sp );
              long startTime = new Date().getTime();
              try
                   File f = new File( fileName );
                   FileReader in = new FileReader( f );
                   int size = (int) f.length();
                   data = new char[ size ];
                   int chars_read = 0;
                   while( chars_read < size )
                        chars_read += in.read( data, chars_read, size - chars_read );
                   in.close();
                   long endTime=new Date().getTime();
                   System.out.println( "File size: " + chars_read );
                   // System.out.println( data );
              catch (IOException sse)
                   System.out.println("Error has occured"+sse);
              System.out.println( "Time to read file: " + (new Date().getTime() - startTime ));
              if (data.length > 8092)
                   Thread load = new LoadThread(data, textPane.getDocument());
                   load.start();
              else
                   textPane.setText( new String(data, 0, data.length) );
         public static void main( String[] args )
              String fileName = "c:/java/jdk1.3/src/java/awt/Component.java";
              JFrame f = new LoadTextPane(fileName);
              f.setDefaultCloseOperation( EXIT_ON_CLOSE );
              f.setSize( 1000, 600);
              f.setVisible(true);
         class LoadThread extends Thread
              char[] data;
              Document doc;
              LoadThread(char[] data, Document doc)
                   this.data = data;
                   this.doc = doc;
              public void run()
                  int start = 0;
                  int end = data.length;
                  int increment = 8192;
                   long begin = System.currentTimeMillis();
                  while ( start < end )
                       if (start + increment > end)
                            increment = end - start;
                       String text = new String(data, start, increment);
                       try
                            doc.insertString(doc.getLength(), text, null);
                       catch(BadLocationException e)
                            System.out.println(e);
                       start += increment;
                        //  allow some time for the gui to process typed text, scrolling etc
    //                    try { Thread.sleep(300); }
    //                    catch (Exception e) {}
                   System.out.println( "Load Text Pane: " + (System.currentTimeMillis() - begin) );
    }

  • Can't sync Photos to iPod - Unknown Error (-50)

    Earlier I was not able to sync my iPhoto library to my iPod via iTunes because I would get the error message "...Unknown Error (-50)".
    I have solved my problem, but I thought I would share my experience so Apple can fix the problem and other people can benefit from my work around until the problem is fixed.
    The problem seems to stem from iPhoto's AlbumData.xml file getting bad XML syntax. iPhoto can read this bad XML syntax and function, but iTunes can't handle it.
    I imported some photos into iPhoto that had some keywords that were entered via Google Picasa. These keywords some how caused iPhoto to put bad syntax in the AlbumData.xml file. To get the XML file correct, I used iPhoto to identify the offending photos and keywords. I think replaced the photo's keywords with keywords I created in iPhoto and deleted the Picasa generated keywords from my iPhoto Library using iPhoto's preferences page.
    Ironically, iPhoto worked fine and it was iTunes that could not handle the bad XML file (funny, I thought iTunes would be making API calls to iPhoto and not reading the XML file directly - so much for software reuse).
    Hopefully, Apple will fix this problem in future iPhoto and iTune fixes. After all, those darn "Hi, I am Mac..." commercials claim that Apple so is much better then MS. Seems like Apple's software has odors too.
    Just sharing,
    Donald

    Donald B:- This fix worked a treat! Thanks.
    Gravity Addict:- I was lucky that the problem obviously occurred after my last import so I only had to look at 60 pictures.
    In the 'Photos' menu click 'Get Info' to show the Info window with 'Keywords' highlighted. For me it was obvious that I had two keywords associated with these pictures that I had not put in, so just deleted these from the iPhoto preferences. Hope this works for you.
    LJ

Maybe you are looking for