View unanswered posts | View active topics


Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
[FD3 Plugin] MultiGenerator new little plugin 
Author Message
Member

Joined: Sat Nov 15, 2008 4:00 am
Posts: 171
Post [FD3 Plugin] MultiGenerator new little plugin
Hi to All.

MultiGenerator plugin for FD 3. Not so smart, but in some case its can be usefull :)

Image

Usage
Right click inside current class and look to MultiGenerator menu item or define a shortcuts keys in plugin settings.

Description
1. Generate getter/setter for multiple fields with rename and additional functionality.
To setup new accessor name slowly click two times on field node name.
2. Generate constructor from fields (modify version of Canab patch).
You can change order of parameters (Item up/down buttons);
If class has constructor plugin will add parameters and needed code in current (non destructive);
In ver 4.0.1 adds possibility to set name for parameters (similar to get/set dialog).
3. Cleanup unused imports and organize them. (removed from plugin, now its part of FD)
3. Qiuck class package fix (experimental).

Default shortcuts:
Can be setup in Plugin Options.

Tested on FlashDevelop versions:
* 3.2.0 RTM
* SVN build (r1101)

TODO:
1. Extract interface

Current version: 0.4.3
Download Current Version of MultiGenerator Plugin

Known bugs:


Version History:
0.1.0 - Initial Betta
0.2.0 - Correct organize and cleanup unused imports (now public and private imports section stay in their places)
0.3.0 - Added truncate imports item in context menu and some option for setup plugin
0.3.1 - Removed imports cleanups and organizers
0.4.0 - New interface, new feachures.
0.4.1 - Add parameters renames (and remove constant fields from dialogs :) )
0.4.3 - Few bugs fixed.


Last edited by Kulkoff on Sun May 16, 2010 10:43 am, edited 9 times in total.



Thu Mar 25, 2010 7:40 pm
Profile
Admin

Joined: Tue Aug 30, 2005 6:14 pm
Posts: 2545
Location: Finland
Post Re: [FD3 Plugin] MultiGenerator new little plugin
Nice work. Would you like to share the source as we would like to improve the our default refactoring?


Thu Mar 25, 2010 8:07 pm
Profile WWW
Member

Joined: Sat Nov 15, 2008 4:00 am
Posts: 171
Post Re: [FD3 Plugin] MultiGenerator new little plugin
Mika wrote:
Nice work. Would you like to share the source as we would like to improve the our default refactoring?


Mika, no problem. My experiens in C# is very poor. I just started deep dive into it :)
Actualy organize based on refactoring sources of FD, I just added strip unused imports.

But I dont understand one thing, is it posible to get seperate imports collections of other class in current file?
Now all imports (for internal classes to) placed in one collection in CurrentModel, its not a error,
but its not good to move all imports from all internal classes into package section.
In other side we have MemberModel.LineFrom property and we can based on this place organized imports back.
But for me its little hard right now :)


Thu Mar 25, 2010 9:35 pm
Profile
Member

Joined: Sat Nov 15, 2008 4:00 am
Posts: 171
Post Re: [FD3 Plugin] MultiGenerator new little plugin
Here are the source http://kulkoff.com/downloads/MultiGenerator_source.rar


Thu Mar 25, 2010 9:56 pm
Profile
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 10746
Location: Paris, France
Post Re: [FD3 Plugin] MultiGenerator new little plugin
@kulkoff
package VS private classes imports are determined by the import's line, compared to the FileModel's private section line index.


Fri Mar 26, 2010 7:37 pm
Profile WWW
Member

Joined: Sat Nov 15, 2008 4:00 am
Posts: 171
Post Re: [FD3 Plugin] MultiGenerator new little plugin
Plugin updated with some new options for organize imports.
And now all imports sections (private and public) stay in their places :D

Download available in first post.
Also in first post I share sources if FD team interest implement this by default in FD. :)


Sun Mar 28, 2010 11:05 am
Profile
Admin

Joined: Tue Aug 30, 2005 6:14 pm
Posts: 2545
Location: Finland
Post Re: [FD3 Plugin] MultiGenerator new little plugin
Thanks for you hard work, i added your imports organization to FD. Atm this multigenerator code will not be added as we already have too much new features to support in the next release. I would be intrested adding this and some other refactoring stuff like "surround with" in to next releases.

