blob: 18b8ba1da7b6c7387eae7259b817024fbee2ae8d [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2000, 2017 IBM Corporation and others.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
*******************************************************************************/
package org.eclipse.dltk.internal.corext.refactoring.participants;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
public class RefactoringProcessors {
public static String[] getNatures(IProject[] projects)
throws CoreException {
Set<String> result = new HashSet<>();
for (int i = 0; i < projects.length; i++) {
String[] pns = projects[i].getDescription().getNatureIds();
for (int p = 0; p < pns.length; p++) {
result.add(pns[p]);
}
}
return result.toArray(new String[result.size()]);
}
}