KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > corext > refactoring > participants > RefactoringProcessors


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.corext.refactoring.participants;
12
13 import java.util.HashSet JavaDoc;
14 import java.util.Set JavaDoc;
15
16 import org.eclipse.core.runtime.CoreException;
17
18 import org.eclipse.core.resources.IProject;
19
20 public class RefactoringProcessors {
21     
22     public static String JavaDoc[] getNatures(IProject[] projects) throws CoreException {
23         Set JavaDoc result= new HashSet JavaDoc();
24         for (int i= 0; i < projects.length; i++) {
25             String JavaDoc[] pns= projects[i].getDescription().getNatureIds();
26             for (int p = 0; p < pns.length; p++) {
27                 result.add(pns[p]);
28             }
29         }
30         return (String JavaDoc[])result.toArray(new String JavaDoc[result.size()]);
31     }
32 }
33
Popular Tags