public static <NodeType extends ZyGraphNode<?>> String getSelectedContent(
      final AbstractZyGraph<NodeType, ?> graph) {
    final StringBuilder selection = new StringBuilder();

    IteratorFunctions.iterateSelected(
        graph,
        new INodeCallback<NodeType>() {
          @Override
          public IterationMode next(final NodeType node) {
            final IZyNodeRealizer realizer = node.getRealizer();

            final ZyLabelContent content = realizer.getNodeContent();

            for (final ZyLineContent line : content) {
              selection.append(line.getText());
              selection.append("\n");
            }

            selection.append("\n");

            return IterationMode.CONTINUE;
          }
        });

    return selection.toString();
  }
Returns the predecessors of the selected nodes of a graph.

@param <NodeType> The type of the nodes in the graph.
@param graph The graph in question.
@return A collection of all predecessor nodes of the selected graph nodes.
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/zygraph/helpers/GraphHelpers.java