/******************************************************************************* * Copyright (c) 2015 Red Hat, Inc. Distributed under license by Red Hat, Inc. * All rights reserved. This program is made available under the terms of the * Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: Red Hat, Inc. - initial API and implementation ******************************************************************************/ package org.jboss.tools.openshift.internal.ui.dialog; import java.util.Collection; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.Viewer; /** * Simple content provider that displays resource, for instance, the outcome * of a create operation where some resources could have failed * @author jeff.cantrill * */ public class ResourceSummaryContentProvider implements ITreeContentProvider { @Override public void dispose() { } @Override public void inputChanged(Viewer arg0, Object arg1, Object arg2) { } @Override public Object[] getChildren(Object node) { return null; } @Override public Object[] getElements(Object input) { if(input instanceof Collection<?>) { return ((Collection<?>) input).toArray(); } return new Object[] {input}; } @Override public Object getParent(Object arg0) { return null; } @Override public boolean hasChildren(Object node) { return false; } }