I had included some sample code of what I am doing. I added the disposeChildren method to qx.core.Object, this is not a current method. I have a few other methods that I added to Object as well, but they are all similar to disposeChildren.

Jim


On 9/25/06, Sebastian Werner <[EMAIL PROTECTED]> wrote:
Jim, we talk about properties here, but right, this will affects fields
and methods, too.

Do you only fix properties to fulfill your custom needs or do you add
stuff, too?

Cheers,

Sebastian


Jim Hunter schrieb:
> I add both fields and methods to base classes. Here is an example of one
> of the methods that I use all over my application (I use the
> disposeChildren() function everywhere to remove objects from the system
> as removeAll() does not work as detailed in many posts):
>
> qx.Proto = qx.OO.classes["qx.core.Object"].prototype;
> qx.Proto.hasChildren = function()
> {
>   // this gives a basic result for widgets like Labels that don't have
> this function
>   // I feel ALL classes should have this method
>   return false;
> }
> qx.Proto.getChildren = function()
> {
>   // this helps with some classes that have problems with this method,
> may not be needed in the future.
>   s = new Array(); // return an empty array
>   return s;
> }
> qx.Proto.disposeChildren = function()
> {
>   //mainWin.info(this.classname);
>   try
>   {
>    if (this.hasChildren() == true)
>    {
>      this.forEachChild(function()
>        {
>          this.disposeChildren();
>          this.setParent(null);
>          this.dispose();
>        }
>     )
>    }
>   }
>   catch(e)
>   {
>     // qx.ui.table.Table always fails on hasChildren so ignore it.
>   }
> }
>
> Notice that I am modifying the base class, there is no way I can
> subclass and get the same results. The only way a change will work is
> that the change include these methods in the base class. I agree with
> Christian in that I do not want to maintain my own branch of the trunc
> in order have my own code added in and maintain my own builds. I would
> rather use the release versions of qooxdoo and add additional
> functionality from my own file at runtime. I don't care if the way to
> add a method gets changed as long as I can still add methods to base
> classes. I have no problem changing my user fields of base classes to
> use the userData way, no big deal, but if you take away my ability to
> add methods to base classes you are making me code with my hands tied
> behind my back. While you are making changes, keep this one thing in
> mind... not all problems can be solved by subclassing!
>
> Thanks,
> Jim
>
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to