Geertjan's Blog

  • January 20, 2006

Copy and Move Code in the NetBeans Source Editor

Geertjan Wielenga
Product Manager
A few days ago I blogged that Sandip will "soon be announcing a few more plug-in modules... and making them available in his Update Center. I've had the chance of playing a bit with his new plug-in modules already and, honestly, I'm willing to bet that every single NetBeans user (in the universe) will find them useful..."

Well, check out his blog entry for today! If you go to his Update Center (as explained in his blog), you'll find the Line Tools plug-in module:

What it does is that it lets you copy or move selected text in the editor. To facilitate this, you get four new buttons in the toolbar. When you click "Copy Line Up" (as shown below), all the selected text is copied to a spot directly above the currently selected text. (Or, if you don't select text, only the current line is copied.)

Not bad, huh? There are dozens of times a day, when I'm working on someone else's code, that I'm manually copying a line or a section of code and then doing my work on the original. That way, I can easily revert back to the copy if I mess up the original. But now, thanks to Sandip, the process is automated! (Maybe an enhancement of his module would be for the copy up/down actions to provide commented-out copies, so that errors aren't generated right after the copy. By the way, Sandip also provides the sources to his module, so you can play around with them and adapt them for your own purposes.) Anyway, you can see the usefulness of this module, can't you. So hurry up and get it installed already!

Join the discussion

Comments ( 7 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.