What have my fellow Delphi programmers done to make Eclipse/Java more like Delphi?
Posted
by
Robert Oschler
on Programmers
See other posts from Programmers
or by Robert Oschler
Published on 2011-04-21T18:28:34Z
Indexed on
2012/04/06
5:40 UTC
Read the original article
Hit count: 542
I am a veteran Delphi programmer working on my first real Android app. I am using Eclipse and Java as my development environment. The thing I miss the most of course is Delphi's VCL components and the associated IDE tools for design-time editing and code creation. Fortunately I am finding Eclipse to be one hell of an IDE with it's lush context sensitive help, deep auto-complete and code wizard facilities, and other niceties. This is a huge double treat since it is free. However, here is an example of something in the Eclipse/Java environment that will give a Delphi programmer pause. I will use the simple case of adding an "on-click" code stub for an OK button.
DELPHI
- Drop button on a form
- Double-click button on form and fill in the code that will fire when the button is clicked
ECLIPSE
- Drop button on layout in the graphical XML file editor
- Add the View.OnClickListener interface to the containing class's "implements" list if not there already. (Command+1 on Macs, Ctrl + 1 on PCs I believe).
- Use Eclipse to automatically add the code stub for unimplemented methods needed to support the View.OnClickListener interface, thus creating the event handler function stub.
- Find the stub and fill it in. However, if you have more than one possible click event source then you will need to inspect the View parameter to see which View element triggered the OnClick() event, thus requiring a case statement to handle multiple click event sources.
NOTE: I am relatively new to Eclipse/Java so if there is a much easier way of doing this please let me know.
Now that work flow isn't all that terrible, but again, that's just the simplest of use cases. Ratchet up the amount of extra work and thinking for a more complex component (aka widget) and the large number of properties/events it might have. It won't be long before you miss dearly the Delphi intelligent property editor and other designers. Eclipse tries to cover this ground by having an extensive list of properties in the menu that pops up when you right-click over a component/widget in the XML graphical layout editor. That's a huge and welcome assist but it's just not even close to the convenience of the Delphi IDE.
Let me be very clear. I absolutely am not ranting nor do I want to start a Delphi vs. Java ideology discussion. Android/Eclipse/Java is what it is and there is a lot that impresses me. What I want to know is what other Delphi programmers that made the switch to the Eclipse/Java IDE have done to make things more Delphi like, and not just to make component/widget event code creation easier but any programming task. For example:
- Clever tips/tricks
- Eclipse plugins you found
- other ideas?
Any great blog posts or web resources on the topic are appreciated too.
-- roschler
© Programmers or respective owner