Autocomplete and Language Add-on

Post a reply

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Topic review
   

Expand view Topic review: Autocomplete and Language Add-on

Re: Autocomplete and Language Add-on

Post by Guest » Sat Mar 09, 2013 10:01 pm

Ok thanks Robert :) that's all from my site. You were a great help. Hope you also improve RSTALangiageSupport ;;

Re: Autocomplete and Language Add-on

Post by robert » Sat Mar 09, 2013 4:16 pm

You play back a macro by calling RSTA's playbackLastMacro() method. The macro-related methods are on the parent class RTextArea.

Re: Autocomplete and Language Add-on

Post by groggy » Sat Mar 09, 2013 8:29 am

and how can I play them back

Re: Autocomplete and Language Add-on

Post by robert » Sat Mar 09, 2013 4:38 am

No, there is no such thing. Macros can only be serialized to and from XML.

Re: Autocomplete and Language Add-on

Post by groggy » Fri Mar 08, 2013 7:05 pm

I have also another problem :
the CTRL / keystroke does not work for me

Re: Autocomplete and Language Add-on

Post by groggy » Fri Mar 08, 2013 4:02 pm

I meant the macro xml files. If I save them and open them as a normal "file" I just geTt xml code. My question is if there is a method or class I dunno which converts the XML file to a "normal" text so the user can see easily what he did

Re: Autocomplete and Language Add-on

Post by robert » Fri Mar 08, 2013 1:57 pm

I'm sorry, I don't understand what you're asking. Simply setting the syntax style to SYNTAX_STYLE_XML will get you syntax highlighting. You'd set up syntax highlighting and code folding like so:

java code:

textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
textArea.setCodeFoldingEnabled(true);
RTextScrollPane scrollPane = new RTextScrollPane(textArea);


If by "parsed code" you mean squiggle underlining for syntax errors, then no, that doesn't come automatically. You have to use RSTALanguageSupport and enable it on the RSTA instance, as described in the project's readme file:

java code:

RSyntaxTextArea textArea = new RSyntaxTextArea(25, 70);
LanguageSupportFactory.get().register(textArea);
...

Re: Autocomplete and Language Add-on

Post by groggy » Thu Mar 07, 2013 9:05 pm

Anso if I load the XML files would I GET xml code or already " parsed code" and if not how Can I parse it?

Re: Autocomplete and Language Add-on

Post by robert » Thu Mar 07, 2013 4:23 am

With the built-in Java syntax highlighting, only the keyword "return" is painted with TokenTypes.RESERVED_WORD_2. It's highlighted (possibly) differently because it denotes an exit point for a method, which users may like to make stand out over other keywords.

More generally though, each language is free to use the two different keyword types however they want (perhaps some language indeed has two different logical types of keywords), but for the built-in languages, I believe RESERVED_WORD_2 is either used for "return" only (C, C++, Java, etc.), or not used at all.

Re: Autocomplete and Language Add-on

Post by groggy » Tue Mar 05, 2013 5:13 pm

Sorry I forget to login ^^

Top