[openide-dev] actionscript editor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[openide-dev] actionscript editor

Nicolas Désy
Hi all,
 
I'm currently porting my Swing app to NetBeans IDE as a module suite. (http://osflash.org/samui)
 
I want to use NetBeans editor to edit Actionscript files. I haven't found any good documentation to create my custom syntax but I searched in NetBeans source and I've find the way to do it. Here is my classes for the moment :
 
AS2DataLoader
AS2DataNode
AS2DataObject
AS2EditorKit
AS2LayerTokenContext
AS2SettingsDefaults
AS2SettingsInitializer
AS2SettingsNames
AS2Syntax
AS2TokenContext
 

Everything work fine but I have two problems :
  -I can edit files but I can't save them.
  -I don't know how/where to add my syntax highlighting settings in NetBeans Options.
 
For the syntax highlighting settings, I use this code to register my initializer :
 

Settings.addInitializer(new AS2SettingsInitializer());
Settings.reset();
 

Am I missing something ? Can you point me to a good article/exemple to explain me how to do this ?
 
Thanks in advance,
Nicolas
Reply | Threaded
Open this post in threaded view
|

Re: [openide-dev] actionscript editor

Tom Ball
Nicolas D?sy wrote:

>
> Hi all,
>  
> I'm currently porting my Swing app to NetBeans IDE as a module suite.
> (http://osflash.org/samui)
>  
> I want to use NetBeans editor to edit Actionscript files. I haven't
> found any good documentation to create my custom syntax but I searched
> in NetBeans source and I've find the way to do it. Here is my classes
> for the moment :
>  
> AS2DataLoader
> AS2DataNode
> AS2DataObject
> AS2EditorKit
> AS2LayerTokenContext
> AS2SettingsDefaults
> AS2SettingsInitializer
> AS2SettingsNames
> AS2Syntax
> AS2TokenContext
>  
>
> Everything work fine but I have two problems :
>   -I can edit files but I can't save them.
>   -I don't know how/where to add my syntax highlighting settings in
> NetBeans Options.
>  
> For the syntax highlighting settings, I use this code to register my
> initializer :
>  
>
> Settings.addInitializer(new AS2SettingsInitializer());
> Settings.reset();
>  
>
> Am I missing something ? Can you point me to a good article/exemple to
> explain me how to do this ?
>  
> Thanks in advance,
> Nicolas

Have you looked at Coyote?  http://coyote.dev.java.net/  It's a
framework for supporting scripting languages fairly easily, with Groovy
and Jython support included.  I found its code very easy to understand
as an example, but you may want to use it as your framework.

Tom
Reply | Threaded
Open this post in threaded view
|

[openide-dev] Re: actionscript editor

Tim Boudreau
In reply to this post by Nicolas Désy
Nicolas D?sy wrote:
> Hi all,
>  
> I'm currently porting my Swing app to NetBeans IDE as a module suite.
> (http://osflash.org/samui)

Neat stuff!  Can we add you to the third party page once you've got
something working?

> I want to use NetBeans editor to edit Actionscript files. I haven't
> found any good documentation to create my custom syntax but I searched
> in NetBeans source and I've find the way to do it. Here is my classes
> for the moment :
>  
> AS2DataLoader
> AS2DataNode
> AS2DataObject
> AS2EditorKit
> AS2LayerTokenContext
> AS2SettingsDefaults
> AS2SettingsInitializer
> AS2SettingsNames
> AS2Syntax
> AS2TokenContext
>  
>
> Everything work fine but I have two problems :
>   -I can edit files but I can't save them.

is AS2DataObject providing a SaveCookie from getCookie(SaveCookie.class)
when the document is dirty?  SaveAction will check for the cookie to
decide if it should be enabled or not.

>   -I don't know how/where to add my syntax highlighting settings in
> NetBeans Options.

I'd suggest copying whatever, say, the java syntax highlighting module
does.  Actually two much smaller modules where looking for how they save
settings won't be a needle in a haystack:  Properties or HTML.

> For the syntax highlighting settings, I use this code to register my
> initializer :
>  
> Settings.addInitializer(new AS2SettingsInitializer());
> Settings.reset();
>
> Am I missing something ? Can you point me to a good article/exemple to
> explain me how to do this ?

The editor has its own somewhat funky mechanism for saving settings -
have a look at BaseOptions, which I think is in editor/lib (or it might
be in editor itself).

I know that the Lexer module is supposed to make doing syntax
highlighting, etc. much easier;  I understand it's functional, but is
more the weekend project of the main author of the editor.  Might be
helpful to you.

Tom's suggestion of looking at Coyote is a very good one.  The Scripting
module (which I think coyote uses - David S. can say more here) is also
probably interesting for you.

-Tim