public class UIComponentScope extends Object implements Serializable
UIComponentWithCustomScopes
subclasses define custom scopes
(e.g. UIRepeater
creates a separate scope for each row).
Generally, scope maps component definition record to one or many Java Vaadin component instances.
UIScreen references a root scope, which may have multiple child scopes. Root scope sees all
UI components, child scopes may see only a subset of UI components.Constructor and Description |
---|
UIComponentScope(UIComponentWithCustomScopes component)
Full constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Set<UIComponent> |
getComponentsForDefinition(UIComponentDefinitionId definitionId)
Returns all components created from the given component definition, that
were registered in this scope directly, in any of its sub-scopes or in a
different branch within a super-scope (note that this should NOT return
any components registered in any other super-scope from the same branch).
|
Set<UIComponent> |
getRegisteredComponents()
Returns a collection of all components registered in this scope.
|
List<UIComponent> |
getRegisteredComponentsChildrenFirst(UIComponent root)
Similar to
getRegisteredComponents() but orders the result so that child appears in the list before a parent. |
int |
hashCode() |
boolean |
hasRegisteredComponent(UIComponent component)
Answer whether a component is registered in this scope.
|
static UIComponentScope |
newRoot()
Creates root scope.
|
void |
registerComponent(UIComponent component)
Register the given UI component within this scope.
|
String |
toString() |
void |
unregisterComponent(UIComponent component)
Unregister the given UI component from this scope.
|
void |
updateContext()
Updates context dependent variables for this scope.
|
public UIComponentScope(UIComponentWithCustomScopes component)
component
- component which creates custom scopes for all of its children. Not present in this scope. Null for root scope.public static UIComponentScope newRoot()
public Set<UIComponent> getRegisteredComponents()
public boolean hasRegisteredComponent(UIComponent component)
component
- public void registerComponent(UIComponent component)
LspsScreen
implementor may call this method,
all other clients should call LspsScreen.registerUIComponent(com.whitestein.lsps.vaadin.ui.components.UIComponent)
.component
- the component, not null.public void unregisterComponent(UIComponent component)
component
- not nullpublic Set<UIComponent> getComponentsForDefinition(UIComponentDefinitionId definitionId)
definitionId
- not null.UIComponent
-s within this scope created from the given
component definition. Never null, never contains nulls. Unmodifiable.public void updateContext()
UIComponentWithCustomScopes.updateContextFor(UIComponentScope)
on the owning components.
Used for example to update values of Table/Repeater iterators.public List<UIComponent> getRegisteredComponentsChildrenFirst(UIComponent root)
getRegisteredComponents()
but orders the result so that child appears in the list before a parent.root
- start at this root. Not null.Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.