Can we have a ContainerInterface? Some of the base components can implement this.
For example: setLayout(...) can be defined in ContainerInterface and may be, Label can implement that to define its layout.
One of the limitations of jSeamless is that for these core items I have to provide for the lowest common denominator. For example, in most implementations Label would not have layout options really at all. However, I realize that these core components will be severely limiting in and of themselves, so I'm intending to create wrappers for most components in something similar to what the "extensions" project is now. It would contain niceties like AutoCompleteTextInput, ComboBox, etc. all the stuff that a standard UI should have. The core is not meant to be a complete UI in and of itself, but the core building blocks to get there.
In 1.x, CustomerComponent does not have "Container" behavior and because Java is not very aspect oriented, we can not create that behavior on the fly. If CustomerComponent implements ContainerInterface, that can be resolved to some extend.
What I currently have in 2.0 is an interface WrapperComponent that has "hasChildren" and "getChildren" methods. CustomComponent, View, and Container will all implement this interface.
Practically, getComponent() method of CustomComponent always returns a Container. (I can't think of just a Component because in that case, one would have extended the Component itself).
So, it must be getContainer() and should return a ContainerInterface ?
getLabel() should be a defined in ContainerInterface.
Not really, there may be many cases where you want to extend something like TextInput, but you don't want to give just anyone the ability to call setText for example. Using CustomComponent gives you the ability to only expose what you want so as not to confuse people.
Should we think of a ComponentInerface too? This may allow us to add other stuff to the UI in a generic way.
I came up with an ExtensionComponent idea yesterday that would be implemented by Components that are outside of the core so either implementations can add their own specialized components, or we could have a higher level set of components for implementations that wish to support them. Also, this could be used by implementations that want to add functionalilty beyond the standard components, say for a Button they have a "direction" property that defines the direction the text displays. This wouldn't be visible by default to the normal jSeamless Button, but they could extend Button and implement ExtensionComponent to have BetterButton that has additional properties on it.
Using the extensions ideology should help to close the gap with one of the biggest limitations 1.0 faced: lacking specialized support for specific implementations.