03-18-2010 09:25 AM
I just stumbled upon net.rim.device.api.ui.Field.setPadding(), .setMargin() etc. , tried to find out and wondered why these methods are there publicly in the JDE API, but undocumented.
Are they somehow unwanted/deprecated or not supported?
Is it safe to use them? If yes - on which JDE versions?
thanks and greetings,
Solved! Go to Solution.
03-18-2010 09:33 AM
many classes have undocumented methods. they can be removed or changed without further notice. you can use them at your own risk. when they work on all current OS releases there may be an upcoming one that does no longer support them - a calculable risk.
03-18-2010 10:02 AM
is this an official statement - are you working for RIM?
If so, sorry, this does not really satisfy me.
What I thought (and still think) is that if a method of a [widely used] API is public or protected it cannot be removed without being deprecated for a while first. And it simply must be documented. I mean as a developer I need reliable information about an API.
Sure, setPadding/setMargin are somewhat self-explanatory, but I am missing the @since and the parameters' description.
And if it is deprecated or unwanted this must also be documented.
(I know there are drawbacks, too, when doing so. You don't get rid of stuff quickly, if at all...)
If you are the wrong addressee to rant at, sorry ;-)
03-18-2010 10:10 AM
i am knot working for RIM. official statement is: do not use them. my own statement is: do it at your own risk.
i can add some experience if you try and ask nicely, but maybe this won't satisfy you either.
this is a user to user forum. if you want support from RIM you can either try your luck on email@example.com or buy an official RIM support contract. Or become an alliance member and bask in the infinite wisdom and the super-fast answers of the alliance support (from 4 weeks to never).
sometimes Mark answers threads here with official statements, but it is mainly his one-man-show as far as official is concerned, no claim on it.
03-18-2010 10:24 AM
I agree with Simon's comments.
The fact that the methods are not documented means that they are not part of the supported API, so RIM has to say you can't use them.
Unofficially I have been told that setPadding works from 4.2 to current and that there are no plans to remove it. However for me, even that is a bit dodgy. Try painting the background once you have specified it. I can only paint the non padded area....
I would be careful with this statement:
"if a method of a API is public or protected it cannot be removed"
Remember that in RIM's case, the API is the JavaDoc, not what is in the jar. So the fact that it is public in the jar does not make it part of the API.
03-18-2010 10:40 AM
You are quick, I am impressed :-)
Of course if you can tell any experience that will be much appreciated.
On the other hand I might not be able to use those methods because it is not only my own risk and I am not an experienced BlackBerry developer - I just cannot appraise the risk.
What a pity - I bet there are many other useful undocumented methods...
-- wondering if your signature works for other planets, too.
03-18-2010 10:57 AM
agreed, my statement might have been a little careless. It did never occur to me that there could be this line between public methods of a jar and an publicly supported API.
But yes, I agree, RIM can of course go this way. It is their decision. I'll just won't use those methods and get irritated by them secretly ;-) (they appear in my IDE after all...)
03-19-2010 02:15 PM
Peter, I would drop a little knowedge on you here
paintBackground receives a Graphics Object that is sized to the padded size of the field. paint receives a a Graphics Object clipped to the Size of non padded field.
Also, regarding these apis, RIM has released source code which uses them via KB articles, and provided descriptions of their functionality at DevCon 09, though only in sessions.
I will add my voice as another developer using setPadding.