what about the option:

parent.addMovedChild(IMoveable)

then it is always compile save and you only have to have moved() on the interface.

johan

On 9/7/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
because components have access to a lot more information on creation it is not always safe to move them around (switch parents) because the underlying markup changes, for example


class MyComponent extends Panel {
public MyComponent(...) {
   if (getAttributes().get("mode").equals("one")) {
          new MyInnerPanel1(...);
   } else {
          new MyInnerPanel2(...);
  }
}

so when this component is moved to a different parent it will be attached to a different tag - maybe with a different value of "mode" defined - so it needs to react to this and adjust or not support moving at all.

there are two lines of thought on this

1) allow all components to be movable - that means the implementors of context sensitive components need to always implement the logic to allow their components to readjust when moved

2) only allow components that want to be moved to be movable - that means we dont provide a public api for moving and do something like this:

protected Component.switchParent(MContainer newparent) { if (!(isntanceof IMovable)) { throw new exception...} do the parent switching stuff; onMoved(); }}
interface IMovable { void moveTo(MContainer newparent); void onMoved();}

the moving api is protected - and should be exposed publicly by users through implementing IMovable (names are up for grabs).

what do you guys think? which way sounds better?

-Igor


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to