Class VisibleEnableBehaviour
java.lang.Object
org.apache.wicket.behavior.Behavior
com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour
- All Implemented Interfaces:
Serializable
,org.apache.wicket.IComponentAwareEventSink
,org.apache.wicket.markup.html.IComponentAwareHeaderContributor
,org.apache.wicket.util.io.IClusterable
- Direct Known Subclasses:
EnableBehaviour
,FeatureVisibleEnableBehaviour
,PageDisabledVisibleBehaviour
,PageVisibleDisabledBehaviour
,VisibleBehaviour
public class VisibleEnableBehaviour
extends org.apache.wicket.behavior.Behavior
TODO: move to com.evolveum.midpoint.gui.api.util
Suppliers take precedence when evaluating visibility and enabled state before
isVisible()
and isEnabled()
methods.- Author:
- lazyman
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final VisibleEnableBehaviour
static final VisibleEnableBehaviour
-
Constructor Summary
ConstructorDescriptionVisibleEnableBehaviour
(@Nullable SerializableSupplier<Boolean> visible) VisibleEnableBehaviour
(@Nullable SerializableSupplier<Boolean> visible, @Nullable SerializableSupplier<Boolean> enabled) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.boolean
Deprecated.useVisibleEnableBehaviour(SerializableSupplier)
instead This method doesn't properly handle null values (when behaviour can't decide on whether component should be visible or not).void
onConfigure
(org.apache.wicket.Component component) Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, beforeRender, bind, canCallListener, detach, getStatelessHint, isEnabled, isTemporary, onAttribute, onComponentTag, onEvent, onException, onRemove, onTag, renderHead, unbind
-
Field Details
-
ALWAYS_VISIBLE_ENABLED
-
ALWAYS_INVISIBLE
-
-
Constructor Details
-
VisibleEnableBehaviour
public VisibleEnableBehaviour() -
VisibleEnableBehaviour
-
VisibleEnableBehaviour
public VisibleEnableBehaviour(@Nullable @Nullable SerializableSupplier<Boolean> visible, @Nullable @Nullable SerializableSupplier<Boolean> enabled)
-
-
Method Details
-
isVisible
Deprecated.useVisibleEnableBehaviour(SerializableSupplier)
instead This method doesn't properly handle null values (when behaviour can't decide on whether component should be visible or not).- Returns:
- Default implementation returns true even if underlying supplier returns null (this is because of backward compatibility of this class)
-
isEnabled
Deprecated.useVisibleEnableBehaviour(SerializableSupplier, SerializableSupplier)
instead. This method doesn't properly handle null values (when behaviour can't decide on whether component should be enabled or not).- Returns:
- Default implementation returns true even if underlying supplier returns null (this is because of backward compatibility of this class)
-
onConfigure
public void onConfigure(org.apache.wicket.Component component) - Overrides:
onConfigure
in classorg.apache.wicket.behavior.Behavior
-
VisibleEnableBehaviour(SerializableSupplier, SerializableSupplier)
instead.