title: Failed to create the part's control treeviewer. ClassCastException
body: <p>I want to create a project tree explorer in my RCP application.
  <br>This is my viewpart for tree:</p>
  
  <pre><code>public class ProjectExplorer extends ViewPart{  
      public static final String ID = "rcp.projectexplorer";
      public ProjectExplorer() {
      }
      private TreeViewer viewer;
      public void createPartControl(Composite parent) {
          viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
          viewer.setContentProvider(new ViewContentProvider());
          viewer.setLabelProvider(new ViewLabelProvider());
          viewer.setInput(ProjectManager.getInstance().getProjects().toArray());
      }
  
      @Override
      public void setFocus() {
          viewer.getControl().setFocus();
      }
  
  }
  </code></pre>
  
  <p><code>ProjectManager.getInstance().getProjects().toArray()</code> - returns array with current projects.
  Each project implements the interface <code>IProjectNode</code>.
  <br>In ContentProvider the method <code>Object[] getElements(Object inputElement)</code> I try to cast projects (<code>inputElement</code>) from <code>Object[]</code> to <code>IProjectNode[]</code>.</p>
  
  <pre><code>public class ViewContentProvider implements ITreeContentProvider {
  
      @Override
      public void dispose() {
          // TODO Auto-generated method stub
  
      }
  
      @Override
      public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
          // TODO Auto-generated method stub
  
      }
  
      @Override
      public Object[] getElements(Object inputElement) {
          return (IProjectNode[])inputElement;
      }
  
      @Override
      public Object[] getChildren(Object parentElement) {
          return ((IProjectNode)parentElement).getChildren();
      }
  
      @Override
      public Object getParent(Object element) {
          // TODO Auto-generated method stub
          return ((IProjectNode)element).getParent();
      }
  
      @Override
      public boolean hasChildren(Object element) {
          if (((IProjectNode)element).getChildren() == null)
              return true;
          return false;
      }
  
  }
  </code></pre>
  
  <p>But I have following error:"Failed to create the part's controls".
  <br></p>
  
  <pre class="lang-none prettyprint-override"><code>java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Lrcp.projects.source.IProjectNode;
  at rcp.projects.ViewContentProvider.getElements(ViewContentProvider.java:24)
  at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:999)
  at org.eclipse.jface.viewers.ColumnViewer.getRawChildren(ColumnViewer.java:699)
  </code></pre>
  
  <p>Each child in projects also implements <code>IProjectNode</code>.</p>
  
  <p>How I can fix this exception? What I doing wrong?
  <br>
  Info about children methods:
  <br></p>
  
  <pre><code>public boolean hasChildren(Object element) {'
          if (((IProjectNode)element).getChildren() == null)
              return false;
          return true;
      }
  </code></pre>
  
  <p><br>
  Implements for 'getChildren()' in Project class:  <br/></p>
  
  <pre><code>public IProjectNode[] getChildren() {
          IProjectNode[] projectNodes = {
                  settingsFile,
                  ldlFile,
                  pythonFolder,
                  outFolder
                  };
          return projectNodes;
      }
  </code></pre>
  
  <p><br>
  <code>settingsFile, ldlFile, pythonFolder, outFolder</code> also implements <code>IProjectNode</code>.</p>