I found two issues while testing. Could you take a look? You can post us a patch if you want.

1. If you first do organize and then truncate, imports lose indendation.
2. Organizing leaves extra empty lines after the last import

Thanks again!


Mon Mar 29, 2010 11:03 am
Profile WWW
Member

Joined: Mon Oct 16, 2006 12:02 am
Posts: 333
Location: Lviv, Ukraine
Post Re: [FD3 Plugin] MultiGenerator new little plugin
Hi.
It shouldn't be hard to add "Generate constructor" from selected fields in you existing UI.
It would be really useful.
Or could you provide access in googlecode to be able to checkout sources and create a patch?


Thu Apr 15, 2010 7:59 am
Profile WWW
Member

Joined: Sat Nov 15, 2008 4:00 am
Posts: 171
Post Re: [FD3 Plugin] MultiGenerator new little plugin
Canab wrote:
Hi.
It shouldn't be hard to add "Generate constructor" from selected fields in you existing UI.
It would be really useful.
Or could you provide access in googlecode to be able to checkout sources and create a patch?


Hi, Canab, I dont understand for what you need this.
Or maybe I missing something. :)

Sources can be taken from here http://code.google.com/p/multigenerator/
I removed organize import functionality (its alredy part of FD for next release) and now support only things for generate code.
Feel free to modify sources or provide a patch.

P.S. Sorry. My English is very bad. I undersatnd what you mean. Make constructor argumets from selected fields. Is that correct? If it is, that realy would be useful. And If you has a free time for patch, I glad to add it in plugin :)


Thu Apr 15, 2010 12:12 pm
Profile
Member

Joined: Mon Oct 16, 2006 12:02 am
Posts: 333
Location: Lviv, Ukraine
Post Re: [FD3 Plugin] MultiGenerator new little plugin
thanks for sharing sources.
I mean about to generate Class constructor with selected fields as parameters.
1. Choose fields (the same as for generating getters/setters)
2. Generate constructor
Code:
public function ClassName(field1:Type1, field2:Type2...)
{
    _field1 = field1;
    _field2 = field2;
    ...
}

maybe it is necessary to provide some options for naming.


Thu Apr 15, 2010 1:23 pm
Profile WWW
Member

Joined: Mon Oct 16, 2006 12:02 am
Posts: 333
Location: Lviv, Ukraine
Post Re: [FD3 Plugin] MultiGenerator new little plugin
ok, there is a very quick implementation of constructor generator, but it is already usable for me.

Patch:
http://dl.dropbox.com/u/1674435/fd/generator/pluginpatch.patch

Compiled DLL:
http://dl.dropbox.com/u/1674435/fd/generator/MultiGenerator.dll

Screenshot:
Image


Thu Apr 15, 2010 3:39 pm
Profile WWW
Member

Joined: Sat Nov 15, 2008 4:00 am
Posts: 171
Post Re: [FD3 Plugin] MultiGenerator new little plugin
Version up to 0.4.0 and some new features and interface.

Redownload and reinstal plugin from link in first post


Sat May 15, 2010 1:22 pm
Profile
Member

Joined: Thu Feb 09, 2006 10:58 am
Posts: 943
Location: Israel
Post Re: [FD3 Plugin] MultiGenerator new little plugin
Hi this is a nice addition, it would help me alot in some cases.

There is only one thing:
When I generate a getter setter it produces them with a name, but it give the same name to the generate constructor. Sometime I need them both, could they be with different names?

_________________
MovieClipCommander


Sat May 15, 2010 2:49 pm
Profile
Member

Joined: Sat Nov 15, 2008 4:00 am
Posts: 171
Post Re: [FD3 Plugin] MultiGenerator new little plugin
IAP wrote:
Hi this is a nice addition, it would help me alot in some cases.

There is only one thing:
When I generate a getter setter it produces them with a name, but it give the same name to the generate constructor. Sometime I need them both, could they be with different names?


Yes, its could be a nice stuff. I'll try to implement this soon.


Sat May 15, 2010 3:30 pm
Profile
Member

Joined: Sat Nov 15, 2008 4:00 am
Posts: 171
Post Re: [FD3 Plugin] MultiGenerator new little plugin
Up. v0.4.1. Adds rename parameters possibility in "Generate constructor from fields" dialog. :)


Sat May 15, 2010 3:55 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 25 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 4 guests


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

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