@Override public VisitContext getVisitContext(FacesContext context, Collection<String> ids, Set<VisitHint> hints) { if (ids == null || ids.isEmpty()) { return new FullVisitContext(context, hints); } else { return new PartialVisitContext(context, ids, hints); } } }
@Override public Iterator<E> iterator() { return new IteratorProxy<E>(_wrapped.iterator()); }
private void _idRemoved(String clientId) { // An id to visit has been removed, update our other // collections to reflect this. Note that we don't // update the ids collection, since we ids (non-client ids) // may not be unique. // Update the unvisited ids collection _unvisitedClientIds.remove(clientId); // Update the subtree ids collection _removeSubtreeClientId(clientId); }
private void _idAdded(String clientId) { // An id to visit has been added, update our other // collections to reflect this. // Update the ids collection _ids.add(_getIdFromClientId(clientId)); // Update the unvisited ids collection _unvisitedClientIds.add(clientId); // Update the subtree ids collection _addSubtreeClientId(clientId); }
private String _getIdFromClientId(String clientId) { final char separator = getFacesContext().getNamingContainerSeparatorChar(); int lastIndex = clientId.lastIndexOf(separator); String id = null; if (lastIndex < 0) { id = clientId; } else if (lastIndex < (clientId.length() - 1)) { id = clientId.substring(lastIndex + 1); } //else //{ // TODO log warning for trailing colon case //} return id; }
String clientId = _getVisitId(component);
@Override public VisitContext getVisitContext(FacesContext context, Collection<String> ids, Set<VisitHint> hints) { if (ids == null || ids.isEmpty()) { return new FullVisitContext(context, hints); } else { return new PartialVisitContext(context, ids, hints); } } }
private void _idAdded(String clientId) { // An id to visit has been added, update our other // collections to reflect this. // Update the ids collection _ids.add(_getIdFromClientId(clientId)); // Update the unvisited ids collection _unvisitedClientIds.add(clientId); // Update the subtree ids collection _addSubtreeClientId(clientId); }
private String _getVisitId(UIComponent component) { // We first check to see whether the component's id // is in our id collection. We do this before checking // for the full client id because getting the full client id // is more expensive than just getting the local id. String id = component.getId(); if ((id != null) && !_ids.contains(id)) return null; // The id was a match - now check the client id. // note that client id should never be null (should be // generated even if id is null, so asserting this.) String clientId = component.getClientId(getFacesContext()); assert(clientId != null); return _clientIds.contains(clientId) ? clientId : null; }
@Override public Iterator<E> iterator() { return new IteratorProxy<E>(_wrapped.iterator()); }
private void _idRemoved(String clientId) { // An id to visit has been removed, update our other // collections to reflect this. Note that we don't // update the ids collection, since we ids (non-client ids) // may not be unique. // Update the unvisited ids collection _unvisitedClientIds.remove(clientId); // Update the subtree ids collection _removeSubtreeClientId(clientId); }
String clientId = _getVisitId(component);
@Override public VisitContext getVisitContext(FacesContext context, Collection<String> ids, Set<VisitHint> hints) { if (ids == null || ids.isEmpty()) { return new FullVisitContext(context, hints); } else { return new PartialVisitContext(context, ids, hints); } } }
private void _idAdded(String clientId) { // An id to visit has been added, update our other // collections to reflect this. // Update the ids collection _ids.add(_getIdFromClientId(clientId)); // Update the unvisited ids collection _unvisitedClientIds.add(clientId); // Update the subtree ids collection _addSubtreeClientId(clientId); }
/** * @see VisitContext#getSubtreeIdsToVisit VisitContext.getSubtreeIdsToVisit() */ @Override public Collection<String> getSubtreeIdsToVisit(UIComponent component) { // Make sure component is a NamingContainer if (!(component instanceof NamingContainer)) { throw new IllegalArgumentException("Component is not a NamingContainer: " + component); } String clientId = component.getClientId(getFacesContext()); Collection<String> ids = _subtreeClientIds.get(clientId); if (ids == null) return Collections.emptyList(); else return Collections.unmodifiableCollection(ids); }
@Override public Iterator<E> iterator() { return new IteratorProxy<E>(_wrapped.iterator()); }
private void _idRemoved(String clientId) { // An id to visit has been removed, update our other // collections to reflect this. Note that we don't // update the ids collection, since we ids (non-client ids) // may not be unique. // Update the unvisited ids collection _unvisitedClientIds.remove(clientId); // Update the subtree ids collection _removeSubtreeClientId(clientId); }
private String _getVisitId(UIComponent component) { // We first check to see whether the component's id // is in our id collection. We do this before checking // for the full client id because getting the full client id // is more expensive than just getting the local id. String id = component.getId(); if ((id != null) && !_ids.contains(id)) return null; // The id was a match - now check the client id. // note that client id should never be null (should be // generated even if id is null, so asserting this.) String clientId = component.getClientId(getFacesContext()); assert(clientId != null); return _clientIds.contains(clientId) ? clientId : null; }
private String _getVisitId(UIComponent component) { // We first check to see whether the component's id // is in our id collection. We do this before checking // for the full client id because getting the full client id // is more expensive than just getting the local id. String id = component.getId(); if ((id != null) && !_ids.contains(id)) { return null; } // The id was a match - now check the client id. // note that client id should never be null (should be // generated even if id is null, so asserting this.) String clientId = component.getClientId(getFacesContext()); assert(clientId != null); return _clientIds.contains(clientId) ? clientId : null; }
/** * @see VisitContext#getSubtreeIdsToVisit VisitContext.getSubtreeIdsToVisit() */ @Override public Collection<String> getSubtreeIdsToVisit(UIComponent component) { // Make sure component is a NamingContainer if (!(component instanceof NamingContainer)) { throw new IllegalArgumentException("Component is not a NamingContainer: " + component); } String clientId = component.getClientId(getFacesContext()); Collection<String> ids = _subtreeClientIds.get(clientId); if (ids == null) return Collections.emptyList(); else return Collections.unmodifiableCollection(ids); }