Java Code Examples for com.intellij.util.containers.JBIterable#generate()

The following examples show how to use com.intellij.util.containers.JBIterable#generate() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TreeChangeEventImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
private boolean integrateIntoExistingChanges(CompositeElement nextParent) {
  for (CompositeElement eachParent : JBIterable.generate(nextParent, TreeElement::getTreeParent)) {
    CompositeElement superParent = eachParent.getTreeParent();
    TreeChangeImpl superChange = myChangedElements.get(superParent);
    if (superChange != null) {
      superChange.markChildChanged(eachParent, 0);
      return true;
    }
  }
  return false;
}
 
Example 2
Source File: SyntaxTraverser.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
public JBIterable<T> parents(@Nullable final T element) {
  return JBIterable.generate(element, t -> parent(t));
}
 
Example 3
Source File: SyntaxTraverser.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
public JBIterable<? extends T> siblings(@Nonnull T node) {
  return JBIterable.generate(node, TO_NEXT);
}
 
Example 4
Source File: TreeChangeImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
private JBIterable<TreeElement> getCurrentChildren() {
  return JBIterable.generate(myParent.getFirstChildNode(), TreeElement::getTreeNext);
}
 
Example 5
Source File: UIUtil.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
public static JBIterable<Component> uiParents(@Nullable Component c, boolean strict) {
  return strict ? JBIterable.generate(c, COMPONENT_PARENT).skip(1) : JBIterable.generate(c, COMPONENT_PARENT);
}