コード例 #1
0
ファイル: XMLNode.java プロジェクト: paxnil/spindle
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
   */
  public Object[] getChildren(Object obj) {
    if (obj instanceof XMLNode) {
      List result = new ArrayList();

      XMLNode artifact = (XMLNode) obj;
      for (Iterator it = artifact.getChildren().iterator(); it.hasNext(); ) {
        XMLNode child = (XMLNode) it.next();
        String childType = child.getType();
        if (childType == ITypeConstants.ENDTAG
            || (childType == ITypeConstants.TEXT && child.containsOnlyWhitespaces())) continue;
        result.add(child);
      }

      String type = artifact.getType();
      if (type == ITypeConstants.TAG || type == ITypeConstants.EMPTYTAG) {
        result.addAll(0, artifact.getAttributes());
      } else if (type == ITypeConstants.DECL) {
      }

      return result.toArray(new XMLNode[0]);
    }

    return null;
  }