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