View unanswered posts | View active topics



Reply to topic  [ 26 posts ]  Go to page 1, 2  Next
GENiAS Release 1.2 ( Code Generator for ActionScript ) 
Author Message
Member

Joined: Thu Sep 08, 2005 8:32 pm
Posts: 301
Location: Virginia
Reply with quote
GENiAS Plugin

Download Current Release!

This thread would be dedicated for the release, feature requests, and discussion of GENiAS. GENiAS allows developers to generate ActionScript 2.0 in FlashDevelop conveniently, it is a supplement to Snippet. Currently GENiAS can generate getter/setter wrapper for field variables, insert color values and sort source code (which is useful in sorting imports and variable declarations).

I'm interested in any comments or suggestions, and I'll be watching for any bug reports in the Bugs forum here.

History and Change Log
GENiAS 1.2
    - Allow sorting selected lines of code alphabetically
    - Allow user to configurate how property name should be guessed in FD's setting.

GENiAS 1.1
    - Encapsulation allows you to choose from any field variables
    - Add Color dialog

GENiAS 1.0.1
    - Redesigned dialog and better script detection
    - The menu now is called "Code Generator" under Insert menu

GENiAS 1.0
    - Encapsulate a field with Getter and Setter methods.


Source
http://www.flashdevelop.org/community/v ... .php?t=365


Last edited by tangent on Tue Aug 08, 2006 12:59 am, edited 5 times in total.



Sat Mar 18, 2006 10:26 pm
Profile YIM WWW
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Reply with quote
Post 
You're amazing Tangent :D

Some feedback:
- some fields are not accepted when pressing Ctrl+E
- <Escape> to cancel the dialog?
- the layout of the dialog needs some tuning but the features are excellent!
- the dialog should not stay on top of all applications...
- "Generate Invalidate Function" is not clear: I would say "Add call to invalidate()"
- technical: add a sci.SetSel(position, position) so that no text will be selected after the inserted text.

Now if it can display a dialog anywhere like SharpDevelop it would be perfect!


Sat Mar 18, 2006 10:48 pm
Profile WWW
Member

Joined: Thu Sep 08, 2005 8:32 pm
Posts: 301
Location: Virginia
Reply with quote
Post 
Thanks Philippe. I will incorporate the text changes and the Cancel button shortly. I agree the layout could really use some tune up.


Sat Mar 18, 2006 10:53 pm
Profile YIM WWW
Member

Joined: Thu Feb 09, 2006 10:58 am
Posts: 1099
Location: Israel
Reply with quote
Post 
Its a greate plugin. I would consider integrating it with the editor context menu.
When more types of code generators will be added direct access thrue a cascading menu will be very helpfull.

_________________
MovieClipCommander


Mon Mar 20, 2006 11:36 am
Profile
Member

Joined: Thu Sep 08, 2005 8:32 pm
Posts: 301
Location: Virginia
Reply with quote
Post 
Thank you all for the feedback, and I have updated the plugin which would work hand-in-hand with RC2 of FlashDevelop.

Please let me know if any other code generation you would like to have to make your day-to-day development easier.

For those who are interested in the source code, GENiAS source code, along with other plugins I have created for FlashDevelop, are now in sourceforge, please read GENiAS and FlashBuild on SourceForge for more details.


Sun Apr 23, 2006 8:54 pm
Profile YIM WWW
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Reply with quote
Post 
Cool, it's much better :)
This kind of plugin is a great workflow improvement!

However:
- the label "Field information" seems to hide some characters of the information to the right,
- if I press Ctrl+E at an unexpected location I get it crash:

System.NullReferenceException: ...
at GENiAS.PluginMain.PrepareEncapsulateField()
at GENiAS.PluginMain.PropertyWrapper_Click(Object sender, EventArgs e)
(snip)

:idea: Now it would be nice to be able to press Ctrl+E anywhere and choose the variable to encapsulate ;)


Sun Apr 23, 2006 9:11 pm
Profile WWW
Member

Joined: Thu Sep 08, 2005 8:32 pm
Posts: 301
Location: Virginia
Reply with quote
Post 
Philippe wrote:
Cool, it's much better :)
:idea: Now it would be nice to be able to press Ctrl+E anywhere and choose the variable to encapsulate ;)


Good idea, Philippe.


Thu May 11, 2006 7:54 pm
Profile YIM WWW
Member

Joined: Thu Sep 08, 2005 8:32 pm
Posts: 301
Location: Virginia
Reply with quote
Post 
I have updated GENiAS to 1.1.

