示例#1
0
  /**
   * Return source folder node in which package node exists.
   *
   * @return parent source folder node
   */
  public SourceFolderNode getSourceFolder() {
    Node parent = getParent();

    while (parent != null) {
      if (parent instanceof SourceFolderNode) {
        return (SourceFolderNode) parent;
      }

      parent = parent.getParent();
    }

    throw new IllegalStateException("Source directory wasn't bind to package.");
  }
示例#2
0
  private static ProjectConfigDto getRootConfig(Node selectedNode) {
    Node parent = selectedNode.getParent();
    if (parent == null) {
      if (selectedNode instanceof ProjectNode) {
        return ((ProjectNode) selectedNode).getData();
      }
      return null;
    }

    return getRootConfig(parent);
  }