- a components enabled property is currently not versioned (which can be
important I think) - there is a comment about this and that it's because of
the Links auto enabling, but is there no way to build this without
disabling versioning of this property?
i can go around it i think. We can do this in the Link.onComponentTag()
if (getAutoEnable())
{
// the link is enabled if this link doesn't link to the current page
boolean versionEnabled = isVersioned();
setVersioned(false);
setEnabled(!linksTo(getPage()));
setVersioned(versionEnabled);
}
- the attributemodifier has a enabled property with getter and setter
which is not versioned as well which can cause strange behaviour if this is
enabled/disabled across different versions of a page
this is a bit harder. How do i get a page instance for a attribute modifier?
Then we should record all the IBehaviour.bind(component) methods in AttributeModifiers..
And then it can get fuzzy anyway, because what would happen if you reuse a behaviour acros pages?
Should then every page be suddenly versioned? Even if they are in the pagemap and not active?
I think we should enforce this in the API itself. Or make it clear that you can bind only once?
If for example a developers reuses a Behavior across pages. Then ALL the pages will be kept in memory
because the behaviour will have a reference to it.
So i think we should alter the javadoc:
/**
* Bind this handler to the given component.
*
* @param hostComponent
* the component to bind to
*/
to
/**
* Bind this handler to the given component.
*
* @param hostComponent
* the component to bind to
* @throws IllegalStateException when bind is called a second time for a different component
*/
Or something like that.
-> I think this should be a isVisible() method only (which could even go to
IBehaviour and get handled by the component so the behaviour has not to
care about this) or it should be versioned (which probably would make
sense with IBehaviour/AbstractBehaviour as well)
What do you mean rename isEnabled ot isVisible() and remove setEnabled?
But what would that solve?
Because now if you override isVisible() on component then you also bypass the version manager.
(this would be a candidate to be final because of that!, but it is to damn handy to be able to override it)
johan
