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
ConstructorDescriptionDeprecated.VisibleEnableBehaviour
(@Nullable SerializableSupplier<Boolean> visible) Deprecated.VisibleEnableBehaviour
(@Nullable SerializableSupplier<Boolean> visible, @Nullable SerializableSupplier<Boolean> enabled) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
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
Deprecated. -
VisibleEnableBehaviour
@Deprecated public VisibleEnableBehaviour(@Nullable @Nullable SerializableSupplier<Boolean> visible) Deprecated. -
VisibleEnableBehaviour
public VisibleEnableBehaviour(@Nullable @Nullable SerializableSupplier<Boolean> visible, @Nullable @Nullable SerializableSupplier<Boolean> enabled)
-
-
Method Details
-
isVisible
public boolean isVisible()- Returns:
- Default implementation returns true even if underlying supplier returns null (this is because of backward compatibility of this class)
This method doesn't properly handle situations, when underlying supplier itself is null (when behaviour can't
decide on whether component should be visible or not). In such case, it returns
true
.
-
isEnabled
public boolean isEnabled()- Returns:
- Default implementation returns true even if underlying supplier returns null (this is because of backward compatibility of this class)
This method doesn't properly handle situations, when underlying supplier itself is null (when behaviour can't
decide on whether component should be enabled or not). In such case, it returns
true
.
-
onConfigure
public void onConfigure(org.apache.wicket.Component component) - Overrides:
onConfigure
in classorg.apache.wicket.behavior.Behavior
-
VisibleEnableBehaviour(SerializableSupplier, SerializableSupplier)
instead