Home Download Buy Blog Forum Support

Generate Getters/Setters (like in Eclipse)

Generate Getters/Setters (like in Eclipse)

Postby jverdeyen on Mon Aug 27, 2012 8:16 pm

Hi,

I'm already using a plugin to generate one serie of getter/setter (or setter/getter alone).
But (a very long long long time ago) I used to work in Eclipse, and it has a nifty feature where u could ask to generate getter and setters for the datamembers in your PHP class. (Or Java,..)

Does anyone has a plugin like this? I'm using this tool now : http://www.shuchow.com/gettersetter.html
But my (Eclipse/Aptana) colleagues are laughing with me :oops:

Many thanks!
jverdeyen
 
Posts: 5
Joined: Wed May 09, 2012 1:30 pm

Re: Generate Getters/Setters (like in Eclipse)

Postby jverdeyen on Wed Sep 05, 2012 12:27 pm

I've created a small generator for PHP files.
It's just a 10min version and I don't know python at all :shock:

Some issues:

- Doesn't check indention
- Just adds it to the end of the file (not within the class)

Suggestions and fixes are welcome!

Edit:

Gist Url: https://gist.github.com/3635821
jverdeyen
 
Posts: 5
Joined: Wed May 09, 2012 1:30 pm

Re: Generate Getters/Setters (like in Eclipse)

Postby quarnster on Wed Sep 26, 2012 10:20 am

You could also create a snippet here's one I use for C++:

Code: Select all
<snippet>
    <content><![CDATA[
${1:returnType} Get${2:Something}() const
{
    return m${2:VariableName};
}
void Set${2:Something}(${1:returnType} arg)
{
    m${2:VariableName} = arg;
}
]]></content>
    <tabTrigger>getset</tabTrigger>
    <scope>source.c++</scope>
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
    <!-- <tabTrigger>hello</tabTrigger> -->
    <!-- Optional: Set a scope to limit where the snippet will trigger -->
    <!-- <scope>source.python</scope> -->
</snippet>
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: Generate Getters/Setters (like in Eclipse)

Postby francodacosta on Thu Mar 14, 2013 11:25 am

francodacosta
 
Posts: 3
Joined: Tue Nov 27, 2012 12:08 pm


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 3 guests

cron