In this release, you can encapsulate any field by choosing it in the dropdown menu. This is a new behavior from the last release per Philippe's genious suggestion. There are a few tips,
1. If you name the field as m_fieldName, or __fieldName, it would automatically name the property as fieldName.
2. If you use Encapsulate on the same line as the field variable, it will by default pick the variable in the dropdown menu.

I have also included a color dialog you can pick a color and have a hexidecimal value inserted at cursor.


Fri May 12, 2006 7:42 pm
Profile YIM WWW
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Reply with quote
Post 
Awesome!

Two last things:
- maybe it could guess the property name fieldName from _fieldName (one underscore), $fieldName and maybe mcFieldName, txtFieldName, etc (ie. one to three lowercase chars, then one uppercase char -- that would be convenient,
- the Generate button should be default for <Enter>, and Cancel for <Escape> (see in the "Misc" group of the Form's properties). So this dialog can be nicely controlled using the keyboard only.

The color picker has already been added in the Insert menu in the RC2.

Now I think the plugin might be included in the next release of FlashDevelop :)


Fri May 12, 2006 8:08 pm
Profile WWW
Member

Joined: Mon Dec 26, 2005 6:10 pm
Posts: 165
Reply with quote
Post 
Nice. A few things:

The set function i get is like this:

Code:
   public function set width( val: ):Void
   {
       = val;
      invalidate();
   }


1. no typing of the parameter ( val: )
2. i believe setters should not return a type. i forget the details, but it has something to do with the fact that a setter automatically calles a getter, so you can do something like:

x = myobj.x = 10;

the setter will call the getter and return the value to x. i remember I ran into trouble with having my setters return Void. It will probably be fine 99% of the time, but there is a use case that creates a problem. i just can't remember what it is. :)

3. the value is not assigned to the field:

= val;


Fri May 12, 2006 8:26 pm
Profile
Member

Joined: Thu Sep 08, 2005 8:32 pm
Posts: 301
Location: Virginia
Reply with quote
Post 
Oops, sorry about the bug, it is now fixed and posted on SF.NET.


Fri May 12, 2006 9:20 pm
Profile YIM WWW
Member

Joined: Thu Sep 08, 2005 8:32 pm
Posts: 301
Location: Virginia
Reply with quote
Post 
Great idea. I have reintroduced the accept/cancel button. They were there before but got lost somehow when I was monkeying the design mode.

I have added the guess property name. In the next release, I will make this configurable.

Philippe wrote:
Awesome!

Two last things:
- maybe it could guess the property name fieldName from _fieldName (one underscore), $fieldName and maybe mcFieldName, txtFieldName, etc (ie. one to three lowercase chars, then one uppercase char -- that would be convenient,
- the Generate button should be default for <Enter>, and Cancel for <Escape> (see in the "Misc" group of the Form's properties). So this dialog can be nicely controlled using the keyboard only.

The color picker has already been added in the Insert menu in the RC2.

Now I think the plugin might be included in the next release of FlashDevelop :)


Fri May 12, 2006 9:22 pm
Profile YIM WWW
Member

Joined: Sat Apr 22, 2006 3:52 am
Posts: 26
Location: Atlanta
Reply with quote
Post 
Can we ask for one more change?

That the getters/setters be added at the end of the class just before the enclosing '}' so that the variables are not mixed in with their getters/setters? I often define all my member variables first, then define the getters and setters.

Also would it be possible to have an option to define all getters and setters at once. So you pull up the plugin and it shows a list of all variables with a check 2 check boxes next to each of them, "get" and "set" and you also have a select all and deselect all

something like

property get set type

name x x String
age x x number


just a thought for future, I use this a lot in re-sharper in visual studio and also in eclipse for JAVA stuff.

btw, thanks for the plugin, it rocks, I was about to start typing all my getters/setters and did a search and found this gem!

Grant






[/code]


Sat May 13, 2006 2:49 pm
Profile YIM WWW
Member

Joined: Thu Sep 08, 2005 8:32 pm
Posts: 301
Location: Virginia
Reply with quote
Post 
Grant, that's a good idea! I will definitely consider adding a batch getter/setter generator feature.


Sat May 13, 2006 8:01 pm
Profile YIM WWW
Member

Joined: Thu Feb 09, 2006 10:58 am
Posts: 1099
Location: Israel
Reply with quote
Post 
Or maybe just not to close the dialog after generating a getter setter.
Helpful plugin, by the way. I'm looking forward to see it evolve into something much bigger.

Can the plugin add itself automaticaly to the Scintilla context menu? What command should I write in the XML if I want to add it manualy?

_________________
MovieClipCommander


Sun May 14, 2006 2:57 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 26 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.