QCubed Netbeans Plugin
Hey all -
I'm relatively new to the forums, but I use QCubed extensively where I work. I've found the best free PHP IDE out there to be Netbeans - for me at least - and I've been working on a plugin to streamline my QCubed development which I'm calling QCodo-Netbeans-Tools. Notably I'm working on implementing a few key features:
Code Templates for QCodo:
Code templates - for the unaware - allow you to expand a short character sequence into a predefined code template. They are perfect for when you want to create QControls within a function; for example, imagine typing:
qlabelHitting 'Tab' and having it expand into:
$lbl<name> = new QLabel($this);
$lbl<name>->Text = "";While a rather simple example, the scenario should illustrate how much more efficient you could be, especially with QControls that require a lot more properties to be set by default.
Code templates are actually already built into netbeans, so for the plugin, all that needs to be created are actual templates themselves specifying what to insert for the given keystrokes.
Code Palette Items for the Base QControls (with insertion intelligence):
The Code Palette in Netbeans allows you to drag items from the palette into your code, and Netbeans will insert the code that the item represents into the location you dragged the item at in your code. Essentially its another way to do code templates, but with an advantage. We're able to run custom insertion code when the item is dragged into the editor window. I created a simple PHP/QCodo parser which will find 3 key areas of your document and insert the following into the document, significantly reducing the amount you need to do in order to create a new QControl on your QForm:
QForm before:
class myQForm extends QForm {
protected function Form_Create() {}
}QForm after:
class myQForm extends QForm {
protected $lblName; // This is added
protected function Form_Create() {
$this->lblName_Create(); // This is added
}
// This entire function is added
protected function lblName_Create() {
$this->lblName = new QLabel($this);
$this->lblName->Text = "Text";
}
}The best part about it is that all you have to do is drag the item from the palette anywhere in your code editor window, and all those steps are done immediately. Again, this seems trivial but when you're adding many many QControls, even small things like this become tedious and a lot of work!
You are also prompted when you drag the palette item into your editor window what you would like to name your control, and what text you want to have appear (this is customized to each QControl depending on what properties need to be defined) - that way it's not named lblName every time :)
File Templates:
File templates are really a no-brainer - just standard templates for creating new QForms/QControls/Template files. These are customizable through the Netbeans interface so you can make these fit your needs for whatever project you're working on.
File Linking between Controller/View:(idea)
A great feature I've seen in many other IDEs is the ability to switch between the current file and files that are referenced by the current file. I think it would be amazing if the plugin could have a button at the top of the editor window which listed any template files that the controller is associated with, and you could switch to those templates by clicking on the button.
So basically I'm pushing for more automation in the IDE department. So much of the work I do on a day-to-day basis could easily be cut down to a few keystrokes, leaving me with only the fun problems to solve! I'm posting this now because I've finally gotten the code shared up online and you are more than welcome to download and compile it and add it to your netbeans installation if you would like. Currently I only have two palette items created (QLabel and QTextBox) but I'm going to keep adding more as I find the time. I'm very open to suggestions/ideas and help - you can find the code for netbeans over at http://code.google.com/p/qcodo-netbeans-tools/. Thanks!

I don't use Netbeans but I might give this a try. I really like the palette idea, I think it is what is missing with QCubed. This would make for a more Visual Studio type development environment. Will let you know what I think when I have a chance to try it out.
I did some minor work on this tonight and I have QTextBoxes working a lot better, and added in basic support for QLinkButtons. I also posted a .nbm, which you can find in the downloads section on the Google code website http://code.google.com/p/qcodo-netbeans-tools/. You can install it by going to Tools->Plugins and clicking on the 'Downloads' tab. From there you can browse for the .nbm file and hit install. You must be using Netbeans 6.9.
I make no promises as to its stability at this point - but if you give it a shot I guarantee you won't be disappointed with how easy/fast the Palette items make coding!
Note:
To get the palette items to show up, simply open a .php file (or any file you have associated with php in netbeans) and you will see a section of the palette show up called 'QCodo Controls'.
Let me know of any thoughts!