Archive for the ‘Eclipse’ Tag

FDT 4 – How to auto-generate Getters and Setters

Again, this is common knowledge but I thought I would post it for convenience and the hope that it will help someone else out in the future.

To generate a getter and/or a setter create a variable in the declaration section of your class. Make sure to prefix it with an underscore _ and also make it private. Simply put the cursor in the variable and press Cmd-1 (on a Mac). FDT will then generate the statements for you. For instance, in the below statement, if I put the cursor on the _alertText_str variable here:-

private var _alertText_str:String;

And press Cmd-1, FDT will generate:-

public function get alertText_str() : String {
return _alertText_str;
public function set alertText_str(alertText_str : String) : void {
_alertText_str = alertText_str;

Thanks to @dougal07 for showing me this.


Make #FDT’s code assist more like #FlashDevelop’s

I love FDT but the main thing I miss from FlashDevelop is it’s amazing code assist functionality. My friend Darren B just showed me how to make FDT behave more like FD and I think it’s pretty close! Do the following:-

Window -> Preferences -> FDT -> Editor -> Code Assist -> Auto activation triggers for AS: abcdefghijklmnopqrstuvwxyz_.:

This will basically bring up the code assist upon any key press (rather than having to trigger it manually).

There are also a WEALTH of FDT customisation techniques to be found on this wonderful blog:-

I am starting to see that I am barely scratching the surface of the power contained within Eclipse and FDT.

Word-wrap in Eclipse

I was amazed to see that word-wrapping does not come as standard in Eclipse and that it has been on the feature request list for years. I know that your code shouldn’t be longer than the width of the page but I wanted to use Eclipse to edit my xml and I frequently have large chunks of text content that are a pain to work with if they don’t wrap. After some rooting around I found this plugin – ‘Virtual word wrap’. Once installed, you can turn wrapping on and off with a right-click. I read that it’s a little basic and buggy but it serves my purposes well. Here is the link:-